/* ---------- shared ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
}
@media (max-width: 759px) { .card { padding: 16px 14px; border-radius: 16px; } }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.card-head h3 { font-size: 16px; font-weight: 700; }
.panel-sub { margin-top: 3px; color: var(--text-3); font-size: 13px; }
.panel-foot { margin-top: 10px; }
.head-actions { display: flex; align-items: center; gap: 8px; }
.count { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 15px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-weight: 650;
  font-size: 14px;
  transition: background 0.18s var(--ease), transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.btn-primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 8px 18px -12px var(--primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary-strong); transform: translateY(-1px); }
.btn-primary.is-stop,
.btn-primary.is-stop:hover:not(:disabled) { background: var(--danger); color: var(--on-danger); }
.btn:disabled { opacity: 0.5; }
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 11px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-weight: 600;
  font-size: 13px;
}
.btn-ghost:hover:not(:disabled) { color: var(--primary-strong); border-color: var(--border-strong); }
.btn-ghost:disabled { opacity: 0.45; }
.btn-sm { min-height: 32px; font-size: 12.5px; }
.btn-sm .icon { width: 16px; height: 16px; }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* Outcome badges: status colours always come with an icon and a label */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 7px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
  line-height: 1.4;
}
.badge .icon { width: 15px; height: 15px; stroke-width: 2.1; }
.badge-sm { font-size: 11.5px; padding: 1px 8px 1px 6px; }
.badge-booked { color: var(--ok); background: var(--ok-soft); }
.badge-rescheduled { color: var(--info); background: var(--info-soft); }
.badge-cancelled { color: var(--text-2); background: var(--neutral-soft); }
.badge-info { color: var(--violet); background: var(--violet-soft); }
.badge-handover { color: var(--warn); background: var(--warn-soft); }
.badge-emergency { color: var(--danger); background: var(--danger-soft); }
.badge-abandoned { color: var(--text-3); background: var(--surface-3); border-style: dashed; }

