/* ==========================================================================
   Product tour — looping "video" clips of the app.
   Each clip is one fixed-ratio screen sized in em off its own width (cqw),
   so it scales like a video and the cursor keyframes stay on their targets.
   Screen = 50em x 31.25em. Sidebar 10em; body content starts at
   inline 11.2em / top 6.1em and is 37.6em x 24.25em.
   Everything in a clip runs on one looping timeline of var(--dur).
   All names, numbers and the account are made up; the account name is blurred.
   ========================================================================== */

/* --- Section layout (alternating rows) --- */
.tour-list { display: grid; gap: clamp(20px, 3vw, 32px); }

.tour-row {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(20px, 4vw, 52px);
  padding: clamp(12px, 2vw, 20px);
  background: var(--card);
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.tour-row:nth-child(even) .tour-media { order: 2; }

.tour-media {
  min-width: 0;
  padding: clamp(14px, 3vw, 34px);
  background: linear-gradient(145deg, var(--teal-soft), var(--lemon-subtle));
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
}

.tour-copy { min-width: 0; padding-inline-end: clamp(0px, 2vw, 24px); }

.tour-copy .section-kicker { margin-bottom: 10px; }

.tour-copy h3 { margin-bottom: 12px; font-size: clamp(1.45rem, 2.5vw, 2.05rem); font-weight: 900; line-height: 1.25; }

.tour-copy p { margin-bottom: 18px; font-size: 1.05rem; line-height: 1.6; color: var(--muted); }

.tour-points { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }

.tour-points li { display: flex; align-items: flex-start; gap: 8px; font-size: 15px; font-weight: 700; line-height: 1.45; }

.tour-points li i { margin-top: 3px; flex-shrink: 0; color: var(--teal-dark); }

.tour-points li.is-note { font-weight: 500; color: var(--muted); }

.tour-note { margin-top: 18px; text-align: center; font-size: 14px; color: var(--muted); }

.tour-note i { color: var(--teal-dark); vertical-align: -2px; }

@media (max-width: 1060px) {
  .tour-row { grid-template-columns: 1fr; }
  .tour-row:nth-child(even) .tour-media { order: 0; }
  .tour-copy { padding: 4px 8px 10px; }
}

@media (max-width: 560px) {
  .tour-row { padding: 8px; }
  .tour-media { padding: 8px; }
  .clip-ctrl { padding: 6px 10px; }
}

/* --- Clip frame + controls --- */
.clip {
  --dur: 12s;
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.clip .app-bar { padding: 7px 12px; font-size: 12px; }

.clip-screen { position: relative; aspect-ratio: 16 / 10; container-type: inline-size; overflow: hidden; }

.clip-ctrl {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  background: var(--paper-2);
  border-top: var(--border);
}

.clip-btn {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font-size: 14px;
  color: var(--navy);
  background: var(--lemon);
  border: 2px solid var(--navy);
  border-radius: 50%;
  cursor: pointer;
}

.clip-btn:focus-visible { outline: 3px solid var(--teal-dark); outline-offset: 2px; }

.clip-btn .ph-play, .clip.is-paused .clip-btn .ph-pause { display: none; }

.clip.is-paused .clip-btn .ph-play { display: block; }

.clip-track { flex: 1; height: 6px; overflow: hidden; background: var(--line); border-radius: var(--radius-pill); }

.clip-track i { display: block; height: 100%; background: var(--teal); transform-origin: left; animation: clip-progress var(--dur) linear infinite; }

html[dir='rtl'] .clip-track i { transform-origin: right; }

.clip-label { white-space: nowrap; }

@keyframes clip-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Paused by the button, or waiting to scroll into view (set by saas.js) */
.clip.is-paused *, .clip.is-paused *::before, .clip.is-paused *::after,
.clip.is-waiting *, .clip.is-waiting *::before, .clip.is-waiting *::after { animation-play-state: paused !important; }

/* --- The app (fixed light palette, like a real screenshot) --- */
.ghl {
  --dir: 1;
  --g-ink: #102a43;
  --g-muted: #5d6d7c;
  --g-bg: #f8f7ee;
  --g-card: #fffef8;
  --g-line: rgba(16, 42, 67, 0.14);
  --g-side: #10294a;
  --g-teal: #12b7b2;
  --g-teal-dark: #087c7a;
  --g-teal-soft: #dff7f5;
  --g-lemon: #f4ed42;
  --g-lemon-soft: #fbf7c2;
  --g-wa: #128c4a;
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 10em minmax(0, 1fr);
  font-family: var(--font-body);
  font-size: 2cqw;
  line-height: 1.3;
  color: var(--g-ink);
  background: var(--g-bg);
  user-select: none;
}

html[dir='rtl'] .ghl { --dir: -1; }

.ghl i { line-height: 1; }

.ghl b { font-weight: 700; }

/* Sidebar */
.g-side { display: flex; flex-direction: column; gap: 0.15em; padding: 0.7em 0.55em; overflow: hidden; color: #cfd9e2; background: var(--g-side); }

.g-logo { display: flex; justify-content: center; padding-bottom: 0.55em; }

.g-logo img { width: auto; height: 1.4em; }

.g-acct { display: flex; align-items: center; gap: 0.4em; margin-bottom: 0.55em; padding: 0.4em 0.45em; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 0.5em; }

.g-acct > i { font-size: 1.15em; color: #fff; }

.g-acct b { display: block; font-size: 0.72em; color: #fff; white-space: nowrap; }

.g-redact { display: block; width: 4.2em; height: 0.45em; margin-top: 0.3em; background: rgba(255, 255, 255, 0.45); border-radius: 1em; filter: blur(1.2px); }

.g-acct .g-redact + .g-redact { width: 3em; margin-top: 0.2em; opacity: 0.6; }

.g-nav { display: flex; align-items: center; gap: 0.5em; height: 1.75em; padding: 0 0.5em; font-size: 0.8em; white-space: nowrap; border-radius: 0.45em; }

.g-nav i { font-size: 1.15em; }

.g-nav.on { font-weight: 700; color: var(--g-ink); background: var(--g-teal); }

/* Main column */
.g-main { position: relative; display: grid; grid-template-rows: 2.6em 2.6em minmax(0, 1fr); min-width: 0; }

.g-top { display: flex; align-items: center; justify-content: flex-end; gap: 0.4em; padding: 0 1.2em; }

.g-top span { width: 1.55em; height: 1.55em; display: grid; place-items: center; color: var(--g-ink); background: var(--g-card); border: 1px solid var(--g-line); border-radius: 50%; }

.g-top span i { font-size: 0.85em; }

.g-top .is-ai { color: #fff; background: #4b2bb8; border-color: #4b2bb8; }

.g-top .is-me { color: #fff; background: #8cc37e; border-color: #8cc37e; }

.g-head { display: flex; align-items: flex-end; gap: 1.3em; padding: 0 1.2em; border-bottom: 1px solid var(--g-line); }

.g-title { padding-bottom: 0.42em; font-family: var(--font-heading); font-size: 1.1em; font-weight: 900; }

.g-tab { padding-bottom: 0.75em; font-size: 0.78em; color: var(--g-muted); }

.g-tab.on { font-weight: 700; color: var(--g-teal-dark); box-shadow: inset 0 -0.2em 0 var(--g-teal); }

.g-body { position: relative; min-height: 0; padding: 0.9em 1.2em; overflow: hidden; }

/* Shared bits */
.g-tools { display: flex; align-items: center; gap: 0.6em; height: 2em; margin-bottom: 0.8em; }

.g-input, .g-select, .g-date { display: flex; align-items: center; gap: 0.4em; height: 2em; padding: 0 0.6em; color: var(--g-muted); background: var(--g-card); border: 1px solid var(--g-line); border-radius: 0.45em; white-space: nowrap; }

.g-select { color: var(--g-ink); }

.g-select .ph-caret-down, .g-date .ph-caret-down { margin-inline-start: auto; }

.t { font-size: 0.78em; }

.g-chip { display: inline-flex; align-items: center; padding: 0.25em 0.7em; font-size: 0.72em; font-weight: 700; color: #1d5fd1; background: #e3eefc; border-radius: 1em; white-space: nowrap; }

.g-btn { display: inline-flex; align-items: center; gap: 0.35em; height: 2em; margin-inline-start: auto; padding: 0 0.8em; font-weight: 700; white-space: nowrap; background: var(--g-lemon); border: 0.1em solid var(--g-ink); border-radius: 0.45em; box-shadow: 0.15em 0.15em 0 var(--g-ink); }

.g-swap { display: inline-grid; }

.g-swap > * { grid-area: 1 / 1; }

.g-card { background: var(--g-card); border: 1px solid var(--g-line); border-radius: 0.6em; }

.g-tag { display: inline-flex; align-items: center; gap: 0.25em; padding: 0.15em 0.55em; font-size: 0.9em; font-weight: 700; white-space: nowrap; background: #eceee9; border-radius: 1em; }

.g-tag.wa { color: var(--g-wa); background: #dcf3e5; }

.g-tag.vip { color: #6b5200; background: var(--g-lemon); }

.g-tag.add { width: 1.6em; justify-content: center; padding: 0.15em 0; color: var(--g-muted); background: transparent; border: 1px dashed var(--g-muted); }

.g-av { width: 2em; height: 2em; flex-shrink: 0; display: inline-grid; place-items: center; font-weight: 700; color: var(--g-teal-dark); background: var(--g-teal-soft); border-radius: 50%; }

.g-toast {
  position: absolute;
  z-index: 25;
  top: 0.55em;
  inset-inline-start: 1.2em;
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.5em 0.85em;
  font-size: 0.78em;
  color: #fff;
  background: var(--g-side);
  border-radius: 0.6em;
  box-shadow: 0 0.4em 1.2em rgba(16, 42, 67, 0.25);
  opacity: 0;
}

.g-toast i { font-size: 1.2em; color: var(--g-lemon); }

/* Covers the body while the loop resets */
.g-fade { position: absolute; inset: 0; z-index: 20; pointer-events: none; background: var(--g-bg); animation: g-fade var(--dur) infinite; }

@keyframes g-fade { 0% { opacity: 1; } 4%, 95% { opacity: 0; } 100% { opacity: 1; } }

/* Cursor: a zero-size point placed with inset-inline-start/top */
.g-cursor { position: absolute; z-index: 30; top: 0; inset-inline-start: 0; width: 0; height: 0; }

.g-cursor svg { position: absolute; top: -0.13em; left: -0.27em; width: 1.6em; height: 1.6em; filter: drop-shadow(0 0.1em 0.15em rgba(0, 0, 0, 0.3)); }

.g-cursor::after { content: ''; position: absolute; top: -1em; left: -1em; width: 2em; height: 2em; background: rgba(18, 183, 178, 0.5); border-radius: 50%; opacity: 0; transform: scale(0); }

/* ==========================================================================
   Clip 1 — Contacts: a WhatsApp lead lands, gets tagged, record opens
   ========================================================================== */
.s-contacts .g-input { width: 12em; }

.g-table { overflow: hidden; }

.g-tr { display: grid; grid-template-columns: 1.6fr 1.2fr 1.6fr 1.2fr; align-items: center; gap: 0.5em; height: 2.1em; padding: 0 0.7em; border-top: 1px solid var(--g-line); }

.g-tr > span { display: flex; align-items: center; gap: 0.45em; min-width: 0; overflow: hidden; font-size: 0.74em; white-space: nowrap; text-overflow: ellipsis; }

.g-tr.is-head { height: 1.9em; font-weight: 700; color: var(--g-muted); background: #f1f0e6; border-top: 0; }

.g-tr .ltr { direction: ltr; }

.g-tr.is-new { height: 0; overflow: hidden; animation: c1-row var(--dur) infinite; }

.c1-tag { opacity: 0; transform: scale(0); animation: c1-tag var(--dur) infinite; }

.c1-n12 { animation: c1-before var(--dur) infinite; }

.c1-n13 { opacity: 0; animation: c1-after var(--dur) infinite; }

.s-contacts .g-toast { animation: c1-toast var(--dur) infinite; }

.g-panel {
  position: absolute;
  z-index: 15;
  inset-block: 0;
  inset-inline-end: 0;
  width: 15.5em;
  padding: 0.9em;
  background: var(--g-card);
  border-inline-start: 1px solid var(--g-line);
  box-shadow: 0 0 1.5em rgba(16, 42, 67, 0.18);
  transform: translateX(calc(var(--dir) * 105%));
  animation: c1-panel var(--dur) infinite;
}

.g-panel-head { display: flex; align-items: center; gap: 0.6em; margin-bottom: 0.8em; }

.g-panel-head .g-av { font-size: 1.1em; }

.g-panel-head b { display: block; font-size: 0.9em; }

.g-panel-head small { display: block; font-size: 0.7em; color: var(--g-muted); }

.g-field { display: flex; justify-content: space-between; gap: 0.5em; padding: 0.4em 0; font-size: 0.72em; border-top: 1px solid var(--g-line); }

.g-field span:first-child { color: var(--g-muted); }

.g-field .tags { display: flex; gap: 0.3em; }

.g-field .g-tag { font-size: 0.95em; }

.g-feed { margin-top: 0.7em; font-size: 0.7em; }

.g-feed b { display: block; margin-bottom: 0.4em; font-size: 1.05em; }

.g-feed li { display: flex; align-items: flex-start; gap: 0.45em; padding: 0.3em 0; list-style: none; }

.g-feed li i { margin-top: 0.1em; color: var(--g-teal-dark); }

.s-contacts .g-cursor { animation: c1-cursor var(--dur) infinite; }

.s-contacts .g-cursor::after { animation: c1-ring var(--dur) infinite; }

@keyframes c1-row {
  0%, 10% { height: 0; background: var(--g-lemon-soft); }
  16%, 48% { height: 2.1em; background: var(--g-lemon-soft); }
  56%, 100% { height: 2.1em; background: var(--g-teal-soft); }
}

@keyframes c1-before { 0%, 15% { opacity: 1; } 16%, 100% { opacity: 0; } }

@keyframes c1-after { 0%, 15% { opacity: 0; } 16%, 100% { opacity: 1; } }

@keyframes c1-toast {
  0%, 13% { opacity: 0; transform: translateY(-0.6em); }
  16%, 38% { opacity: 1; transform: none; }
  42%, 100% { opacity: 0; transform: translateY(-0.6em); }
}

@keyframes c1-tag {
  0%, 48% { opacity: 0; transform: scale(0); }
  52% { opacity: 1; transform: scale(1.15); }
  55%, 100% { opacity: 1; transform: scale(1); }
}

@keyframes c1-panel {
  0%, 64% { transform: translateX(calc(var(--dir) * 105%)); }
  70%, 100% { transform: none; }
}

@keyframes c1-cursor {
  0%, 20% { inset-inline-start: 30em; top: 23em; }
  40%, 47% { inset-inline-start: 41.3em; top: 11.85em; }
  58%, 66% { inset-inline-start: 15.2em; top: 11.85em; }
  80% { inset-inline-start: 26em; top: 18em; }
  100% { inset-inline-start: 30em; top: 23em; }
}

@keyframes c1-ring {
  0%, 44% { opacity: 0; transform: scale(0); }
  45% { opacity: 1; transform: scale(0.3); }
  50%, 61% { opacity: 0; transform: scale(1.3); }
  62% { opacity: 1; transform: scale(0.3); }
  67%, 100% { opacity: 0; transform: scale(1.3); }
}

/* ==========================================================================
   Clip 2 — Pipeline: drag a deal to "booked" (reminder fires), then to "won"
   Column pitch = (37.6em - 3 * 0.7em) / 4 + 0.7em = 9.575em
   ========================================================================== */
.s-pipe .g-select { width: 10em; }

.g-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.7em; height: calc(100% - 2.8em); }

.g-col { display: flex; flex-direction: column; gap: 0.5em; min-width: 0; }

.g-col-head { padding: 0.45em 0.6em; background: var(--g-card); border: 1px solid var(--g-line); border-radius: 0.5em; }

.g-col-head b { display: flex; align-items: center; justify-content: space-between; gap: 0.3em; font-size: 0.8em; white-space: nowrap; }

.g-cnt { min-width: 1.6em; padding: 0 0.4em; font-size: 0.8em; text-align: center; color: var(--g-muted); background: #eceee9; border-radius: 1em; }

.g-col-head small { display: block; font-size: 0.66em; color: var(--g-muted); white-space: nowrap; }

.g-col-body { position: relative; flex: 1; padding: 0.45em; background: rgba(255, 255, 255, 0.5); border: 0.1em solid var(--g-ink); border-radius: 0.6em; }

.g-deal { position: relative; height: 5.4em; padding: 0.55em 0.6em; background: var(--g-card); border: 1px solid var(--g-line); border-radius: 0.5em; box-shadow: 0 0.1em 0.3em rgba(16, 42, 67, 0.08); }

.g-deal + .g-deal { margin-top: 0.5em; }

.g-deal b { display: block; overflow: hidden; font-size: 0.78em; white-space: nowrap; text-overflow: ellipsis; }

.g-deal small { display: block; overflow: hidden; font-size: 0.64em; color: var(--g-muted); white-space: nowrap; text-overflow: ellipsis; }

.g-deal .val { margin-top: 0.35em; font-size: 0.7em; font-weight: 700; }

.g-deal .ico { display: flex; gap: 0.5em; margin-top: 0.45em; font-size: 0.72em; color: var(--g-muted); }

.g-deal.is-a { z-index: 5; animation: c2-move var(--dur) infinite; }

.g-deal.is-a .g-tag { position: absolute; bottom: 0.55em; inset-inline-end: 0.5em; font-size: 0.6em; opacity: 0; }

.c2-booked { color: var(--g-teal-dark); background: var(--g-teal-soft); animation: c2-booked var(--dur) infinite; }

.c2-won { color: #fff !important; background: var(--g-wa) !important; animation: c2-won var(--dur) infinite; }

.g-deal.is-d { animation: c2-up var(--dur) infinite; }

.c2-h1a { animation: c2-show-to30 var(--dur) infinite; }
.c2-h1b { opacity: 0; animation: c2-show-from30 var(--dur) infinite; }
.c2-h3a { animation: c2-hide-30-67 var(--dur) infinite; }
.c2-h3b { opacity: 0; animation: c2-show-30-67 var(--dur) infinite; }
.c2-h4a { animation: c2-show-to67 var(--dur) infinite; }
.c2-h4b { opacity: 0; animation: c2-show-from67 var(--dur) infinite; }

.g-col.is-won .g-col-head { position: relative; animation: c2-won-head var(--dur) infinite; }

.c2-plus { position: absolute; top: 9.4em; inset-inline-start: 0; width: 100%; text-align: center; font-size: 0.7em; font-weight: 900; color: var(--g-wa); opacity: 0; animation: c2-plus var(--dur) infinite; }

.s-pipe .g-toast.is-1 { animation: c2-toast1 var(--dur) infinite; }

.s-pipe .g-toast.is-2 { animation: c2-toast2 var(--dur) infinite; }

.s-pipe .g-cursor { top: 2.6em; inset-inline-start: 4.5em; animation: c2-cursor var(--dur) infinite; }

.s-pipe .g-cursor::after { animation: c2-ring var(--dur) infinite; }

@keyframes c2-move {
  0%, 15% { transform: none; box-shadow: 0 0.1em 0.3em rgba(16, 42, 67, 0.08); }
  17% { transform: rotate(2deg) scale(1.05); box-shadow: 0 0.8em 1.6em rgba(16, 42, 67, 0.25); }
  30% { transform: translateX(calc(var(--dir) * 19.15em)) rotate(2deg) scale(1.05); box-shadow: 0 0.8em 1.6em rgba(16, 42, 67, 0.25); }
  32%, 50% { transform: translateX(calc(var(--dir) * 19.15em)); box-shadow: 0 0.1em 0.3em rgba(16, 42, 67, 0.08); }
  52% { transform: translateX(calc(var(--dir) * 19.15em)) rotate(2deg) scale(1.05); box-shadow: 0 0.8em 1.6em rgba(16, 42, 67, 0.25); }
  65% { transform: translateX(calc(var(--dir) * 28.725em)) rotate(2deg) scale(1.05); box-shadow: 0 0.8em 1.6em rgba(16, 42, 67, 0.25); }
  67%, 100% { transform: translateX(calc(var(--dir) * 28.725em)); box-shadow: 0 0.1em 0.3em rgba(16, 42, 67, 0.08); background: #e7f7ec; border-color: var(--g-wa); }
}

@keyframes c2-booked { 0%, 31% { opacity: 0; } 33%, 64% { opacity: 1; } 66%, 100% { opacity: 0; } }

@keyframes c2-won { 0%, 66% { opacity: 0; transform: scale(0.6); } 69%, 100% { opacity: 1; transform: none; } }

@keyframes c2-up { 0%, 28% { transform: none; } 34%, 100% { transform: translateY(-5.9em); } }

@keyframes c2-show-to30 { 0%, 29% { opacity: 1; } 30%, 100% { opacity: 0; } }
@keyframes c2-show-from30 { 0%, 29% { opacity: 0; } 30%, 100% { opacity: 1; } }
@keyframes c2-hide-30-67 { 0%, 29% { opacity: 1; } 30%, 66% { opacity: 0; } 67%, 100% { opacity: 1; } }
@keyframes c2-show-30-67 { 0%, 29% { opacity: 0; } 30%, 66% { opacity: 1; } 67%, 100% { opacity: 0; } }
@keyframes c2-show-to67 { 0%, 66% { opacity: 1; } 67%, 100% { opacity: 0; } }
@keyframes c2-show-from67 { 0%, 66% { opacity: 0; } 67%, 100% { opacity: 1; } }

@keyframes c2-won-head { 0%, 66% { background: var(--g-card); } 68%, 100% { background: #e7f7ec; border-color: var(--g-wa); } }

@keyframes c2-plus {
  0%, 67% { opacity: 0; transform: translateY(0.6em); }
  70% { opacity: 1; transform: none; }
  84% { opacity: 1; transform: translateY(-0.6em); }
  88%, 100% { opacity: 0; transform: translateY(-0.8em); }
}

@keyframes c2-toast1 {
  0%, 32% { opacity: 0; transform: translateY(-0.6em); }
  35%, 50% { opacity: 1; transform: none; }
  53%, 100% { opacity: 0; transform: translateY(-0.6em); }
}

@keyframes c2-toast2 {
  0%, 68% { opacity: 0; transform: translateY(-0.6em); }
  71%, 90% { opacity: 1; transform: none; }
  93%, 100% { opacity: 0; transform: translateY(-0.6em); }
}

@keyframes c2-cursor {
  0%, 5% { transform: translate(calc(var(--dir) * 7em), 12em); }
  14%, 72% { transform: none; }
  86%, 100% { transform: translate(calc(var(--dir) * -3em), 9em); }
}

@keyframes c2-ring {
  0%, 14% { opacity: 0; transform: scale(0); }
  15% { opacity: 1; transform: scale(0.3); }
  20%, 49% { opacity: 0; transform: scale(1.3); }
  50% { opacity: 1; transform: scale(0.3); }
  55%, 100% { opacity: 0; transform: scale(1.3); }
}

/* ==========================================================================
   Clip 3 — Conversations: WhatsApp message, AI replies and books the slot
   ========================================================================== */
.g-inbox { display: grid; grid-template-columns: 13em minmax(0, 1fr); gap: 0.8em; height: 100%; }

.g-list { display: flex; flex-direction: column; overflow: hidden; }

.g-list .g-input { flex-shrink: 0; height: 2em; border-width: 0 0 1px; border-radius: 0; }

.g-conv { display: flex; flex-shrink: 0; align-items: center; gap: 0.5em; height: 3em; padding: 0 0.6em; overflow: hidden; border-bottom: 1px solid var(--g-line); }

.g-conv .g-av { position: relative; font-size: 0.8em; }

.g-conv .g-av i { font-size: 1.2em; }

.g-conv .g-av.wa { color: var(--g-wa); background: #dcf3e5; }

.g-conv .g-av.ig { color: #c13584; background: #f9e1ef; }

.g-conv .g-av.web { color: var(--g-teal-dark); }

.g-conv div { flex: 1; min-width: 0; }

.g-conv b { display: block; overflow: hidden; font-size: 0.72em; white-space: nowrap; text-overflow: ellipsis; }

.g-conv small { display: block; overflow: hidden; font-size: 0.64em; color: var(--g-muted); white-space: nowrap; text-overflow: ellipsis; }

.g-conv time { align-self: flex-start; margin-top: 0.7em; font-size: 0.58em; color: var(--g-muted); }

.g-conv.is-new { height: 0; border-bottom-width: 0; animation: c3-new var(--dur) infinite; }

.g-badge { display: grid; place-items: center; width: 1.5em; height: 1.5em; font-size: 0.6em; font-weight: 700; color: #fff; background: var(--g-wa); border-radius: 50%; animation: c3-badge var(--dur) infinite; }

.g-chat { position: relative; display: flex; flex-direction: column; overflow: hidden; }

.g-chat-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 0.4em; font-size: 0.78em; color: var(--g-muted); animation: c3-empty var(--dur) infinite; }

.g-chat-empty i { font-size: 2.4em; color: var(--g-line); }

.g-chat-live { display: flex; flex-direction: column; height: 100%; opacity: 0; animation: c3-live var(--dur) infinite; }

.g-chat-head { display: flex; flex-shrink: 0; align-items: center; gap: 0.5em; height: 2.6em; padding: 0 0.7em; border-bottom: 1px solid var(--g-line); }

.g-chat-head .g-av { font-size: 0.8em; color: var(--g-wa); background: #dcf3e5; }

.g-chat-head b { display: block; font-size: 0.76em; }

.g-chat-head small { display: block; font-size: 0.62em; color: var(--g-wa); }

.g-chat-head .g-chip { margin-inline-start: auto; color: #4b2bb8; background: #ece7fb; }

.g-msgs { position: relative; flex: 1; display: flex; flex-direction: column; gap: 0.5em; padding: 0.8em; background: #f3f1e6; }

.g-msg { align-self: flex-start; max-width: 78%; padding: 0.45em 0.65em; font-size: 0.72em; line-height: 1.45; background: var(--g-card); border: 1px solid var(--g-line); border-radius: 0.7em; opacity: 0; }

.g-msg.out { align-self: flex-end; background: #d9f5e3; border-color: transparent; }

.g-msg .who { display: flex; align-items: center; gap: 0.3em; margin-bottom: 0.15em; font-size: 0.85em; font-weight: 700; color: #4b2bb8; }

.g-slots { display: flex; gap: 0.35em; margin-top: 0.35em; }

.g-slots span { padding: 0.1em 0.55em; font-weight: 700; color: var(--g-teal-dark); border: 1px solid var(--g-teal-dark); border-radius: 1em; }

.g-slots .c3-pick { animation: c3-pick var(--dur) infinite; }

.c3-m1 { animation: c3-m1 var(--dur) infinite; }
.c3-m2 { animation: c3-m2 var(--dur) infinite; }
.c3-m3 { animation: c3-m3 var(--dur) infinite; }
.c3-m4 { animation: c3-m4 var(--dur) infinite; }

.g-compose { display: flex; flex-shrink: 0; align-items: center; gap: 0.5em; height: 2.3em; padding: 0 0.8em; color: var(--g-muted); background: var(--g-card); border-top: 1px solid var(--g-line); }

.g-compose .ph-paper-plane-right { margin-inline-start: auto; color: var(--g-teal-dark); }

html[dir='rtl'] .g-compose .ph-paper-plane-right { transform: scaleX(-1); }

.g-kpi strong .unit { font-size: 0.5em; font-weight: 700; }

.g-typing { position: absolute; bottom: 0.7em; inset-inline-end: 0.8em; display: flex; align-items: center; gap: 0.4em; padding: 0.4em 0.65em; font-size: 0.64em; color: #4b2bb8; background: var(--g-card); border-radius: 1em; opacity: 0; animation: c3-typing var(--dur) infinite; }

.g-typing span { width: 0.45em; height: 0.45em; background: #4b2bb8; border-radius: 50%; animation: g-dot 0.9s infinite; }

.g-typing span:nth-child(2) { animation-delay: 0.15s; }

.g-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes g-dot { 0%, 60%, 100% { opacity: 0.3; transform: none; } 30% { opacity: 1; transform: translateY(-0.25em); } }

.s-inbox .g-toast { animation: c3-toast var(--dur) infinite; }

.s-inbox .g-cursor { animation: c3-cursor var(--dur) infinite; }

.s-inbox .g-cursor::after { animation: c3-ring var(--dur) infinite; }

@keyframes c3-new {
  0%, 6% { height: 0; border-bottom-width: 0; background: var(--g-lemon-soft); }
  12%, 25% { height: 3em; border-bottom-width: 1px; background: var(--g-lemon-soft); }
  27%, 100% { height: 3em; border-bottom-width: 1px; background: var(--g-teal-soft); }
}

@keyframes c3-badge { 0%, 25% { opacity: 1; } 27%, 100% { opacity: 0; } }

@keyframes c3-empty { 0%, 26% { opacity: 1; } 28%, 100% { opacity: 0; } }

@keyframes c3-live { 0%, 26% { opacity: 0; } 28%, 100% { opacity: 1; } }

@keyframes c3-m1 { 0%, 28% { opacity: 0; transform: translateY(0.5em); } 31%, 100% { opacity: 1; transform: none; } }
@keyframes c3-m2 { 0%, 43% { opacity: 0; transform: translateY(0.5em); } 46%, 100% { opacity: 1; transform: none; } }
@keyframes c3-m3 { 0%, 54% { opacity: 0; transform: translateY(0.5em); } 57%, 100% { opacity: 1; transform: none; } }
@keyframes c3-m4 { 0%, 67% { opacity: 0; transform: translateY(0.5em); } 70%, 100% { opacity: 1; transform: none; } }

@keyframes c3-pick { 0%, 55% { color: var(--g-teal-dark); background: transparent; } 57%, 100% { color: #fff; background: var(--g-teal-dark); } }

@keyframes c3-typing { 0%, 33% { opacity: 0; } 35%, 42% { opacity: 1; } 44%, 58% { opacity: 0; } 60%, 66% { opacity: 1; } 68%, 100% { opacity: 0; } }

@keyframes c3-toast {
  0%, 71% { opacity: 0; transform: translateY(-0.6em); }
  74%, 91% { opacity: 1; transform: none; }
  94%, 100% { opacity: 0; transform: translateY(-0.6em); }
}

@keyframes c3-cursor {
  0%, 12% { inset-inline-start: 30em; top: 24em; }
  22%, 26% { inset-inline-start: 17.7em; top: 9.6em; }
  40%, 100% { inset-inline-start: 30em; top: 24em; }
}

@keyframes c3-ring {
  0%, 23% { opacity: 0; transform: scale(0); }
  24% { opacity: 1; transform: scale(0.3); }
  29%, 100% { opacity: 0; transform: scale(1.3); }
}

/* ==========================================================================
   Clip 4 — Dashboard: pick a period, numbers and charts fill in
   ========================================================================== */
@property --n { syntax: '<integer>'; inherits: false; initial-value: 0; }

@property --p { syntax: '<number>'; inherits: true; initial-value: 0; }

.s-dash .g-select { width: 9em; }

.g-date { position: relative; width: 8em; }

.g-menu { position: absolute; z-index: 6; top: 2.2em; inset-inline-start: 0; width: 8em; padding: 0.3em; background: var(--g-card); border: 1px solid var(--g-line); border-radius: 0.5em; box-shadow: 0 0.5em 1.2em rgba(16, 42, 67, 0.18); opacity: 0; transform: translateY(-0.4em); animation: c4-menu var(--dur) infinite; }

.g-menu span { display: flex; align-items: center; height: 1.7em; padding: 0 0.5em; color: var(--g-ink); border-radius: 0.35em; }

.g-menu .c4-hover { animation: c4-hover var(--dur) infinite; }

.c4-d7 { animation: c1-before var(--dur) infinite; }

.c4-d30 { opacity: 0; animation: c1-after var(--dur) infinite; }

.g-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8em; height: 5.6em; margin-bottom: 0.8em; }

.g-kpi { display: flex; flex-direction: column; justify-content: center; gap: 0.15em; padding: 0 0.9em; }

.g-kpi small { font-size: 0.72em; color: var(--g-muted); }

.g-kpi strong { font-family: var(--font-heading); font-size: 1.6em; font-weight: 900; line-height: 1.15; }

.g-kpi em { font-size: 0.64em; font-style: normal; font-weight: 700; color: var(--g-wa); }

.g-num { counter-reset: n var(--n); }

.g-num::before { content: counter(n); }

.c4-n128 { animation: c4-n128 var(--dur) infinite; }
.c4-n48 { animation: c4-n48 var(--dur) infinite; }
.c4-n64 { animation: c4-n64 var(--dur) infinite; }

.g-charts { display: grid; grid-template-columns: 2fr 1fr; gap: 0.8em; height: calc(100% - 9.2em); }

.g-chart { display: flex; flex-direction: column; min-width: 0; padding: 0.9em; }

.g-chart > b { flex-shrink: 0; height: 1.4em; margin-bottom: 0.6em; font-size: 0.78em; }

.g-bars { flex: 1; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); align-items: end; gap: 0.7em; padding-bottom: 0.2em; border-bottom: 1px solid var(--g-line); }

.g-bar { position: relative; height: var(--h); background: var(--g-teal); border-radius: 0.3em 0.3em 0 0; transform-origin: bottom; animation: c4-bar var(--dur) calc(var(--i) * 70ms) infinite backwards; }

.g-bar:nth-child(odd) { background: #7fd9d5; }

.g-bar.is-hot { background: var(--g-teal-dark); }

.g-tip { position: absolute; bottom: calc(100% + 0.5em); left: 50%; padding: 0.35em 0.6em; font-size: 0.62em; font-weight: 700; color: #fff; white-space: nowrap; background: var(--g-side); border-radius: 0.4em; opacity: 0; transform: translateX(-50%); animation: c4-tip var(--dur) infinite; }

.g-xlabels { display: grid; flex-shrink: 0; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 0.7em; height: 1.2em; padding-top: 0.25em; font-size: 0.58em; text-align: center; color: var(--g-muted); }

.g-donut-wrap { flex: 1; display: grid; place-items: center; align-content: center; gap: 0.6em; }

.g-donut { position: relative; width: 7.5em; aspect-ratio: 1; display: grid; place-items: center; background: conic-gradient(var(--g-teal) calc(var(--p) * 1%), #e6e8e1 0); border-radius: 50%; animation: c4-p var(--dur) infinite; }

.g-donut::before { content: ''; position: absolute; inset: 0.9em; background: var(--g-card); border-radius: 50%; }

.g-donut b { position: relative; font-family: var(--font-heading); font-size: 1.4em; font-weight: 900; counter-reset: p var(--n); animation: c4-n32 var(--dur) infinite; }

.g-donut b::before { content: counter(p) '%'; }

.g-donut-wrap small { font-size: 0.68em; color: var(--g-muted); }

.s-dash .g-cursor { animation: c4-cursor var(--dur) infinite; }

.s-dash .g-cursor::after { animation: c4-ring var(--dur) infinite; }

@keyframes c4-menu {
  0%, 8% { opacity: 0; transform: translateY(-0.4em); }
  10%, 15% { opacity: 1; transform: none; }
  17%, 100% { opacity: 0; transform: translateY(-0.4em); }
}

@keyframes c4-hover { 0%, 13% { background: transparent; } 14%, 100% { background: var(--g-teal-soft); } }

@keyframes c4-n128 { 0%, 17% { --n: 0; } 38%, 100% { --n: 128; } }
@keyframes c4-n48 { 0%, 17% { --n: 0; } 38%, 100% { --n: 48; } }
@keyframes c4-n64 { 0%, 17% { --n: 0; } 38%, 100% { --n: 64; } }
@keyframes c4-n32 { 0%, 20% { --n: 0; } 40%, 100% { --n: 32; } }

@keyframes c4-p { 0%, 20% { --p: 0; } 40%, 100% { --p: 32; } }

@keyframes c4-bar { 0%, 17% { transform: scaleY(0); } 32%, 100% { transform: scaleY(1); } }

@keyframes c4-tip {
  0%, 50% { opacity: 0; transform: translate(-50%, 0.4em); }
  53%, 82% { opacity: 1; transform: translate(-50%, 0); }
  85%, 100% { opacity: 0; transform: translate(-50%, 0.4em); }
}

@keyframes c4-cursor {
  0%, 2% { inset-inline-start: 30em; top: 22em; }
  7%, 8% { inset-inline-start: 24.8em; top: 7.1em; }
  12%, 15% { inset-inline-start: 23.6em; top: 11.15em; }
  30% { inset-inline-start: 33em; top: 20em; }
  46%, 84% { inset-inline-start: 27.7em; top: 24.5em; }
  100% { inset-inline-start: 30em; top: 22em; }
}

@keyframes c4-ring {
  0%, 7% { opacity: 0; transform: scale(0); }
  8% { opacity: 1; transform: scale(0.3); }
  12%, 14% { opacity: 0; transform: scale(1.3); }
  15% { opacity: 1; transform: scale(0.3); }
  20%, 100% { opacity: 0; transform: scale(1.3); }
}

@media (prefers-reduced-motion: reduce) {
  .g-typing span { animation: none; }
}
