/* =============================================================================
   Nim Platform — feature page template components
   Depends on the theme tokens/primitives (tokens.css ≡ abri/style.css).
   Sections: header mega · hero · story (sticky) · features (tabs) · highlights
             · proof · cta · faq · reveal · product scenes (mk-*)
   ========================================================================== */

/* ------------------------------------------------- Header (standalone demo only)
   Scoped to #site so these rules never touch the theme's own mega menu inside WordPress. */
#site .has-mega { position: relative; }
#site .mega {
  position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 110;
  width: min(560px, calc(100vw - 2 * var(--gutter)));
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 18px; opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
#site .has-mega.is-open > .mega { opacity: 1; visibility: visible; transform: translateY(0); }
#site .mega__col-title { display: block; font-size: .8rem; font-weight: 700; color: var(--label); margin: 0 10px 8px; }
#site .nav-main .mega__links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
#site .nav-main .mega__links > li { display: block; }
#site .nav-main .mega__links a { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--ink); font-weight: 500; width: 100%; }
#site .nav-main .mega__links a:hover, #site .nav-main .mega__links .current-menu-item > a { background: var(--p-50); color: var(--ink); }
#site .mega__ico { flex-shrink: 0; width: 36px; height: 36px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--p-50); color: var(--p-300); }
#site .mega__links a:hover .mega__ico, #site .mega__links .current-menu-item .mega__ico { background: var(--p-300); color: #fff; }
#site .mega__ico svg { width: 18px; height: 18px; }
#site .mega__body { display: flex; flex-direction: column; line-height: 1.5; }
#site .mega__item-title { font-weight: 700; font-size: .95rem; }
#site .mega__item-desc { font-size: .8rem; color: var(--ink-soft); }
#site .nav-main > ul > li.nav-main__cta-item { display: none; }

/* ------------------------------------------------------------------ Hero */
.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(1100px 460px at 85% -12%, var(--p-50), transparent 62%), radial-gradient(760px 380px at 8% 8%, var(--s-50), transparent 58%);
  padding-block: 84px 96px;
}
.hero__inner { display: grid; grid-template-columns: 1.08fr .92fr; gap: 56px; align-items: center; }
.hero h1 { margin-bottom: .5em; }
.hero--platform { padding-block: 72px 96px; }
.hero--platform .hero__inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: 56px; }
.hero--platform h1 { max-width: 22ch; }
.hero--platform h1 .accent { color: var(--p-300); }
.hero__lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 52ch; margin-bottom: 32px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 26px; }
.hero__notes { display: flex; flex-wrap: wrap; gap: 10px 26px; list-style: none; margin: 0; padding: 0; font-size: .93rem; color: var(--m-300); }
.hero__notes li { display: flex; align-items: center; gap: 7px; }
.hero__notes svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--p-300); }
.hero--platform .hero__media { box-shadow: none; background: none; border-radius: 0; overflow: visible; }
.hero--platform .hero__media .scene { box-shadow: var(--shadow-lg); aspect-ratio: 5 / 4; }
.hero--platform .hero__media .scene--wide { aspect-ratio: 4 / 3; }

/* ------------------------------------------------- Story (sticky stage) */
.story {
  --story-step: 100vh;                         /* scroll distance per state */
  --story-tail: .35;                           /* dwell after the last state (× step) */
  --story-in: 120px;                           /* incoming state slides up from here */
  --story-out: -56px;                          /* outgoing state drifts up to here */
  --stage-h: calc(100vh - var(--header-h));
  position: relative; background: #fff;
}
@supports (height: 100svh) {
  .story { --stage-h: calc(100svh - var(--header-h)); }
}
.story__intro { padding-block: var(--section-y) 8px; text-align: center; max-width: 860px; }
.story__claim { font-size: clamp(1.45rem, 1rem + 1.8vw, 2.35rem); line-height: 1.5; margin: 0; }
.story__track { position: relative; height: calc(var(--stage-h) + (var(--story-steps, 3) - 1 + var(--story-tail)) * var(--story-step)); }
.story__stage { position: sticky; top: var(--header-h); height: var(--stage-h); overflow: hidden; }
.story__frame { position: relative; height: 100%; max-width: var(--wrap); margin-inline: auto; }
.story__state {
  position: absolute; inset: 0; padding-inline: var(--gutter) calc(var(--gutter) + 40px);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: center;
  opacity: var(--o, 0);
  transform: translate3d(0, var(--y, 0px), 0);
  will-change: transform, opacity;
  transition: transform .14s linear, opacity .14s linear;   /* smooths discrete wheel steps */
}
.story__visual { width: min(100%, calc(var(--stage-h) - 200px)); margin-inline: auto; }
.story__copy { max-width: 30rem; }
.story__step { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font); font-weight: 800; font-size: 1rem; line-height: 1; color: var(--p-300); margin-bottom: 14px; direction: rtl; unicode-bidi: isolate; }
.story__step i { font-style: normal; color: var(--m-100); font-weight: 500; font-size: 1em; line-height: 1; }
.story__title { font-size: clamp(1.5rem, 1.1rem + 1.5vw, 2.25rem); line-height: 1.4; margin-bottom: .55em; }
.story__desc { color: var(--ink-soft); font-size: 1.08rem; margin: 0; }
.story__dots { position: absolute; inset-inline-end: var(--gutter); top: 50%; transform: translateY(-50%); z-index: 5; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.story__dot { width: 22px; height: 22px; display: grid; place-items: center; border: 0; background: none; padding: 0; cursor: pointer; border-radius: var(--radius-full); }
.story__dot span { width: 10px; height: 10px; border-radius: var(--radius-full); background: var(--m-75); transition: transform .25s var(--ease-out), background .25s ease, box-shadow .25s ease; }
.story__dot:hover span { background: var(--p-200); }
.story__dot[aria-current="step"] span { background: var(--p-300); transform: scale(1.35); box-shadow: 0 0 0 5px var(--brand-16); }
/* No JS: show every state in flow */
.story:not(.story--js) .story__track { height: auto; }
.story:not(.story--js) .story__stage { position: static; height: auto; overflow: visible; }
.story:not(.story--js) .story__state { position: relative; opacity: 1; transform: none; padding-block: 48px; }
.story:not(.story--js) .story__dots { display: none; }

/* --------------------------------------------------------- Feature tabs */
.tabs { display: grid; gap: 40px; }
.tabs__scroller { display: flex; justify-content: center; overflow-x: auto; scrollbar-width: none; padding-block: 4px; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
.tabs__scroller::-webkit-scrollbar { display: none; }
.tabs__list { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tabs__tab {
  border: 1px solid var(--line); background: #fff; color: var(--m-400); font-weight: 700; font-size: .95rem; line-height: 1;
  padding: 12px 20px; border-radius: var(--radius-full); cursor: pointer; white-space: nowrap;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .15s ease, box-shadow .2s ease;
}
.tabs__tab:hover { border-color: var(--p-75); color: var(--p-400); background: var(--p-50); }
.tabs__tab[aria-selected="true"] { background: var(--p-300); border-color: var(--p-300); color: #fff; box-shadow: var(--glow); }
.tabs__panels { display: grid; }
.tabs__panel {
  grid-area: 1 / 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: center;
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .35s var(--ease-out), transform .35s var(--ease-out), visibility 0s linear .35s;
}
.tabs__panel.is-active { opacity: 1; visibility: visible; transform: none; transition-delay: 0s, 0s, 0s; }
.tabs__copy h3 { font-size: clamp(1.35rem, 1rem + 1.2vw, 1.9rem); line-height: 1.45; max-width: 18ch; }
.tabs__copy p { color: var(--ink-soft); font-size: 1.05rem; max-width: 48ch; margin: 0; }
.tabs__visual { width: min(100%, 560px); margin-inline: auto; }

/* ------------------------------------------------------------- Proof */
.proof__grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 24px; align-items: stretch; }
.proof__stats { background: linear-gradient(140deg, var(--p-50), #fff 60%, var(--s-50)); border: 1px solid var(--p-75); border-radius: var(--radius-lg); padding: 34px 30px; display: flex; flex-direction: column; }
.proof__stats .eyebrow { align-self: flex-start; }
.proof__statlist { display: grid; gap: 22px; margin-top: 6px; flex: 1; align-content: space-evenly; }
.proof__stat { display: flex; flex-direction: column; }
.proof__num { font-size: clamp(2rem, 1.4rem + 1.6vw, 2.8rem); font-weight: 800; color: var(--p-300); line-height: 1.2; }
.proof__label { color: var(--ink-soft); font-size: .98rem; }
.proof__quote { margin: 0; padding: 34px 32px; border-radius: var(--radius-lg); justify-content: center; }
.proof__quote .quote__text { font-size: 1.2rem; line-height: 2; margin: 0 0 26px; padding: 0; flex-grow: 0; }
.proof__quote .quote__who > span:last-child { line-height: 1.5; }
.proof__logos { margin-top: 48px; }
/* The strip runs full-bleed like the theme's, so it escapes .wrap's gutters. */
.proof__logos { margin-inline: calc(var(--gutter) * -1); }
.proof__logos .logos__title { margin: 0; }
/* Wordmark fallback for a logo line that carries no image URL. */
.logos__item { font-weight: 800; font-size: 1.15rem; color: var(--m-100); letter-spacing: -.01em; white-space: nowrap; transition: color .2s ease; }
.logos__item:hover { color: var(--m-300); }

/* --------------------------------------------------------------- CTA */
.cta { padding-bottom: calc(var(--section-y) - 24px); }

/* ------------------------------------------------------------ Footer */
#site .site-footer .footer__top { grid-template-columns: 1.6fr repeat(3, minmax(140px, max-content)); }

/* --------------------------------------------------------------- FAQ */
.faqs__grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr); gap: 48px; align-items: start; }
.faqs__head h2 { font-size: clamp(1.4rem, 1rem + 1.3vw, 2rem); }
.faqs__head p { color: var(--ink-soft); margin: 0; }
.faq { max-width: none; margin: 0; }
.faq__h { margin: 0; font-size: inherit; line-height: inherit; }
.faq__panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .32s var(--ease-out); }
.faq__item.is-open .faq__panel { grid-template-rows: 1fr; }
.faq__panel > .faq__a { min-height: 0; overflow: hidden; padding-bottom: 0; transition: padding .32s var(--ease-out); }
.faq__item.is-open .faq__panel > .faq__a { padding-bottom: 22px; }
.faq__q:hover { color: var(--p-400); }

/* ------------------------------------------------------------ Reveal */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); }
.reveal--delay { transition-delay: .12s; }
.reveal.is-visible { opacity: 1; transform: none; }