/* ---------- call card ---------- */
.call-card {
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}
.call-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; }
.caller-id { display: flex; align-items: center; gap: 11px; min-width: 0; }
.caller-id > div { display: flex; flex-direction: column; min-width: 0; }
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary-strong);
}
.avatar .icon { width: 19px; height: 19px; }
.caller-name { font-weight: 700; font-size: 15px; }
.call-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
  font-size: 13px;
}
.call-card[data-state="live"] .call-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-soft);
}
.call-card[data-activity="thinking"] .call-status::before { background: var(--info); box-shadow: 0 0 0 3px var(--info-soft); }
.call-card[data-activity="caller"] .call-status::before { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.call-meta { display: flex; align-items: center; gap: 8px; }
.call-timer {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
}

.stage {
  position: relative;
  height: 236px;
  display: grid;
  place-items: center;
  background: radial-gradient(120% 95% at 50% 0%, var(--stage-1), var(--stage-2) 75%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.orb { position: absolute; width: 230px; height: 230px; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.stage-center { position: relative; z-index: 1; display: grid; place-items: center; }
.start-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 26px 0 22px;
  border-radius: 999px;
  border: 0;
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 700;
  font-size: 16.5px;
  box-shadow: var(--shadow-lg), 0 0 0 6px var(--start-ring);
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}
.start-btn .icon { width: 22px; height: 22px; stroke-width: 2; }
.start-btn:hover { background: var(--primary-strong); transform: translateY(-1px) scale(1.01); }
.start-btn:active { transform: scale(0.98); }
.stage-hint {
  position: absolute;
  bottom: 12px;
  left: 16px;
  right: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-2);
}
.call-card:not([data-state="idle"]) .stage-hint,
.call-card:not([data-state="idle"]) .start-btn { display: none; }

.call-summary { padding: 10px 16px 0; }
.summary-row { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.summary-label { color: var(--text-3); font-weight: 600; }
.summary-dur { font-family: var(--mono); color: var(--text-2); font-size: 13px; }

.call-controls { display: flex; justify-content: center; gap: 22px; padding: 12px 12px 6px; }
.ctrl {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 74px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  border-radius: 14px;
  padding: 2px;
}
.ctrl .icon {
  box-sizing: content-box;
  width: 22px;
  height: 22px;
  padding: 13px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--border);
  transition: background 0.18s var(--ease), transform 0.18s var(--ease);
}
.ctrl:hover:not(:disabled) .icon { transform: translateY(-1px); border-color: var(--border-strong); }
.ctrl[aria-pressed="true"] .icon { background: var(--primary-soft); color: var(--primary-strong); border-color: transparent; }
.ctrl-end .icon { background: var(--danger); color: var(--on-danger); border-color: transparent; }
.ctrl-new .icon { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.ctrl:disabled { opacity: 0.45; }
.call-card[data-state="idle"] #btn-end,
.call-card[data-state="idle"] .ctrl-new,
.call-card[data-state="live"] .ctrl-new,
.call-card[data-state="ended"] #btn-end,
.call-card[data-state="ended"] #btn-mic { display: none; }

.transcript {
  list-style: none;
  height: 320px;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  scroll-behavior: smooth;
}
.transcript:empty::before {
  content: attr(data-empty);
  margin: auto;
  color: var(--text-3);
  font-size: 13.5px;
  text-align: center;
  max-width: 30ch;
}
@media (max-width: 759px) { .transcript { height: 300px; } }

.msg { display: flex; flex-direction: column; max-width: 88%; }
.msg-agent { align-self: flex-start; }
.msg-caller { align-self: flex-end; align-items: flex-end; }
.msg-head { display: flex; gap: 8px; align-items: baseline; font-size: 11.5px; color: var(--text-3); margin: 0 6px 3px; }
.msg-head .who { font-weight: 700; color: var(--text-2); }
.msg-head time { font-variant-numeric: tabular-nums; }
.bubble {
  padding: 9px 13px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg-agent .bubble { background: var(--agent-bubble); border-top-left-radius: 6px; }
.msg-caller .bubble { background: var(--caller-bubble); border-top-right-radius: 6px; }
.msg.is-interim .bubble { font-style: italic; color: var(--text-2); }
.msg.is-interim .bubble::after { content: " …"; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.msg-system {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 92%;
  font-size: 12.5px;
  color: var(--text-3);
  text-align: center;
}
.msg-system .icon { width: 15px; height: 15px; }
.msg-api { align-self: center; max-width: 100%; }
.api-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 3px 9px;
  border-radius: 8px;
  border: 1px dashed var(--border-strong);
  background: var(--surface);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-2);
}
.api-chip .p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.api-chip:hover { border-style: solid; border-color: var(--primary); }

.composer { display: flex; gap: 8px; padding: 12px 14px 10px; }
.composer input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 15px;
}
.composer input::placeholder { color: var(--text-3); }
.composer input:focus-visible { outline-offset: 1px; }
.send-btn {
  width: 46px;
  height: 46px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 0;
  background: var(--primary);
  color: var(--primary-ink);
  transition: background 0.18s var(--ease), transform 0.18s var(--ease);
}
.send-btn:hover { background: var(--primary-strong); transform: translateY(-1px); }
.send-btn .icon { width: 20px; height: 20px; }

.call-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 0 16px 14px; font-size: 12.5px; color: var(--text-3); }
.voice-note { flex: 1 1 200px; }
.voice-picker { display: flex; align-items: center; gap: 8px; }
.voice-picker select { height: 30px; font-size: 12.5px; max-width: 220px; }

.privacy-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 13px;
}
.privacy-note .icon { color: var(--ok); margin-top: 1px; }

/* ---------- conversation engine (free rules or AI tiers) ---------- */
.engine .card-head { margin-bottom: 10px; }
.engine-tiers { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 520px) { .engine-tiers { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tier {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 56px;
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.tier input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.tier-name { font-size: 13.5px; font-weight: 650; color: var(--text); }
.tier-sub { font-size: 12px; color: var(--text-3); line-height: 1.3; }
.tier:hover { border-color: var(--border-strong); }
.tier:has(input:checked) { border-color: var(--primary); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--primary); }
.tier:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.tier:has(input:disabled) { cursor: not-allowed; opacity: 0.55; }
.tier:has(input:disabled):hover { border-color: var(--border); }
.engine-code { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.engine-code label { font-size: 13px; color: var(--text-2); }
.engine-code input { height: 32px; min-width: 0; flex: 1 1 160px; max-width: 260px; }
.engine-status { margin-top: 10px; font-size: 13px; color: var(--text-2); }
.engine-status:empty { display: none; }
.engine-note { margin-top: 8px; font-size: 12.5px; color: var(--text-3); }

/* ---------- scenarios ---------- */
.scenarios .card-head { margin-bottom: 6px; align-items: center; }
.scenario-progress { min-height: 0; font-size: 13px; font-weight: 600; color: var(--primary-strong); margin-top: 6px; }
.scenario-progress:empty { display: none; }
.scenario-busy { margin-top: 6px; color: var(--warn); }
.scenario-grid { display: grid; gap: 8px; margin-top: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 520px) and (max-width: 1099px) { .scenario-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.scenario {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  text-align: left;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), transform 0.18s var(--ease);
}
.scenario:hover:not(:disabled) { border-color: var(--primary); background: var(--surface); transform: translateY(-1px); }
.scenario:disabled { opacity: 0.55; }
.scenario.is-running { opacity: 1; border-color: var(--primary); background: var(--primary-soft); }
.scenario-icon {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--primary-soft);
  color: var(--primary-strong);
}
.scenario-icon .icon { width: 19px; height: 19px; }
.si-reschedule { background: var(--info-soft); color: var(--info); }
.si-cancel { background: var(--neutral-soft); color: var(--text-2); }
.si-prep { background: var(--violet-soft); color: var(--violet); }
.si-emergency { background: var(--danger-soft); color: var(--danger); }
.si-human { background: var(--warn-soft); color: var(--warn); }
.scenario-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.scenario-title { font-weight: 650; font-size: 14px; }
.scenario-sub { font-size: 12.5px; color: var(--text-3); }
.scenario-play { color: var(--text-3); width: 18px; height: 18px; }

/* ---------- API console ---------- */
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); flex: none; }
.live-dot.is-busy { background: var(--ok); animation: live 1s ease-in-out infinite; }
@keyframes live { 50% { box-shadow: 0 0 0 5px var(--ok-soft); } }

