/* =====================================================================
   Product mockups — illustrative renditions of the real (light) vvCRM UI,
   desaturated: white surfaces, 1px borders, neutral greys; blue only for
   the active / primary element.
   Everything is sized in em so a window scales with its container
   (container query units on .win).
   ===================================================================== */

/* tokens live on :root because some mockup parts (the fake site, the widget
   button) sit outside a .ui block */
:root {
  --crm-bg: #f6f8fb;
  --crm-surface: #ffffff;
  --crm-surface-2: #f8fafc;
  --crm-surface-3: #eef2f7;
  --crm-border: #e3e8ef;
  --crm-border-subtle: #edf1f5;
  --crm-text: #0f1723;
  --crm-text-strong: #334155;
  --crm-text-muted: #5f6b7a;
  --crm-text-subtle: #626e7e;
  --crm-accent: #0084ff;
  --crm-accent-strong: #0a6ed1;
  --crm-accent-text: #0962c0;
  --crm-accent-soft: rgba(0, 132, 255, 0.1);
  --crm-radius-card: 10px;
}
.ui {
  color: var(--crm-text);
  font-family: var(--f-sans);
  line-height: 1.4;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
.win .ui {
  font-size: clamp(8.5px, 1.16cqi, 14px);
}
:where(.ui) svg {
  width: 1.15em;
  height: 1.15em;
  flex: none;
}
.ui b {
  font-weight: 600;
}
.ui small {
  color: var(--crm-text-muted);
  font-size: 0.86em;
}
.ui time {
  color: var(--crm-text-subtle);
  font-size: 0.82em;
  font-variant-numeric: tabular-nums;
}

/* atoms */
.av {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 2.5em;
  height: 2.5em;
  border-radius: 50%;
  color: var(--crm-text-strong);
  font-size: 0.8em;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: #eef2f7;
  box-shadow: inset 0 0 0 1px #dfe5ec;
}
.av-xs {
  width: 2em;
  height: 2em;
  font-size: 0.68em;
}
.av-sm {
  width: 2.3em;
  height: 2.3em;
  font-size: 0.74em;
}
.av-lg {
  width: 3em;
  height: 3em;
  font-size: 0.88em;
}
.av-xl {
  width: 4.6em;
  height: 4.6em;
  font-size: 1.1em;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.24em 0.65em;
  border-radius: 0.35em;
  font-size: 0.8em;
  font-weight: 500;
  white-space: nowrap;
  color: var(--crm-text-strong);
  background: var(--crm-surface-3);
}
.chip svg {
  width: 1.05em;
  height: 1.05em;
}
.chip-acc {
  color: var(--crm-accent-text);
  background: var(--crm-accent-soft);
}
.chip-line {
  color: var(--crm-text-muted);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--crm-border);
}
/* channel marks stay monochrome: the glyph identifies the channel */
.ch {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1.6em;
  height: 1.6em;
  border-radius: 50%;
  color: var(--crm-text-strong);
  background: var(--crm-surface-3);
  box-shadow: inset 0 0 0 1px var(--crm-border);
  font-style: normal;
  vertical-align: middle;
}
.ch svg {
  width: 0.9em;
  height: 0.9em;
}
.badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.6em;
  height: 1.6em;
  padding: 0 0.4em;
  border-radius: 999px;
  background: var(--crm-accent-strong);
  color: #fff;
  font-size: 0.72em;
  font-weight: 600;
  font-style: normal;
}

/* generic step visibility for scripted demos */
.ui [data-step].off,
.ui [data-wstep].off {
  display: none;
}
.ui [data-step].pop,
.ui [data-wstep].pop {
  animation: popIn 0.7s var(--ease) both;
}
@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(0.5em);
  }
}
[data-demo]:not(.is-live) *,
[data-demo]:not(.is-live) *::before,
[data-demo]:not(.is-live) *::after {
  animation-play-state: paused !important;
}

/* ---------- unified card (problem section) ---------- */
.unified {
  font-size: 14px;
  background: var(--crm-surface);
  border-radius: 12px;
  padding: 1.2em;
  display: grid;
  gap: 1em;
  box-shadow:
    0 0 0 1px var(--line-2),
    var(--shadow-3);
}
.uc-head {
  display: flex;
  align-items: center;
  gap: 0.8em;
}
.uc-head > div {
  flex: 1;
  display: grid;
}
.uc-head b {
  font-size: 1.12em;
}
.uc-chans {
  display: flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.6em 0.7em;
  border-radius: 8px;
  background: var(--crm-bg);
  border: 1px solid var(--crm-border-subtle);
}
.uc-sep {
  flex: 1;
}
.uc-meta {
  font-size: 0.8em;
  color: var(--crm-text-muted);
  font-weight: 500;
}
.uc-feed {
  display: grid;
}
.uc-feed li {
  display: flex;
  gap: 0.7em;
  align-items: center;
  padding: 0.6em 0.2em;
  border-bottom: 1px solid var(--crm-border-subtle);
  font-size: 0.95em;
}
.uc-feed p {
  flex: 1;
  color: var(--crm-text-strong);
}
.uc-feed b {
  color: var(--crm-text);
  font-weight: 500;
  margin-right: 0.3em;
}
.uc-feed em {
  font-style: normal;
  font-size: 0.8em;
  color: var(--crm-text-muted);
  margin-left: 0.3em;
}
.uc-deal {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.75em 0.9em;
  border-radius: 8px;
  background: var(--crm-bg);
  border: 1px solid var(--crm-border-subtle);
  font-weight: 500;
}
.uc-deal b {
  margin-left: auto;
  font-size: 1.08em;
  font-variant-numeric: tabular-nums;
}
.uc-note {
  margin-top: -0.3em;
  text-align: right;
  font-size: 0.72em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--crm-text-subtle);
}