/* =============================================================== Scenes
   Product visuals. Everything scales with the container (cqw → em). */
.scene {
  --sc-bg: linear-gradient(145deg, var(--p-50) 0%, #eef3fb 55%, #fdf3ea 100%);
  position: relative; width: 100%; aspect-ratio: 1 / 1; border-radius: var(--radius-lg); overflow: hidden;
  background: var(--sc-bg); border: 1px solid rgba(22, 74, 131, .08);
  container-type: inline-size; line-height: 1.6; color: var(--ink);
  direction: rtl; text-align: start;
  /* Flow layout: [top card] → window → [bottom card]. Nothing overlaps; the window takes the remaining height.
     NB: cqw resolves against the nearest *ancestor* container, so on .scene itself only % (of width) is safe;
     children may use cqw freely. */
  display: flex; flex-direction: column; justify-content: center; padding: 6% 7%;
}
.scene > * { font-size: clamp(8px, 2.9cqw, 13.5px); }   /* cqw here = the scene's content box */
/* Mockup chrome (window URLs, code, webhook rows) asks for --font-en. Manrope has no Persian
   glyphs, so inside a scene the stack falls back to Vazirmatn — never to a system font — for the
   Persian words that appear inside otherwise-Latin UI (e.g. the message body in an API sample). */
.scene { --font-en: "Manrope", "Vazirmatn", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.scene--warm { --sc-bg: linear-gradient(145deg, var(--s-50) 0%, #fff7f1 50%, var(--p-50) 100%); border-color: rgba(171, 113, 68, .1); }
.scene--wide { aspect-ratio: 4 / 3; padding: 5% 5%; }
.scene__window { display: flex; flex: 1 1 auto; min-height: 0; width: 100%; }   /* fills the space between the cards */
.scene__window > .mk-window { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.scene__window > .mk-window > .mk-window__body { flex: 1; min-height: 0; }
.scene__window .mk-panes { flex: 1; min-height: 0; }
.scene__window--auto { flex: 0 0 auto; }                                      /* window hugs its content; the scene centres the whole group */
.scene__window--bare { position: absolute; inset: 5cqw 8cqw 25cqw; }          /* hub: full-bleed diagram, clear of the bottom card */
.scene:has(.scene__window--bare) { justify-content: flex-end; }
.scene__float { position: relative; z-index: 2; width: 58%; max-width: 20em; flex: 0 0 auto; }
.scene__float--ts { order: -1; align-self: flex-start; margin-bottom: 3.5cqw; }
.scene__float--bs { align-self: flex-start; margin-top: 3.5cqw; }
.scene__float--be { align-self: flex-end; margin-top: 3.5cqw; }
/* Same width as the window above, flush with its edges (specificity beats the 66% phone rule). */
.scene .scene__float--match { width: 100%; max-width: none; align-self: stretch; }
.mk-card--float { box-shadow: var(--shadow-lg); border-color: rgba(22, 74, 131, .12); }

/* Window chrome */
.mk-window { background: #fff; border: 1px solid var(--line); border-radius: 1.2em; box-shadow: var(--shadow-lg); overflow: hidden; }
.mk-window__bar { display: flex; align-items: center; gap: .8em; padding: .7em 1em; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.mk-window__dots { display: inline-flex; gap: .35em; }
.mk-window__dots i { width: .7em; height: .7em; border-radius: 50%; background: #e6ecf0; }
.mk-window__dots i:nth-child(1) { background: #ff5f57; } .mk-window__dots i:nth-child(2) { background: #febc2e; } .mk-window__dots i:nth-child(3) { background: #28c840; }
.mk-window__url { flex: 1; text-align: center; font-family: var(--font-en); direction: ltr; font-size: .78em; color: var(--label); background: #fff; border: 1px solid var(--line); border-radius: .6em; padding: .2em .8em; max-width: 60%; margin-inline: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-window__body { padding: 1.1em; display: flex; flex-direction: column; gap: .9em; }
.mk-window__body:has(> .mk-panes) { padding: 0; }
/* Short content in a tall window: centre the whole stack instead of pinning the footnote to the
   bottom, which otherwise leaves a hole between the last block and the note. */
.mk-window__body { justify-content: center; }
.mk-window--stack .mk-window__body { gap: 1em; }

/* Panes */
.mk-panes { display: grid; }
.mk-panes--3 { grid-template-columns: 1.15fr 1.7fr 1.05fr; }
.mk-panes--2 { grid-template-columns: 1.15fr 1.9fr; }
.mk-panes--profile { grid-template-columns: 1fr 1.5fr; }
.mk-panes--builder { grid-template-columns: .9fr 1.8fr; }
.mk-pane { padding: 1em; display: flex; flex-direction: column; gap: .55em; min-width: 0; min-height: 0; overflow: hidden; }   /* long lists clip like a scrolled pane */
.mk-pane--chat > .mk-chat { flex: 1; min-height: 0; overflow: hidden; }                                                       /* composer stays pinned */
.mk-pane--side { background: var(--bg-soft); border-inline-end: 1px solid var(--line); }
.mk-pane--profile { border-inline-end: 0; border-inline-start: 1px solid var(--line); }
.mk-pane--chat { gap: .7em; }
.mk-pane--chat .mk-input { margin-top: auto; }   /* inside a chat pane the composer still sits at the bottom */

/* Text primitives */
.mk-label { font-size: .74em; color: var(--label); margin-top: .5em; }
.mk-head { display: flex; align-items: center; justify-content: space-between; gap: .8em; }
.mk-head__title { font-weight: 800; font-size: 1.02em; }
.mk-line { display: block; height: .55em; width: var(--w, 60%); border-radius: 1em; background: var(--m-50); }
.mk-time { font-size: .7em; color: var(--label); white-space: nowrap; display: inline-flex; align-items: center; gap: .3em; }
.mk-time .ico { width: 1.1em; height: 1.1em; }
.mk-kv { display: flex; align-items: center; gap: .5em; font-size: .8em; color: var(--m-400); }
.mk-field { display: flex; justify-content: space-between; gap: .5em; font-size: .78em; color: var(--label); border-bottom: 1px dashed var(--line); padding-bottom: .3em; }
.mk-field b { color: var(--ink); font-weight: 700; }

/* Rows / avatars / chips / tags */
.mk-row { display: flex; align-items: center; gap: .65em; padding: .5em .6em; border-radius: .7em; min-width: 0; }
.mk-row.is-active { background: #fff; box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.mk-row__body { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.45; }
.mk-row__title { font-weight: 700; font-size: .86em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-row__sub { font-size: .74em; color: var(--label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-flex; align-items: center; gap: .3em; }
.mk-row__meta { flex-shrink: 0; }
.mk-list { display: flex; flex-direction: column; gap: .15em; }
.mk-avatar { width: 2.4em; height: 2.4em; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .95em; color: #fff; flex-shrink: 0; }
.mk-avatar[data-c="1"] { background: #4a81c4; } .mk-avatar[data-c="2"] { background: #e07a3c; } .mk-avatar[data-c="3"] { background: #8b5cf6; } .mk-avatar[data-c="4"] { background: #10b981; } .mk-avatar[data-c="5"] { background: #123a66; }
.mk-avatar--lg { width: 3.6em; height: 3.6em; font-size: 1.2em; }
.mk-avatar--sm { width: 1.8em; height: 1.8em; font-size: .8em; }
.mk-avatar--bot { background: #8b5cf6 !important; }
.mk-avatar-wrap { position: relative; flex-shrink: 0; }
.mk-avatar-wrap .mk-chip--xs { position: absolute; inset-inline-end: -.25em; bottom: -.25em; box-shadow: 0 0 0 .15em #fff; }
.mk-chip { width: 1.9em; height: 1.9em; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; flex-shrink: 0; }
.mk-chip .ico { width: 1.05em; height: 1.05em; }
.mk-chip--xs { width: 1.2em; height: 1.2em; } .mk-chip--xs .ico { width: .7em; height: .7em; }
.mk-chip--sm { width: 1.6em; height: 1.6em; } .mk-chip--sm .ico { width: .9em; height: .9em; }
.mk-chip--whatsapp { background: #25d366; } .mk-chip--telegram { background: #229ed9; } .mk-chip--instagram { background: linear-gradient(135deg, #f58529, #dd2a7b 60%, #8134af); } .mk-chip--bale { background: #2dbf8a; } .mk-chip--web, .mk-chip--globe { background: var(--p-300); } .mk-chip--sms { background: #f59e0b; } .mk-chip--email { background: #64748b; } .mk-chip--phone { background: var(--p-300); } .mk-chip--cart { background: #10b981; } .mk-chip--edit { background: #8b5cf6; }
.mk-chip--plain { background: var(--p-50) !important; color: var(--p-400); }
.mk-chips { display: inline-flex; gap: .25em; }
.mk-tag { display: inline-flex; align-items: center; gap: .3em; font-size: .68em; font-weight: 700; padding: .3em .9em; border-radius: 1em; white-space: nowrap; line-height: 1.5; }
.mk-tag--brand { background: var(--p-50); color: var(--p-400); }
.mk-tag--green { background: #e6f8ef; color: #0f8a5f; }
.mk-tag--warm { background: var(--s-50); color: var(--s-400); }
.mk-tag--purple { background: #f1ecfe; color: #6d3fd8; }
.mk-tag--gray { background: var(--m-50); color: var(--m-300); }
.mk-tag--add { border: 1px dashed var(--m-75); color: var(--label); background: none; }
.mk-tag .ico { width: 1em; height: 1em; }
.mk-tags { display: flex; flex-wrap: wrap; gap: .35em; }
.mk-tags--filters { margin-top: -.2em; }
.mk-chan { display: flex; align-items: center; gap: .55em; font-size: .82em; color: var(--m-400); padding: .35em .5em; border-radius: .6em; }
.mk-chan .ico { width: 1.2em; height: 1.2em; color: var(--p-400); }
.mk-chan.is-active { background: var(--p-50); color: var(--p-500); font-weight: 700; }

/* Chat */
.mk-chat__head { display: flex; align-items: center; gap: .65em; padding-bottom: .7em; border-bottom: 1px solid var(--line); }
.mk-chat { display: flex; flex-direction: column; gap: .5em; }
.mk-chat--tall { flex: 1; min-height: 0; overflow: hidden; }
.mk-bubble { max-width: 82%; padding: .6em .9em; border-radius: 1em; font-size: .84em; line-height: 1.6; }
.mk-bubble--in { align-self: flex-start; background: var(--m-50); color: var(--ink); border-start-start-radius: .3em; }
.mk-bubble--out { align-self: flex-end; background: var(--p-300); color: #fff; border-start-end-radius: .3em; }
.mk-bubble--bot { align-self: flex-end; background: #f1ecfe; color: #4c2ba0; border-start-end-radius: .3em; position: relative; }
.mk-bubble--bot::before { content: "پاسخ خودکار هوش مصنوعی ✦"; display: block; font-size: .72em; color: #8b5cf6; margin-bottom: .2em; }
.mk-file { align-self: flex-end; display: inline-flex; align-items: center; gap: .5em; border: 1px solid var(--line); border-radius: .8em; padding: .45em .8em; font-size: .78em; background: #fff; }
.mk-file .ico { width: 1.1em; height: 1.1em; color: var(--danger); }
.mk-input { margin-top: .2em; display: flex; align-items: center; justify-content: space-between; gap: .6em; border: 1px solid var(--line); border-radius: 2em; padding: .45em .5em .45em 1em; font-size: .8em; color: var(--label); background: #fff; }
.mk-input i { width: 2em; height: 2em; border-radius: 50%; background: var(--p-300); color: #fff; display: grid; place-items: center; }
.mk-input i .ico { width: 1em; height: 1em; }
.mk-sep { display: flex; align-items: center; gap: .5em; font-size: .68em; color: var(--label); margin-block: .3em; }
.mk-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.mk-quick { display: flex; flex-wrap: wrap; gap: .35em; align-self: flex-end; }
.mk-quick span { font-size: .72em; font-weight: 700; color: var(--p-400); border: 1px solid var(--p-75); border-radius: 1em; padding: .25em .8em; background: #fff; }
.mk-profile { display: flex; flex-direction: column; align-items: center; gap: .4em; text-align: center; padding-block: .4em .6em; }
.mk-profile__name { font-weight: 800; font-size: .95em; }
.mk-note { display: flex; align-items: flex-start; gap: .5em; font-size: .76em; color: var(--m-400); background: var(--bg-soft); border: 1px solid var(--line); border-radius: .7em; padding: .55em .7em; }
.mk-note .ico { width: 1.1em; height: 1.1em; color: var(--p-400); flex-shrink: 0; margin-top: .2em; }
.mk-note--internal { background: #fff8e6; border-color: #f7e2a8; align-self: stretch; }
.mk-note--internal b { color: #9a6b00; }

/* Timeline */
.mk-timeline { display: flex; flex-direction: column; position: relative; }
.mk-timeline::before { content: ""; position: absolute; top: .9em; bottom: .9em; inset-inline-start: .78em; width: 2px; background: var(--line); }
.mk-event { display: flex; align-items: flex-start; gap: .7em; padding: .45em 0; position: relative; }
.mk-event .mk-chip { box-shadow: 0 0 0 .2em #fff; }
.mk-event__body { display: flex; flex-direction: column; line-height: 1.45; min-width: 0; }
.mk-event__text { font-size: .8em; font-weight: 600; }
.mk-event__time { font-size: .68em; color: var(--label); }

/* Rules / broadcast */
.mk-rules { display: flex; flex-direction: column; gap: .4em; }
.mk-rule { display: grid; grid-template-columns: 1fr auto 1.2fr; gap: .5em; align-items: center; font-size: .76em; }
.mk-rule > span, .mk-rule > em, .mk-rule > b { border: 1px solid var(--line); border-radius: .5em; padding: .35em .6em; background: #fff; font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-rule > em { color: var(--label); }
.mk-rule > b { color: var(--p-500); font-weight: 700; }
.mk-rule--add { display: flex; gap: .4em; color: var(--p-400); font-weight: 700; }
.mk-rule--add .ico { width: 1.1em; height: 1.1em; }
.mk-count { display: flex; align-items: center; gap: .6em; background: var(--p-50); border-radius: .8em; padding: .6em .9em; }
.mk-count b { font-size: 1.4em; font-weight: 800; color: var(--p-500); }
.mk-count span { font-size: .78em; color: var(--p-400); }
.mk-count .mk-spark { width: 5em; height: 2em; margin-inline-start: auto; }
.mk-compose { border: 1px solid var(--line); border-radius: .9em; overflow: hidden; }
.mk-compose__text { padding: .8em .9em; font-size: .82em; line-height: 1.8; }
.mk-compose__text i { font-style: normal; background: var(--s-50); color: var(--s-400); border-radius: .4em; padding: 0 .4em; font-weight: 700; }
.mk-compose__foot { display: flex; align-items: center; gap: .5em; padding: .55em .8em; background: var(--bg-soft); border-top: 1px solid var(--line); font-size: .74em; color: var(--label); }
.mk-compose__foot .mk-btn { margin-inline-start: auto; }

/* Buttons / toggles / progress */
.mk-btn { display: inline-flex; align-items: center; gap: .35em; font-size: .74em; font-weight: 700; padding: .5em 1em; border-radius: 1em; white-space: nowrap; line-height: 1.4; }
.mk-btn--primary { background: var(--p-300); color: #fff; box-shadow: 0 .3em .8em rgba(29, 95, 168, .25); }
.mk-btn--ghost { background: #fff; color: var(--p-400); border: 1px solid var(--p-75); }
.mk-btn .ico { width: 1.1em; height: 1.1em; }
.mk-toggle { width: 2.4em; height: 1.35em; border-radius: 1em; background: var(--m-75); position: relative; display: inline-block; flex-shrink: 0; }
.mk-toggle i { position: absolute; top: .15em; inset-inline-start: .15em; width: 1.05em; height: 1.05em; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: inset-inline-start .2s; }
.mk-toggle.is-on { background: var(--p-300); }
.mk-toggle.is-on i { inset-inline-start: 1.2em; }
.mk-progress { display: block; height: .5em; border-radius: 1em; background: var(--m-50); overflow: hidden; width: 100%; }
.mk-progress i { display: block; height: 100%; width: var(--v, 50%); background: var(--p-300); border-radius: 1em; }
.mk-progress.is-green i { background: #10b981; } .mk-progress.is-warm i { background: var(--s-300); } .mk-progress.is-gray i { background: var(--m-75); }
.mk-dot { width: .6em; height: .6em; border-radius: 50%; background: var(--m-75); display: inline-block; margin-inline-end: .3em; }
.mk-dot.is-on { background: #10b981; }

/* Grids / tiles */
.mk-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6em; }
.mk-grid--apps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mk-tile { display: flex; flex-direction: column; align-items: center; gap: .3em; text-align: center; border: 1px solid var(--line); border-radius: .9em; padding: .9em .6em .8em; background: #fff; }
.mk-tile__name { font-weight: 700; font-size: .82em; }
.mk-tile__sub { font-size: .68em; color: var(--label); }
.mk-tile .mk-toggle { margin-top: .3em; }
.mk-tile--app > .ico { width: 1.8em; height: 1.8em; color: var(--p-400); background: var(--p-50); border-radius: .6em; padding: .35em; box-sizing: content-box; }
.mk-tile--app .mk-btn { margin-top: .2em; }
.mk-search { display: inline-flex; align-items: center; gap: .4em; border: 1px solid var(--line); border-radius: 1em; padding: .3em .8em; font-size: .74em; color: var(--label); }
.mk-search .ico { width: 1.1em; height: 1.1em; }

/* Routing / agents */
.mk-route { display: flex; flex-direction: column; gap: .3em; }
.mk-route__in .mk-row { background: var(--bg-soft); border: 1px solid var(--line); }
.mk-route__arrow { display: grid; place-items: center; color: var(--m-75); }
.mk-route__arrow .ico { width: 1.3em; height: 1.3em; }
.mk-route__rule { display: flex; align-items: center; gap: .6em; font-size: .78em; color: var(--p-500); background: var(--p-50); border-radius: .8em; padding: .6em .9em; line-height: 1.6; }
.mk-route__rule .ico { width: 1.2em; height: 1.2em; flex-shrink: 0; }
.mk-agents { display: flex; flex-direction: column; gap: .35em; }
.mk-agent { display: flex; align-items: center; gap: .6em; padding: .5em .7em; border-radius: .8em; border: 1px solid var(--line); background: #fff; }
.mk-agent.is-picked { border-color: #a7e3cb; background: #f2fbf7; }
.mk-agent .mk-row__body { gap: .3em; }
.mk-agent__status { font-size: .72em; color: var(--label); display: inline-flex; align-items: center; white-space: nowrap; }

/* Flow builder */
.mk-flow { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
.mk-node { display: flex; align-items: center; gap: .6em; border: 1px solid var(--line); border-radius: .9em; padding: .55em .8em; background: #fff; box-shadow: var(--shadow-sm); }
.mk-node__ico { width: 2.2em; height: 2.2em; border-radius: .6em; display: grid; place-items: center; background: var(--p-50); color: var(--p-400); flex-shrink: 0; }
.mk-node__ico .ico { width: 1.2em; height: 1.2em; }
.mk-node--cond .mk-node__ico { background: #f1ecfe; color: #6d3fd8; }
.mk-node__body { display: flex; flex-direction: column; line-height: 1.4; min-width: 0; }
.mk-node__type { font-size: .66em; color: var(--label); font-weight: 700; }
.mk-node__label { font-size: .82em; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-node--sm { padding: .45em .6em; }
.mk-node--sm .mk-node__ico { width: 1.8em; height: 1.8em; }
.mk-flow__line { width: 2px; height: 1.1em; background: var(--m-75); margin-inline: auto; }
.mk-flow__split { display: grid; grid-template-columns: 1fr 1fr; gap: .8em; margin-top: 1em; position: relative; }
.mk-flow__split::before { content: ""; position: absolute; top: -1em; inset-inline: 25%; height: 1em; border: 2px solid var(--m-75); border-bottom: 0; border-radius: .6em .6em 0 0; }
.mk-flow__branch { display: flex; flex-direction: column; gap: .5em; position: relative; }
.mk-flow__lbl { align-self: center; font-size: .68em; font-weight: 800; color: var(--label); background: var(--m-50); border-radius: 1em; padding: .1em .8em; }
.mk-flow__lbl.is-yes { color: #0f8a5f; background: #e6f8ef; }

/* Tasks */
.mk-task { border: 1px solid var(--line); border-radius: .9em; padding: .8em .9em; display: flex; flex-direction: column; gap: .45em; background: #fff; box-shadow: var(--shadow-sm); }
.mk-task--dim { opacity: .7; }
.mk-task__title { font-weight: 800; font-size: .9em; }
.mk-task__foot { display: flex; align-items: center; gap: .5em; font-size: .72em; color: var(--label); margin-top: .3em; }
.mk-task__foot .mk-time { margin-inline-start: auto; }
.mk-check { display: flex; align-items: center; gap: .5em; font-size: .82em; }
.mk-check i { width: 1.25em; height: 1.25em; border-radius: .35em; border: 1.5px solid var(--m-75); display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.mk-check i .ico { width: .8em; height: .8em; opacity: 0; }
.mk-check.is-on i { background: var(--p-300); border-color: var(--p-300); }
.mk-check.is-on i .ico { opacity: 1; }
.mk-task .mk-check.is-on span { color: var(--label); text-decoration: line-through; }
.mk-task > .mk-tag { align-self: flex-start; }

/* KPIs / charts */
.mk-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5em; }
.mk-kpis--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mk-kpi { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: .8em; padding: .6em .7em; background: #fff; line-height: 1.3; }
.mk-kpi__num { font-weight: 800; font-size: 1.25em; color: var(--ink); }
.mk-kpi__label { font-size: .66em; color: var(--label); }
.mk-kpi__delta { font-size: .66em; font-weight: 700; margin-top: .2em; }
.mk-kpi__delta.is-up { color: #0f8a5f; } .mk-kpi__delta.is-down { color: #0f8a5f; }
.mk-chart { border: 1px solid var(--line); border-radius: .9em; padding: .8em .9em; background: #fff; }
.mk-chart__head { display: flex; justify-content: space-between; align-items: center; font-size: .76em; color: var(--m-400); margin-bottom: .6em; }
.mk-chart__head b { color: var(--p-500); font-size: 1.1em; }
.mk-legend { display: inline-flex; align-items: center; gap: .4em; font-size: .9em; color: var(--label); }
.mk-legend i { width: .7em; height: .7em; border-radius: .2em; display: inline-block; }
.mk-legend i.is-brand { background: var(--p-300); } .mk-legend i.is-warm { background: var(--s-300); }
.mk-bars { display: flex; align-items: flex-end; gap: .55em; height: 7em; }
.mk-chart--sm .mk-bars { height: 4.2em; }
.mk-bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: .3em; min-width: 0; }
.mk-bar i { display: block; width: 100%; height: var(--h, 40%); border-radius: .35em .35em .1em .1em; background: linear-gradient(180deg, var(--p-200), var(--p-300)); }
.mk-bar.is-accent i { background: linear-gradient(180deg, var(--s-200), var(--s-300)); }
.mk-bar b { font-size: .62em; color: var(--label); font-weight: 600; white-space: nowrap; }
.mk-spark { width: 100%; height: 4.5em; display: block; transform: scaleX(-1); /* time flows right→left in RTL */ }
.mk-spark__area { fill: rgba(29, 95, 168, .12); }
.mk-spark__line { fill: none; stroke: var(--p-300); stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.mk-trend { border: 1px solid var(--line); border-radius: .9em; padding: .8em .9em .5em; background: #fff; }
.mk-trend__foot { display: flex; justify-content: space-between; font-size: .66em; color: var(--label); margin-top: .3em; }
.mk-table { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: .9em; overflow: hidden; background: #fff; }
.mk-table__row { display: grid; grid-template-columns: auto 1.4fr 1fr 1fr 1fr; align-items: center; gap: .5em; padding: .5em .8em; font-size: .78em; border-top: 1px solid var(--line); }
.mk-table__row:first-child { border-top: 0; }
.mk-table__row--head { grid-template-columns: 2.6fr 1fr 1fr 1fr; background: var(--bg-soft); color: var(--label); font-size: .7em; font-weight: 700; }
.mk-table__name { font-weight: 700; display: inline-flex; align-items: center; gap: .4em; }
.mk-table__name .ico { width: 1em; height: 1em; color: var(--p-400); }
.mk-table--sla .mk-table__row { grid-template-columns: 1.4fr 1fr 1.2fr 1.3fr; }
.mk-table--perm .mk-table__row { grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr; }
.mk-table--perm .mk-table__row--head { grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr; }
.mk-table--perm .mk-table__row > span:not(.mk-table__name) { display: flex; justify-content: center; }
.mk-donut { --v: 75; width: 6.5em; height: 6.5em; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; background: conic-gradient(var(--p-300) calc(var(--v) * 1%), var(--m-50) 0); position: relative; }
.mk-donut::before { content: ""; position: absolute; inset: 1em; border-radius: 50%; background: #fff; }
.mk-donut__num { position: relative; font-weight: 800; font-size: 1.15em; color: var(--p-500); }
.mk-csat { display: flex; align-items: center; gap: 1em; }
.mk-csat__bars { flex: 1; display: flex; flex-direction: column; gap: .45em; }
.mk-csat__row { display: grid; grid-template-columns: 3.2em 1fr 2.2em; align-items: center; gap: .5em; font-size: .74em; color: var(--m-400); }
.mk-csat__row b { text-align: end; }
.mk-stars { color: #f5b301; font-size: .8em; letter-spacing: .05em; white-space: nowrap; }
.mk-stars i { font-style: normal; color: var(--m-50); }

/* Code / webhook */
.mk-code { background: var(--dark); color: #d7e6ec; border-radius: .9em; overflow: hidden; }
.mk-code__bar { display: flex; align-items: center; gap: .35em; padding: .55em .8em; background: var(--dark-2); }
.mk-code__bar span { width: .65em; height: .65em; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.mk-code__bar b { margin-inline-start: auto; font-size: .7em; color: var(--on-dark); font-weight: 600; }
.mk-code pre { margin: 0; padding: .8em 1em; font-family: var(--font-en); font-size: .78em; line-height: 1.7; white-space: pre; overflow: hidden; }
.c-k { color: #ffb86b; font-weight: 700; } .c-p { color: #8be9fd; } .c-s { color: #bd93f9; } .c-v { color: #b6f2c0; }
.mk-webhook { border: 1px solid var(--line); border-radius: .9em; padding: .7em .9em; background: #fff; display: flex; flex-direction: column; gap: .35em; }
.mk-webhook__head { display: flex; align-items: center; gap: .5em; font-size: .8em; font-weight: 700; margin-bottom: .2em; }
.mk-webhook__head .ico { width: 1.1em; height: 1.1em; color: var(--s-300); }
.mk-webhook__head .mk-tag { margin-inline-start: auto; font-family: var(--font-en); direction: ltr; }
.mk-webhook__row { display: flex; gap: .6em; font-size: .74em; }
.mk-webhook__row span { color: var(--label); font-family: var(--font-en); min-width: 4.2em; }
.mk-webhook__row b { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Hub */
.mk-hub { position: absolute; inset: 0; }
/* A radial diagram only looks right on a SQUARE stage: on a wider box the ring becomes an ellipse
   and the spokes come out uneven. This variant keeps the stage square and centres it, so every
   tile sits at the same distance from the core. */
.scene__hub { flex: 1 1 auto; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.mk-hub--square { position: relative; inset: auto; width: 100%; aspect-ratio: 1; height: auto; max-height: 100%; }
.mk-hub--square .mk-app { width: 5.2em; }
.mk-hub__lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.mk-hub__lines line { stroke: var(--p-75); stroke-width: .35; stroke-dasharray: 1.2 1.2; vector-effect: non-scaling-stroke; }
.mk-hub__core { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 8.5em; height: 8.5em; border-radius: 50%; background: #fff; box-shadow: var(--shadow-lg), 0 0 0 1.2em rgba(29, 95, 168, .08); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2em; font-weight: 800; color: var(--p-500); }
.mk-hub__core .ico { width: 3em; height: 3em; color: var(--p-300); }
.mk-app { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); width: 5.6em; display: flex; flex-direction: column; align-items: center; gap: .3em; background: #fff; border: 1px solid var(--line); border-radius: .9em; padding: .7em .4em; box-shadow: var(--shadow); font-size: .9em; font-weight: 700; text-align: center; line-height: 1.3; }
.mk-app .ico { width: 1.6em; height: 1.6em; color: var(--p-400); }
.mk-app span { font-size: .78em; }

/* Log / sync */
.mk-log { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: .9em; overflow: hidden; background: #fff; }
.mk-log__row { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: .6em; padding: .55em .8em; border-top: 1px solid var(--line); font-size: .78em; }
.mk-log__row:first-child { border-top: 0; }
.mk-log__ico { width: 1.9em; height: 1.9em; border-radius: .5em; display: grid; place-items: center; background: var(--p-50); color: var(--p-400); }
.mk-log__ico.is-warm { background: var(--s-50); color: var(--s-400); }
.mk-log__ico .ico { width: 1em; height: 1em; }
.mk-log__text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Mini (floating card content) */
.mk-mini { display: flex; align-items: center; gap: .7em; }
.mk-mini__ico { width: 2.4em; height: 2.4em; border-radius: .7em; display: grid; place-items: center; background: var(--p-50); color: var(--p-400); flex-shrink: 0; }
.mk-mini__ico.is-green { background: #e6f8ef; color: #0f8a5f; } .mk-mini__ico.is-warm { background: var(--s-50); color: var(--s-400); } .mk-mini__ico.is-purple { background: #f1ecfe; color: #6d3fd8; }
.mk-mini__ico .ico { width: 1.2em; height: 1.2em; }
.mk-card { background: #fff; border: 1px solid var(--line); border-radius: 1em; padding: .8em .9em; box-shadow: var(--shadow); }

/* Forms */
.mk-form { display: flex; flex-direction: column; gap: .5em; }
.mk-form__row { display: grid; grid-template-columns: 1fr 1.3fr; gap: .6em; align-items: center; }
.mk-form__label { font-size: .8em; font-weight: 700; display: flex; flex-direction: column; line-height: 1.3; }
.mk-form__label em { font-style: normal; font-weight: 500; font-size: .8em; color: var(--label); }
.mk-form__input { border: 1px solid var(--line); border-radius: .6em; padding: .45em .7em; font-size: .78em; background: #fff; }

/* ===================================================== Responsive
   Breakpoints follow the theme: 1024 (tablet) / 860 (nav) / 700 (mobile) */
@media (max-width: 1024px) {
  .hero--platform .hero__inner { grid-template-columns: 1fr; gap: 40px; }
  .hero--platform .hero__media { max-width: 720px; margin-inline: auto; width: 100%; }
  .hero--platform h1 { max-width: none; }
  .story__state { gap: 40px; padding-inline: var(--gutter) calc(var(--gutter) + 36px); }
  .story__visual { width: min(100%, calc(var(--stage-h) - 140px)); }
  .tabs__panel { gap: 36px; }
  .proof__grid { grid-template-columns: 1fr; }
  .faqs__grid { grid-template-columns: 1fr; gap: 28px; }
  #site .nav-main .mega__links { grid-template-columns: 1fr; }
  #site .site-footer .footer__top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  #site .nav-main > ul > li.nav-main__cta-item { display: block; margin-top: 12px; }
  #site .nav-main a.nav-main__cta { width: 100%; justify-content: center; background: var(--p-300); color: #fff; padding: 15px 30px; border-radius: var(--radius-full); }
  #site .nav-main a.nav-main__cta:hover { background: var(--p-400); color: #fff; }
  #site .mega { position: static; width: auto; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 4px 0 8px 12px; display: none; }
  #site .has-mega.is-open > .mega { display: block; }
  #site .mega__col-title { display: none; }

  /* Story: recomposed for touch — visual above, copy below, same scroll model */
  .story { --story-step: 85vh; --story-tail: .3; --story-in: 72px; --story-out: -36px; }
  .story__intro { padding-top: 56px; }
  .story__state { grid-template-columns: 1fr; grid-template-rows: auto auto; gap: 18px; align-content: center; padding-inline: var(--gutter); padding-block: 20px 60px; }
  .story__visual { width: min(100%, calc(var(--stage-h) * .5), 420px); }
  .story__copy { max-width: none; text-align: center; margin-inline: auto; }
  .story__title { font-size: 1.45rem; }
  .story__desc { font-size: .98rem; }
  /* Dots below the content stack (image + copy), not overlapping the top of the picture */
  .story__dots { inset-inline-start: auto; top: auto; bottom: 16px; left: 50%; transform: translateX(-50%); flex-direction: row; gap: 10px; }
  .tabs__panel { grid-template-columns: 1fr; gap: 24px; }
  .tabs__copy { text-align: center; }
  .tabs__copy h3, .tabs__copy p { margin-inline: auto; }
  .tabs__visual { width: min(100%, 460px); }
}
@media (max-width: 700px) {
  .hero--platform { padding-block: 48px 64px; }
  .hero--platform .hero__media .scene { aspect-ratio: 1 / 1; }   /* more height for the product scene on phones */
  .hero__copy { text-align: center; }
  .hero__lead { margin-inline: auto; font-size: 1rem; }
  .hero__cta, .hero__notes { justify-content: center; }
  .hero__cta .btn { flex: 1 1 auto; }
  .story__claim { font-size: 1.35rem; }
  .story__state { padding-block: 56px 16px; gap: 16px; }
  .story__visual { width: min(100%, calc(var(--stage-h) * .46)); }
  .tabs__list { flex-wrap: nowrap; justify-content: flex-start; }
  .tabs__scroller { justify-content: flex-start; }
  .proof__stats, .proof__quote { padding: 26px 22px; }
  .proof__num { font-size: 1.9rem; }
  #site .site-footer .footer__top { grid-template-columns: 1fr; }
  .scene__float { width: 66%; }
  .mk-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mk-kpis--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mk-panes--3 { grid-template-columns: 1.15fr 1.7fr; }
  .mk-pane--profile { display: none; }
}
@media (max-height: 640px) and (min-width: 861px) {
  .story__visual { width: min(100%, calc(var(--stage-h) - 120px)); }
  .story__title { font-size: 1.5rem; }
}

/* ------------------------------------------------------------- Motion */
@media (prefers-reduced-motion: reduce) {
  /* The marquee is decoration, not content: hold it still and let the row sit where it is. */
  .logos__marquee.is-ready .logos__track { animation: none; }
  .story__state { transition: opacity .2s linear; transform: none !important; }
  .story__dot span, .tabs__panel, .faq__panel, .reveal, .btn, .card, .mk-toggle i { transition: none !important; }
  .mk-hub__ring { animation: none; opacity: .5; }
  .tabs__panel { transform: none; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ================================================ Concept-first scene primitives
   Frames: phone (customer's view) · duo (window + phone) · stack (diagram/cards) */
.scene__stack { display: flex; flex-direction: column; justify-content: center; flex: 1 1 auto; min-height: 0; width: 100%; }
.scene__phone { display: flex; justify-content: center; align-items: center; flex: 1 1 auto; min-height: 0; }
.scene__duo { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1.2em; align-items: center; flex: 1 1 auto; min-height: 0; width: 100%; }
.scene__duo--rev { grid-template-columns: 1fr 1.5fr; }
.scene__duo-main { min-width: 0; min-height: 0; display: flex; }
.scene__duo-main > .mk-window, .scene__duo-main > .mk-card { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.scene__duo-main > .mk-window > .mk-window__body { flex: 1; min-height: 0; }
.scene__duo-side { min-width: 0; display: flex; justify-content: center; }
.mk-card--panel { padding: 1em; gap: .9em; }
.mk-phone { width: 100%; max-width: 15.5em; background: #fff; border: .35em solid var(--dark); border-radius: 2.2em; padding: .9em .7em .8em; box-shadow: var(--shadow-lg); position: relative; }
.scene__phone .mk-phone { max-width: 22em; font-size: 1.08em; }
.mk-phone__notch { width: 5em; height: .9em; background: var(--dark); border-radius: 0 0 .8em .8em; margin: -.9em auto .6em; }
.mk-phone__bar { text-align: center; font-size: .78em; font-weight: 700; color: var(--ink); padding-bottom: .5em; border-bottom: 1px solid var(--line); margin-bottom: .6em; }
.mk-phone__body { display: flex; flex-direction: column; gap: .5em; }
.mk-phone .mk-bubble { max-width: 92%; }
.mk-ticks { font-size: .66em; color: var(--label); align-self: flex-end; }
.mk-rate { display: flex; justify-content: center; gap: .8em; padding: .3em 0; }
.mk-rate span { font-size: 1.6em; opacity: .45; }
.mk-rate span.is-on { opacity: 1; transform: scale(1.25); }
/* Survey card (csat): the customer's rating request, sitting under the report window */
.mk-survey { display: flex; flex-direction: column; gap: .5em; }
.mk-survey__head { display: flex; align-items: center; gap: .4em; font-size: .72em; color: var(--label); }
.mk-survey__head b { color: var(--ink); font-size: 1.05em; }
.mk-survey__head .mk-time { margin-inline-start: auto; }
.mk-survey .mk-bubble { max-width: 78%; font-size: .78em; }
.mk-survey .mk-rate { padding: 0; }
.mk-survey .mk-rate span { font-size: 1.35em; }
.mk-dist { display: flex; flex-direction: column; gap: .3em; }
.mk-dist__row { display: grid; grid-template-columns: 2.4em 1fr 2.6em; align-items: center; gap: .5em; font-size: .72em; color: var(--label); }
.mk-dist__row b { color: var(--ink); text-align: end; }
/* Device shot: tighter padding so the phone reads as the subject, plus a grounding shadow. */
.scene--device { padding: 4% 7%; }
.scene--device .scene__phone { position: relative; }
.scene--device .scene__phone::after {
  content: ""; position: absolute; inset-inline: 34%; bottom: 2%; height: 4%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(16, 42, 55, .28), transparent 72%);
  filter: blur(4px);
}

/* ---- Device frame: a phone that actually looks like one (≈ 1 : 2), with real messenger chrome */
.mk-device { position: relative; height: 100%; aspect-ratio: 1 / 2.02; width: auto; max-width: 100%; background: var(--dark); border-radius: 2.4em; padding: .28em; box-shadow: var(--shadow-lg), 0 0 0 .08em rgba(255, 255, 255, .35) inset; }
.mk-device__screen { height: 100%; display: flex; flex-direction: column; background: #fff; border-radius: 2.15em; overflow: hidden; }
.mk-device__notch { position: absolute; top: .28em; left: 50%; transform: translateX(-50%); width: 34%; height: 1.25em; background: var(--dark); border-radius: 0 0 .9em .9em; }
.mk-status { display: flex; align-items: center; justify-content: space-between; padding: .5em .95em .2em; font-size: .6em; font-weight: 800; color: var(--ink); flex-shrink: 0; }
.mk-status__icons { display: inline-flex; align-items: flex-end; gap: .3em; }
.mk-sig { width: .8em; height: .62em; background:
    linear-gradient(var(--ink), var(--ink)) 0 100% / .17em .28em no-repeat,
    linear-gradient(var(--ink), var(--ink)) 50% 100% / .17em .45em no-repeat,
    linear-gradient(var(--ink), var(--ink)) 100% 100% / .17em .62em no-repeat; }
.mk-wifi { width: .72em; height: .38em; border: .15em solid var(--ink); border-bottom: 0; border-radius: .72em .72em 0 0; }
.mk-bat { position: relative; width: 1.1em; height: .56em; border: .11em solid var(--ink); border-radius: .2em; }
.mk-bat::before { content: ""; position: absolute; inset: .09em; width: 62%; background: var(--ink); border-radius: .07em; }
.mk-bat::after { content: ""; position: absolute; inset-inline-end: -.24em; top: .13em; bottom: .13em; width: .11em; background: var(--ink); border-radius: 0 .1em .1em 0; }
.mk-appbar { display: flex; align-items: center; gap: .5em; padding: .5em .8em .6em; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.mk-appbar__back { color: var(--p-400); display: flex; }
.mk-appbar__back .ico { width: 1.1em; height: 1.1em; transform: scaleX(-1); }
.mk-appbar .mk-avatar { width: 2em; height: 2em; font-size: .9em; }
.mk-appbar__body { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.mk-appbar__body b { font-size: .84em; }
.mk-appbar__body span { font-size: .64em; color: var(--label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Anchored to the bottom like a real thread; older messages scroll off the top rather than the
   bubbles squashing to fit. */
.mk-thread2 { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: .45em; padding: .7em; background: linear-gradient(180deg, var(--bg-soft), #fff); }
.mk-thread2 > * { flex-shrink: 0; }
/* The oldest message fades out at the top instead of being cut by a hard edge. */
.mk-thread2 { -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 9%); mask-image: linear-gradient(180deg, transparent 0, #000 9%); }
.mk-msg { max-width: 86%; padding: .5em .7em .35em; border-radius: 1em; font-size: .76em; line-height: 1.65; }
.mk-msg--in { align-self: flex-start; background: var(--m-50); border-start-start-radius: .3em; }
.mk-msg--out { align-self: flex-end; background: var(--p-300); color: #fff; border-start-end-radius: .3em; }
.mk-msg--bot { align-self: flex-end; background: #f1ecfe; color: #4c2ba0; border-start-end-radius: .3em; }
.mk-msg--bot .mk-msg__t::before { content: "پاسخ خودکار هوش مصنوعی ✦"; display: block; font-size: .8em; font-weight: 700; color: #8b5cf6; margin-bottom: .15em; }
.mk-msg__meta { display: block; font-size: .72em; font-style: normal; opacity: .55; text-align: end; margin-top: .1em; }
.mk-msg__meta i { font-style: normal; margin-inline-start: .2em; }
.mk-divider { display: flex; align-items: center; gap: .5em; font-size: .64em; color: var(--label); margin: .15em 0; }
.mk-divider::before, .mk-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.mk-divider span { display: inline-flex; align-items: center; gap: .3em; background: #fff; border: 1px solid var(--line); border-radius: 1em; padding: .25em .7em; white-space: nowrap; }
.mk-divider b { color: var(--p-500); }
.mk-divider .ico { width: .9em; height: .9em; color: var(--p-300); }
.mk-compose2 { display: flex; align-items: center; gap: .5em; padding: .5em .7em .7em; border-top: 1px solid var(--line); flex-shrink: 0; }
.mk-compose2 span { flex: 1; font-size: .68em; color: var(--label); background: var(--bg-soft); border: 1px solid var(--line); border-radius: 1em; padding: .45em .8em; }
.mk-compose2 i { width: 1.8em; height: 1.8em; border-radius: 50%; background: var(--p-300); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.mk-compose2 .ico { width: .95em; height: .95em; }

.mk-handoff { display: flex; align-items: center; gap: .5em; font-size: .74em; color: var(--p-500); background: var(--p-50); border-radius: .8em; padding: .5em .8em; }
.mk-handoff .ico { width: 1.1em; height: 1.1em; }

/* Concept cards */
.mk-metrics { display: flex; flex-direction: column; gap: .45em; }
.mk-metric { display: flex; align-items: center; gap: .6em; border-radius: .8em; padding: .6em .8em; font-size: .86em; background: var(--bg-soft); }
.mk-metric__ico { width: 1.9em; height: 1.9em; border-radius: .5em; display: grid; place-items: center; background: #fff; }
.mk-metric__ico .ico { width: 1em; height: 1em; }
.mk-metric__label { flex: 1; }
.mk-metric__val { font-size: 1.25em; font-weight: 800; }
.mk-metric.is-brand { background: var(--p-50); color: var(--p-500); } .mk-metric.is-warm { background: #fff7e6; color: #9a6b00; } .mk-metric.is-danger { background: var(--danger-10); color: var(--danger); }
.mk-live { display: inline-flex; align-items: center; gap: .4em; font-size: .72em; font-weight: 700; color: #0f8a5f; }
.mk-live i { width: .6em; height: .6em; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 .25em rgba(16, 185, 129, .2); }
.mk-twocol { display: grid; grid-template-columns: 1.1fr 1fr; gap: .9em; }
.mk-workload { display: flex; flex-direction: column; gap: .35em; }
.mk-work { display: flex; align-items: center; gap: .5em; font-size: .8em; }
.mk-work__name { flex: 1; font-weight: 700; display: flex; flex-direction: column; line-height: 1.3; }
.mk-work__name small { font-weight: 500; color: var(--label); font-size: .82em; display: inline-flex; align-items: center; }
.mk-work b { font-size: 1.15em; }
.mk-dot.is-busy { background: var(--s-300); }
.mk-heat { display: grid; grid-template-columns: repeat(var(--cols, 12), 1fr); gap: .18em; }
.mk-heat i { aspect-ratio: 1; border-radius: .15em; background: color-mix(in srgb, var(--p-300) calc(var(--v) * 100%), var(--p-50)); }
.mk-counter { display: inline-flex; align-items: center; gap: .3em; font-size: .78em; color: var(--label); position: relative; min-width: 5.2em; justify-content: flex-end; }
.mk-counter i { position: absolute; inset-inline: 0; bottom: -.45em; height: .3em; border-radius: 1em; background: var(--m-50); overflow: hidden; }
.mk-counter i::after { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: var(--v, 50%); background: var(--p-300); border-radius: 1em; }
.mk-counter b { color: var(--ink); font-size: 1.1em; }
.mk-counter.is-full b { color: var(--danger); } .mk-counter.is-full i::after { background: var(--danger); }
.mk-agent.is-full { opacity: .75; background: var(--bg-soft); }
.mk-policy { display: flex; gap: .35em; flex-wrap: wrap; }
.mk-policy span { display: inline-flex; align-items: center; gap: .35em; font-size: .74em; font-weight: 700; padding: .35em .8em; border-radius: 1em; border: 1px solid var(--line); color: var(--label); background: #fff; }
.mk-policy span.is-on { background: var(--p-300); border-color: var(--p-300); color: #fff; }
.mk-policy .ico { width: 1em; height: 1em; }
.mk-queue { display: flex; flex-direction: column; gap: .3em; }
.mk-queue__item { display: flex; align-items: center; gap: .5em; font-size: .8em; padding: .45em .7em; border-radius: .7em; border: 1px solid var(--line); background: #fff; }
.mk-queue__item > span:nth-child(2) { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-queue__item.is-next { border-color: var(--p-75); background: var(--p-50); }
.mk-seg { display: flex; align-items: center; gap: .5em; font-size: .8em; background: var(--bg-soft); border-radius: .8em; padding: .55em .8em; }
.mk-seg .ico { width: 1.1em; height: 1.1em; color: var(--p-400); }
.mk-seg > span { flex: 1; }
.mk-seg__n { color: var(--p-500); }
.mk-msgcard { display: flex; align-items: flex-start; gap: .6em; font-size: .84em; font-weight: 600; background: var(--p-50); color: var(--p-500); border-radius: .9em; padding: .7em .9em; }
.mk-msgcard .ico { width: 1.2em; height: 1.2em; flex-shrink: 0; margin-top: .15em; }
.mk-row--dest { border: 1px solid var(--line); background: #fff; }
.mk-dest { display: inline-flex; align-items: center; gap: .35em; font-size: .74em; font-weight: 700; }
.mk-footnote { display: flex; align-items: center; gap: .45em; font-size: .72em; color: var(--label); margin-top: .2em; padding-top: .3em; }
.mk-footnote .ico { width: 1em; height: 1em; color: var(--p-300); }
.mk-filters { display: flex; gap: .3em; }
.mk-filters span { font-size: .68em; font-weight: 700; padding: .25em .7em; border-radius: 1em; color: var(--label); }
.mk-filters span.is-on { background: #fff; color: var(--p-500); box-shadow: var(--shadow-sm); }
.mk-slash { font-style: normal; font-family: var(--font-en); font-weight: 800; color: var(--p-400); background: var(--p-50); border-radius: .3em; padding: 0 .35em; }
.mk-input i.is-note { background: #f5b301; }
.mk-typing { display: flex; align-items: center; gap: .35em; font-size: .72em; color: var(--label); padding: .2em .4em; }
.mk-typing > span:not(.mk-avatar) { flex: 1; }
.mk-typing i { width: .4em; height: .4em; border-radius: 50%; background: var(--m-75); animation: mk-blink 1.2s infinite; }
.mk-typing i:nth-child(3) { animation-delay: .2s; } .mk-typing i:nth-child(4) { animation-delay: .4s; }
@keyframes mk-blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.mk-note mark { background: var(--p-50); color: var(--p-500); font-weight: 700; border-radius: .3em; padding: 0 .3em; }

/* Lanes → thread diagram */
.mk-lanes { display: grid; grid-template-columns: 1.2fr .35fr 1fr; align-items: center; gap: .4em; width: 100%; font-size: 1.12em; }
.mk-lanes__src { display: flex; flex-direction: column; gap: .8em; }
.mk-lane { display: flex; align-items: center; gap: .6em; background: #fff; border: 1px solid var(--line); border-radius: .9em; padding: .6em .7em; box-shadow: var(--shadow-sm); }
.mk-lane__body { display: flex; flex-direction: column; min-width: 0; line-height: 1.4; }
.mk-lane__ch { font-size: .66em; color: var(--label); }
.mk-lane__msg { font-size: .8em; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-lanes__merge svg { width: 100%; height: 12em; transform: scaleX(-1); }
.mk-lanes__merge path { fill: none; stroke: var(--p-200); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-dasharray: 4 4; }
.mk-thread { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .35em; background: #fff; border: 1px solid var(--p-75); border-radius: 1.2em; padding: 1em .8em; box-shadow: var(--shadow-lg); }
.mk-thread__name { font-weight: 800; font-size: .95em; }
.mk-thread__sub { font-size: .68em; color: var(--label); }
.mk-thread__stats { display: grid; grid-template-columns: repeat(3, auto); gap: .1em .7em; margin-top: .5em; font-size: .68em; color: var(--label); }
.mk-thread__stats b { font-size: 1.5em; color: var(--p-500); }

/* Smart triage diagram: messages → core → teams */
.mk-triage { display: grid; grid-template-columns: 1.15fr .16fr auto .16fr 1fr; align-items: center; gap: .2em; width: 100%; font-size: 1.22em; }
.mk-triage__src, .mk-triage__dst { display: flex; flex-direction: column; gap: .7em; min-width: 0; }
.mk-triage__dst { gap: 1.1em; }
.mk-lane--msg { padding: .5em .6em; }
.mk-lane--msg .mk-lane__msg, .mk-team .mk-row__title, .mk-team .mk-row__sub { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.45; }
.mk-lane--msg .mk-lane__ch b { color: var(--p-500); font-weight: 700; }
.mk-triage__wire svg { width: 100%; height: 15em; transform: scaleX(-1); }
.mk-triage__wire path { fill: none; stroke: var(--p-200); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-dasharray: 4 4; }
.mk-triage__core { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .25em; width: 7.2em; background: #fff; border: 1px solid var(--p-75); border-radius: 1.2em; padding: .9em .5em; box-shadow: var(--shadow-lg); }
.mk-triage__core .ico { width: 1.6em; height: 1.6em; color: var(--p-400); background: var(--p-50); border-radius: .6em; padding: .35em; box-sizing: content-box; }
.mk-triage__core b { font-size: .8em; }
.mk-triage__core span { font-size: .62em; color: var(--label); line-height: 1.5; }
.mk-team { display: flex; align-items: center; gap: .5em; background: #fff; border: 1px solid var(--line); border-radius: .9em; padding: .55em .7em; box-shadow: var(--shadow-sm); min-width: 0; }
.mk-team .mk-row__title { font-size: .84em; }
.mk-footnote--center { justify-content: center; margin-top: 1.2em; }

.mk-preview { display: flex; flex-direction: column; gap: .5em; background: var(--bg-soft); border-radius: .9em; padding: .8em; }
.mk-mini__ico.is-ai { background: #f1ecfe; color: #6d3fd8; }
/* AI hub core (botReach): gradient badge, white glyph, soft pulsing ring — reads as "AI" at a glance */
.mk-hub__core--ai { background: radial-gradient(120% 120% at 30% 22%, #3d84d6 0%, var(--p-300) 45%, #6d3fd8 100%); box-shadow: var(--shadow-lg), 0 0 0 1.1em rgba(109, 63, 216, .09); color: #fff; }
.mk-hub__core--ai .ico { color: #fff; }
.mk-hub__core--ai span:not(.mk-hub__ring) { color: #fff; }
.mk-hub__ring { position: absolute; inset: -1.1em; border-radius: 50%; border: 1.5px dashed rgba(109, 63, 216, .35); animation: mk-hub-pulse 3.2s ease-in-out infinite; }
@keyframes mk-hub-pulse { 0%, 100% { transform: scale(1); opacity: .8; } 50% { transform: scale(1.07); opacity: .25; } }
.mk-shortcut { font-family: var(--font-en); font-size: .74em; font-weight: 800; color: var(--p-500); background: var(--p-50); border-radius: .5em; padding: .25em .55em; flex-shrink: 0; }
/* Bulk selection bar + pick boxes (crm) */
.mk-bulkbar { display: flex; align-items: center; gap: .5em; font-size: .78em; background: var(--p-50); color: var(--p-500); border-radius: .8em; padding: .5em .7em; }
.mk-bulkbar .ico { width: 1.1em; height: 1.1em; }
.mk-bulkbar__acts { display: inline-flex; gap: .35em; margin-inline-start: auto; }
.mk-bulkbar .mk-btn { font-size: .92em; }
.mk-pick { width: 1.15em; height: 1.15em; border: 1.5px solid var(--m-75); border-radius: .35em; display: grid; place-items: center; flex-shrink: 0; color: #fff; }
.mk-pick.is-on { background: var(--p-300); border-color: var(--p-300); }
.mk-pick .ico { width: .8em; height: .8em; }
/* Merge: two records into one */
.mk-merge { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .5em; }
.mk-merge__card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .15em; background: #fff; border: 1px solid var(--line); border-radius: .9em; padding: .7em .5em; box-shadow: var(--shadow-sm); }
.mk-merge__card .mk-row__sub { display: inline-flex; align-items: center; gap: .3em; font-size: .68em; }
.mk-merge__plus { width: 1.7em; height: 1.7em; border-radius: 50%; background: var(--p-50); color: var(--p-400); display: grid; place-items: center; }
.mk-merge__plus .ico { width: .9em; height: .9em; }
.mk-row__meta b, b.mk-row__meta { font-size: .9em; color: var(--p-500); }
.mk-table--cmp .mk-table__row, .mk-table--cmp .mk-table__row--head { grid-template-columns: 1.5fr 1.2fr 1.2fr; }
.mk-table--cmp .is-good { display: inline-flex; align-items: center; gap: .3em; color: #0f8a5f; font-weight: 700; }
.mk-table--cmp .is-good .ico { width: .9em; height: .9em; }
.mk-table--cmp .is-meh { color: var(--label); }
.mk-safir { display: flex; flex-direction: column; gap: .45em; }
.mk-safir__row { display: flex; align-items: center; gap: .6em; border: 1px solid var(--line); border-radius: .9em; padding: .6em .7em; background: #fff; font-size: .92em; }
.mk-safir__row b { font-size: .82em; color: var(--p-500); white-space: nowrap; }
.mk-safir__row .mk-mini__ico { width: 2em; height: 2em; border-radius: .6em; display: grid; place-items: center; flex-shrink: 0; }
.mk-safir__row .mk-mini__ico .ico { width: 1em; height: 1em; }
.mk-safir__row.is-highlight { border-color: var(--p-75); background: var(--p-50); }
.mk-step { width: 1.5em; height: 1.5em; border-radius: 50%; background: var(--p-50); color: var(--p-500); font-size: .72em; font-weight: 800; display: grid; place-items: center; flex-shrink: 0; }
.mk-checks { display: grid; grid-template-columns: 1fr 1fr; gap: .25em .6em; }
.mk-verb { font-family: var(--font-en); font-size: .72em; font-weight: 800; color: var(--p-500); background: var(--p-50); border-radius: .4em; padding: .15em .5em; text-align: center; }
.mk-table--api .mk-table__row { grid-template-columns: 4em 1.6fr 1.4fr; }
.mk-table--api .mk-table__row--head { grid-template-columns: 4em 1.6fr 1.4fr; }
.mk-table--api .mk-table__name { font-size: .92em; }
.mk-flowline { display: flex; align-items: center; justify-content: space-between; gap: .3em; }
.mk-flowline .ico { width: 1em; height: 1em; color: var(--m-75); flex-shrink: 0; }
.mk-flowline__n { display: flex; flex-direction: column; align-items: center; gap: .3em; text-align: center; font-size: .72em; font-weight: 600; background: #fff; border: 1px solid var(--line); border-radius: .8em; padding: .6em .5em; flex: 1; min-width: 0; }
.mk-flowline__n .mk-mini__ico { width: 1.9em; height: 1.9em; border-radius: .5em; display: grid; place-items: center; }
.mk-table__row.is-dim { opacity: .6; }
.mk-bubble--wide { align-self: stretch; max-width: none; }

/* Live agents table */
.mk-metrics--row { flex-direction: row; }
.mk-metrics--row .mk-metric { flex: 1; flex-direction: column; align-items: flex-start; gap: .2em; padding: .55em .7em; min-width: 0; }
.mk-metrics--row .mk-metric__label { font-size: .84em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.mk-table--live { flex-shrink: 0; }
.mk-table--live .mk-table__row { grid-template-columns: auto 1.3fr 1.2fr .7fr .9fr; }
.mk-table--live .mk-table__row--head { grid-template-columns: 2.4fr 1.2fr .7fr .9fr; }
.mk-table__row.is-dim { color: var(--label); }
.mk-status { display: inline-flex; align-items: center; white-space: nowrap; }
.mk-dot.is-off { background: var(--m-75); }

/* Rule builder */
.mk-rule-sec { display: flex; flex-direction: column; gap: .35em; }
.mk-rule-sec__t { display: inline-flex; align-items: center; gap: .4em; font-size: .7em; font-weight: 700; color: var(--label); }
.mk-rule-sec__t .ico { width: 1.1em; height: 1.1em; color: var(--p-400); }
.mk-evt { font-size: .84em; font-weight: 700; background: var(--p-50); color: var(--p-500); border-radius: .7em; padding: .5em .8em; }
.mk-cond { display: flex; align-items: center; gap: .4em; font-size: .78em; }
.mk-cond__join { font-size: .85em; font-weight: 800; color: var(--label); min-width: 1.4em; }
.mk-cond__f, .mk-cond em, .mk-cond b { border: 1px solid var(--line); border-radius: .5em; padding: .3em .6em; background: #fff; font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-cond em { color: var(--label); }
.mk-cond b { color: var(--p-500); }
.mk-act { display: flex; align-items: center; gap: .5em; font-size: .8em; background: #f2fbf7; border: 1px solid #cdeedd; border-radius: .7em; padding: .45em .7em; }
.mk-act__ico { width: 1.6em; height: 1.6em; border-radius: .45em; background: #fff; color: #0f8a5f; display: grid; place-items: center; flex-shrink: 0; }
.mk-act__ico .ico { width: .95em; height: .95em; }

/* Macros */
.mk-macros { display: flex; flex-direction: column; gap: .5em; }
.mk-macro { border: 1px solid var(--line); border-radius: .9em; background: #fff; overflow: hidden; }
.mk-macro.is-open { border-color: var(--p-75); box-shadow: var(--shadow-sm); }
.mk-macro__head { display: flex; align-items: center; gap: .6em; padding: .6em .8em; font-size: .84em; }
.mk-macro__head b { flex: 1; }
.mk-macro__ico { width: 1.8em; height: 1.8em; border-radius: .5em; background: var(--p-50); color: var(--p-400); display: grid; place-items: center; }
.mk-macro__ico .ico { width: 1em; height: 1em; }
.mk-macro__n { font-size: .8em; color: var(--label); }
.mk-macro__steps { margin: 0; padding: .2em 2.2em .7em; font-size: .78em; color: var(--m-400); display: flex; flex-direction: column; gap: .2em; }
.mk-macro__steps li::marker { color: var(--p-300); font-weight: 800; }

/* Scores / SLA / alerts */
.mk-scorecard { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: .5em; }
.mk-score { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .1em; background: var(--bg-soft); border-radius: .9em; padding: .8em .5em; }
.mk-score b { font-size: 1.6em; font-weight: 800; color: var(--p-500); line-height: 1.1; }
.mk-score span { font-size: .66em; color: var(--label); }
.mk-hit { font-size: .76em; color: var(--label); } .mk-hit b { color: #0f8a5f; font-size: 1.25em; }
.mk-slalist { display: flex; flex-direction: column; gap: .55em; }
.mk-slarow { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: .4em .6em; align-items: center; font-size: .76em; border: 1px solid var(--line); border-radius: .8em; padding: .6em .8em; background: #fff; }
.mk-slarow__t { font-weight: 800; }
.mk-slarow__target, .mk-slarow__avg { color: var(--label); }
.mk-slarow .mk-progress { grid-column: 1 / -1; }
.mk-alert { display: flex; align-items: flex-start; gap: .5em; font-size: .76em; background: #fff7e6; color: #7a5200; border: 1px solid #f7e2a8; border-radius: .8em; padding: .6em .8em; }
.mk-alert .ico { width: 1.1em; height: 1.1em; flex-shrink: 0; margin-top: .15em; }
.mk-trend__head { display: flex; justify-content: space-between; font-size: .76em; color: var(--label); margin-bottom: .3em; }
.mk-trend__head b { color: var(--p-500); font-size: 1.2em; } .mk-trend__head small { color: #0f8a5f; font-size: .7em; }

/* API / webhooks */
.mk-resp { display: flex; align-items: center; gap: .6em; font-size: .8em; border: 1px solid #cdeedd; background: #f2fbf7; border-radius: .8em; padding: .5em .8em; }
.mk-resp__code { font-family: var(--font-en); font-weight: 800; color: #0f8a5f; }
.mk-resp__t { flex: 1; font-weight: 700; }
.mk-resp__meta { font-size: .8em; color: var(--label); }
.mk-endpoint { font-family: var(--font-en); font-size: .68em; color: var(--label); background: var(--bg-soft); border-radius: .5em; padding: .25em .6em; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-events { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: .9em; overflow: hidden; background: #fff; }
.mk-event2 { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .6em; padding: .5em .8em; border-top: 1px solid var(--line); font-size: .76em; }
.mk-event2:first-child { border-top: 0; }
.mk-event2.is-new { background: var(--p-50); }
.mk-event2 code { font-family: var(--font-en); font-size: .85em; color: #6d3fd8; background: #f1ecfe; border-radius: .4em; padding: .1em .5em; }
.mk-event2 > span:nth-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-segs { display: flex; flex-direction: column; gap: .3em; }
.mk-segs span { display: flex; justify-content: space-between; font-size: .78em; padding: .4em .6em; border-radius: .6em; color: var(--m-400); }
.mk-segs span.is-on { background: #fff; color: var(--p-500); font-weight: 700; box-shadow: var(--shadow-sm); }
.mk-segs b { color: var(--label); font-weight: 600; }
.mk-profile__sub { font-size: .7em; color: var(--label); }

@media (max-width: 700px) {
  .scene__duo, .scene__duo--rev { grid-template-columns: 1fr; }
  .scene__duo-side { display: none; }
  .mk-twocol { grid-template-columns: 1fr; }
  .mk-lanes { grid-template-columns: 1fr .3fr .9fr; }
}.mk-hours { display: flex; flex-direction: column; gap: .3em; }
.mk-hour { display: flex; align-items: center; gap: .6em; font-size: .8em; padding: .35em .6em; border-radius: .6em; background: var(--bg-soft); }
.mk-hour.is-off { color: var(--label); }
.mk-hour__d { flex: 1; font-weight: 700; }
.mk-hour__t { font-family: var(--font); color: var(--m-400); }.mk-chip--eita { background: #f7941d; } .mk-chip--soroush { background: #1e6fd9; } .mk-chip--rubika { background: #8e44ad; }