.api-list { list-style: none; max-height: 520px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.api-list .empty { padding: 26px 16px; text-align: center; color: var(--text-3); font-size: 13.5px; }
.api-entry { border-bottom: 1px solid var(--border); }
.api-entry:last-child { border-bottom: 0; }
.api-entry.is-new { animation: flash 0.9s var(--ease); }
.api-entry.is-focus { box-shadow: inset 3px 0 0 var(--accent); }
@keyframes flash { from { background: var(--primary-soft); } to { background: transparent; } }
.api-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
}
.api-summary::-webkit-details-marker { display: none; }
.api-summary:hover { background: var(--surface); }
.api-summary .path { font-family: var(--mono); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.api-summary time, .api-summary .latency { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 520px) { .api-summary { grid-template-columns: auto minmax(0, 1fr) auto auto; } .api-summary time { display: none; } }

.m, .status {
  display: inline-block;
  min-width: 54px;
  padding: 2px 6px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.02em;
}
.api-chip .m, .api-chip .s { min-width: 0; padding: 0 4px; border-radius: 4px; }
.m-get { color: var(--info); background: var(--info-soft); }
.m-post { color: var(--ok); background: var(--ok-soft); }
.m-patch { color: var(--warn); background: var(--warn-soft); }
.m-delete { color: var(--danger); background: var(--danger-soft); }
.status { min-width: 40px; }
.s-2xx { color: var(--ok); background: var(--ok-soft); }
.s-4xx { color: var(--warn); background: var(--warn-soft); }
.s-5xx { color: var(--danger); background: var(--danger-soft); }
.s-pending { color: var(--text-3); background: var(--surface-3); }
.api-body { padding: 4px 12px 12px; display: grid; gap: 10px; }
.api-section h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-3); margin-bottom: 5px; }
.api-pending { color: var(--text-3); font-size: 12.5px; }
.json {
  margin: 0;
  padding: 10px 12px;
  max-height: 260px;
  overflow: auto;
  border-radius: 10px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre;
  color: var(--text-2);
}
.j-key { color: var(--j-key); }
.j-str { color: var(--j-str); }
.j-num { color: var(--j-num); }
.j-bool, .j-null { color: var(--j-bool); }
.copy-btn { justify-self: start; }