/* ---------- inbox ---------- */
.ui-inbox {
  display: grid;
  grid-template-columns: 25% minmax(0, 1fr) 24%;
  height: 40em;
  background: var(--crm-bg);
}
.ib-list {
  border-right: 1px solid var(--crm-border);
  padding: 1em 0.8em;
  display: flex;
  flex-direction: column;
  gap: 0.8em;
  min-width: 0;
  overflow: hidden;
  background: var(--crm-surface-2);
}
.ib-search {
  display: flex;
  gap: 0.5em;
  align-items: center;
  padding: 0.55em 0.8em;
  border-radius: 7px;
  background: var(--crm-surface);
  border: 1px solid var(--crm-border);
  color: var(--crm-text-subtle);
  font-size: 0.9em;
}
.ib-tabs {
  display: flex;
  gap: 0.3em;
  font-size: 0.86em;
}
.ib-tabs span {
  padding: 0.35em 0.6em;
  border-radius: 6px;
  color: var(--crm-text-muted);
  white-space: nowrap;
}
.ib-tabs .on {
  background: var(--crm-surface-3);
  color: var(--crm-text);
  font-weight: 500;
}
.ib-tabs b {
  color: var(--crm-text-subtle);
  font-weight: 500;
  margin-left: 0.15em;
}
.ib-convs {
  display: grid;
  gap: 0.15em;
}
.ib-conv {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.6em;
  align-items: center;
  padding: 0.65em 0.6em;
  border-radius: 7px;
  transition:
    background-color 0.4s,
    box-shadow 0.4s;
}
.ib-conv.is-active {
  background: var(--crm-surface);
  box-shadow:
    inset 2px 0 0 var(--crm-accent),
    0 1px 2px rgba(15, 23, 35, 0.06);
}
.ib-conv.flash {
  animation: rowFlash 1.6s var(--ease);
}
@keyframes rowFlash {
  0% {
    background: #e8f1fc;
  }
}
.ib-conv[data-new].off {
  display: none;
}
.ib-conv[data-new].pop {
  animation: slideDown 0.8s var(--ease) both;
}
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-0.8em);
    margin-bottom: -3.2em;
  }
}
.ib-cmain {
  display: grid;
  min-width: 0;
}
.ib-cmain b {
  display: flex;
  align-items: center;
  gap: 0.35em;
  font-size: 0.95em;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
}
.ib-cmain b .ch {
  width: 1.35em;
  height: 1.35em;
}
.ib-cmain small {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ib-cside {
  display: grid;
  justify-items: end;
  gap: 0.25em;
}
.ib-thread {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--crm-surface);
}
.ib-th {
  display: flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.85em 1.1em;
  border-bottom: 1px solid var(--crm-border);
  background: var(--crm-surface);
}
.ib-thn {
  flex: 1;
  display: grid;
  min-width: 0;
}
.ib-thn small {
  display: flex;
  align-items: center;
  gap: 0.35em;
  white-space: nowrap;
}
.ib-thn .ch {
  width: 1.3em;
  height: 1.3em;
}
.ib-assign {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.84em;
  color: var(--crm-text-strong);
  padding: 0.25em 0.6em 0.25em 0.25em;
  border: 1px solid var(--crm-border);
  border-radius: 999px;
  white-space: nowrap;
}
.ib-msgs {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.6em;
  padding: 1em 1.2em;
  overflow: hidden;
}
.ib-day {
  align-self: center;
  font-size: 0.76em;
  color: var(--crm-text-subtle);
  border: 1px solid var(--crm-border);
  padding: 0.15em 0.8em;
  border-radius: 999px;
}
.msg {
  max-width: 74%;
  padding: 0.6em 0.9em 0.5em;
  border-radius: 0.8em;
  font-size: 0.95em;
  line-height: 1.45;
}
.msg time {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  float: right;
  margin: 0.45em 0 0 0.8em;
  font-size: 0.72em;
}
.msg.in {
  align-self: flex-start;
  background: #f1f4f8;
  box-shadow: inset 0 0 0 1px #e6ebf1;
  border-bottom-left-radius: 0.25em;
}
.msg.out {
  align-self: flex-end;
  color: var(--crm-text);
  background: #eaf2fd;
  box-shadow: inset 0 0 0 1px #d8e6f8;
  border-bottom-right-radius: 0.25em;
}
.msg.out time {
  color: var(--crm-text-muted);
}
.tick {
  position: relative;
  display: inline-block;
  width: 1.1em;
  height: 0.7em;
}
.tick::before,
.tick::after {
  content: '';
  position: absolute;
  top: 0;
  width: 0.35em;
  height: 0.6em;
  border: solid currentColor;
  border-width: 0 0.12em 0.12em 0;
  transform: rotate(45deg);
}
.tick::before {
  left: 0.1em;
}
.tick::after {
  left: 0.45em;
  opacity: 0;
}
.tick.delivered::after,
.tick.read::after {
  opacity: 1;
}
.tick.read {
  color: var(--crm-accent-text);
}
.typing {
  display: none;
  align-self: flex-start;
  gap: 0.3em;
  padding: 0.75em 0.9em;
  border-radius: 0.8em;
  border-bottom-left-radius: 0.25em;
  background: #f1f4f8;
  box-shadow: inset 0 0 0 1px #e6ebf1;
}
.typing.on {
  display: inline-flex;
}
.typing i {
  width: 0.4em;
  height: 0.4em;
  border-radius: 50%;
  background: var(--crm-text-muted);
  animation: typing 1.4s infinite ease-in-out;
}
.typing i:nth-child(2) {
  animation-delay: 0.18s;
}
.typing i:nth-child(3) {
  animation-delay: 0.36s;
}
@keyframes typing {
  0%,
  60%,
  100% {
    opacity: 0.35;
  }
  30% {
    opacity: 1;
  }
}
.ib-suggest {
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin: 0 1.1em 0.6em;
  padding: 0.55em 0.75em;
  border-radius: 8px;
  background: var(--crm-surface);
  border: 1px solid var(--crm-border);
  font-size: 0.88em;
  color: var(--crm-text-strong);
}
.ib-suggest svg {
  color: var(--crm-text-muted);
}
.ib-suggest span {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ib-suggest b {
  color: var(--crm-text);
  font-weight: 500;
  margin-right: 0.3em;
}
.ib-suggest em {
  font-style: normal;
  font-weight: 500;
  color: var(--crm-text);
  background: var(--crm-surface-3);
  box-shadow: inset 0 0 0 1px var(--crm-border);
  padding: 0.3em 0.7em;
  border-radius: 6px;
  transition: background-color 0.2s;
}
.ib-suggest.press em {
  background: #e3e8ef;
}
.ib-composer {
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.75em 1.1em 0.9em;
  border-top: 1px solid var(--crm-border);
  background: var(--crm-surface);
}
.ib-input {
  flex: 1;
  min-width: 0;
  padding: 0.6em 0.9em;
  border-radius: 7px;
  border: 1px solid var(--crm-border);
  background: var(--crm-surface);
  color: var(--crm-text-subtle);
  font-size: 0.92em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition:
    border-color 0.3s,
    box-shadow 0.3s;
}
.ib-input.typing-now {
  color: var(--crm-text);
  border-color: var(--crm-accent);
  box-shadow: 0 0 0 3px rgba(0, 132, 255, 0.14);
}
.ib-input.typing-now [data-typer]::after {
  content: '';
  display: inline-block;
  width: 1px;
  height: 1.1em;
  margin-left: 1px;
  vertical-align: -0.2em;
  background: var(--crm-text);
  animation: caret 1s steps(1) infinite;
}
@keyframes caret {
  50% {
    opacity: 0;
  }
}
.ib-tool {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.5em 0.7em;
  border-radius: 7px;
  font-size: 0.84em;
  color: var(--crm-text-muted);
  border: 1px solid var(--crm-border);
  white-space: nowrap;
}
.ib-send {
  display: grid;
  place-items: center;
  width: 2.4em;
  height: 2.4em;
  border-radius: 7px;
  color: #fff;
  background: var(--crm-accent-strong);
}
.ib-send.press {
  animation: press 0.5s var(--ease);
}
@keyframes press {
  40% {
    opacity: 0.6;
  }
}
.ib-ctx {
  border-left: 1px solid var(--crm-border);
  padding: 1em 0.9em;
  display: flex;
  flex-direction: column;
  gap: 0.8em;
  background: var(--crm-surface-2);
  min-width: 0;
  overflow: hidden;
}
.ctx-card {
  display: grid;
  gap: 0.55em;
  padding: 0.85em;
  border-radius: 8px;
  background: var(--crm-surface);
  border: 1px solid var(--crm-border);
}
.ctx-h {
  font-size: 0.7em;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--crm-text-subtle);
}
.ctx-client {
  display: flex;
  gap: 0.6em;
  align-items: center;
}
.ctx-client div {
  display: grid;
}
.ctx-tags {
  display: flex;
  gap: 0.3em;
  flex-wrap: wrap;
}
.ctx-deal {
  display: grid;
  gap: 0.35em;
  justify-items: start;
  font-size: 0.92em;
}
.ctx-deal b {
  font-weight: 500;
}
.ctx-deal em {
  font-style: normal;
  font-weight: 600;
  font-size: 1.12em;
  font-variant-numeric: tabular-nums;
}
.ctx-stages {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.25em;
}
.ctx-stages i {
  height: 0.25em;
  border-radius: 999px;
  background: var(--crm-surface-3);
}
.ctx-stages i.on {
  background: var(--crm-accent);
}
.ctx-task {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.88em;
}
.ctx-task i {
  width: 1em;
  height: 1em;
  border-radius: 3px;
  border: 1px solid var(--crm-text-subtle);
  flex: none;
}
.ctx-task time,
.ctx-hist time {
  margin-left: auto;
}
.ctx-task.done {
  color: var(--crm-text-subtle);
  text-decoration: line-through;
}
.ctx-task.done i {
  border-color: var(--crm-text-subtle);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475467' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 80% no-repeat,
    #e3e8ef;
}
.ctx-hist {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.88em;
}
.ctx-hist .ch {
  width: 1.35em;
  height: 1.35em;
}

