/* ═══ Reception/AI design system ═════════════════════════════════════════
   Switchboard console: ink housing, paper panels, line-green signal,
   memo-pad yellow for captured messages. Archivo display / Plex Mono data.
═══════════════════════════════════════════════════════════════════════════ */
:root {
  --ink: #171b20;
  --ink-2: #59626b;
  --paper: #e7e6e2;
  --panel: #ffffff;
  --line: #159a68;
  --line-deep: #0d7a52;
  --line-soft: #e3f7ee;
  --auth-teal-1: #1e4d47;
  --auth-teal-2: #14332f;
  --auth-font: "Inter", system-ui, sans-serif;
  --urgent: #b4362e;
  --amber: #b97d10;
  --memo: #fbf3dc;
  --memo-edge: #e3d2a1;
  --memo-ink: #8a7534;
  --rule: #dcdcd6;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --disp: "Inter", system-ui, sans-serif;
  --shadow: 0 2px 6px rgba(13,58,45,.06), 0 10px 28px rgba(13,58,45,.10);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 15px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; }
.hidden { display: none !important; }
.mono { font-family: var(--mono); }
h1, h2, h3 { font-family: var(--disp); }
.err { color: var(--urgent); font-size: 13px; }
.hint { font-weight: 400; color: var(--ink-2); font-size: 12px; margin-left: 6px; }

.brand { font-family: var(--disp); font-weight: 700; letter-spacing: -0.01em; font-size: 20px; }
.brand.xl { font-size: 26px; }
.brand-dot { color: var(--line); }