/* ---------- schedule board ---------- */
.board-top { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.board-nav { display: flex; align-items: center; gap: 8px; }
.board-day { min-width: 15ch; text-align: center; font-weight: 700; font-size: 15px; }
.mini-cal { display: grid; grid-template-columns: repeat(7, 32px); gap: 4px; }
.cal-wd { font-size: 10.5px; text-align: center; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.cal-day {
  position: relative;
  height: 30px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  padding: 0;
}
.cal-day:hover:not(:disabled) { border-color: var(--primary); }
.cal-day:disabled { opacity: 0.32; background: transparent; }
.cal-day.is-closed:not(:disabled) { color: var(--text-3); background: var(--surface-3); }
.cal-day.is-today { box-shadow: inset 0 0 0 1.5px var(--primary); }
.cal-day[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.cal-dot { position: absolute; left: 50%; bottom: 3px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--accent); }
.cal-day[aria-pressed="true"] .cal-dot { background: var(--primary-ink); }

.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 10px; font-size: 12px; color: var(--text-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 16px; height: 10px; border-radius: 3px; display: inline-block; }
.sw-free { background: var(--slot-free); box-shadow: inset 0 0 0 1px var(--slot-free-line); }
.sw-booked { background: var(--slot-booked); }
.sw-offered { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.sw-mine { background: var(--primary); }
.sw-freed { background: var(--ok-soft); box-shadow: inset 0 0 0 1.5px var(--ok); }
.sw-past { background: repeating-linear-gradient(135deg, var(--hatch) 0 2px, transparent 2px 5px); box-shadow: inset 0 0 0 1px var(--border); }

.board-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.board-grid { min-width: 640px; padding: 4px 10px 8px; }
.board-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 40px;
  border-bottom: 1px dashed var(--border);
}
.board-row:last-child { border-bottom: 0; }
.board-row.is-off { opacity: 0.6; }
.board-axis { min-height: 26px; border-bottom: 1px solid var(--border); position: sticky; top: 0; }
.row-head { display: flex; flex-direction: column; min-width: 0; position: sticky; left: 0; z-index: 3; align-self: stretch; justify-content: center; background: var(--surface-2); box-shadow: 8px 0 8px -8px rgba(0, 0, 0, 0.18); }
@media (max-width: 759px) {
  .board-row { grid-template-columns: 118px minmax(0, 1fr); }
  .board-day { font-size: 14px; min-width: 0; flex: 1; }
  .board-nav { width: 100%; }
}
.doc-name { font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-dept { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track {
  position: relative;
  height: 26px;
  background-image: linear-gradient(to right, var(--grid-line) 1px, transparent 1px);
  background-size: calc(100% / 11) 100%;
}
.axis-track { height: 18px; background: none; }
.tick { position: absolute; top: 0; transform: translateX(-50%); font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.session { position: absolute; top: 0; bottom: 0; border-radius: 6px; background: var(--session-bg); }
.slot {
  position: absolute;
  top: 3px;
  bottom: 3px;
  border-radius: 5px;
  border: 1px solid var(--surface-2);
  background-clip: padding-box;
  overflow: hidden;
}
.slot.is-free { background-color: var(--slot-free); box-shadow: inset 0 0 0 1px var(--slot-free-line); }
.slot.is-booked { background-color: var(--slot-booked); }
.slot.is-past.is-free { background: repeating-linear-gradient(135deg, var(--hatch) 0 2px, transparent 2px 5px); box-shadow: none; }
.slot.is-past.is-booked { opacity: 0.55; }
.slot.is-offered { background-color: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); z-index: 1; }
.slot.is-mine { background-color: var(--primary); z-index: 1; }
.slot.is-freed { background-color: var(--ok-soft); box-shadow: inset 0 0 0 2px var(--ok); z-index: 1; }
.offer-n {
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 14px;
  height: 14px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 9.5px;
  font-weight: 800;
}
.slot-code { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--mono); font-size: 9.5px; font-weight: 700; color: var(--primary-ink); letter-spacing: 0.03em; }
.pulse-booked, .pulse-moved { animation: pulse-ring 1.1s var(--ease) 2; }
.pulse-freed { animation: pulse-free 1.1s var(--ease) 2; }
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 var(--primary); transform: scaleY(1); }
  40% { transform: scaleY(1.25); }
  100% { box-shadow: 0 0 0 7px transparent; transform: scaleY(1); }
}
@keyframes pulse-free {
  0% { box-shadow: inset 0 0 0 2px var(--ok), 0 0 0 0 var(--ok); }
  100% { box-shadow: inset 0 0 0 2px var(--ok), 0 0 0 7px transparent; }
}
.now-line { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--danger); border-radius: 2px; z-index: 2; }
.now-line::before { content: ""; position: absolute; top: -2px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.board-empty { padding: 22px 8px; color: var(--text-3); font-size: 13.5px; }

/* ---------- KPIs and call log ---------- */
.kpis { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); margin-bottom: 14px; }
.kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.kpi-label { font-size: 12.5px; font-weight: 650; color: var(--text-2); }
.kpi-value { font-size: 25px; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--text); }
.kpi-note { font-size: 11.5px; color: var(--text-3); }