@container (max-width: 760px) {
  .ui-inbox {
    grid-template-columns: 34% minmax(0, 1fr);
  }
  .ib-ctx {
    display: none;
  }
}
@container (max-width: 560px) {
  .win .ui {
    font-size: clamp(10px, 3cqi, 13px);
  }
  .ui-inbox {
    grid-template-columns: 1fr;
    height: 34em;
  }
  .ib-list {
    display: none;
  }
  .ib-tool {
    display: none;
  }
  .ib-assign {
    display: none;
  }
  .msg {
    max-width: 86%;
  }
}

/* ---------- calls ---------- */
.ui-call {
  display: grid;
  grid-template-columns: 34% minmax(0, 1fr) 30%;
  height: 36em;
  background: var(--crm-bg);
}
.sp {
  display: flex;
  flex-direction: column;
  background: var(--crm-surface);
  border-right: 1px solid var(--crm-border);
}
.sp-top {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.9em 1.1em;
  border-bottom: 1px solid var(--crm-border);
}
.sp-title {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-weight: 600;
}
.sp-title svg {
  color: var(--crm-text-muted);
}
.sp-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.78em;
  font-weight: 500;
  color: var(--crm-text-strong);
  border: 1px solid var(--crm-border);
  padding: 0.2em 0.6em;
  border-radius: 999px;
}
.sp-status i {
  width: 0.45em;
  height: 0.45em;
  border-radius: 50%;
  background: var(--crm-text-muted);
}
.ui-call[data-state='talking'] .sp-status i,
.ui-call:not([data-state]) .sp-status i,
.ui-call[data-state='ringing'] .sp-status i {
  background: var(--crm-accent);
}
.sp-q {
  margin-left: auto;
  display: inline-flex;
  align-items: flex-end;
  gap: 0.15em;
  height: 1em;
}
.sp-q i {
  width: 0.22em;
  border-radius: 1px;
  background: var(--crm-text-muted);
}
.sp-q i:nth-child(1) {
  height: 30%;
}
.sp-q i:nth-child(2) {
  height: 55%;
}
.sp-q i:nth-child(3) {
  height: 78%;
}
.sp-q i:nth-child(4) {
  height: 100%;
}
.sp-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1em;
  padding: 1.6em 1.2em 1.2em;
}
.sp-who {
  display: grid;
  justify-items: center;
  gap: 0.25em;
  text-align: center;
}
.sp-who b {
  font-size: 1.2em;
  margin-top: 0.4em;
  font-weight: 600;
}
.sp-state {
  margin-top: 0.3em;
  font-size: 0.86em;
  font-weight: 500;
  color: var(--crm-text-strong);
  font-variant-numeric: tabular-nums;
}
.sp-ring {
  position: relative;
  display: grid;
  place-items: center;
}
.sp-ring::before,
.sp-ring::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--crm-accent);
  opacity: 0;
}
.ui-call[data-state='ringing'] .sp-ring::before,
.ui-call[data-state='ringing'] .sp-ring::after {
  animation: ring 2.2s var(--ease) infinite;
}
.ui-call[data-state='ringing'] .sp-ring::after {
  animation-delay: 0.7s;
}
@keyframes ring {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}
.wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.22em;
  height: 3.4em;
  width: 100%;
}
.wave i {
  width: 0.2em;
  height: 100%;
  border-radius: 999px;
  background: #a0aab8;
  transform: scaleY(var(--s, 0.2));
}
.ui-call[data-state='talking'] .wave i,
.ui-call:not([data-state]) .wave i {
  animation: wave var(--dur, 1s) ease-in-out infinite alternate;
  animation-delay: var(--del, 0s);
}
.ui-call[data-state='ringing'] .wave i,
.ui-call[data-state='ended'] .wave i {
  transform: scaleY(0.06);
  opacity: 0.5;
}
@keyframes wave {
  from {
    transform: scaleY(0.12);
  }
  to {
    transform: scaleY(var(--s, 0.8));
  }
}
.sp-ctrl {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5em;
  width: 100%;
}
.sp-b {
  display: grid;
  justify-items: center;
  gap: 0.3em;
  padding: 0.6em 0.2em;
  border-radius: 8px;
  background: var(--crm-bg);
  border: 1px solid var(--crm-border-subtle);
  color: var(--crm-text-strong);
}
.sp-b small {
  font-size: 0.72em;
}
/* inactive controls: dimmed by colour, not opacity, so the labels stay AA */
.ui-call[data-state='ringing'] .sp-b,
.ui-call[data-state='ended'] .sp-b {
  color: var(--crm-text-subtle);
  border-style: dashed;
}
.sp-main {
  display: flex;
  gap: 0.6em;
  width: 100%;
}
.sp-accept,
.sp-end {
  flex: 1;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.75em;
  border-radius: 8px;
  font-weight: 500;
}
.sp-accept {
  color: #fff;
  background: var(--crm-accent-strong);
}
.sp-end {
  color: var(--crm-text);
  background: var(--crm-surface-3);
  box-shadow: inset 0 0 0 1px #d6dde6;
}
.ui-call[data-state='ringing'] .sp-accept {
  display: flex;
}
.ui-call[data-state='ringing'] .sp-end,
.ui-call[data-state='talking'] .sp-end,
.ui-call:not([data-state]) .sp-end {
  display: flex;
}
.sp-after {
  display: none;
  flex-wrap: wrap;
  gap: 0.4em;
  justify-content: center;
}
.ui-call[data-state='ended'] .sp-after {
  display: flex;
  animation: popIn 0.6s var(--ease) both;
}
.scr {
  display: flex;
  flex-direction: column;
  gap: 1em;
  padding: 1.2em 1.3em;
  min-width: 0;
}
.sc-h {
  display: flex;
  align-items: center;
  gap: 0.5em;
}
.sc-h svg {
  color: var(--crm-text-muted);
}
.sc-h small {
  margin-left: auto;
}
.sc-steps {
  display: grid;
  gap: 0.5em;
  counter-reset: s;
}
.sc-steps li {
  counter-increment: s;
  display: flex;
  align-items: center;
  gap: 0.75em;
  padding: 0.75em 0.9em;
  border-radius: 8px;
  background: var(--crm-surface);
  border: 1px solid var(--crm-border-subtle);
  color: var(--crm-text-muted);
  font-size: 0.95em;
  transition:
    border-color 0.5s,
    color 0.5s;
}
.sc-steps li::before {
  content: counter(s);
  flex: none;
  display: grid;
  place-items: center;
  width: 1.8em;
  height: 1.8em;
  border-radius: 50%;
  font-size: 0.78em;
  font-weight: 600;
  color: var(--crm-text-muted);
  box-shadow: inset 0 0 0 1px var(--crm-border);
  transition:
    background-color 0.5s,
    color 0.5s;
}
.sc-steps li.now {
  color: var(--crm-text);
  border-color: rgba(0, 132, 255, 0.55);
}
.sc-steps li.now::before {
  background: var(--crm-accent-strong);
  color: #fff;
  box-shadow: none;
}
.sc-steps li.done {
  color: var(--crm-text-strong);
}
.sc-steps li.done::before {
  content: '';
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475467' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 58% no-repeat,
    var(--crm-surface-3);
}
.sc-tip {
  margin-top: auto;
  display: flex;
  gap: 0.6em;
  align-items: flex-start;
  padding: 0.8em 0.9em;
  border-radius: 8px;
  border: 1px dashed var(--crm-border);
  color: var(--crm-text-muted);
  font-size: 0.86em;
}
.sc-tip svg {
  color: var(--crm-text-muted);
  margin-top: 0.1em;
}
.mon {
  display: flex;
  flex-direction: column;
  gap: 0.8em;
  padding: 1.2em 1.1em;
  background: var(--crm-surface);
  border-left: 1px solid var(--crm-border);
  min-width: 0;
}
.mon-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5em;
}
.mon-list {
  display: grid;
  gap: 0.45em;
}
.mon-list li {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.6em;
  border-radius: 8px;
  border: 1px solid var(--crm-border-subtle);
  background: var(--crm-bg);
}
.mon-n {
  display: grid;
  min-width: 0;
  flex: 1;
}
.mon-n b {
  font-size: 0.92em;
  font-weight: 500;
  white-space: nowrap;
}
.st {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  white-space: nowrap;
}
.st::before {
  content: '';
  width: 0.45em;
  height: 0.45em;
  border-radius: 50%;
  background: currentColor;
}
.st-call::before {
  background: var(--crm-accent);
}
.st-free::before {
  background: transparent;
  box-shadow: inset 0 0 0 1px currentColor;
}
.st-pause::before {
  background: #b3bcc8;
}
.mon-a {
  display: flex;
  gap: 0.25em;
}
.mon-a em {
  display: grid;
  place-items: center;
  width: 1.9em;
  height: 1.9em;
  border-radius: 6px;
  border: 1px solid var(--crm-border);
  color: var(--crm-text-strong);
}
.mon-a em:first-child {
  color: #fff;
  background: var(--crm-accent-strong);
  border-color: transparent;
}
.mon-a svg {
  width: 1em;
  height: 1em;
}
@container (max-width: 820px) {
  .ui-call {
    grid-template-columns: 42% minmax(0, 1fr);
  }
  .mon {
    display: none;
  }
}
@container (max-width: 560px) {
  .ui-call {
    grid-template-columns: 1fr;
    height: auto;
  }
  .scr {
    display: none;
  }
  .sp {
    border-right: 0;
  }
}