/* ═══ Auth split screen ═══ */
.auth { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; font-family: var(--auth-font); }
.auth-left { position: relative; overflow: hidden; background: linear-gradient(155deg, var(--auth-teal-1) 0%, var(--auth-teal-2) 65%, #0d201d 100%); color: #eef1f3; padding: 56px 64px; display: flex; flex-direction: column; justify-content: center; gap: 26px; }
.auth-left::before { content: ""; position: absolute; inset: 0; background: radial-gradient(600px 400px at 15% 10%, rgba(21,154,104,.35), transparent 70%), radial-gradient(700px 500px at 90% 95%, rgba(21,154,104,.25), transparent 70%); pointer-events: none; }
.auth-left > * { position: relative; }
.auth-left .brand-dot { color: #4fd39a; }
.auth-left .brand { display: flex; align-items: center; gap: 10px; font-family: var(--auth-font); font-weight: 700; letter-spacing: -0.01em; font-stretch: normal; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: #4fd39a; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.brand-dotmark { width: 12px; height: 12px; border-radius: 50%; background: #0d201d; }
.auth-left h1 { font-family: var(--auth-font); font-size: clamp(28px, 4vw, 44px); font-weight: 700; font-stretch: normal; letter-spacing: -0.02em; line-height: 1.1; margin: 4px 0 0; }
.sell { list-style: none; padding: 0; margin: 0; }
.sell li { padding: 10px 0 10px 26px; position: relative; color: #c4d6cf; font-size: 14.5px; }
.sell li b { color: #fff; }
.sell li::before { content: ""; position: absolute; left: 0; top: 18px; width: 12px; height: 12px; border-radius: 50%; border: 3px solid #4fd39a; }
.auth-stats { display: flex; gap: 16px; flex-wrap: wrap; }
.stat-card { background: rgba(255,255,255,.97); border-radius: 14px; padding: 16px 20px; min-width: 160px; box-shadow: 0 20px 40px -12px rgba(0,0,0,.45); }
.stat-l { font-family: var(--auth-font); font-size: 11.5px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 6px; }
.stat-v { font-family: var(--auth-font); font-size: 26px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.stat-up { font-size: 13px; font-weight: 700; color: var(--line-deep); }
.auth-right { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: #fff; }
.auth-card { font-family: var(--auth-font); background: var(--panel); border: none; box-shadow: none; padding: 34px 0; width: 100%; max-width: 400px; border-radius: 6px; }
.auth-toggle { display: flex; background: #f2f4f3; border: none; border-radius: 12px; padding: 4px; overflow: hidden; margin-bottom: 22px; }
.auth-toggle button { flex: 1; border: 0; background: none; border-radius: 9px; padding: 10px; font-family: var(--auth-font); font-weight: 600; font-size: 14px; cursor: pointer; color: var(--ink-2); }
.auth-toggle button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.auth-card label { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 0; }
.auth-card input { margin-top: 5px; border-radius: 10px; }
.auth-card .btn.primary.wide { background: var(--line); border-radius: 10px; font-family: var(--auth-font); font-weight: 700; box-shadow: 0 8px 20px -6px rgba(21,154,104,.55); }

/* ═══ Onboarding ═══ */
.onboard { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 48px 20px; }
.ob-card { background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; box-shadow: var(--shadow); width: 100%; max-width: 640px; padding: 36px 40px 28px; }
.ob-progress { display: flex; gap: 6px; margin: 20px 0 26px; }
.ob-progress span { flex: 1; height: 4px; background: var(--rule); border-radius: 2px; }
.ob-progress span.on { background: var(--line); }
.ob-step h2 { margin: 0 0 6px; font-weight: 800; font-stretch: 85%; font-size: 26px; }
.lead { color: var(--ink-2); margin: 0 0 18px; }
.ob-step label { display: block; font-weight: 600; font-size: 13px; margin: 16px 0 0; }
.ob-step input, .ob-step textarea { margin-top: 5px; }
.persona-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
.persona-card { border: 2px solid var(--rule); border-radius: 6px; padding: 12px; cursor: pointer; text-align: left; background: var(--panel); font: inherit; }
.persona-card.on { border-color: var(--line); background: var(--line-soft); }
.persona-card b { font-family: var(--disp); display: block; }
.persona-card small { color: var(--ink-2); font-size: 11px; line-height: 1.3; display: block; margin-top: 3px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ob-nav { display: flex; justify-content: space-between; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--rule); }
.ob-review { background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; padding: 14px 18px; font-size: 13px; }
.ob-review .rrow { display: flex; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--rule); }
.ob-review .rrow:last-child { border: 0; }
.ob-review b { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--ink-2); min-width: 110px; padding-top: 3px; }

/* ═══ App chrome ═══ */
header { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding: 14px 28px; background: var(--ink); color: #eef1f3; }
header .brand-dot { color: #35c98f; }
.head-right { margin-left: auto; display: flex; align-items: center; gap: 16px; font-size: 13px; }
.line-status { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .08em; color: #35c98f; border: 1px solid #35c98f55; padding: 5px 12px; border-radius: 999px; }
.line-status.closed { color: #9aa4ad; border-color: #9aa4ad55; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .25 } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none } }
.banner { background: var(--amber); color: #fff; padding: 9px 28px; font-size: 13px; font-weight: 600; }

.tabs { display: flex; gap: 2px; padding: 0 28px; background: var(--panel); border-bottom: 1px solid var(--rule); overflow-x: auto; }
.tab { font-family: var(--disp); font-weight: 600; font-size: 14px; border: 0; background: none; padding: 13px 18px; cursor: pointer; color: var(--ink-2); border-bottom: 3px solid transparent; white-space: nowrap; }
.tab.active { color: var(--ink); border-bottom-color: var(--line); font-weight: 700; }
.tab:focus-visible { outline: 2px solid var(--line); outline-offset: -2px; }
.badge { background: var(--urgent); color: #fff; font-family: var(--mono); font-size: 11px; border-radius: 999px; padding: 1px 7px; margin-left: 4px; }

main { padding: 26px 28px 90px; max-width: 1600px; margin: 0 auto; }
.pane { display: none; }
.pane.active { display: block; }
.pane-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 16px; }
.pane-head h2 { margin: 0; font-weight: 800; font-stretch: 85%; }
.pane-head select { width: auto; font-family: var(--disp); font-weight: 600; }
.empty { color: var(--ink-2); padding: 48px 0; text-align: center; }

/* ═══ KPIs ═══ */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; box-shadow: var(--shadow); padding: 16px 18px 14px; }
.kpi .v { font-family: var(--disp); font-weight: 700; font-size: 28px; line-height: 1.1; letter-spacing: -0.01em; }
.kpi .v small { font-size: 15px; color: var(--ink-2); }
.kpi .l { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--ink-2); margin-top: 5px; }
.kpi.good .v { color: var(--line-deep); }
.kpi.warn .v { color: var(--urgent); }
.chart-card { background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 18px; }
.chart-title { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--ink-2); margin-bottom: 10px; }
.kpi-outcomes { display: flex; flex-wrap: wrap; gap: 10px; }
.oc-chip { font-family: var(--mono); font-size: 12px; border: 1px solid var(--rule); background: var(--panel); border-radius: 4px; padding: 6px 12px; }
.oc-chip b { color: var(--line-deep); }

/* ═══ Tables ═══ */
table.calls { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--rule); box-shadow: var(--shadow); }
.calls th { text-align: left; font-family: var(--mono); font-size: 10px; letter-spacing: .12em; color: var(--ink-2); padding: 11px 12px; border-bottom: 2px solid var(--ink); }
.calls td { padding: 11px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; font-size: 14px; }
.calls tr:hover td { background: #f6f8f9; }
.calls td.num { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.outcome { font-family: var(--mono); font-size: 11px; letter-spacing: .05em; padding: 2px 8px; border: 1px solid var(--rule); border-radius: 3px; white-space: nowrap; }
.outcome.message_taken { border-color: var(--memo-edge); background: var(--memo); color: var(--memo-ink); }
.outcome.transferred { border-color: var(--line); color: var(--line-deep); background: var(--line-soft); }
.outcome.spam { color: var(--urgent); border-color: var(--urgent); }
.outcome.answered_enquiry { border-color: var(--line-soft); color: var(--line-deep); }

/* ═══ Memo slips ═══ */
.memo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.memo { background: var(--memo); border: 1px solid var(--memo-edge); box-shadow: 0 2px 0 var(--memo-edge); border-radius: 3px; padding: 16px 18px 14px; position: relative; }
.memo::before { content: "WHILE YOU WERE OUT"; display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .22em; color: var(--memo-ink); border-bottom: 1px solid var(--memo-edge); padding-bottom: 6px; margin-bottom: 10px; }
.memo.cb::before { content: "PLEASE CALL BACK"; }
.memo .field { display: flex; gap: 8px; font-size: 13px; margin: 3px 0; }
.memo .field b { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; color: var(--memo-ink); min-width: 62px; padding-top: 2px; }
.memo .body { margin-top: 8px; font-size: 14px; border-top: 1px dashed var(--memo-edge); padding-top: 8px; }
.memo .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; font-family: var(--mono); font-size: 11px; color: var(--memo-ink); }
.memo.urgent { border-left: 4px solid var(--urgent); }
.memo.urgent::after { content: "URGENT"; position: absolute; top: 12px; right: 14px; color: var(--urgent); font-family: var(--mono); font-size: 10px; letter-spacing: .18em; }
.memo.done { opacity: .45; }
.memo a { color: inherit; }

/* ═══ Buttons & inputs ═══ */
.btn { font-family: var(--disp); font-weight: 600; font-size: 13px; border: 1px solid var(--ink); background: var(--panel); color: var(--ink); padding: 9px 16px; border-radius: 10px; cursor: pointer; }
.btn:hover { background: var(--ink); color: #fff; }
.btn.primary { background: var(--line); border-color: var(--line); color: #fff; box-shadow: 0 8px 20px -8px rgba(21,154,104,.55); }
.btn.primary:hover { background: var(--line-deep); border-color: var(--line-deep); }
.btn.ghost { background: transparent; border-color: #ffffff44; color: #eef1f3; }
.btn.ghost:hover { border-color: #fff; background: transparent; }
.btn.wide { width: 100%; margin-top: 20px; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn:focus-visible { outline: 2px solid var(--line); outline-offset: 2px; }
input, textarea, select { font: 14px/1.4 "Inter", system-ui, sans-serif; color: var(--ink); border: 1px solid var(--rule); border-radius: 10px; background: #fff; padding: 9px 12px; width: 100%; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--line); outline-offset: -1px; }
textarea { resize: vertical; font-family: var(--mono); font-size: 13px; }

/* ═══ Settings ═══ */
.settings fieldset { border: 1px solid var(--rule); border-radius: 6px; background: var(--panel); box-shadow: var(--shadow); margin: 0 0 14px; padding: 18px 22px 20px; }
.settings legend { font-family: var(--disp); font-weight: 700; padding: 0 8px; font-size: 14px; }
.settings label { display: block; margin: 12px 0 0; font-weight: 600; font-size: 13px; }
.settings label input, .settings label textarea, .settings label select { margin-top: 5px; font-weight: 400; }
.settings .row, .ob-step .row { display: flex; align-items: center; gap: 8px; }
.settings .row input, .ob-step .row input { width: auto; margin: 0; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.inline { display: flex; gap: 8px; margin-top: 5px; }
.inline.wrap { flex-wrap: wrap; }
.inline .btn { flex-shrink: 0; }
.dayrow { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.day { font-family: var(--mono); font-size: 12px; border: 1px solid var(--rule); border-radius: 4px; background: #fff; padding: 6px 10px; cursor: pointer; }
.day.on { background: var(--line); border-color: var(--line); color: #fff; }
.blocklist { list-style: none; padding: 0; margin: 10px 0 0; font-family: var(--mono); font-size: 13px; }
.blocklist li { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--rule); }
.savebar { display: flex; align-items: center; gap: 14px; position: sticky; bottom: 0; background: var(--paper); padding: 14px 0; }

/* ═══ Billing ═══ */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.plan-card { background: var(--panel); border: 2px solid var(--rule); border-radius: 8px; box-shadow: var(--shadow); padding: 20px 22px; }
.plan-card.current { border-color: var(--line); }
.plan-card .price { font-family: var(--mono); font-weight: 600; font-size: 30px; }
.plan-card .price small { font-size: 14px; color: var(--ink-2); }
.plan-card .pname { font-family: var(--disp); font-weight: 700; margin-bottom: 6px; }
.plan-card .pdesc { color: var(--ink-2); font-size: 13px; margin: 6px 0 14px; }
.plan-tag { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--line-deep); background: var(--line-soft); border-radius: 3px; padding: 2px 8px; }
.confirm-box { border: 1px solid var(--line); background: var(--line-soft); border-radius: 6px; padding: 14px 16px; margin-top: 14px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.confirm-box .btn { align-self: flex-start; }

/* ═══ Admin ═══ */
.admin-table td { font-size: 13px; }
.number-results { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.number-chip { font-family: var(--mono); font-size: 13px; border: 1px solid var(--rule); border-radius: 4px; padding: 6px 10px; background: #fff; cursor: pointer; }
.number-chip:hover { border-color: var(--line); background: var(--line-soft); }
.status-pill { font-family: var(--mono); font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.status-pill.active { background: var(--line-soft); color: var(--line-deep); }
.status-pill.suspended { background: #f4dedc; color: var(--urgent); }

/* ═══ Drawer ═══ */
.drawer { position: fixed; top: 0; right: 0; width: min(480px, 100%); height: 100vh; background: var(--panel); border-left: 2px solid var(--ink); padding: 20px 22px; overflow-y: auto; box-shadow: -8px 0 24px rgba(0,0,0,.14); z-index: 50; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.drawer-summary { background: var(--line-soft); border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; font-size: 14px; }
.transcript .turn { margin: 10px 0; }
.transcript .who { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--ink-2); }
.transcript .assistant .who { color: var(--line-deep); }
.transcript p { margin: 2px 0 0; }

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-left { padding: 40px 28px; }
}
@media (max-width: 640px) {
  header, .tabs, main { padding-left: 14px; padding-right: 14px; }
  .grid3 { grid-template-columns: 1fr; }
  .persona-row { grid-template-columns: 1fr; }
  .calls th:nth-child(5), .calls td:nth-child(5) { display: none; }
  .ob-card { padding: 26px 20px; }
}

/* ═══ v2.2 polish ═══ */
/* Line card — the hero of the customer overview */
.line-card {
  display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
  background: linear-gradient(135deg, #171b20 0%, #23303a 100%);
  color: #eef1f3; border-radius: 8px; padding: 22px 26px; margin-bottom: 22px;
  box-shadow: var(--shadow); border: 1px solid #2c3a44;
}
.lc-label { font-family: var(--mono); font-size: 10px; letter-spacing: .18em; color: #7fd6b2; margin-bottom: 4px; }
.lc-number { font-size: 30px; font-weight: 600; letter-spacing: .02em; }
.lc-divert { font-size: 17px; padding-top: 7px; }
.lc-sub { color: #9aa4ad; font-size: 12px; margin-top: 3px; }
.lc-right { text-align: right; }

/* Number chips: picked state */
.number-chip.picked { border-color: var(--line); background: var(--line-soft); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }

/* Admin table: breathe */
.admin-table { border-radius: 6px; overflow: hidden; }
.admin-table td { padding-top: 13px; padding-bottom: 13px; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 6px; margin-right: 6px;
  background: var(--line-soft); color: var(--line-deep);
  font-family: var(--disp); font-weight: 700; font-size: 11px; vertical-align: middle;
}
.pane-head .hint { max-width: 560px; }

/* Empty states read as designed, not broken */
.empty { border: 1px dashed var(--rule); border-radius: 8px; background: var(--panel); }

/* Onboarding number results spacing */
#obNumResults { margin-top: 12px; }
@media (max-width: 640px) { .lc-right { text-align: left; } .line-card { padding: 18px; } .lc-number { font-size: 22px; } }


/* ═══ v2.4 admin console ═══ */
.subnav { display: flex; gap: 8px; margin-bottom: 22px; flex-wrap: wrap; }
.sn { font-family: var(--disp); font-weight: 600; font-size: 13px; border: 1px solid var(--rule); background: var(--panel); color: var(--ink-2); padding: 8px 16px; border-radius: 999px; cursor: pointer; }
.sn.on { background: var(--line-soft); border-color: var(--line); color: var(--line-deep); }
.sn:focus-visible { outline: 2px solid var(--line); outline-offset: 2px; }
.grid2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .grid2col { grid-template-columns: 1fr; } }

/* ═══ Activity feed (Aircall-style) ═══ */
.ac-livebar { display: flex; justify-content: center; margin: 4px 0 18px; }
.ac-live-pill { display: inline-flex; align-items: center; gap: 8px; background: var(--line-soft); color: var(--line-deep); font-family: var(--disp); font-weight: 700; font-size: 12px; letter-spacing: .04em; padding: 7px 18px; border-radius: 999px; }
.ac-live-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); display: inline-block; }
.ac-gauges { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 22px; }
.ac-gauge, .ac-metric { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.ac-ring { --pct: 50; width: 72px; height: 72px; border-radius: 50%; background: conic-gradient(var(--line) calc(var(--pct)*1%), var(--line-soft) 0); display: flex; align-items: center; justify-content: center; }
.ac-ring.warn { background: conic-gradient(var(--line) calc(var(--pct)*1%), var(--amber) 0); }
.ac-ring span { width: 54px; height: 54px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--disp); font-weight: 700; font-size: 16px; }
.ac-gauge-label { font-family: var(--disp); font-size: 10.5px; font-weight: 700; letter-spacing: .03em; color: var(--ink-2); }
.ac-metric-v { font-family: var(--disp); font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.ac-metric-l { font-size: 11px; color: var(--ink-2); line-height: 1.4; }
.ac-split { display: grid; grid-template-columns: 1fr 220px; gap: 20px; margin-bottom: 28px; }
.ac-feed { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 18px 20px; }
.ac-feed-head h3 { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.ac-feed-sub { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; color: var(--ink-2); margin-bottom: 8px; }
.ac-call-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--rule); font-size: 13.5px; }
.ac-call-row:last-child { border-bottom: none; }
.ac-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rule); flex-shrink: 0; }
.ac-dot.live { background: var(--line); }
.ac-call-who { flex: 1; color: var(--ink-2); }
.ac-call-dur, .ac-call-time { font-size: 11.5px; color: var(--ink-2); }
.ac-roster { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 18px 20px; }
.ac-roster-head { font-family: var(--disp); font-size: 11px; font-weight: 700; color: var(--line-deep); letter-spacing: .04em; margin-bottom: 14px; }
.ac-agent { display: flex; align-items: center; gap: 10px; font-size: 13px; margin-bottom: 12px; }
.ac-avatar { width: 26px; height: 26px; border-radius: 50%; color: #fff; font-family: var(--disp); font-weight: 700; font-size: 10.5px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ac-floating { display: flex; gap: 18px; flex-wrap: wrap; }
.ac-float-card { flex: 1; min-width: 220px; background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 20px 22px; }
.ac-float-card.revenue { background: linear-gradient(160deg, #fff, var(--line-soft)); }
.ac-float-label { font-family: var(--disp); font-size: 11px; font-weight: 700; color: var(--line-deep); letter-spacing: .04em; margin-bottom: 8px; }
.ac-float-title { font-size: 14.5px; font-weight: 600; margin-bottom: 12px; }
.ac-float-avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--line-soft); margin: 0 auto; }
.ac-float-value { font-family: var(--disp); font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
.ac-float-value .up { font-size: 13px; font-weight: 700; color: var(--line-deep); margin-left: 6px; }
@media (max-width: 860px) { .ac-gauges { grid-template-columns: repeat(3, 1fr); } .ac-split { grid-template-columns: 1fr; } }
.uptime-row { display: flex; gap: 28px; flex-wrap: wrap; }
.uptime-item .u-pct { font-family: var(--mono); font-weight: 600; font-size: 28px; color: var(--line-deep); }
.uptime-item .u-pct.bad { color: var(--urgent); }
.uptime-item .u-l { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--ink-2); }
.uptime-item .u-sub { font-size: 12px; color: var(--ink-2); }
.chart-card + .chart-card { margin-top: 0; }
.chart-card { margin-bottom: 16px; }

.plan-mini { width: auto; font-family: var(--mono); font-size: 12px; padding: 4px 6px; margin-left: 6px; vertical-align: middle; }


/* ═══ v3.0 — schedule calendar + polish ═══ */
:root {
  --pastel-1: #d9efe3; --pastel-1-ink: #1d6b4a;
  --pastel-2: #dce9f7; --pastel-2-ink: #23568c;
  --pastel-3: #eadff5; --pastel-3-ink: #5f3d85;
  --pastel-4: #fbe6d7; --pastel-4-ink: #8a4f1d;
  --pastel-5: #f7f0d3; --pastel-5-ink: #7a6414;
  --pastel-6: #f9dfe4; --pastel-6-ink: #8c2f43;
}
.kpi, .chart-card, .plan-card, .memo, table.calls, .settings fieldset { border-radius: var(--r-lg); box-shadow: var(--shadow); border-color: var(--rule); }
.cal-legend { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-legend span { font-family: var(--mono); font-size: 11px; padding: 3px 10px; border-radius: 999px; }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
  background: var(--panel); border: 1px solid var(--rule); border-radius: 12px;
  padding: 14px; box-shadow: var(--shadow);
}
.cal-dow { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--ink-2); text-align: center; padding: 4px 0 8px; }
.cal-day { min-height: 92px; border: 1px solid var(--rule); border-radius: 8px; padding: 5px 6px; background: #fdfdfd; }
.cal-day.out { opacity: .38; }
.cal-day.today { border-color: var(--line); box-shadow: inset 0 0 0 1px var(--line); background: #fbfffd; }
.cal-day .dnum { font-family: var(--mono); font-size: 11px; color: var(--ink-2); margin-bottom: 4px; }
.cal-day.today .dnum { color: var(--line-deep); font-weight: 600; }
.cal-chip {
  display: block; width: 100%; text-align: left; border: 0; cursor: pointer;
  font: 11px/1.35 var(--mono); border-radius: 5px; padding: 3px 6px; margin: 2px 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-chip.done { text-decoration: line-through; opacity: .55; }
.cal-chip.cancelled { opacity: .35; text-decoration: line-through; }
.bk-pending { border: 1px dashed var(--memo-edge); background: var(--memo); border-radius: 8px; padding: 10px 12px; margin: 8px 0; font-size: 13px; }
.bk-pending .who { font-weight: 600; }
.bk-pending .inline { margin-top: 8px; }
.bk-pending input[type="datetime-local"] { max-width: 220px; }
.bk-detail-grid { display: grid; grid-template-columns: 90px 1fr; gap: 4px 10px; font-size: 13px; }
.bk-detail-grid b { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--ink-2); padding-top: 3px; }
.train-item { border-bottom: 1px dashed var(--rule); padding: 12px 0; }
.train-item .q { font-weight: 600; margin-bottom: 6px; }
.train-item .inline input { flex: 1; }
@media (max-width: 700px) { .cal-day { min-height: 64px; } .cal-chip { font-size: 10px; } }


/* ═══ v3.2 — colour pass ═══ */
body { background: linear-gradient(180deg, #eef3f4 0%, var(--paper) 240px); }

/* Tabs + subnav: colour dots */
.tab::before, .sn::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; background: var(--rule); }
.tab:nth-of-type(1)::before, .sn:nth-of-type(1)::before { background: #0e8a5f; }
.tab:nth-of-type(2)::before, .sn:nth-of-type(2)::before { background: #3d7fc4; }
.tab:nth-of-type(3)::before, .sn:nth-of-type(3)::before { background: #b97d10; }
.tab:nth-of-type(4)::before, .sn:nth-of-type(4)::before { background: #8a5fc0; }
.tab:nth-of-type(5)::before, .sn:nth-of-type(5)::before { background: #c05a7a; }
.tab:nth-of-type(6)::before, .sn:nth-of-type(6)::before { background: #2ba3a0; }
.tab:nth-of-type(7)::before { background: #c0653d; }

/* KPI icon squares */
.kpi { display: flex; align-items: center; gap: 14px; }
.kicon { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }

/* Outcome pills, coloured per type */
.outcome { border-radius: 999px; border: 0; padding: 3px 10px; }
.outcome.answered_enquiry { background: var(--pastel-1); color: var(--pastel-1-ink); }
.outcome.booking { background: var(--pastel-2); color: var(--pastel-2-ink); }
.outcome.callback { background: var(--pastel-3); color: var(--pastel-3-ink); }
.outcome.message_taken { background: var(--pastel-5); color: var(--pastel-5-ink); }
.outcome.transferred { background: var(--line-soft); color: var(--line-deep); }
.outcome.hangup, .outcome.completed { background: #e8eaec; color: var(--ink-2); }
.outcome.spam, .outcome.trial_expired { background: var(--pastel-6); color: var(--pastel-6-ink); }

/* Auth selling points: icon squares */
.sell li::before { display: none; }
.sell li { padding: 8px 0; display: flex; align-items: center; gap: 12px; }
.sell .sicon { width: 38px; height: 38px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }

/* Softer chart cards + section headers */
.chart-title { color: var(--ink); }
.chart-title .hint { color: var(--ink-2); }
.uptime-item .u-pct { color: var(--line); }


/* ═══ v3.4 — repaint: lighter, friendlier ═══ */
header { background: #fff; color: var(--ink); border-bottom: 1px solid var(--rule); box-shadow: 0 1px 0 rgba(23,27,32,.04); }
header .brand-dot { color: var(--line); }
.head-right { color: var(--ink-2); }
.btn.ghost { border-color: var(--rule); color: var(--ink); }
.btn.ghost:hover { border-color: var(--ink); background: #fff; }
.line-status { color: var(--line-deep); background: var(--line-soft); border-color: transparent; }
.line-status.closed { color: var(--ink-2); background: #eef0f2; }

.banner { background: var(--pastel-2); color: var(--pastel-2-ink); font-weight: 600; border-bottom: 1px solid #c4d8ee; }

.btn.primary { background: var(--line); border-color: var(--line); box-shadow: 0 8px 20px -8px rgba(21,154,104,.55); }
.btn.primary:hover { background: var(--line-deep); border-color: var(--line-deep); }

.line-card {
  background: linear-gradient(120deg, #e7f1fb 0%, #ddefe7 100%);
  color: var(--ink); border: 1px solid #cfe0ef;
}
.lc-label { color: var(--pastel-2-ink); }
.lc-sub { color: var(--ink-2); }

.auth-left { background: linear-gradient(150deg, #143642 0%, #0d5c46 100%); }

.tabs { box-shadow: 0 1px 0 rgba(23,27,32,.03); }

/* Wizard: use the space */
.ob-card { max-width: 800px; }
.ob-step textarea { min-height: 120px; }

/* ═══ Q&A editor ═══ */
.faq-row { display: grid; grid-template-columns: 1fr 1.4fr 34px; gap: 8px; margin: 8px 0; align-items: start; }
.faq-row input, .faq-row textarea { font-family: inherit; font-size: 13px; }
.faq-row textarea { min-height: 38px; resize: vertical; }
.faq-row .faq-x { border: 1px solid var(--rule); background: #fff; border-radius: 6px; height: 38px; cursor: pointer; color: var(--ink-2); font-size: 15px; }
.faq-row .faq-x:hover { color: var(--urgent); border-color: var(--urgent); }
@media (max-width: 640px) { .faq-row { grid-template-columns: 1fr; } .faq-row .faq-x { width: 60px; } }

/* ═══ example-beside-box ═══ */
@media (max-width: 760px) {   }

/* Schedule detail action rows */
.bk-action-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.bk-action-label { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--ink-2); min-width: 88px; }
.bk-action-row input[type="datetime-local"] { max-width: 210px; width: auto; }

/* ═══ Help accordion ═══ */
.help-acc { background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; }
.help-acc summary { cursor: pointer; padding: 14px 18px; font-family: var(--disp); font-weight: 700; font-size: 15px; list-style: none; display: flex; align-items: center; gap: 10px; }
.help-acc summary::-webkit-details-marker { display: none; }
.help-acc summary::before { content: "▸"; color: var(--line); transition: transform .15s; }
.help-acc[open] summary::before { transform: rotate(90deg); }
.help-acc .hb { padding: 0 18px 16px; font-size: 14px; }
.help-acc h4 { margin: 14px 0 6px; font-size: 13px; font-family: var(--mono); letter-spacing: .1em; color: var(--ink-2); }
.divcode { display: inline-block; font-family: var(--mono); font-size: 14px; background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; padding: 5px 12px; margin: 3px 4px 3px 0; cursor: pointer; }
.divcode:hover { border-color: var(--line); background: var(--line-soft); }
.divcode.copied { border-color: var(--line); background: var(--line-soft); }
.help-acc ol, .help-acc ul { padding-left: 20px; margin: 6px 0; }
.help-acc li { margin: 4px 0; }

/* ═══ status pills (admin numbers) ═══ */
.pill { display: inline-block; font-family: var(--mono); font-size: 11px; padding: 3px 9px; border-radius: 999px; background: #eef0f2; color: var(--ink-2); }
.pill.good { background: var(--pastel-1); color: var(--pastel-1-ink); }
.pill.warn { background: var(--pastel-5); color: var(--pastel-5-ink); }
.pill.bad { background: var(--pastel-6); color: var(--pastel-6-ink); }

/* ═══ call centre ═══ */
.qcall { border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; margin: 6px 0; background: #fdfdfd; }
.qcall.waiting { border-left: 4px solid var(--line); }
.qcall .who { font-weight: 600; font-size: 13px; }

/* ═══════════════════════════════════════════════════════════════════
   v5.0 — OPERATOR CONSOLE SHELL
   A persistent left rail (the switchboard), a calm work surface right.
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --rail-w: 232px;
  --rail-bg: #12171c;
  --rail-ink: #96a1ab;
  --rail-ink-hi: #ffffff;
  --rail-hair: #232c34;
  --topbar-h: 60px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
}

#view-app { display: block; }
.shell { display: flex; min-height: 100vh; background: var(--paper); }

/* ── Left rail ─────────────────────────────────────────────────── */
.rail {
  width: var(--rail-w);
  flex: 0 0 var(--rail-w);
  background: linear-gradient(165deg, var(--auth-teal-1) 0%, var(--auth-teal-2) 60%, #0d201d 100%);
  color: var(--rail-ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}
.rail-brand {
  font-family: var(--disp);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: .04em;
  color: var(--rail-ink-hi);
  padding: 20px 20px 14px;
}
.rail-brand .brand-dot { color: var(--line); }

/* switchboard lamp — the signature status light */
.lamp {
  margin: 0 14px 16px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(14,138,95,.14);
  color: #5fd3a4;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  display: flex;
  align-items: center;
  gap: 9px;
  text-transform: uppercase;
}
.lamp.closed { background: rgba(255,255,255,.06); color: #7b858e; }
.lamp .pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; flex-shrink: 0;
  box-shadow: 0 0 0 0 currentColor;
  animation: lamp 2.4s infinite;
}
.lamp.closed .pulse { animation: none; }
@keyframes lamp {
  0%   { box-shadow: 0 0 0 0 rgba(95,211,164,.5); }
  70%  { box-shadow: 0 0 0 7px rgba(95,211,164,0); }
  100% { box-shadow: 0 0 0 0 rgba(95,211,164,0); }
}

.rail .tabs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 10px;
  flex: 1;
  overflow-y: auto;
  border: 0;
  background: none;
  box-shadow: none;
  margin: 0;
}
.rail .tab {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--rail-ink);
  font-family: var(--disp);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.rail .tab::before { display: none; }   /* kill the old colour-dot rule */
.rail .tab .ti {
  width: 17px; height: 17px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
  opacity: .75;
}
.rail .tab span:first-of-type { flex: 1; }
.rail .tab:hover { background: rgba(255,255,255,.05); color: var(--rail-ink-hi); }
.rail .tab.active {
  background: rgba(79,211,154,.16);
  color: var(--rail-ink-hi);
  font-weight: 600;
}
.rail .tab.active .ti { opacity: 1; color: #5fd3a4; }
.rail .tab:focus-visible { outline: 2px solid var(--line); outline-offset: -2px; }
.rail .badge {
  background: var(--urgent); color: #fff;
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  min-width: 18px; height: 18px; line-height: 18px;
  border-radius: 999px; text-align: center; padding: 0 5px;
}
.rail-sep { height: 1px; background: var(--rail-hair); margin: 10px 12px; }
.rail-foot {
  padding: 14px 16px;
  border-top: 1px solid var(--rail-hair);
  display: flex; flex-direction: column; gap: 9px;
}
.rail-num { font-size: 12px; color: var(--rail-ink); letter-spacing: .02em; }
.rail-foot .btn.ghost {
  border-color: var(--rail-hair); color: var(--rail-ink); background: none; width: 100%;
}
.rail-foot .btn.ghost:hover { border-color: #3a454e; color: #fff; background: rgba(255,255,255,.04); }

/* ── Work surface ──────────────────────────────────────────────── */
.surface { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  background: var(--panel);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 30;
}
.topbar-title {
  font-family: var(--disp);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 0;
  color: var(--ink);
}
.railtoggle { display: none; background: none; border: 0; cursor: pointer; padding: 6px; color: var(--ink); }
.railtoggle svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; fill: none; }
.rail-scrim { display: none; }

.surface main { padding: 26px 40px 60px; max-width: 1320px; width: 100%; margin: 0 auto; box-sizing: border-box; }
.surface .banner { border-radius: 0; margin: 0; }

/* Panes: hide the old .pane-head h2 duplication with topbar title */
.pane-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.pane-head h2 { font-family: var(--disp); font-size: 15px; font-weight: 700; margin: 0; letter-spacing: -.005em; }

/* ── Mobile: rail becomes an off-canvas drawer ─────────────────── */
@media (max-width: 900px) {
  .rail {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform .22s cubic-bezier(.4,0,.2,1);
    box-shadow: 8px 0 32px rgba(0,0,0,.25);
  }
  .rail.open { transform: none; }
  .railtoggle { display: block; }
  .rail-scrim {
    display: block; position: fixed; inset: 0; background: rgba(18,23,28,.45);
    opacity: 0; pointer-events: none; transition: opacity .22s; z-index: 39;
  }
  .rail-scrim.on { opacity: 1; pointer-events: auto; }
  .surface main { padding: 18px 16px 80px; }
  .topbar { padding: 0 14px; }
}

/* ── Toasts ───────────────────────────────────────────────────── */
.toasts {
  position: fixed; right: 20px; bottom: 20px; z-index: 2000;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
  max-width: min(380px, calc(100vw - 40px));
}
.toast {
  pointer-events: auto;
  background: var(--ink); color: #fff;
  border-radius: var(--r-md); padding: 13px 16px;
  box-shadow: 0 10px 34px rgba(23,27,32,.28);
  font-size: 13.5px; line-height: 1.5;
  display: flex; gap: 11px; align-items: flex-start;
  animation: toast-in .22s cubic-bezier(.2,.9,.3,1);
  border-left: 3px solid var(--line);
}
.toast.err { border-left-color: #e06a5e; }
.toast.warn { border-left-color: var(--amber); }
.toast .tmark { font-family: var(--mono); font-size: 12px; opacity: .8; flex-shrink: 0; margin-top: 1px; }
.toast.leaving { animation: toast-out .18s forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } .lamp .pulse { animation: none; } }

/* ── Confirm dialog ───────────────────────────────────────────── */
.modal-scrim {
  position: fixed; inset: 0; background: rgba(18,23,28,.5);
  display: flex; align-items: center; justify-content: center; z-index: 2100; padding: 20px;
  animation: fade-in .15s;
}
@keyframes fade-in { from { opacity: 0; } }
.modal {
  background: var(--panel); border-radius: var(--r-lg); padding: 24px;
  max-width: 420px; width: 100%; box-shadow: 0 24px 60px rgba(23,27,32,.3);
  animation: modal-in .2s cubic-bezier(.2,.9,.3,1);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal h3 { font-family: var(--disp); font-size: 17px; margin: 0 0 8px; }
.modal p { font-size: 14px; line-height: 1.55; color: var(--ink-2); margin: 0 0 20px; white-space: pre-line; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ── Empty states ─────────────────────────────────────────────── */
.empty { text-align: center; padding: 46px 24px; }
.empty svg { width: 40px; height: 40px; stroke: var(--rule); stroke-width: 1.5; fill: none; margin-bottom: 14px; }
.empty h4 { font-family: var(--disp); font-size: 15px; margin: 0 0 6px; color: var(--ink); }
.empty p { font-size: 13px; color: var(--ink-2); margin: 0 auto; max-width: 340px; line-height: 1.6; }

/* ── Skeletons ────────────────────────────────────────────────── */
.sk { background: linear-gradient(90deg, #e8ebed 25%, #f2f4f5 50%, #e8ebed 75%); background-size: 200% 100%; animation: sk 1.3s infinite; border-radius: 6px; }
@keyframes sk { to { background-position: -200% 0; } }
.sk-row { height: 42px; margin-bottom: 8px; }
.sk-kpi { height: 78px; border-radius: var(--r-md); }

/* ── Component polish ─────────────────────────────────────────── */
.kpi, .chart-card, .memo, table.calls, .settings fieldset, .plan-card {
  border-radius: var(--r-md);
}
.kpi { transition: transform .14s, box-shadow .14s; }
.kpi:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(23,27,32,.07), 0 10px 24px rgba(23,27,32,.08); }
.btn { transition: background .13s, border-color .13s, color .13s, transform .08s; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--line); outline-offset: 2px;
}
table.calls tbody tr { transition: background .1s; }
table.calls tbody tr:hover { background: #f7f9fa; }
input, select, textarea { transition: border-color .13s, box-shadow .13s; }
input:focus, select:focus, textarea:focus { border-color: var(--line); }
.chart-card { transition: box-shadow .15s; }

/* ── Hero line card: the switchboard patch panel ───────────────── */
.line-card {
  position: relative;
  overflow: hidden;
  padding: 26px 28px;
  border-radius: var(--r-lg);
}
/* faint patch-panel jack pattern — the switchboard signature */
.line-card::after {
  content: "";
  position: absolute; right: -30px; top: -30px;
  width: 220px; height: 220px;
  background-image: radial-gradient(circle, rgba(23,27,32,.14) 1.6px, transparent 1.7px);
  background-size: 19px 19px;
  opacity: .5;
  pointer-events: none;
  mask-image: radial-gradient(circle at 70% 30%, #000 40%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 70% 30%, #000 40%, transparent 72%);
}
.lc-label { font-family: var(--mono); font-size: 10px; letter-spacing: .18em; opacity: .72; }
.lc-number { font-size: clamp(26px, 4.4vw, 38px); font-weight: 600; letter-spacing: -.02em; line-height: 1.1; margin-top: 4px; }
.lc-divert { font-size: 17px; font-weight: 500; margin-top: 4px; }

/* ── Section rhythm ───────────────────────────────────────────── */
.chart-title {
  font-family: var(--mono); font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-2); margin-bottom: 12px;
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.chart-title .hint { letter-spacing: 0; text-transform: none; font-family: var(--disp); font-size: 12px; }
.chart-card { padding: 18px 20px; }
.kpi-grid { gap: 12px; }
.kpi { padding: 15px 16px; }
.kpi .v { font-family: var(--mono); font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.kpi .v small { font-size: 14px; opacity: .6; }
.kpi .l { font-family: var(--mono); font-size: 9.5px; letter-spacing: .13em; color: var(--ink-2); margin-top: 3px; }

/* Tables: quieter, denser, more app-like */
table.calls { border-collapse: separate; border-spacing: 0; overflow: hidden; }
table.calls thead th {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-2); font-weight: 500; padding: 11px 14px; background: #f7f9fa;
  border-bottom: 1px solid var(--rule); text-align: left;
}
table.calls tbody td { padding: 11px 14px; border-bottom: 1px solid #eef1f2; font-size: 13.5px; vertical-align: middle; }
table.calls tbody tr:last-child td { border-bottom: 0; }

/* Buttons: clearer hierarchy */
.btn { font-family: var(--disp); font-weight: 600; border-radius: var(--r-sm); }
.btn.sm { font-size: 12px; padding: 6px 12px; }
.btn.primary { box-shadow: 0 1px 2px rgba(10,107,74,.24); }

/* Settings: card-like fieldsets */
.settings fieldset { padding: 18px 20px; margin-bottom: 16px; border: 1px solid var(--rule); background: var(--panel); box-shadow: var(--shadow); }
.settings legend { font-family: var(--disp); font-weight: 700; font-size: 14px; padding: 0 8px; }
.settings label { display: block; font-size: 12.5px; font-weight: 600; margin-top: 12px; }
.settings label.row { display: flex; align-items: center; gap: 9px; font-weight: 500; }

/* ── Hero: dark patch-panel, the anchor of the overview ─────────── */
.line-card {
  background: linear-gradient(135deg, #12171c 0%, #143a2e 100%);
  color: #eef2f4;
  border: 0;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap;
  box-shadow: 0 2px 4px rgba(23,27,32,.1), 0 14px 40px rgba(20,58,46,.18);
}
.line-card::after {
  background-image: radial-gradient(circle, rgba(95,211,164,.5) 1.7px, transparent 1.8px);
  opacity: .35;
}
.line-card .lc-label { color: #5fd3a4; opacity: 1; }
.line-card .lc-number { color: #fff; }
.line-card .lc-sub { color: #8fa0a9; font-size: 12.5px; margin-top: 6px; }
.line-card .lc-divert { color: #fff; }
.line-card > div:last-child { text-align: right; }
@media (max-width: 620px) {
  .line-card { flex-direction: column; align-items: flex-start; }
  .line-card > div:last-child { text-align: left; }
}

/* ── KPI grid: denser, fills the surface ───────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .kpi { padding: 12px; gap: 10px; }
  .kpi .kicon { width: 34px; height: 34px; border-radius: 9px; }
  .kpi .kicon svg { width: 17px; height: 17px; }
  .kpi .v { font-size: 21px; }
  .kpi .l { font-size: 8.5px; }
  .line-card { padding: 20px; }
}

/* Period selector: aligned, quiet */
.period-row { display: flex; align-items: center; gap: 10px; margin: 22px 0 14px; }
.period-row h3 { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); margin: 0; font-weight: 500; }
.period-row select { width: auto; min-width: 110px; font-size: 13px; padding: 6px 10px; }

/* A pane heading that merely repeats the topbar title is hidden, but the
   row stays so its action buttons keep their position. */
.pane-head h2.dupe { display: none; }
.pane-head:has(h2.dupe) { justify-content: flex-end; margin-bottom: 14px; }
.pane-head:has(h2.dupe) .hint { margin-right: auto; }

/* ── Getting-started checklist ─────────────────────────────────── */
.setup-card {
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-md);
  padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.setup-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.setup-title { font-family: var(--disp); font-size: 17px; font-weight: 700; margin: 4px 0 0; letter-spacing: -.01em; }
.setup-progress { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.setup-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.setup-step {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 12px; border-radius: var(--r-sm);
  transition: background .12s;
}
.setup-step + .setup-step { border-top: 1px solid #f0f2f3; }
.setup-step:hover { background: #f8fafa; }
.setup-tick {
  width: 21px; height: 21px; border-radius: 50%; flex-shrink: 0; margin-top: 1px;
  border: 1.8px solid var(--rule); display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: transparent;
}
.setup-step.done .setup-tick { background: var(--line-deep); border-color: var(--line-deep); color: #fff; }
.setup-step.done .st-title { color: var(--ink-2); text-decoration: line-through; text-decoration-color: var(--rule); }
.st-body { flex: 1; min-width: 0; }
.st-title { font-size: 13.5px; font-weight: 600; }
.st-sub { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; line-height: 1.5; }
.setup-step .btn { flex-shrink: 0; }
@media (max-width: 560px) {
  .setup-step { flex-wrap: wrap; }
  .setup-step .btn { margin-left: 33px; }
}

/* ── Onboarding: named stepper ─────────────────────────────────── */
.onboard { background: linear-gradient(165deg, #eef2f3 0%, #e4ecea 100%); }
.ob-card { border-radius: var(--r-lg); box-shadow: 0 2px 6px rgba(23,27,32,.06), 0 20px 60px rgba(23,27,32,.10); }
.ob-stepper { display: flex; gap: 4px; margin: 22px 0 28px; }
.ob-stepper .obs { flex: 1; min-width: 0; }
.ob-stepper .obs-bar { height: 3px; border-radius: 2px; background: var(--rule); transition: background .25s; }
.ob-stepper .obs.on .obs-bar, .ob-stepper .obs.done .obs-bar { background: var(--line); }
.ob-stepper .obs-label {
  font-family: var(--mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--rule); margin-top: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color .25s;
}
.ob-stepper .obs.done .obs-label { color: var(--ink-2); }
.ob-stepper .obs.on .obs-label { color: var(--line-deep); font-weight: 600; }
.ob-step h2 { font-size: 27px; letter-spacing: -.02em; }
.ob-step .lead { color: var(--ink-2); font-size: 14.5px; line-height: 1.6; margin: 0 0 4px; }
.ob-nav .btn.primary { min-width: 132px; }
.ob-count { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--ink-2); text-transform: uppercase; }
@media (max-width: 620px) {
  .ob-stepper .obs-label { display: none; }
  .ob-step h2 { font-size: 22px; }
}
.ob-review { border-radius: var(--r-md); padding: 6px 18px; }
.ob-review .rrow { align-items: flex-start; padding: 10px 0; }
.ob-review b { text-transform: uppercase; min-width: 148px; }
.ob-review .rval { font-size: 13.5px; line-height: 1.5; }
.ob-review .rval.warn { color: var(--amber); font-weight: 600; }

/* ── Sticky save bar: always reachable on a long settings form ─── */
.savebar {
  position: sticky; bottom: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; margin: 8px -4px 0;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--rule); border-radius: var(--r-md);
  box-shadow: 0 -2px 20px rgba(23,27,32,.07);
}
.savebar .btn.primary { min-width: 140px; }

/* ═══════════════════════════════════════════════════════════════════
   v5.2 — TYPE CORRECTION
   Mono is for DATA (numbers, codes, timers). Labels go back to the
   friendly sans in sentence case: easier to read on a phone, in the
   sun, for someone who isn't 25.
   ═══════════════════════════════════════════════════════════════════ */

/* KPI captions: readable label, not a tracked-out shout */
.kpi .l {
  font-family: var(--disp);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
  color: var(--ink-2);
  margin-top: 3px;
  line-height: 1.35;
}
/* the value stays mono — that's data, and mono aligns digits */
.kpi .v { font-family: var(--mono); }

/* Card titles: sentence case, legible weight */
.chart-title {
  font-family: var(--disp);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 12px;
}
.chart-title .hint { font-weight: 400; font-size: 12.5px; color: var(--ink-2); }

/* Table headers: readable, still quiet */
table.calls thead th {
  font-family: var(--disp);
  font-size: 11.5px;
  letter-spacing: .01em;
  text-transform: none;
  font-weight: 600;
  color: var(--ink-2);
}

/* Onboarding stepper labels */
.ob-stepper .obs-label { font-family: var(--disp); font-size: 11px; letter-spacing: 0; text-transform: none; }

/* Rail lamp: keep it small but readable */
.lamp { font-family: var(--disp); font-size: 11.5px; letter-spacing: .01em; text-transform: none; font-weight: 500; }

/* Setup checklist + review labels */
.ob-review b { font-family: var(--disp); font-size: 12px; letter-spacing: 0; text-transform: none; font-weight: 600; color: var(--ink-2); }
.setup-progress { font-family: var(--disp); font-size: 12.5px; }

/* The memo slip keeps its mono heading — that IS the signature, and
   there's exactly one of it per card rather than one per label. */
.memo .memo-head { font-family: var(--mono); }
.ob-note { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; margin: 14px 0 0; padding-left: 12px; border-left: 2px solid var(--line-soft); }

/* ═══ SUPPORT CENTRE ═══ */
.announce {
  padding: 12px 28px; font-size: 13.5px; line-height: 1.5;
  background: var(--pastel-2); color: var(--pastel-2-ink);
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.announce.warn { background: var(--pastel-5); color: var(--pastel-5-ink); }
.announce.good { background: var(--pastel-1); color: var(--pastel-1-ink); }
.announce b { font-weight: 700; }

.ask-card {
  background: linear-gradient(160deg, #12171c 0%, #143a2e 100%); color: #fff;
  border-radius: var(--r-lg); padding: 26px 28px; margin-bottom: 20px;
}
.ask-title { font-family: var(--disp); font-size: 21px; font-weight: 700; margin: 0 0 4px; }
.ask-card .hint { color: #93a8b1; }
.ask-row { display: flex; gap: 10px; margin-top: 16px; }
.ask-row input {
  flex: 1; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
  color: #fff; border-radius: var(--r-sm); padding: 11px 14px; font-size: 14px;
}
.ask-row input::placeholder { color: #7d919b; }
.ask-row input:focus { border-color: #5fd3a4; outline: none; }
.ask-quick { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.ask-quick button {
  background: rgba(255,255,255,.09); border: 0; color: #cfe0e6;
  border-radius: 999px; padding: 6px 13px; font-size: 12.5px; cursor: pointer;
  font-family: var(--disp);
}
.ask-quick button:hover { background: rgba(255,255,255,.16); color: #fff; }

.ans-card { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 20px 22px; box-shadow: var(--shadow); }
.ans-body { font-size: 14.5px; line-height: 1.65; white-space: pre-wrap; }
.ans-foot { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rule); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ans-foot .hint { margin-right: auto; }
.ans-sources { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.ans-sources button { background: var(--line-soft); border: 0; color: var(--line-deep); border-radius: 999px; padding: 6px 13px; font-size: 12.5px; cursor: pointer; font-family: var(--disp); font-weight: 600; }
.thinking { display: flex; gap: 5px; align-items: center; padding: 22px; color: var(--ink-2); font-size: 13.5px; }
.thinking i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); animation: th 1.1s infinite; }
.thinking i:nth-child(2) { animation-delay: .15s; } .thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes th { 0%,100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

.guide-cat { font-family: var(--disp); font-size: 12px; font-weight: 700; color: var(--ink-2); margin: 20px 0 8px; }
.guide { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-md); margin-bottom: 8px; overflow: hidden; }
.guide summary { cursor: pointer; padding: 14px 18px; font-weight: 600; font-size: 14px; list-style: none; display: flex; align-items: center; gap: 10px; }
.guide summary::-webkit-details-marker { display: none; }
.guide summary::before { content: "▸"; color: var(--line); transition: transform .15s; }
.guide[open] summary::before { transform: rotate(90deg); }
.guide .gbody { padding: 0 18px 18px; font-size: 14px; line-height: 1.65; white-space: pre-wrap; color: var(--ink); }

.tkt { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 9px; cursor: pointer; transition: border-color .12s; }
.tkt:hover { border-color: var(--line); }
.tkt-head { display: flex; align-items: center; gap: 10px; }
.tkt-subj { font-weight: 600; font-size: 14px; flex: 1; }
.tkt-meta { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.msg { border-radius: var(--r-md); padding: 13px 16px; margin-bottom: 10px; font-size: 14px; line-height: 1.6; white-space: pre-wrap; max-width: 78%; }
.msg.customer { background: var(--line-soft); margin-left: auto; }
.msg.support { background: var(--panel); border: 1px solid var(--rule); }
.msg.ai { background: var(--pastel-3); }
.msg-who { font-size: 11px; font-weight: 700; opacity: .65; margin-bottom: 5px; font-family: var(--disp); }

/* ═══════════════════════════════════════════════════════════════════
   THEMES — set data-theme on <html>. Default (no attribute) is the
   original teal. Each theme only overrides the accent family; the
   neutrals, spacing and type stay identical.
   ═══════════════════════════════════════════════════════════════════ */

/* Slate blue — calm, conventional business software */
html[data-theme="blue"] {
  --line: #2563a8; --line-deep: #1b4a80; --line-soft: #dde9f6;
  --rail-bg: #131a24; --rail-hair: #242f3d;
}
html[data-theme="blue"] .lamp { background: rgba(37,99,168,.2); color: #7ab6f0; }
html[data-theme="blue"] .lamp .pulse { animation-name: lamp-blue; }
html[data-theme="blue"] .rail .tab.active .ti { color: #7ab6f0; }
html[data-theme="blue"] .line-card { background: linear-gradient(135deg, #131a24 0%, #1b4a80 100%); }
html[data-theme="blue"] .line-card .lc-label { color: #7ab6f0; }
html[data-theme="blue"] .line-card::after { background-image: radial-gradient(circle, rgba(122,182,240,.5) 1.7px, transparent 1.8px); }
html[data-theme="blue"] .ask-card { background: linear-gradient(160deg, #131a24 0%, #1b4a80 100%); }
@keyframes lamp-blue { 0% { box-shadow: 0 0 0 0 rgba(122,182,240,.5); } 70% { box-shadow: 0 0 0 7px rgba(122,182,240,0); } 100% { box-shadow: 0 0 0 0 rgba(122,182,240,0); } }

/* Indigo — modern, a little more distinctive */
html[data-theme="indigo"] {
  --line: #5b53c6; --line-deep: #443da8; --line-soft: #e5e3f8;
  --rail-bg: #16151f; --rail-hair: #2a2838;
}
html[data-theme="indigo"] .lamp { background: rgba(91,83,198,.22); color: #a9a2f5; }
html[data-theme="indigo"] .lamp .pulse { animation-name: lamp-indigo; }
html[data-theme="indigo"] .rail .tab.active .ti { color: #a9a2f5; }
html[data-theme="indigo"] .line-card { background: linear-gradient(135deg, #16151f 0%, #443da8 100%); }
html[data-theme="indigo"] .line-card .lc-label { color: #a9a2f5; }
html[data-theme="indigo"] .line-card::after { background-image: radial-gradient(circle, rgba(169,162,245,.5) 1.7px, transparent 1.8px); }
html[data-theme="indigo"] .ask-card { background: linear-gradient(160deg, #16151f 0%, #443da8 100%); }
@keyframes lamp-indigo { 0% { box-shadow: 0 0 0 0 rgba(169,162,245,.5); } 70% { box-shadow: 0 0 0 7px rgba(169,162,245,0); } 100% { box-shadow: 0 0 0 0 rgba(169,162,245,0); } }

/* Charcoal & amber — warm, industrial, suits trades */
html[data-theme="amber"] {
  --line: #b5701a; --line-deep: #8f5713; --line-soft: #fbebd6;
  --rail-bg: #1b1917; --rail-hair: #2f2b27;
}
html[data-theme="amber"] .lamp { background: rgba(181,112,26,.24); color: #efb469; }
html[data-theme="amber"] .lamp .pulse { animation-name: lamp-amber; }
html[data-theme="amber"] .rail .tab.active .ti { color: #efb469; }
html[data-theme="amber"] .line-card { background: linear-gradient(135deg, #1b1917 0%, #6b431a 100%); }
html[data-theme="amber"] .line-card .lc-label { color: #efb469; }
html[data-theme="amber"] .line-card::after { background-image: radial-gradient(circle, rgba(239,180,105,.5) 1.7px, transparent 1.8px); }
html[data-theme="amber"] .ask-card { background: linear-gradient(160deg, #1b1917 0%, #6b431a 100%); }
@keyframes lamp-amber { 0% { box-shadow: 0 0 0 0 rgba(239,180,105,.5); } 70% { box-shadow: 0 0 0 7px rgba(239,180,105,0); } 100% { box-shadow: 0 0 0 0 rgba(239,180,105,0); } }

/* Ink & crimson — confident, high contrast */
html[data-theme="crimson"] {
  --line: #b23b4a; --line-deep: #8e2c39; --line-soft: #f9e2e5;
  --rail-bg: #17151a; --rail-hair: #2b262e;
}
html[data-theme="crimson"] .lamp { background: rgba(178,59,74,.24); color: #ef8e9b; }
html[data-theme="crimson"] .lamp .pulse { animation-name: lamp-crimson; }
html[data-theme="crimson"] .rail .tab.active .ti { color: #ef8e9b; }
html[data-theme="crimson"] .line-card { background: linear-gradient(135deg, #17151a 0%, #7a2733 100%); }
html[data-theme="crimson"] .line-card .lc-label { color: #ef8e9b; }
html[data-theme="crimson"] .line-card::after { background-image: radial-gradient(circle, rgba(239,142,155,.5) 1.7px, transparent 1.8px); }
html[data-theme="crimson"] .ask-card { background: linear-gradient(160deg, #17151a 0%, #7a2733 100%); }
@keyframes lamp-crimson { 0% { box-shadow: 0 0 0 0 rgba(239,142,155,.5); } 70% { box-shadow: 0 0 0 7px rgba(239,142,155,0); } 100% { box-shadow: 0 0 0 0 rgba(239,142,155,0); } }

/* Graphite — near-monochrome, lets the pastel job colours do the talking */
html[data-theme="graphite"] {
  --line: #4a5560; --line-deep: #333c45; --line-soft: #e4e8ec;
  --rail-bg: #14181c; --rail-hair: #262d34;
}
html[data-theme="graphite"] .lamp { background: rgba(255,255,255,.1); color: #b6c2cc; }
html[data-theme="graphite"] .lamp .pulse { animation-name: lamp-graphite; }
html[data-theme="graphite"] .rail .tab.active .ti { color: #b6c2cc; }
html[data-theme="graphite"] .line-card { background: linear-gradient(135deg, #14181c 0%, #3c464f 100%); }
html[data-theme="graphite"] .line-card .lc-label { color: #b6c2cc; }
html[data-theme="graphite"] .line-card::after { background-image: radial-gradient(circle, rgba(182,194,204,.45) 1.7px, transparent 1.8px); }
html[data-theme="graphite"] .ask-card { background: linear-gradient(160deg, #14181c 0%, #3c464f 100%); }
@keyframes lamp-graphite { 0% { box-shadow: 0 0 0 0 rgba(182,194,204,.45); } 70% { box-shadow: 0 0 0 7px rgba(182,194,204,0); } 100% { box-shadow: 0 0 0 0 rgba(182,194,204,0); } }

/* Theme picker swatches */
.theme-row { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch {
  border: 2px solid var(--rule); border-radius: var(--r-md); padding: 10px 12px;
  background: var(--panel); cursor: pointer; text-align: left; min-width: 128px;
  font-family: var(--disp); font-size: 12.5px; font-weight: 600; transition: border-color .12s;
}
.swatch:hover { border-color: var(--ink-2); }
.swatch.on { border-color: var(--line); }
.swatch .chips { display: flex; gap: 4px; margin-bottom: 8px; }
.swatch .chips i { width: 22px; height: 22px; border-radius: 5px; display: block; }
.rail-legal { font-size: 11.5px; color: var(--rail-ink); text-align: center; margin-top: 2px; }
.rail-legal a { color: var(--rail-ink); text-decoration: none; }
.rail-legal a:hover { color: #fff; text-decoration: underline; }

/* ── Form dialog ──────────────────────────────────────────────── */
.modal-form { max-width: 520px; }
.fd-intro { font-size: 13.5px; color: var(--ink-2); margin: 0 0 16px; }
.fd-body { max-height: 62vh; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.fd-field { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 14px; }
.fd-field .hint { font-weight: 400; margin-left: 6px; }
.fd-field .req { color: var(--urgent); margin-left: 2px; }
.fd-field input, .fd-field textarea, .fd-field select { margin-top: 5px; width: 100%; }
.fd-field textarea { font-family: var(--disp); line-height: 1.6; resize: vertical; }
.fd-err { color: var(--urgent); font-size: 13px; margin: 0 0 12px; font-weight: 600; }

/* ── Logo upload ──────────────────────────────────────────────── */
.logo-field { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 16px; flex-wrap: wrap; }
.logo-preview {
  width: 116px; height: 116px; flex-shrink: 0;
  border: 1px dashed var(--rule); border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  background: #fbfcfc; overflow: hidden; padding: 10px; box-sizing: border-box;
}
.logo-preview.dark { background: var(--rail-bg); border-color: var(--rail-hair); }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-none { font-size: 11.5px; color: var(--ink-2); text-align: center; }
.logo-preview.dark .logo-none { color: var(--rail-ink); }
.logo-actions { flex: 1; min-width: 200px; }
.lf-label { font-size: 12.5px; font-weight: 600; margin-bottom: 2px; }
.logo-actions .hint { margin: 0 0 10px; }
label.btn { display: inline-flex; align-items: center; }

/* Platform logo in the rail */
.rail-brand img { max-width: 148px; max-height: 34px; object-fit: contain; display: block; }

/* Customer logo on the agent's call screen */
.rc-logo { width: 78px; height: 78px; margin: 0 auto 14px; border-radius: 16px;
           background: rgba(255,255,255,.94); display: flex; align-items: center;
           justify-content: center; padding: 9px; box-sizing: border-box; }
.rc-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.cs-logo { width: 46px; height: 46px; border-radius: 10px; background: #fff;
           display: flex; align-items: center; justify-content: center; padding: 6px;
           box-sizing: border-box; flex-shrink: 0; }
.cs-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.cs-head-left { display: flex; align-items: center; gap: 14px; }
/* Checkerboard so both white and dark logos stay visible in the preview */
.logo-preview.checker {
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #eceef0 25%, transparent 25%, transparent 75%, #eceef0 75%),
    linear-gradient(45deg, #eceef0 25%, transparent 25%, transparent 75%, #eceef0 75%);
  background-size: 14px 14px;
  background-position: 0 0, 7px 7px;
}

/* ── Call centre wallboard ────────────────────────────────────── */
.cc-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 860px) { .cc-two { grid-template-columns: 1fr; } }
.kpi.good .v { color: var(--line-deep); }
.kpi.warn .v { color: #a4700f; }
.kpi.bad  .v { color: var(--urgent); }
.kpi-bench { font-size: 10.5px; color: var(--ink-2); margin-top: 3px; }
.sent-bar { display: flex; height: 30px; border-radius: 8px; overflow: hidden; margin-bottom: 10px; }
.sent-bar i { display: block; }
.sent-pos { background: #46c08b; } .sent-neu { background: #cdd6db; } .sent-neg { background: #e2564a; }
.sent-key { display: flex; gap: 16px; font-size: 12.5px; flex-wrap: wrap; }
.sent-key span { display: flex; align-items: center; gap: 6px; }
.sent-key i { width: 10px; height: 10px; border-radius: 3px; display: block; }
.dispo-row { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; font-size: 13px; }
.dispo-row .lbl { min-width: 132px; }
.dispo-row .bar { flex: 1; height: 9px; background: var(--line-soft); border-radius: 5px; overflow: hidden; }
.dispo-row .bar i { display: block; height: 100%; background: var(--line); }
.dispo-row .n { font-family: var(--mono); font-size: 12px; min-width: 28px; text-align: right; }
.hourly { display: flex; align-items: flex-end; gap: 2px; height: 92px; }
.hourly i { flex: 1; background: var(--line); border-radius: 2px 2px 0 0; min-height: 2px; position: relative; }
.hourly i.peak { background: var(--line-deep); }
.hourly-axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--ink-2); margin-top: 5px; font-family: var(--mono); }
.state-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f0f2f3; font-size: 13.5px; }
.state-row:last-child { border-bottom: 0; }
.state-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.st-available { background: #46c08b; } .st-on_call { background: #2f7fd0; }
.st-wrap { background: #d9a441; } .st-break { background: #b06fd4; } .st-offline { background: #c3cbd1; }
.state-row .nm { flex: 1; font-weight: 600; }
.state-row .since { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); }
.review-row { padding: 12px 0; border-bottom: 1px solid #f0f2f3; }
.review-row:last-child { border-bottom: 0; }
.review-head { display: flex; align-items: center; gap: 9px; margin-bottom: 4px; flex-wrap: wrap; }
.qa-score { font-family: var(--mono); font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.qa-low { background: #fde8e6; color: #8f2f26; } .qa-mid { background: #fdf1d9; color: #7a5410; }
.review-sum { font-size: 13px; color: var(--ink-2); line-height: 1.55; }
.review-note { font-size: 12.5px; color: var(--line-deep); margin-top: 4px; }

/* ── Cancellation ─────────────────────────────────────────────── */
.cancel-area { border-top: 1px solid var(--rule); padding-top: 20px; margin-bottom: 30px; }
.ca-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.ca-title { font-family: var(--disp); font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.ca-head .hint { margin: 0; max-width: 520px; }
.btn.danger-ghost { border-color: #e6c4c0; color: var(--urgent); background: #fff; }
.btn.danger-ghost:hover { background: #fdf3f2; border-color: var(--urgent); }
.ca-pending { background: #fdf6e8; border: 1px solid #e8d5a8; border-radius: var(--r-md); padding: 16px 18px; }
.ca-pending p { font-size: 13.5px; line-height: 1.6; margin: 4px 0 14px; color: #6b5518; }

/* Cancellation modal */
.cx-list { margin: 14px 0 4px; padding: 0; list-style: none; }
.cx-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.55; padding: 9px 0; border-bottom: 1px solid #f0f2f3; }
.cx-list li:last-child { border-bottom: 0; }
.cx-ico { flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center;
          justify-content: center; font-size: 11px; margin-top: 1px; }
.cx-keep { background: var(--line-soft); color: var(--line-deep); }
.cx-lose { background: #fdeceb; color: var(--urgent); }
.cx-warn { background: #fdf6e8; border: 1px solid #e8d5a8; border-radius: var(--r-sm); padding: 12px 14px;
           font-size: 13px; line-height: 1.55; margin-top: 14px; color: #6b5518; }
.cx-warn b { color: #4a3a0d; }
.cx-confirm { margin-top: 16px; font-size: 13px; }
.cx-confirm input { margin-top: 6px; }

/* ═══ Table & list patterns: bulk actions, data bars, row actions ═══ */

/* Selection */
.selectable { position: relative; }
.rowpick-wrap { position: absolute; top: 12px; left: 12px; z-index: 2; display: flex; }
.rowpick { width: 17px; height: 17px; cursor: pointer; accent-color: var(--line); margin: 0; }
.memo.selectable { padding-left: 40px; }
.selectable.picked { box-shadow: 0 0 0 2px var(--line); }

/* Floating bulk action bar */
.bulkbar {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 9px; z-index: 900;
  background: var(--rail-bg); color: #fff;
  padding: 10px 12px 10px 18px; border-radius: 999px;
  box-shadow: 0 12px 40px rgba(23,27,32,.34);
  animation: bb-in .18s cubic-bezier(.2,.9,.3,1);
}
@keyframes bb-in { from { opacity: 0; transform: translate(-50%, 14px); } }
.bb-count { font-size: 13px; color: #c3cdd4; margin-right: 4px; white-space: nowrap; }
.bb-count b { color: #fff; font-family: var(--mono); }
.bulkbar .btn { border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.1); color: #fff; }
.bulkbar .btn:hover { background: rgba(255,255,255,.18); }
.bulkbar .btn.primary { background: var(--line); border-color: var(--line); }
.bulkbar .btn.ghost { background: transparent; border-color: transparent; color: #93a3ac; }
@media (max-width: 560px) { .bulkbar { left: 12px; right: 12px; transform: none; justify-content: center; flex-wrap: wrap; border-radius: var(--r-md); } }

/* Data bar inside a table cell — magnitude at a glance */
.databar { position: relative; display: block; min-width: 74px; padding: 3px 0; }
.databar i {
  position: absolute; left: 0; top: 0; bottom: 0; display: block;
  background: var(--line-soft); border-radius: 3px; z-index: 0;
}
.db-val { position: relative; z-index: 1; padding-left: 5px; }

/* Rows that deserve attention */
tr.row-flag { background: #fffaf3; }
tr.row-flag:hover { background: #fff5e8; }
.flagdot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--amber, #c98a1a); margin-right: 7px; vertical-align: middle;
}

/* Inline row actions */
td.rowacts { white-space: nowrap; text-align: right; }
.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: var(--ink-2); cursor: pointer; margin-left: 3px;
  transition: background .12s, color .12s, border-color .12s; text-decoration: none;
}
.iconbtn:hover { background: var(--line-soft); color: var(--line-deep); border-color: var(--rule); }
.iconbtn svg { width: 15px; height: 15px; }

/* ── Customer management ──────────────────────────────────────── */
.biz-controls { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.biz-controls input { max-width: 280px; }
.biz-controls select { max-width: 150px; margin-left: auto; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--rule); background: var(--panel); border-radius: 999px;
  padding: 6px 13px; font-size: 12.5px; cursor: pointer; font-family: var(--disp);
  color: var(--ink-2); transition: all .12s;
}
.chip:hover { border-color: var(--ink-2); color: var(--ink); }
.chip.on { background: var(--rail-bg); border-color: var(--rail-bg); color: #fff; font-weight: 600; }
.chip .n { opacity: .6; margin-left: 4px; font-family: var(--mono); font-size: 11px; }

.health { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; white-space: nowrap; }
.health .hd { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.h-healthy .hd { background: #46c08b; }
.h-watch .hd { background: #d9a441; }
.h-risk .hd { background: #e2564a; }
.h-setup .hd { background: #5b8dd6; }
.h-suspended .hd { background: #b0bac1; }
.h-risk { color: #9c3529; font-weight: 600; }
.h-setup { color: #35608f; }

tr.biz-row { cursor: pointer; }
tr.biz-row:hover { background: var(--line-soft); }
.biz-name { display: flex; align-items: center; gap: 9px; }
.biz-logo { width: 26px; height: 26px; border-radius: 6px; background: #fff; border: 1px solid var(--rule);
            display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.biz-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.biz-initial { font-family: var(--disp); font-size: 10px; font-weight: 700; color: var(--ink-2); }
.biz-sub { font-size: 11.5px; color: var(--ink-2); }

/* Customer detail panel */
.cust-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); z-index: 1100;
  background: var(--panel); box-shadow: -18px 0 60px rgba(23,27,32,.24); display: flex; flex-direction: column;
  animation: cp-in .22s cubic-bezier(.2,.9,.3,1); }
@keyframes cp-in { from { transform: translateX(30px); opacity: 0; } }
.cp-head { padding: 20px 24px 16px; border-bottom: 1px solid var(--rule); display: flex; gap: 14px; align-items: flex-start; }
.cp-head h3 { margin: 0; font-size: 19px; letter-spacing: -.01em; }
.cp-body { flex: 1; overflow-y: auto; padding: 18px 24px 40px; }
.cp-close { margin-left: auto; }
.cp-sec { margin-bottom: 22px; }
.cp-sec h4 { font-family: var(--disp); font-size: 12px; font-weight: 700; color: var(--ink-2);
             margin: 0 0 9px; letter-spacing: .01em; }
.cp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 9px; }
.cp-stat { background: var(--paper); border-radius: var(--r-sm); padding: 10px 12px; }
.cp-stat .v { font-family: var(--mono); font-size: 17px; font-weight: 600; }
.cp-stat .l { font-size: 11px; color: var(--ink-2); margin-top: 1px; }
.cp-kv { display: flex; padding: 7px 0; border-bottom: 1px solid #f0f2f3; font-size: 13px; gap: 12px; }
.cp-kv:last-child { border-bottom: 0; }
.cp-kv b { min-width: 132px; font-weight: 600; color: var(--ink-2); font-size: 12.5px; }
.cp-kv span { flex: 1; }
.cp-note textarea { width: 100%; margin-top: 6px; }
.cp-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
@media (max-width: 620px) { .cust-panel { width: 100%; } }

/* ═══ Customer management ═══ */
.biz-controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.biz-controls input { max-width: 280px; }
.biz-controls select { max-width: 160px; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--rule); background: var(--panel); border-radius: 999px;
  padding: 6px 13px; font-size: 12.5px; cursor: pointer; font-family: var(--disp); font-weight: 500;
  color: var(--ink-2); transition: all .12s;
}
.chip:hover { border-color: var(--ink-2); color: var(--ink); }
.chip.on { background: var(--rail-bg); border-color: var(--rail-bg); color: #fff; font-weight: 600; }

.biz-row { cursor: pointer; }
.biz-name { display: flex; align-items: center; gap: 10px; }
.biz-name b { font-size: 13.5px; }
.biz-name .hint { font-size: 11.5px; }
.biz-logo { width: 30px; height: 30px; border-radius: 7px; object-fit: contain; background: #fff;
            border: 1px solid var(--rule); padding: 2px; flex-shrink: 0; }
.avatar.lg { width: 46px; height: 46px; font-size: 15px; }

/* Health signal */
.health { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; white-space: nowrap; }
.health i { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.health.h-healthy i { background: #46c08b; }
.health.h-watch i   { background: #d9a441; }
.health.h-risk i    { background: #e2564a; }
.health.h-setup i   { background: #4b93d8; }
.health.h-suspended i { background: #a8b2b9; }
.health.h-risk  { color: #a8382c; font-weight: 600; }
.health.h-setup { color: #2c5f8f; }
tr.h-risk  td:first-child { box-shadow: inset 3px 0 0 #e2564a; }
tr.h-setup td:first-child { box-shadow: inset 3px 0 0 #4b93d8; }
tr.h-watch td:first-child { box-shadow: inset 3px 0 0 #d9a441; }

.plan-tag { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; background: var(--line-soft);
            color: var(--line-deep); font-weight: 600; text-transform: capitalize; }
.plan-tag.trial { background: #eef1f3; color: var(--ink-2); }

/* Customer detail */
.tn-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.tn-head h3 { margin: 0 0 3px; font-size: 19px; }
.tn-logo { width: 46px; height: 46px; border-radius: 10px; object-fit: contain; background: #fff;
           border: 1px solid var(--rule); padding: 3px; }
.tn-rows { border-top: 1px solid var(--rule); }
.tn-row { display: flex; gap: 14px; padding: 9px 0; border-bottom: 1px solid #f2f4f5; font-size: 13.5px; }
.tn-row b { min-width: 132px; font-weight: 600; color: var(--ink-2); font-size: 12.5px; }
.tn-row span { flex: 1; }

/* ═══ Support triage ═══ */
.sla-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 8px; margin-bottom: 6px; }
.slatile { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-sm); padding: 10px 12px; }
.slatile .v { font-family: var(--mono); font-size: 20px; font-weight: 600; line-height: 1.1; }
.slatile .l { font-size: 11.5px; color: var(--ink-2); margin-top: 2px; }
.slatile.bad  { border-color: #edc4c0; background: #fdf6f5; }
.slatile.bad .v { color: var(--urgent); }
.slatile.warn { border-color: #e8d5a8; background: #fffbf2; }
.slatile.warn .v { color: #a4700f; }

.sev-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.sev-dot.sev-critical { background: #d6332a; box-shadow: 0 0 0 3px rgba(214,51,42,.16); }
.sev-dot.sev-high     { background: #e08a2e; }
.sev-dot.sev-normal   { background: #7f8b93; }
.sev-dot.sev-low      { background: #c3cbd1; }
.tkt.sev-critical { border-left: 3px solid #d6332a; }
.tkt.sev-high     { border-left: 3px solid #e08a2e; }
.tkt.escalated    { background: #fffaf2; }
.tkt-ai { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; font-style: italic; }
.tkt-why { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.tkt-why span { font-size: 11px; background: var(--line-soft); color: var(--line-deep);
                border-radius: 999px; padding: 2px 9px; }
.tkt.escalated .tkt-why span { background: #f7e9d0; color: #7a5410; }

.tkt-controls { display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
                padding: 12px 0; margin-top: 10px; border-top: 1px solid var(--rule); }
.sev-select { max-width: 230px; }
.esc-reason { width: 100%; font-size: 12.5px; color: #7a5410; background: #fffaf2;
              border-radius: var(--r-sm); padding: 8px 11px; }
.draft-note { font-size: 12px; color: var(--line-deep); background: var(--line-soft);
              border-radius: var(--r-sm); padding: 7px 11px; margin: 12px 0 0; }


/* ═══ Knowledge Studio — modern, guided knowledge-authoring UX ═══ */
.knowledge-studio { border: 0 !important; padding: 0 !important; background: transparent !important; box-shadow: none !important; }
.knowledge-studio > legend { display: none; }
.knowledge-hero { display:flex; justify-content:space-between; gap:28px; align-items:center; padding:30px 32px; border:1px solid var(--rule); border-radius:18px; background:linear-gradient(135deg,#ffffff 0%,#f5f9ff 58%,#eef8f5 100%); box-shadow:0 14px 38px rgba(18,23,28,.07); }
.knowledge-hero h2 { margin:5px 0 8px; font-size:27px; letter-spacing:-.025em; }
.knowledge-hero p { margin:0; max-width:650px; color:var(--ink-2); line-height:1.6; }
.eyebrow { font:700 10px/1 var(--mono); letter-spacing:.16em; color:#55706a; }
.knowledge-score { min-width:260px; display:flex; align-items:center; gap:14px; padding:13px 16px; border:1px solid rgba(255,255,255,.9); background:rgba(255,255,255,.82); border-radius:14px; box-shadow:0 6px 22px rgba(18,23,28,.06); }
.knowledge-score > div:last-child { display:flex; flex-direction:column; gap:4px; }
.knowledge-score span { color:var(--ink-2); font-size:12px; }
.score-ring { --score:0deg; width:62px; height:62px; flex:0 0 62px; border-radius:50%; display:grid; place-items:center; font:800 15px var(--disp); background:radial-gradient(circle at center,#fff 56%,transparent 58%),conic-gradient(#1b8f72 var(--score),#e2e9e7 0); }
.knowledge-stats { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin:14px 0; }
.knowledge-stats > div { display:flex; align-items:baseline; gap:8px; padding:14px 18px; background:#fff; border:1px solid var(--rule); border-radius:12px; }
.knowledge-stats span { font:800 21px var(--disp); }
.knowledge-stats small { font:700 9px var(--mono); letter-spacing:.13em; color:var(--ink-2); }
.knowledge-layout { display:grid; grid-template-columns:minmax(0,1fr) 310px; gap:16px; align-items:start; }
.knowledge-main { display:grid; gap:16px; }
.knowledge-sidebar { display:grid; gap:16px; position:sticky; top:78px; }
.knowledge-card { background:#fff; border:1px solid var(--rule); border-radius:16px; padding:22px; box-shadow:0 8px 28px rgba(18,23,28,.045); }
.knowledge-card-head { display:flex; justify-content:space-between; align-items:flex-start; gap:18px; margin-bottom:16px; }
.knowledge-card-head > div { display:grid; grid-template-columns:auto 1fr; column-gap:10px; }
.knowledge-card-head h3 { margin:0; font-size:17px; }
.knowledge-card-head p { grid-column:2; margin:4px 0 0; color:var(--ink-2); font-size:13px; }
.step-badge { grid-row:1/3; width:28px; height:28px; display:grid; place-items:center; border-radius:9px; background:#e8f4f0; color:#14765f; font:800 12px var(--mono); }
.knowledge-editor { min-height:300px; border-radius:12px !important; border-color:#cbd6d2 !important; padding:17px !important; font-size:14px !important; line-height:1.65 !important; background:#fbfcfc !important; transition:border-color .15s,box-shadow .15s,background .15s; }
.knowledge-editor:focus { background:#fff !important; border-color:#2c8b72 !important; box-shadow:0 0 0 4px rgba(44,139,114,.11) !important; }
.knowledge-prompts { display:flex; flex-wrap:wrap; gap:7px; margin-top:11px; }
.knowledge-prompts button { border:1px solid #d6dfdc; border-radius:999px; padding:7px 10px; background:#fff; color:#4c5f5a; font:600 11px var(--disp); cursor:pointer; }
.knowledge-prompts button:hover { background:#f0f7f5; border-color:#8eb8ad; color:#176e59; }
.checklist-card h3,.knowledge-tip h3 { margin:7px 0 12px; }
.checklist-card ul { list-style:none; padding:0; margin:0; display:grid; gap:8px; }
.checklist-card li { display:flex; align-items:center; gap:9px; padding:9px 10px; border-radius:9px; color:var(--ink-2); font-size:13px; background:#f7f8f8; }
.checklist-card li i { width:21px; height:21px; display:grid; place-items:center; border-radius:50%; background:#e4e8e7; color:transparent; font-style:normal; font-size:11px; }
.checklist-card li.done { color:#145e4d; background:#edf8f4; }
.checklist-card li.done i { color:#fff; background:#23876e; }
.knowledge-tip { background:#151c22; color:#fff; border-color:#151c22; }
.knowledge-tip .eyebrow { color:#86cdb9; }
.knowledge-tip p { color:#b8c2c8; line-height:1.55; font-size:13px; }
.text-link { border:0; padding:0; background:none; color:#8fd8c3; font-weight:700; cursor:pointer; text-align:left; }
.faq-editor-modern { display:grid; gap:10px; }
.faq-editor-modern .faq-row { grid-template-columns:minmax(180px,.8fr) minmax(280px,1.3fr) 38px; padding:10px; border:1px solid #e0e5e3; border-radius:12px; background:#fafbfb; }
.faq-editor-modern .faq-row input,.faq-editor-modern .faq-row textarea { border-color:transparent; background:#fff; }
.faq-editor-modern .faq-row:focus-within { border-color:#8eb8ad; box-shadow:0 0 0 3px rgba(44,139,114,.08); }
@media (max-width:1000px){.knowledge-layout{grid-template-columns:1fr}.knowledge-sidebar{position:static;grid-template-columns:1fr 1fr}.knowledge-score{min-width:230px}}
@media (max-width:720px){.knowledge-hero{align-items:flex-start;flex-direction:column;padding:22px}.knowledge-score{width:100%;min-width:0}.knowledge-stats{grid-template-columns:1fr}.knowledge-sidebar{grid-template-columns:1fr}.knowledge-card{padding:16px}.faq-editor-modern .faq-row{grid-template-columns:1fr}.knowledge-card-head{flex-direction:column}.knowledge-hero h2{font-size:23px}}


/* ═══ Help library ═══ */
.guide-hero { display:flex; align-items:center; justify-content:space-between; gap:24px; padding:24px 26px; margin-bottom:14px; border:1px solid var(--rule); border-radius:16px; background:linear-gradient(135deg,#fff,#f3f8ff); }
.guide-hero h2 { margin:5px 0 5px; font-size:24px; }
.guide-hero p { margin:0; color:var(--ink-2); font-size:13px; }
.guide-search-wrap { min-width:340px; display:flex; align-items:center; gap:8px; padding:0 12px; background:#fff; border:1px solid #cdd7d4; border-radius:11px; box-shadow:0 5px 18px rgba(18,23,28,.05); }
.guide-search-wrap span { color:var(--ink-2); font-size:19px; }
.guide-search-wrap input { border:0 !important; box-shadow:none !important; padding:12px 2px !important; }
.guide-filters { display:flex; gap:7px; overflow-x:auto; padding:3px 1px 12px; scrollbar-width:thin; }
.guide-filter { white-space:nowrap; border:1px solid var(--rule); background:#fff; border-radius:999px; padding:7px 11px; cursor:pointer; font:600 11px var(--disp); color:var(--ink-2); }
.guide-filter span { margin-left:5px; padding:2px 6px; border-radius:999px; background:#eef1f0; font:700 9px var(--mono); }
.guide-filter:hover,.guide-filter.on { border-color:#2a806a; background:#edf7f4; color:#17634f; }
.guide-count { margin:3px 0 12px; color:var(--ink-2); font-size:12px; }
.guide summary { justify-content:space-between; }
.guide summary span { flex:1; }
.guide summary small { color:var(--ink-2); font:600 9px var(--mono); letter-spacing:.08em; text-transform:uppercase; }
@media(max-width:720px){.guide-hero{align-items:stretch;flex-direction:column}.guide-search-wrap{min-width:0;width:100%}.guide summary small{display:none}}

/* ═══ Two-factor authentication ═══ */
.mfa-steps { margin: 14px 0 0; padding-left: 20px; }
.mfa-steps > li { margin-bottom: 20px; font-size: 13.5px; line-height: 1.6; }
.mfa-steps > li::marker { font-weight: 700; color: var(--line-deep); }
.mfa-qr-wrap { display: flex; gap: 20px; align-items: flex-start; margin-top: 10px; flex-wrap: wrap; }
.mfa-qr { background: #fff; border: 1px solid var(--rule); border-radius: var(--r-sm); padding: 8px;
          line-height: 0; flex-shrink: 0; }
.mfa-manual { flex: 1; min-width: 200px; }
.mfa-secret { display: inline-block; font-family: var(--mono); font-size: 14px; letter-spacing: .09em;
              background: var(--line-soft); color: var(--line-deep); padding: 8px 12px;
              border-radius: var(--r-sm); user-select: all; word-break: break-all; margin: 4px 0; }
.mfa-on-note { font-size: 13.5px; margin: 0 0 4px; }
.backup-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 7px;
                margin: 14px 0 4px; }
.backup-codes code { font-family: var(--mono); font-size: 13px; background: var(--line-soft);
                     color: var(--line-deep); padding: 7px 10px; border-radius: var(--r-sm);
                     text-align: center; user-select: all; letter-spacing: .04em; }
.mfa-key-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; flex-wrap: wrap; }

/* ═══ Audit trail ═══ */
.audit-row { display: grid; grid-template-columns: 150px 1fr 180px 110px; gap: 12px;
             padding: 9px 0; border-bottom: 1px solid #f0f2f3; font-size: 13px; align-items: baseline; }
.audit-row:last-child { border-bottom: 0; }
.audit-row.risky { background: #fffaf3; }
.au-when { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); }
.au-what { font-weight: 500; }
.audit-row.risky .au-what { color: #a8382c; }
.au-who, .au-ip { font-size: 11.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.au-ip { font-family: var(--mono); }
@media (max-width: 760px) {
  .audit-row { grid-template-columns: 1fr; gap: 2px; padding: 11px 0; }
  .au-ip { display: none; }
}

/* ═══ Customer drawer actions ═══ */
.tn-drawer { max-width: 540px; }
.tn-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tn-actions .btn.ghost { margin-left: auto; }
.tn-legal { margin-top: 12px; font-size: 11.5px; }

/* ═══ Retention summary ═══ */
.retention-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.ret-item { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-sm); padding: 10px 12px; }
.ret-item b { display: block; font-family: var(--mono); font-size: 15px; }
.ret-item span { font-size: 12px; color: var(--ink-2); }
hr.soft { border: 0; border-top: 1px solid var(--rule); margin: 18px 0; }
.toggle-row { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; cursor: pointer; }
.toggle-row input { margin-top: 2px; }
.toggle-row .hint { display: block; margin-top: 2px; }

/* ═══ Mandatory MFA gate ═══ */
.mfa-gate { position: fixed; inset: 0; z-index: 2000; background: var(--bg, #f4f6f8); display: flex; align-items: center; justify-content: center; padding: 24px; }
.mfa-gate-card { max-width: 460px; background: var(--panel); border: 1px solid var(--rule);
                 border-radius: var(--r-md); padding: 28px 30px; }
.mfa-gate-card h2 { margin: 0 0 6px; }

/* ═══ Auth notice (email verification) ═══ */
.err.notice, .notice { background:#eef5fb; border:1px solid #cfe0f0; color:#1f4e79;
  padding:12px 14px; border-radius:9px; font-size:13px; line-height:1.5; text-align:left; }
.linklike { background:none; border:0; color:#1f4e79; text-decoration:underline; cursor:pointer;
  padding:0; font-size:13px; margin-top:6px; }

/* ═══ AI writing helper (business facts) ═══ */
.ai-helper { background: linear-gradient(180deg,#f3f8fd,#eef4fb); border: 1px solid #d6e4f2;
  border-radius: 11px; padding: 13px 15px; margin-top: 12px; }
.ai-helper-head { font-size: 13px; color: #1f4e79; font-weight: 600; margin-bottom: 8px; }
.ai-helper textarea { width: 100%; box-sizing: border-box; border: 1px solid #cfe0f0;
  border-radius: 8px; padding: 9px 11px; font: inherit; font-size: 13px; resize: vertical; background: #fff; }
.ai-helper .inline { margin-top: 9px; align-items: center; gap: 10px; }

/* ═══ Settings: centred, constrained column (Direction B) ═══ */
#setNav { max-width: 100%; margin: 0; }
#settingsForm.settings { max-width: 100%; margin: 0; }
#securityPane { max-width: 100%; margin: 0; }
/* the savebar sits inside the form, so it inherits the width and centres too */


/* ═══ Added brand colours (theme picker) ═══ */
html[data-theme="teal"] {
  --line: #0ea5a5; --line-deep: #0a7d7d; --line-soft: #d7f2f2;
  --rail-bg: #0f1b1b; --rail-hair: #22383a;
}
html[data-theme="teal"] .lamp { background: #0ea5a533; color: #5fd6d6; }
html[data-theme="teal"] .lamp .pulse { background: #5fd6d6; }
html[data-theme="teal"] .rail .tab.active .ti { color: #5fd6d6; }
html[data-theme="teal"] .line-card { background: linear-gradient(135deg, #0f1b1b 0%, #0a7d7d 100%); }
html[data-theme="teal"] .line-card .lc-label { color: #5fd6d6; }
html[data-theme="teal"] .line-card::after { background-image: radial-gradient(circle, #5fd6d680 1.7px, transparent 1.8px); }
html[data-theme="teal"] .ask-card { background: linear-gradient(160deg, #0f1b1b 0%, #0a7d7d 100%); }
html[data-theme="cobalt"] {
  --line: #2563eb; --line-deep: #1b4fc4; --line-soft: #e2ebfd;
  --rail-bg: #111827; --rail-hair: #26324a;
}
html[data-theme="cobalt"] .lamp { background: #2563eb33; color: #7aa6f5; }
html[data-theme="cobalt"] .lamp .pulse { background: #7aa6f5; }
html[data-theme="cobalt"] .rail .tab.active .ti { color: #7aa6f5; }
html[data-theme="cobalt"] .line-card { background: linear-gradient(135deg, #111827 0%, #1b4fc4 100%); }
html[data-theme="cobalt"] .line-card .lc-label { color: #7aa6f5; }
html[data-theme="cobalt"] .line-card::after { background-image: radial-gradient(circle, #7aa6f580 1.7px, transparent 1.8px); }
html[data-theme="cobalt"] .ask-card { background: linear-gradient(160deg, #111827 0%, #1b4fc4 100%); }
html[data-theme="violet"] {
  --line: #9333ea; --line-deep: #7420c4; --line-soft: #f0e2fb;
  --rail-bg: #181321; --rail-hair: #2f2440;
}
html[data-theme="violet"] .lamp { background: #9333ea33; color: #c79af0; }
html[data-theme="violet"] .lamp .pulse { background: #c79af0; }
html[data-theme="violet"] .rail .tab.active .ti { color: #c79af0; }
html[data-theme="violet"] .line-card { background: linear-gradient(135deg, #181321 0%, #7420c4 100%); }
html[data-theme="violet"] .line-card .lc-label { color: #c79af0; }
html[data-theme="violet"] .line-card::after { background-image: radial-gradient(circle, #c79af080 1.7px, transparent 1.8px); }
html[data-theme="violet"] .ask-card { background: linear-gradient(160deg, #181321 0%, #7420c4 100%); }
html[data-theme="coral"] {
  --line: #f0653f; --line-deep: #c2431f; --line-soft: #fbe4dc;
  --rail-bg: #1c1613; --rail-hair: #372a24;
}
html[data-theme="coral"] .lamp { background: #f0653f33; color: #f5a488; }
html[data-theme="coral"] .lamp .pulse { background: #f5a488; }
html[data-theme="coral"] .rail .tab.active .ti { color: #f5a488; }
html[data-theme="coral"] .line-card { background: linear-gradient(135deg, #1c1613 0%, #c2431f 100%); }
html[data-theme="coral"] .line-card .lc-label { color: #f5a488; }
html[data-theme="coral"] .line-card::after { background-image: radial-gradient(circle, #f5a48880 1.7px, transparent 1.8px); }
html[data-theme="coral"] .ask-card { background: linear-gradient(160deg, #1c1613 0%, #c2431f 100%); }

/* ═══ Real service-level hero ═══ */
.svc-hero { display: flex; align-items: center; gap: 20px; background: var(--panel);
  border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 20px 24px; margin-bottom: 18px; }
.svc-hero .ac-ring { width: 92px; height: 92px; flex-shrink: 0; }
.svc-hero .ac-ring span { width: 70px; height: 70px; font-size: 20px; }
.svc-hero-label { font-family: var(--disp); font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.svc-hero-sub { color: var(--ink-2); font-size: 13px; line-height: 1.5; }

/* ═══ Activity showcase — SAMPLE badge & tweaks ═══ */
.ac-livebar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.ac-sample-badge { font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: .04em; color: var(--amber); background: var(--memo);
  border: 1px solid var(--memo-edge); border-radius: 999px; padding: 4px 12px; cursor: help; }
.ac-showcase { margin-bottom: 22px; }

/* ═══════════════════════════════════════════════════════════════════
   BOLD SETTINGS REDESIGN — colourful, punchy, less plain.
   Pure CSS: no markup or logic changes. Uses theme tokens so it
   respects the colour picker.
═══════════════════════════════════════════════════════════════════ */

/* Each settings section becomes a bolder card with a coloured top accent */
.settings fieldset {
  position: relative;
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(23,27,32,.04), 0 8px 28px rgba(23,27,32,.06);
  margin: 0 0 20px;
  padding: 24px 26px 24px;
  overflow: hidden;
}
/* colourful accent bar down the left edge of every section */
.settings fieldset::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, var(--line), var(--line-deep));
}

/* Bolder, bigger section titles */
.settings legend {
  font-family: var(--disp);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
  padding: 0;
  margin-bottom: 4px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
}
/* coloured dot chip before each section title */
.settings legend::before {
  content: "";
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--line);
  box-shadow: 0 0 0 4px var(--line-soft);
  flex-shrink: 0;
}

/* Chunkier, friendlier inputs with a coloured focus glow */
.settings input,
.settings select,
.settings textarea {
  border: 1.5px solid var(--rule);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14.5px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.settings input:focus,
.settings select:focus,
.settings textarea:focus {
  border-color: var(--line);
  box-shadow: 0 0 0 4px var(--line-soft);
  outline: none;
}

/* Field labels: a touch bolder and more spaced so sections breathe */
.settings label {
  font-weight: 700;
  font-size: 13px;
  margin-top: 18px;
  color: var(--ink);
}

/* Bolder, chunkier subnav pills with colour when active */
.subnav .sn {
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 12px;
  border-width: 1.5px;
  transition: all .14s;
}
.subnav .sn.on {
  background: var(--line);
  border-color: var(--line);
  color: #fff;
  box-shadow: 0 4px 14px var(--line-soft);
}
.subnav .sn.on::before { background: #fff !important; }

/* Make the Save bar button chunkier and on-brand */
.savebar .btn.primary {
  background: linear-gradient(135deg, var(--line), var(--line-deep));
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14.5px;
  padding: 12px 26px;
  box-shadow: 0 4px 16px var(--line-soft);
}

/* ═══ Job address map (booking details) ═══ */
.job-map { margin-top: 14px; }
.job-map-frame { width: 100%; height: 200px; border: 1px solid var(--rule);
  border-radius: var(--r-lg); display: block; }
.job-map-dir { margin-top: 10px; display: inline-block; text-decoration: none; }

/* ═══ "For [person]" badge on tagged messages ═══ */
.msg-for { display: inline-block; font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: .03em; color: var(--line-deep); background: var(--line-soft);
  border-radius: 999px; padding: 3px 11px; margin-bottom: 8px; }

/* ═══════════════════════════════════════════════════════════════════
   SOFT-UI POLISH LAYER
   The premium "floating card" feel: large soft shadows, rounder corners,
   gradient icon badges. Design language (not copied assets) — applied
   with our own tokens so it respects the colour picker.
═══════════════════════════════════════════════════════════════════ */

:root {
  /* The signature soft, large, very-light drop shadow */
  --shadow: 0 20px 27px 0 rgba(13, 58, 45, .06), 0 4px 12px rgba(13, 58, 45, .04);
  --shadow-hover: 0 22px 40px 0 rgba(13, 58, 45, .11), 0 6px 16px rgba(13, 58, 45, .06);
}

/* Rounder cards across the app */
.kpi, .chart-card, .settings fieldset, .ob-card, .plan-card,
.ac-gauge, .ac-metric, .ac-feed, .ac-roster, .memo, .cs-card,
.knowledge-card, .knowledge-hero, .guide, table.calls {
  border-radius: 16px !important;
}

/* Softer, lighter borders so the shadow does the lifting, not the outline */
.kpi, .chart-card, .ac-gauge, .ac-metric, .ac-feed, .ac-roster {
  border-color: rgba(13, 58, 45, .06);
}

/* Gentle lift on hover for the metric tiles — feels alive, like Soft UI */
.kpi, .ac-metric, .ac-gauge {
  transition: transform .18s ease, box-shadow .18s ease;
}
.kpi:hover, .ac-metric:hover, .ac-gauge:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

/* Gradient icon badges — the Soft UI signature. Any .kpi-ic / .stat-ic
   becomes a rounded gradient square in the brand colour. */
.kpi-ic, .stat-ic, .ac-metric .ic {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(310deg, var(--line-deep) 0%, var(--line) 100%);
  color: #fff; box-shadow: 0 4px 12px var(--line-soft);
}
.kpi-ic svg, .stat-ic svg { width: 22px; height: 22px; stroke: #fff; }

/* Buttons get the gradient + soft shadow treatment */
.btn.primary {
  background: linear-gradient(310deg, var(--line-deep) 0%, var(--line) 100%);
  border: none; border-radius: 12px;
  box-shadow: 0 4px 12px var(--line-soft);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px var(--line-soft); }

/* ═══ SOFT-UI POLISH — EXTENDED TO ALL SCREENS ═══ */

/* Every remaining card/panel gets the rounded, floating treatment */
.memo, .cs-card, .stat-card, .plan-card, .ans-card, .ask-card,
.persona-card, .mfa-gate-card, .confirm-box, .drawer, .knowledge-hero,
.admin-table, table.admin-table, .tn-rows, .faq-editor-modern,
.slatile, .modal, .drawer-summary {
  border-radius: 16px !important;
  box-shadow: var(--shadow);
  border-color: rgba(13, 58, 45, .06);
}

/* Message slips (memos) — lift on hover so triaging feels tactile */
.memo { transition: transform .16s ease, box-shadow .16s ease; }
.memo:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }

/* Tables — soften the whole container, round the corners, lighten rules */
table.calls, .admin-table, .tn-rows {
  overflow: hidden;
  border: 1px solid rgba(13, 58, 45, .06);
}
table.calls th, .admin-table th {
  background: var(--line-soft);
  color: var(--line-deep);
  font-weight: 700;
  letter-spacing: .02em;
}
table.calls tr:hover, table.calls tbody tr:hover {
  background: rgba(13, 58, 45, .02);
}

/* Inputs — rounder and softer everywhere, with a gentle branded focus glow */
input, select, textarea {
  border-radius: 12px;
  border: 1.5px solid rgba(13, 58, 45, .10);
  transition: border-color .14s, box-shadow .14s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--line);
  box-shadow: 0 0 0 4px var(--line-soft);
  outline: none;
}

/* Secondary buttons — soften and round to match the primary gradient ones */
.btn {
  border-radius: 12px;
  transition: transform .14s ease, box-shadow .14s ease, background .14s;
}
.btn:not(.primary):hover { transform: translateY(-1px); }

/* Modals — round and float the dialog, soften the backdrop */
.modal-scrim { backdrop-filter: blur(3px); background: rgba(18, 23, 28, .38); }
.modal { border-radius: 18px !important; box-shadow: 0 30px 60px rgba(13, 58, 45, .18); }

/* Drawers (customer detail / message detail) — rounded leading edge */
.drawer { border-radius: 18px 0 0 18px !important; }

/* Pills / badges — fully rounded, the Soft UI way */
.chip, .badge, .pill, .tag, .status-chip { border-radius: 999px; }

/* Sub-nav tabs — soft rounded with a gentle active lift */
.subnav .sn, .sn { border-radius: 12px; }

/* The setup checklist rows — subtle rounded cards */
.setup-step, .rrow, .state-row, .review-row, .tn-row {
  border-radius: 12px;
  transition: background .14s;
}