.call-list { list-style: none; display: grid; gap: 8px; }
.call-list .empty { padding: 18px; text-align: center; color: var(--text-3); font-size: 13.5px; border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.log-entry details { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.log-entry details[open] { background: var(--surface); }
.log-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
}
.log-summary::-webkit-details-marker { display: none; }
.log-summary::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--text-3);
  border-bottom: 2px solid var(--text-3);
  transform: rotate(-45deg);
  transition: transform 0.18s var(--ease);
  flex: none;
}
details[open] > .log-summary::before { transform: rotate(45deg); }
.log-time { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); }
.log-kind { font-weight: 650; font-size: 14px; }
.log-meta { display: inline-flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 12.5px; }
.log-dur { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.log-dur .icon { width: 14px; height: 14px; }
.lang-tag { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border-strong); color: var(--text-2); }
.log-intents { display: inline-flex; flex-wrap: wrap; gap: 4px; flex: 1 1 160px; }
.log-summary .badge { margin-left: auto; }
.log-body { padding: 0 14px 14px; display: grid; gap: 8px; }
.log-extra { display: flex; gap: 6px; flex-wrap: wrap; }
.log-note { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--warn); }
.log-note .icon { width: 15px; height: 15px; }
.log-api { font-size: 12.5px; color: var(--text-3); }
.log-transcript { list-style: none; display: grid; gap: 4px; font-size: 13px; }
.lt { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; }
.lt-who { font-weight: 650; color: var(--text-2); font-size: 12px; }
.lt time { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.lt-api .lt-text { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }
.lt-system .lt-text { color: var(--text-3); font-style: italic; }
.lt-caller .lt-who { color: var(--accent-ink); }
.lt-agent .lt-who { color: var(--primary-strong); }

/* ---------- how it works ---------- */
.callout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--primary-soft);
  border-left: 4px solid var(--primary);
  color: var(--text);
  margin-bottom: 10px;
}
.callout .icon { color: var(--primary-strong); }
.arch { margin: 18px 0 10px; }
.arch-svg { width: 100%; height: auto; }
.arch-narrow { display: none; max-width: 380px; margin: 0 auto; }
@media (max-width: 680px) {
  .arch-wide { display: none; }
  .arch-narrow { display: block; }
}
.arch figcaption { margin-top: 8px; text-align: center; }
.arch-node { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1.5; }
.arch-node-pms { fill: var(--primary-soft); stroke: var(--primary); }
.arch-node-desk { fill: var(--accent-soft); stroke: var(--accent); }
.arch-group { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1.5; }
.arch-group-mw { fill: var(--primary-soft); stroke: var(--primary); }
.arch-sub { fill: var(--surface); stroke: var(--border); stroke-width: 1.2; }
.arch-sub-accent { stroke: var(--primary); stroke-width: 1.6; }
.arch-svg text { text-anchor: middle; font-family: var(--font); }
.arch-t { font-size: 15px; font-weight: 700; fill: var(--text); }
.arch-s { font-size: 12px; fill: var(--text-3); }
.arch-g { font-size: 12.5px; font-weight: 800; fill: var(--primary-strong); letter-spacing: 0.04em; text-transform: uppercase; }
.arch-st { font-size: 14px; font-weight: 600; fill: var(--text); }
.arch-svg .arch-l { text-anchor: start; }
.arch-link { stroke: var(--arch-line); stroke-width: 2; fill: none; }
.arch-link-dash { stroke-dasharray: 5 5; stroke: var(--accent); }
.arch-head { fill: var(--arch-line); }

.info-cols { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 16px; }
.info-card { padding: 16px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.info-card h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; margin-bottom: 10px; }
.info-card h3 .icon { color: var(--primary); }
.info-card ul { list-style: none; display: grid; gap: 8px; }
.info-card li { position: relative; padding-left: 16px; font-size: 14px; color: var(--text-2); }
.info-card li::before { content: ""; position: absolute; left: 2px; top: 0.6em; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }

/* AI tiers and costs */
.cost-card { margin-top: 14px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
.cost-table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 13.5px; }
.cost-table th, .cost-table td { padding: 8px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.cost-table thead th { font-size: 12px; font-weight: 650; color: var(--text-3); text-transform: none; }
.cost-table tbody th { font-weight: 650; color: var(--text); white-space: nowrap; }
.cost-table td { color: var(--text-2); }
.cost-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cost-table tbody tr:last-child th, .cost-table tbody tr:last-child td { border-bottom: 0; }
.cost-table .cost-extra th, .cost-table .cost-extra td { border-top: 1px dashed var(--border-strong); }
.cost-card .small { margin-top: 10px; }

@media (forced-colors: active) {
  .slot { border: 1px solid CanvasText; }
  .slot.is-booked, .slot.is-mine { background: CanvasText; }
  .badge, .chip, .m, .status { border: 1px solid CanvasText; }
}