/* ---------- AI assistant ---------- */
.ui-ai {
  display: flex;
  flex-direction: column;
  height: 34em;
  background: var(--crm-bg);
}
.win .ui-ai {
  font-size: clamp(10px, 1.9cqi, 14.5px);
}
.ai-head {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.95em 1.2em;
  border-bottom: 1px solid var(--crm-border);
  background: var(--crm-surface);
}
.ai-head b {
  font-weight: 600;
}
.ai-head small {
  margin-left: auto;
}
.ai-mark {
  display: grid;
  place-items: center;
  width: 1.7em;
  height: 1.7em;
  border-radius: 6px;
  color: var(--crm-text-strong);
  box-shadow: inset 0 0 0 1px var(--crm-border);
}
.ai-mark svg {
  width: 1em;
  height: 1em;
}
.ai-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.9em;
  padding: 1.2em;
  overflow: hidden;
}
.ai-q {
  display: flex;
  gap: 0.6em;
  align-items: flex-start;
  align-self: flex-end;
  max-width: 88%;
  flex-direction: row-reverse;
}
.ai-q p {
  padding: 0.7em 0.95em;
  border-radius: 0.8em;
  border-top-right-radius: 0.25em;
  background: #f1f4f8;
  box-shadow: inset 0 0 0 1px #e6ebf1;
}
.ai-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
}
.tool {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.3em 0.65em;
  border-radius: 6px;
  font-size: 0.82em;
  font-weight: 500;
  color: var(--crm-text-muted);
  border: 1px solid var(--crm-border);
  transition:
    color 0.4s,
    border-color 0.4s,
    opacity 0.4s;
}
.tool i {
  width: 0.9em;
  height: 0.9em;
  border-radius: 50%;
  border: 1px solid var(--crm-text-muted);
  position: relative;
}
.tool i::after {
  content: '';
  position: absolute;
  left: 0.26em;
  top: 0.1em;
  width: 0.2em;
  height: 0.38em;
  border: solid var(--crm-text-strong);
  border-width: 0 0.1em 0.1em 0;
  transform: rotate(45deg);
}
.tool.run {
  color: var(--crm-text);
  border-color: rgba(0, 132, 255, 0.55);
}
.tool.run i {
  border-color: #e3e8ef;
  border-top-color: var(--crm-accent);
  animation: spin360 0.9s linear infinite;
}
.tool.run i::after,
.tool.wait i::after {
  display: none;
}
.tool.wait {
  color: var(--crm-text-subtle);
  border-style: dashed;
}
.tool.wait i {
  border-color: var(--crm-border);
}
@keyframes spin360 {
  to {
    transform: rotate(360deg);
  }
}
.ai-a {
  display: grid;
  gap: 0.8em;
  padding: 1em 1.1em;
  border-radius: 0.8em;
  border-top-left-radius: 0.25em;
  background: var(--crm-surface);
  border: 1px solid var(--crm-border);
}
.ai-a p {
  color: var(--crm-text-strong);
  line-height: 1.6;
  min-height: 1.5em;
}
.ai-a p.typing-now::after {
  content: '';
  display: inline-block;
  width: 0.45em;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.12em;
  background: var(--crm-text-muted);
  animation: caret 1s steps(1) infinite;
}
.ai-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
}
.ai-refs span {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.25em 0.65em 0.25em 0.3em;
  border-radius: 6px;
  font-size: 0.8em;
  font-weight: 500;
  color: var(--crm-accent-text);
  border: 1px solid rgba(0, 132, 255, 0.35);
}
.ai-refs .ch {
  width: 1.4em;
  height: 1.4em;
}
.ai-fb {
  display: flex;
  align-items: center;
  gap: 0.4em;
}
.ai-fb em {
  display: grid;
  place-items: center;
  width: 2em;
  height: 2em;
  border-radius: 6px;
  border: 1px solid var(--crm-border);
  color: var(--crm-text-muted);
  transition:
    color 0.4s,
    border-color 0.4s;
}
.ai-fb em.on {
  color: var(--crm-text);
  border-color: var(--crm-text-muted);
}
.ai-fb small {
  margin-left: 0.3em;
}
.ai-refs.off,
.ai-fb.off,
.ai-a.off {
  display: none;
}
.ai-input {
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin: 0 1.2em 1.2em;
  padding: 0.45em 0.45em 0.45em 1em;
  border-radius: 8px;
  border: 1px solid var(--crm-border);
  background: var(--crm-surface);
  color: var(--crm-text-subtle);
  font-size: 0.92em;
}
.ai-input span {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ai-input em {
  display: grid;
  place-items: center;
  width: 2.2em;
  height: 2.2em;
  border-radius: 6px;
  background: var(--crm-accent-strong);
  color: #fff;
}

/* ---------- kanban ---------- */
.ui-kanban {
  display: flex;
  flex-direction: column;
  background: var(--crm-bg);
}
.kb-top {
  display: flex;
  align-items: center;
  gap: 0.8em;
  padding: 0.9em 1.2em;
  background: var(--crm-surface);
  border-bottom: 1px solid var(--crm-border);
}
.kb-top > b {
  font-size: 1.15em;
}
.kb-board {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.35em 0.7em;
  border-radius: 7px;
  border: 1px solid var(--crm-border);
  font-size: 0.88em;
  color: var(--crm-text-strong);
}
.kb-sp {
  flex: 1;
}
.kb-f,
.kb-add {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.45em 0.8em;
  border-radius: 7px;
  font-size: 0.86em;
  font-weight: 500;
}
.kb-f {
  border: 1px solid var(--crm-border);
  color: var(--crm-text-strong);
}
.kb-add {
  color: #fff;
  background: var(--crm-accent-strong);
}
.kb-cols {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.8em;
  padding: 1em 1.2em 1.2em;
  min-height: 27em;
}
.kb-col {
  display: flex;
  flex-direction: column;
  gap: 0.6em;
  padding: 0.7em;
  border-radius: 10px;
  background: #f1f4f8;
  box-shadow: inset 0 0 0 1px var(--crm-border-subtle);
  min-width: 0;
  transition:
    background-color 0.5s,
    box-shadow 0.5s;
}
.kb-col.drop {
  background: #eef5ff;
  box-shadow: inset 0 0 0 1px rgba(0, 132, 255, 0.35);
}
.kb-ch {
  display: flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.2em 0.3em 0.4em;
  font-size: 0.84em;
  font-weight: 500;
  color: var(--crm-text-strong);
  white-space: nowrap;
}
.kb-ch i {
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: var(--c, #b3bcc8);
}
.kb-ch b {
  margin-left: auto;
  font-size: 0.9em;
  font-weight: 500;
  color: var(--crm-text-muted);
  font-variant-numeric: tabular-nums;
}
.kb-list {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}
.kb-card {
  display: grid;
  gap: 0.35em;
  padding: 0.75em 0.8em;
  border-radius: 8px;
  background: var(--crm-surface);
  border: 1px solid var(--crm-border);
  box-shadow: 0 1px 2px rgba(15, 23, 35, 0.04);
  font-size: 0.92em;
  will-change: transform;
}
.kb-card > b {
  font-size: 0.98em;
  font-weight: 500;
  line-height: 1.25;
}
.kb-card small {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kb-cf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.2em;
}
.kb-cf em {
  font-style: normal;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.kb-card.lift {
  position: relative;
  z-index: 5;
  border-color: rgba(0, 132, 255, 0.6);
  box-shadow: 0 1em 2em -1em rgba(15, 23, 35, 0.3);
}
.kb-won .kb-card.landed {
  animation: won 1.4s var(--ease);
}
@keyframes won {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 132, 255, 0.45);
  }
  100% {
    box-shadow: 0 0 0 0.8em rgba(0, 132, 255, 0);
  }
}
@container (max-width: 820px) {
  .kb-cols {
    grid-template-columns: repeat(5, 11.5em);
    overflow: hidden;
  }
  .win .ui-kanban {
    font-size: clamp(10px, 1.9cqi, 13px);
  }
}
@container (max-width: 560px) {
  .kb-f {
    display: none;
  }
  .kb-cols {
    grid-template-columns: repeat(5, 13em);
  }
}

/* ---------- automation recipe ---------- */
.recipe {
  --rp: 0;
  position: relative;
  display: grid;
  gap: 0.9em;
  padding: 1.4em 1.4em 1.4em 3.4em;
  border-radius: 12px;
  background: var(--crm-surface);
  font-size: clamp(12.5px, 1.1vw, 15px);
  box-shadow:
    0 0 0 1px var(--line-2),
    var(--shadow-3);
}
.rc-line {
  position: absolute;
  left: calc(1.375em - 0.5px);
  top: var(--lt, 5.8em);
  height: var(--lh, 70%);
  width: 1px;
  background: var(--crm-border);
  overflow: hidden;
}
.rc-line i {
  position: absolute;
  inset: 0;
  transform-origin: 50% 0;
  transform: scaleY(var(--rp));
  background: var(--crm-accent);
}
.rc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  padding-bottom: 0.3em;
}
.rc-head > div {
  display: grid;
  gap: 0.2em;
}
.recipe .rc-cap {
  font-size: 0.72em;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--crm-text-subtle);
}
.rc-head b {
  font-size: 1.08em;
  font-weight: 600;
}
.rc-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.85em;
  font-weight: 500;
  color: var(--crm-text-strong);
}
.rc-toggle i {
  position: relative;
  width: 2.2em;
  height: 1.25em;
  border-radius: 999px;
  background: var(--crm-accent-strong);
}
.rc-toggle i::after {
  content: '';
  position: absolute;
  right: 0.15em;
  top: 0.15em;
  width: 0.95em;
  height: 0.95em;
  border-radius: 50%;
  background: #fff;
}
.rc-block {
  position: relative;
  display: grid;
  gap: 0.45em;
  padding: 0.9em 1em;
  border-radius: 8px;
  border: 1px solid var(--crm-border-subtle);
  background: var(--crm-bg);
  opacity: calc(0.35 + var(--on, 1) * 0.65);
  transition: opacity 0.6s;
}
.rc-block::before {
  content: '';
  position: absolute;
  left: -2.45em;
  top: 1.05em;
  width: 0.85em;
  height: 0.85em;
  border-radius: 50%;
  background: var(--crm-surface);
  border: 1px solid #a0aab8;
  box-shadow: 0 0 0 4px var(--crm-surface);
}
.rc-k {
  font-size: 0.7em;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--crm-text-muted);
}
.rc-row {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.5em 0.7em;
  border-radius: 6px;
  background: var(--crm-surface);
  border: 1px solid var(--crm-border-subtle);
  color: var(--crm-text-strong);
  font-size: 0.95em;
  transition: border-color 0.6s;
}
.rc-row svg {
  color: var(--crm-text-muted);
}
.rc-row em {
  font-style: normal;
  color: var(--crm-text-muted);
}
.rc-row.fire {
  animation: fire 1.4s var(--ease);
}
@keyframes fire {
  0% {
    border-color: rgba(0, 132, 255, 0.7);
    background: #eef5ff;
  }
}
.rc-pulse {
  position: absolute;
  left: calc(1.375em - 0.3em);
  top: calc(var(--lt, 5.8em) - 0.3em);
  width: 0.6em;
  height: 0.6em;
  border-radius: 50%;
  background: var(--crm-accent);
  box-shadow: 0 0 0 0.3em rgba(0, 132, 255, 0.2);
  opacity: 0;
  transform: translateY(var(--py, 0px));
  transition: opacity 0.4s;
}
.recipe.firing .rc-pulse {
  opacity: 1;
}

/* ---------- widgets ---------- */
.browser {
  container-type: inline-size;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  box-shadow:
    0 0 0 1px var(--line-2),
    var(--shadow-3);
}
.br-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  background: #f6f8fb;
  border-bottom: 1px solid #e3e8ef;
}
.br-bar i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d6dde6;
}
.br-bar .win-tag {
  margin-left: auto;
  font-style: normal;
}
.br-bar span {
  margin-left: 12px;
  font-size: 11.5px;
  color: #5f6b7a;
  padding: 2px 12px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #e3e8ef;
}
.br-page {
  position: relative;
  height: clamp(440px, 60cqi, 500px);
  padding: 20px 24px;
  font-size: 14px;
  overflow: hidden;
}
.br-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--crm-text-muted);
}
.br-nav span {
  width: 54px;
  height: 6px;
  border-radius: 3px;
  background: #e3e8ef;
}
.br-nav b {
  margin-right: auto;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.br-hero {
  display: grid;
  gap: 12px;
  margin-top: 40px;
  max-width: 60%;
}
.br-hero i {
  height: 16px;
  border-radius: 4px;
  background: #eef2f7;
}
.br-hero i.br-btn {
  width: 30%;
  height: 32px;
  border-radius: 6px;
  margin-top: 10px;
  background: #dfe6ee;
}
.br-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 36px;
  max-width: 60%;
}
.br-cards i {
  height: 90px;
  border-radius: 8px;
  background: var(--crm-bg);
  box-shadow: inset 0 0 0 1px #e3e8ef;
}
.w-chat,
.w-book,
.w-form {
  position: absolute;
  font-size: 13px;
  background: var(--crm-surface);
  border-radius: 12px;
  box-shadow:
    0 0 0 1px var(--crm-border),
    0 1px 2px rgba(15, 23, 35, 0.05),
    0 24px 48px -20px rgba(15, 23, 35, 0.22);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition:
    opacity 0.6s var(--ease),
    transform 0.8s var(--ease),
    visibility 0.6s;
}
.wg[data-active='chat'] .w-chat,
.wg[data-active='book'] .w-book,
.wg[data-active='form'] .w-form,
.wg:not([data-active]) .w-chat {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.w-chat {
  right: 22px;
  bottom: 84px;
  width: min(300px, 70%);
  overflow: hidden;
  transform-origin: 100% 100%;
}
.wc-head {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  background: var(--crm-surface-2);
  border-bottom: 1px solid var(--crm-border);
}
.wc-head div {
  display: grid;
}
.wc-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
}
.wc-msg {
  align-self: flex-start;
  max-width: 85%;
  padding: 8px 11px;
  border-radius: 10px;
  border-bottom-left-radius: 3px;
  background: #f1f4f8;
  box-shadow: inset 0 0 0 1px #e6ebf1;
  line-height: 1.4;
}
.wc-msg.me {
  align-self: flex-end;
  background: #eaf2fd;
  box-shadow: inset 0 0 0 1px #d8e6f8;
  border-radius: 10px;
  border-bottom-right-radius: 3px;
}
.wc-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.wc-quick span {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--crm-border);
  color: var(--crm-text-strong);
  font-size: 12px;
  font-weight: 500;
}
.wc-quick .hl {
  border-color: rgba(0, 132, 255, 0.5);
  color: var(--crm-accent-text);
}
.wc-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  padding: 8px;
  border-radius: 8px;
  border: 1px dashed var(--crm-border);
}
.wc-form span {
  padding: 6px 9px;
  border-radius: 6px;
  background: var(--crm-bg);
  border: 1px solid var(--crm-border);
  color: var(--crm-text-muted);
  font-size: 12px;
}
.wc-form em {
  font-style: normal;
  text-align: center;
  padding: 7px 12px;
  border-radius: 6px;
  color: #fff;
  font-weight: 500;
  background: var(--crm-accent-strong);
}
.w-fab {
  position: absolute;
  right: 22px;
  bottom: 20px;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: #fff;
  background: var(--crm-accent-strong);
  box-shadow: 0 10px 24px -10px rgba(10, 110, 209, 0.55);
  transition:
    opacity 0.5s,
    transform 0.6s var(--ease);
}
.w-fab svg {
  width: 22px;
  height: 22px;
}
.wg[data-active]:not([data-active='chat']) .w-fab {
  opacity: 0;
  transform: scale(0.8);
}
.w-book {
  left: 50%;
  top: 50%;
  width: min(560px, 90%);
  padding: 16px;
  display: grid;
  gap: 14px;
  translate: -50% -50%;
}
.wb-steps {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.wb-steps span {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--crm-text-subtle);
  border: 1px solid var(--crm-border-subtle);
}
.wb-steps .done {
  color: var(--crm-text-strong);
  border-color: var(--crm-border);
}
.wb-steps .on {
  color: #fff;
  background: var(--crm-accent-strong);
  border-color: transparent;
}
.wb-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
}
.wb-cal {
  display: grid;
  gap: 8px;
}
.wb-cal b {
  font-weight: 500;
}
.wb-days,
.wb-dates {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
  font-size: 11.5px;
}
.wb-days span {
  color: var(--crm-text-subtle);
}
.wb-dates span {
  padding: 5px 0;
  border-radius: 6px;
  color: var(--crm-text-strong);
  font-variant-numeric: tabular-nums;
}
.wb-dates span.off {
  color: #b3bcc8;
}
.wb-dates span.sel {
  color: #fff;
  background: var(--crm-accent-strong);
  font-weight: 600;
}
.wb-slots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  align-content: start;
}
.wb-slots span {
  padding: 8px 0;
  text-align: center;
  border-radius: 6px;
  border: 1px solid var(--crm-border);
  font-weight: 500;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.wb-slots .busy {
  color: #b3bcc8;
  text-decoration: line-through;
  border-color: var(--crm-border-subtle);
}
.wb-slots .pick {
  color: #fff;
  background: var(--crm-accent-strong);
  border-color: transparent;
}
.wb-slots .pick.flash {
  animation: won 1.2s var(--ease);
}
.wb-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.wb-lock {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: var(--crm-text-muted);
}
.wb-lock svg {
  width: 14px;
  height: 14px;
}
.wb-foot em,
.w-form > em {
  font-style: normal;
  padding: 8px 16px;
  border-radius: 6px;
  color: #fff;
  font-weight: 500;
  background: var(--crm-accent-strong);
  white-space: nowrap;
}
.w-form {
  left: 50%;
  top: 50%;
  width: min(380px, 86%);
  padding: 18px;
  display: grid;
  gap: 10px;
  translate: -50% -50%;
}
.w-form > b {
  font-size: 15px;
  font-weight: 600;
}
.wf-f {
  display: grid;
  gap: 4px;
}
.wf-f span {
  font-size: 11.5px;
  color: var(--crm-text-muted);
  font-weight: 500;
}
.wf-f i {
  display: block;
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--crm-border);
  background: var(--crm-bg);
  font-style: normal;
  color: var(--crm-text);
  transition:
    border-color 0.3s,
    box-shadow 0.3s;
}
.wf-f i::before {
  content: attr(data-fill);
}
.wf-f i.typing-now {
  border-color: var(--crm-accent);
  box-shadow: 0 0 0 3px rgba(0, 132, 255, 0.14);
}
.wf-ok {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--crm-text-strong);
}
.wf-ok i {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 80% no-repeat,
    var(--crm-accent-strong);
}
.w-form > em {
  text-align: center;
}
.wg-toast {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 3;
  translate: -50% 0;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 9px 14px;
  border-radius: 8px;
  background: #0f1723;
  box-shadow: 0 16px 30px -14px rgba(15, 23, 35, 0.5);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  animation: popIn 0.6s var(--ease) both;
}
.wg-toast em {
  font-style: normal;
  color: #aab1bb;
  font-family: var(--f-mono);
  font-size: 11.5px;
}
@container (max-width: 520px) {
  .br-page {
    height: 470px;
    padding: 16px;
  }
  .br-hero,
  .br-cards {
    max-width: 100%;
  }
  .w-chat {
    width: calc(100% - 32px);
    right: 16px;
  }
  .wb-grid {
    grid-template-columns: 1fr;
  }
  .wb-cal {
    display: none;
  }
  .w-book {
    width: calc(100% - 24px);
  }
  .wb-slots {
    grid-template-columns: repeat(3, 1fr);
  }
  .wb-foot {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
}

/* ---------- dashboard ---------- */
.ui-dash {
  display: grid;
  gap: 1em;
  padding: 1.2em;
  background: var(--crm-bg);
}
.db-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--crm-surface);
  border: 1px solid var(--crm-border-subtle);
  border-radius: var(--crm-radius-card);
}
.kpi {
  display: grid;
  gap: 0.2em;
  padding: 1em 1.2em;
  border-left: 1px solid var(--crm-border-subtle);
}
.kpi:first-child {
  border-left: 0;
}
.kpi b {
  font-size: 2em;
  font-weight: 500;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.kpi em {
  font-style: normal;
  font-size: 0.8em;
  font-weight: 500;
  color: var(--crm-text-muted);
  font-variant-numeric: tabular-nums;
}
.db-row {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 1em;
}
.db-row2 {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 0.9fr);
}
.db-card {
  display: grid;
  gap: 0.8em;
  align-content: start;
  padding: 1em 1.2em 1.2em;
  background: var(--crm-surface);
  border: 1px solid var(--crm-border-subtle);
  border-radius: var(--crm-radius-card);
  min-width: 0;
}
.db-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
}
.db-h b {
  font-weight: 500;
}
.db-legend {
  display: flex;
  align-items: center;
  gap: 0.45em;
  font-size: 0.8em;
  color: var(--crm-text-muted);
  white-space: nowrap;
}
.db-legend i {
  width: 0.9em;
  height: 2px;
  background: var(--c);
  margin-left: 0.6em;
}
.chart {
  width: 100%;
  height: 13em;
}
.chart .grid line {
  stroke: var(--crm-border-subtle);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.chart .area {
  fill: url(#chart-fade);
  opacity: 0;
  transition: opacity 1.4s 1.8s;
}
.chart .ln {
  fill: none;
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 2.4s var(--ease-io);
}
.ln-a {
  stroke: var(--crm-accent);
  stroke-width: 2 !important;
}
.ln-b {
  stroke: #7a8595;
  transition-delay: 0.2s !important;
}
.ln-c {
  stroke: #c3ccd8;
  transition-delay: 0.4s !important;
}
.drawn .chart .ln,
.rm .chart .ln,
.js-off .chart .ln {
  stroke-dashoffset: 0;
}
.drawn .chart .area,
.rm .chart .area,
.js-off .chart .area {
  opacity: 1;
}
.fn {
  display: grid;
  grid-template-columns: 7.5em minmax(0, 1fr) 2.6em;
  gap: 0.7em;
  align-items: center;
  font-size: 0.9em;
}
.fn span {
  color: var(--crm-text-muted);
}
.fn i {
  height: 1.5em;
  border-radius: 3px;
  background: #dfe5ec;
  width: var(--w);
  transform-origin: 0 50%;
  transform: scaleX(0);
  transition: transform 1.5s var(--ease);
}
.fn.key i {
  background: var(--crm-accent);
}
.fn:nth-child(3) i {
  transition-delay: 0.1s;
}
.fn:nth-child(4) i {
  transition-delay: 0.2s;
}
.fn:nth-child(5) i {
  transition-delay: 0.3s;
}
.fn b {
  text-align: right;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.ld {
  display: grid;
  grid-template-columns: auto 6.5em minmax(0, 1fr) 2.8em;
  gap: 0.6em;
  align-items: center;
  font-size: 0.9em;
}
.ld i {
  position: relative;
  height: 0.35em;
  border-radius: 999px;
  background: var(--crm-surface-3);
  overflow: hidden;
}
.ld i::after {
  content: '';
  position: absolute;
  inset: 0;
  width: var(--w);
  border-radius: inherit;
  background: #a0aab8;
  transform-origin: 0 50%;
  transform: scaleX(0);
  transition: transform 1.6s var(--ease) 0.3s;
}
.ld b {
  text-align: right;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.drawn .fn i,
.rm .fn i,
.js-off .fn i,
.drawn .ld i::after,
.rm .ld i::after,
.js-off .ld i::after {
  transform: none;
}
.dn {
  display: flex;
  align-items: center;
  gap: 1em;
}
.dn svg {
  width: 7.5em;
  height: 7.5em;
  transform: rotate(-90deg);
}
.dn-bg {
  fill: none;
  stroke: var(--crm-surface-3);
  stroke-width: 5;
}
.dn-s {
  fill: none;
  stroke: var(--c);
  stroke-width: 5;
  stroke-dasharray: 0 100;
  stroke-dashoffset: var(--off);
  transition: stroke-dasharray 1.6s var(--ease);
}
.drawn .dn-s,
.rm .dn-s,
.js-off .dn-s {
  stroke-dasharray: var(--len) calc(100 - var(--len));
}
.dn ul {
  display: grid;
  gap: 0.35em;
  font-size: 0.86em;
  color: var(--crm-text-strong);
}
.dn li {
  display: flex;
  align-items: center;
  gap: 0.45em;
}
.dn li i {
  width: 0.6em;
  height: 0.6em;
  border-radius: 2px;
  background: var(--c);
}
.sla {
  display: grid;
}
.sla b {
  font-size: 2.2em;
  font-weight: 500;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.bars {
  display: flex;
  align-items: flex-end;
  gap: 0.4em;
  height: 4em;
}
.bars i {
  flex: 1;
  height: var(--h);
  border-radius: 2px;
  background: #dfe5ec;
  transform-origin: 50% 100%;
  transform: scaleY(0);
  transition: transform 1.2s var(--ease);
}
.bars i:last-child {
  background: var(--crm-accent);
}
.bars i:nth-child(2) {
  transition-delay: 0.05s;
}
.bars i:nth-child(3) {
  transition-delay: 0.1s;
}
.bars i:nth-child(4) {
  transition-delay: 0.15s;
}
.bars i:nth-child(5) {
  transition-delay: 0.2s;
}
.bars i:nth-child(6) {
  transition-delay: 0.25s;
}
.bars i:nth-child(7) {
  transition-delay: 0.3s;
}
.drawn .bars i,
.rm .bars i,
.js-off .bars i {
  transform: none;
}
@container (max-width: 820px) {
  .win .ui-dash {
    font-size: clamp(10px, 1.7cqi, 13px);
  }
  .db-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kpi:nth-child(3) {
    border-left: 0;
  }
  .kpi:nth-child(n + 3) {
    border-top: 1px solid var(--crm-border-subtle);
  }
  .db-row,
  .db-row2 {
    grid-template-columns: 1fr;
  }
  .db-donut,
  .db-sla {
    display: none;
  }
}
@container (max-width: 520px) {
  .win .ui-dash {
    font-size: clamp(10px, 3cqi, 12.5px);
  }
  .db-legend {
    display: none;
  }
}

/* ---------- permission matrix ---------- */
.matrix {
  position: relative;
  padding: 1.2em;
  border-radius: 12px;
  background: var(--crm-surface);
  font-size: clamp(12px, 1vw, 14.5px);
  box-shadow:
    0 0 0 1px var(--line-2),
    var(--shadow-3);
  overflow-x: auto;
}
.mx-cap {
  font-size: 0.78em;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--crm-text-muted);
  margin: 0 0 0.9em 0.4em;
}
.matrix table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.matrix th,
.matrix td {
  padding: 0.75em 0.6em;
  border-bottom: 1px solid var(--crm-border-subtle);
  text-align: center;
  vertical-align: middle;
}
.matrix thead th {
  font-size: 0.78em;
  font-weight: 500;
  color: var(--crm-text-muted);
  line-height: 1.25;
  hyphens: manual;
  border-bottom-color: var(--crm-border);
}
.matrix thead th:first-child,
.matrix tbody th {
  text-align: left;
}
.matrix tbody th {
  font-weight: 500;
  color: var(--crm-text);
}
.matrix tbody th code {
  display: block;
  margin-top: 0.2em;
  font: 400 0.78em/1.3 var(--f-mono);
  color: var(--crm-text-muted);
}
.matrix tbody tr:last-child > * {
  border-bottom: 0;
}
.matrix tbody tr {
  transition: background-color 0.5s;
}
.matrix tbody tr.scan {
  background: #f6f8fb;
}
.matrix tbody tr.scan > th {
  box-shadow: inset 2px 0 0 var(--crm-accent);
}
.sc,
.yes,
.no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.6em;
  padding: 0.2em 0.6em;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 0.82em;
  font-weight: 500;
  opacity: var(--k, 1);
  transition: opacity 0.7s var(--ease);
  transition-delay: calc(var(--i, 0) * 40ms);
}
.sc-all {
  color: var(--crm-text);
  background: #eef2f7;
}
.sc-dep {
  color: var(--crm-text-strong);
  border-color: #c3ccd8;
}
.sc-own {
  color: var(--crm-text-strong);
  border: 1px dashed #a0aab8;
}
.yes {
  color: var(--crm-text);
  background: #eef2f7;
}
.no {
  color: var(--crm-text-muted);
}
.js .matrix:not(.is-in) .sc,
.js .matrix:not(.is-in) .yes,
.js .matrix:not(.is-in) .no {
  --k: 0;
}
@media (max-width: 560px) {
  .matrix {
    padding: 0.9em 0.6em;
    font-size: 11.5px;
  }
  .matrix tbody th code {
    display: none;
  }
  .matrix th,
  .matrix td {
    padding: 0.7em 0.3em;
  }
  .sc,
  .yes,
  .no {
    min-width: 0;
    padding: 0.25em 0.45em;
  }
}
.rm .matrix .sc,
.rm .matrix .yes,
.rm .matrix .no {
  --k: 1;
}

/* ---------- phone: the responsive web app in a mobile browser ---------- */
.phone {
  position: relative;
  padding: 10px;
  border-radius: 42px;
  background: #15181c;
  box-shadow:
    inset 0 0 0 1px #2a2f36,
    var(--shadow-3);
}
.ph-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 600px;
  border-radius: 33px;
  background: var(--crm-bg);
  font-size: 13.5px;
  overflow: hidden;
}
.ph-status {
  height: 34px;
  flex: none;
}
.ph-url {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 12px 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--crm-surface-3);
  color: var(--crm-text-muted);
  font-size: 0.86em;
}
.ph-url svg {
  width: 11px;
  height: 11px;
}
.ph-app {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 12px 14px;
  border-top: 1px solid var(--crm-border-subtle);
}
.ph-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ph-top b {
  flex: 1;
  font-size: 1.35em;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.ph-top svg {
  width: 18px;
  height: 18px;
  color: var(--crm-text-strong);
}
.ph-seg {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--crm-border-subtle);
}
.ph-seg span {
  flex: 1;
  text-align: center;
  padding: 5px;
  border-radius: 6px;
  font-size: 0.86em;
  color: var(--crm-text-muted);
}
.ph-seg .on {
  background: var(--crm-surface-3);
  color: var(--crm-text);
  font-weight: 500;
}
.ph-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  background: var(--crm-surface);
  border: 1px solid var(--crm-border-subtle);
}
.ph-item div {
  flex: 1;
  display: grid;
  min-width: 0;
}
.ph-item b {
  font-weight: 500;
}
.ph-item small {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ph-foot {
  margin-top: auto;
  text-align: center;
  font-size: 0.82em;
  color: var(--crm-text-subtle);
}
@media (max-width: 640px) {
  .ph-screen {
    height: 540px;
  }
}
