/* Hamsokhan guides: the user guide and the developer guide share this sheet. Colours come from tokens.css. */

@font-face {
  font-family: 'Vazirmatn';
  src: url('vazirmatn.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --d-max: 860px;
  --d-aside: 268px;
  --d-header: 60px;
  --d-mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --d-code-bg: #0f172a;
  --d-code-text: #e2e8f0;
  --d-tip: #eef2ff;
  --d-tip-border: #c7d2fe;
  --d-example: #ecfdf5;
  --d-example-border: #a7f3d0;
  --d-warn: #fffbeb;
  --d-warn-border: #fcd34d;
  --d-mark: #4f46e5;
  --d-stage: #f8fafc;
  --d-shadow: 0 1px 2px rgb(15 23 42 / 0.06), 0 8px 28px rgb(15 23 42 / 0.08);
  color-scheme: light;
}

:root[data-theme='dark'] {
  --d-tip: #1e1b4b;
  --d-tip-border: #3730a3;
  --d-example: #052e2b;
  --d-example-border: #115e59;
  --d-warn: #2a1d05;
  --d-warn-border: #854d0e;
  --d-mark: #818cf8;
  --d-stage: #0d1628;
  --d-code-bg: #0a1020;
  --d-shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 30px rgb(0 0 0 / 0.35);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --d-tip: #1e1b4b;
    --d-tip-border: #3730a3;
    --d-example: #052e2b;
    --d-example-border: #115e59;
    --d-warn: #2a1d05;
    --d-warn-border: #854d0e;
    --d-mark: #818cf8;
    --d-stage: #0d1628;
    --d-code-bg: #0a1020;
    --d-shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 30px rgb(0 0 0 / 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { scroll-padding-top: calc(var(--d-header) + 16px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  font-family: var(--hs-font);
  font-size: 16px;
  line-height: 1.95;
  color: var(--hs-text);
  background: var(--hs-bg);
}

a { color: var(--hs-accent-text); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--hs-brand); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Header ------------------------------------------------------------------------------------- */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--d-header);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--hs-surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--hs-border);
}
.top__brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 800; font-size: 17px; white-space: nowrap; }
.top__brand img { width: 30px; height: 30px; }
.top__docs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--hs-field); }
.top__docs a { padding: 4px 12px; border-radius: 9px; color: var(--hs-text-muted); text-decoration: none; font-size: 14px; white-space: nowrap; }
.top__docs a[aria-current='page'] { background: var(--hs-surface); color: var(--hs-text); font-weight: 700; box-shadow: 0 1px 3px rgb(15 23 42 / 0.12); }
.top__search { margin-inline-start: auto; position: relative; }
.top__search input {
  width: 240px;
  height: 38px;
  padding: 0 38px 0 12px;
  border: 1px solid var(--hs-border);
  border-radius: 10px;
  background: var(--hs-field);
  color: var(--hs-text);
  font: inherit;
  font-size: 14px;
}
.top__search svg { position: absolute; inset-inline-start: 12px; top: 11px; color: var(--hs-text-muted); pointer-events: none; }
.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--hs-border);
  border-radius: 10px;
  background: var(--hs-surface);
  color: var(--hs-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
}
.menu-button { display: none; }

/* ---- Layout ------------------------------------------------------------------------------------- */
.layout {
  display: grid;
  grid-template-columns: var(--d-aside) minmax(0, 1fr);
  gap: 40px;
  max-width: calc(var(--d-max) + var(--d-aside) + 120px);
  margin: 0 auto;
  padding: 0 24px;
}
.aside {
  position: sticky;
  top: var(--d-header);
  align-self: start;
  max-height: calc(100vh - var(--d-header));
  overflow: auto;
  padding: 24px 0 40px;
  font-size: 14px;
}
.aside__docs { display: none; }
.toc__list, .toc__list ol { list-style: none; margin: 0; padding: 0; }
.toc__list > li { margin-bottom: 6px; }
.toc__list > li > a { font-weight: 700; color: var(--hs-text); }
.toc__list ol { margin: 2px 0 8px; padding-inline-start: 12px; border-inline-start: 1px solid var(--hs-border); }
.toc a { display: block; padding: 3px 10px; border-radius: 8px; color: var(--hs-text-muted); text-decoration: none; line-height: 1.6; }
.toc a:hover { background: var(--hs-field); color: var(--hs-text); }
.toc a.is-current { color: var(--hs-accent-text); background: var(--hs-brand-soft); font-weight: 700; }
.toc li.is-hidden { display: none; }
main { min-width: 0; max-width: var(--d-max); padding: 32px 0 120px; }

/* ---- Type --------------------------------------------------------------------------------------- */
h1, h2, h3, h4 { line-height: 1.5; margin: 0; }
h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 900; letter-spacing: -0.5px; }
h2 { font-size: 26px; font-weight: 850; margin-top: 72px; padding-top: 8px; }
h3 { font-size: 20px; font-weight: 800; }
h4 { font-size: 16px; font-weight: 800; margin-top: 22px; }
p { margin: 12px 0; }
.lead { font-size: 18px; color: var(--hs-text-muted); }
.section-lead { color: var(--hs-text-muted); margin-top: 6px; }
code { font-family: var(--d-mono); font-size: 0.88em; direction: ltr; unicode-bidi: isolate; padding: 1px 6px; border-radius: 6px; background: var(--hs-field); }
kbd { font-family: var(--d-mono); font-size: 0.85em; padding: 1px 7px; border: 1px solid var(--hs-border); border-bottom-width: 2px; border-radius: 6px; background: var(--hs-surface); }
ul, ol { padding-inline-start: 22px; }
li { margin: 4px 0; }
hr { border: 0; border-top: 1px solid var(--hs-border); margin: 40px 0; }
.muted { color: var(--hs-text-muted); }
.ltr { direction: ltr; unicode-bidi: isolate; }

/* ---- Hero --------------------------------------------------------------------------------------- */
.hero { padding: 24px 0 8px; }
.hero__eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 3px 12px; border-radius: 999px; background: var(--hs-brand-soft); color: var(--hs-accent-text); font-size: 13px; font-weight: 700; }
.hero h1 { margin: 14px 0 8px; }
.hero__meta { font-size: 13px; color: var(--hs-text-muted); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 8px; }
.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid var(--hs-border);
  background: var(--hs-surface);
  color: var(--hs-text);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.button--primary { background: var(--hs-brand); border-color: var(--hs-brand); color: var(--hs-on-brand); }

/* ---- Cards and callouts ------------------------------------------------------------------------- */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin: 20px 0; }
.card {
  display: block;
  padding: 18px;
  border: 1px solid var(--hs-border);
  border-radius: 16px;
  background: var(--hs-surface);
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
a.card:hover { transform: translateY(-2px); box-shadow: var(--d-shadow); }
.card__icon { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--hs-brand-soft); font-size: 20px; }
.card h3, .card strong { display: block; font-size: 16px; margin: 10px 0 4px; }
.card p { margin: 0; font-size: 14px; color: var(--hs-text-muted); line-height: 1.8; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 12px; }
.steps > li { counter-increment: step; position: relative; padding: 14px 64px 14px 16px; border: 1px solid var(--hs-border); border-radius: 14px; background: var(--hs-surface); margin: 0; }
.steps > li::before {
  content: counter(step, persian);
  position: absolute;
  inset-inline-start: 14px;
  top: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--hs-brand);
  color: var(--hs-on-brand);
  font-weight: 800;
}
.steps > li strong { display: block; }

.callout { margin: 18px 0; padding: 14px 18px; border-radius: 14px; border: 1px solid var(--d-tip-border); background: var(--d-tip); }
.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }
.callout__title { display: flex; align-items: center; gap: 8px; font-weight: 800; margin-bottom: 4px; }
.callout--example { border-color: var(--d-example-border); background: var(--d-example); }
.callout--warn { border-color: var(--d-warn-border); background: var(--d-warn); }

/* ---- Feature blocks ----------------------------------------------------------------------------- */
.feature {
  margin: 28px 0;
  padding: 28px;
  border: 1px solid var(--hs-border);
  border-radius: 22px;
  background: var(--hs-surface);
}
.feature.is-hidden, .group.is-hidden { display: none; }
.feature__head { display: flex; align-items: flex-start; gap: 14px; }
.feature__icon { flex: none; width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 22px; background: var(--hs-brand-soft); }
.feature__head h3 { margin-top: 2px; }
.feature__head h3 a { color: inherit; text-decoration: none; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 0 9px; border-radius: 999px; font-size: 12px; line-height: 22px; background: var(--hs-chip); color: var(--hs-text-muted); }
.tag--visitor { background: #dcfce7; color: #166534; }
.tag--agent { background: #e0e7ff; color: #3730a3; }
.tag--admin { background: #fef3c7; color: #92400e; }
.tag--dev { background: #f1f5f9; color: #334155; }
.tag--new { background: #fee2e2; color: #991b1b; }
:root[data-theme='dark'] .tag--visitor { background: #14532d; color: #bbf7d0; }
:root[data-theme='dark'] .tag--agent { background: #312e81; color: #c7d2fe; }
:root[data-theme='dark'] .tag--admin { background: #78350f; color: #fde68a; }
:root[data-theme='dark'] .tag--dev { background: #1e293b; color: #cbd5e1; }
:root[data-theme='dark'] .tag--new { background: #7f1d1d; color: #fecaca; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .tag--visitor { background: #14532d; color: #bbf7d0; }
  :root:not([data-theme='light']) .tag--agent { background: #312e81; color: #c7d2fe; }
  :root:not([data-theme='light']) .tag--admin { background: #78350f; color: #fde68a; }
  :root:not([data-theme='light']) .tag--dev { background: #1e293b; color: #cbd5e1; }
  :root:not([data-theme='light']) .tag--new { background: #7f1d1d; color: #fecaca; }
}

.where { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 14px 0; font-size: 14px; }
.where__label { color: var(--hs-text-muted); }
.where span:not(.where__label) { padding: 2px 10px; border-radius: 8px; background: var(--hs-field); font-weight: 600; }
.where i { font-style: normal; color: var(--hs-text-muted); }

.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; align-items: start; }

/* ---- Screenshots -------------------------------------------------------------------------------- */
.shot { margin: 20px 0; }
.shot__frame {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--hs-border);
  background: var(--d-stage);
  box-shadow: var(--d-shadow);
  cursor: zoom-in;
}
.shot__frame img { display: block; width: 100%; height: auto; }
.shot--narrow .shot__frame { max-width: 400px; margin-inline: auto; }
.shot--phone .shot__frame { max-width: 320px; margin-inline: auto; border: 8px solid #0f172a; border-radius: 36px; }
.shot--tall .shot__frame { max-height: 760px; overflow: hidden; }
.shot--tall .shot__frame::after { content: ''; position: absolute; inset: auto 0 0; height: 80px; background: linear-gradient(transparent, var(--d-stage)); pointer-events: none; }
.shot__mark {
  position: absolute;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--d-mark);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 0 3px #fff, 0 4px 10px rgb(15 23 42 / 0.35);
  z-index: 1;
}
.shot__mark::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--d-mark); opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .shot.is-visible .shot__mark::after { animation: mark-ping 2.4s ease-out 0.4s 2; }
}
@keyframes mark-ping { 0% { transform: scale(1); opacity: 0.8; } 100% { transform: scale(2.2); opacity: 0; } }
.shot figcaption { margin-top: 10px; font-size: 14px; color: var(--hs-text-muted); text-align: center; }
.shot__legend { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; counter-reset: mark; font-size: 15px; }
.shot__legend li { counter-increment: mark; position: relative; padding-inline-start: 36px; margin: 0; line-height: 1.8; }
.shot__legend li::before {
  content: counter(mark, persian);
  position: absolute;
  inset-inline-start: 0;
  top: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--d-mark);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; align-items: start; }
.pair .shot { margin: 8px 0; }

.zoom { padding: 0; border: 0; background: transparent; max-width: min(96vw, 1600px); max-height: 94vh; }
.zoom::backdrop { background: rgb(2 6 23 / 0.82); }
.zoom img { display: block; max-width: 100%; max-height: 90vh; border-radius: 12px; }
.zoom button { position: fixed; top: 16px; inset-inline-end: 16px; }

/* ---- Code --------------------------------------------------------------------------------------- */
.code { position: relative; margin: 16px 0; direction: ltr; }
.code pre {
  margin: 0;
  padding: 18px 20px;
  overflow: auto;
  border-radius: 14px;
  background: var(--d-code-bg);
  color: var(--d-code-text);
  font-family: var(--d-mono);
  font-size: 13.5px;
  line-height: 1.75;
  text-align: left;
  tab-size: 2;
}
.code pre code { padding: 0; background: none; font-size: inherit; color: inherit; }
.code__label { position: absolute; top: 8px; left: 14px; max-width: calc(100% - 100px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--d-mono); font-size: 11px; color: #94a3b8; }
.code__label + pre { padding-top: 30px; }
.code__copy {
  position: absolute;
  top: 8px;
  right: 8px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #1e293b;
  color: #e2e8f0;
  font: 12px var(--hs-font);
  cursor: pointer;
}
.code .c { color: #94a3b8; }
.code .s { color: #86efac; }
.code .k { color: #93c5fd; }
.tabs { margin: 16px 0; }
.tabs__list { display: flex; gap: 4px; direction: ltr; justify-content: flex-start; flex-wrap: wrap; }
.tabs__list button { height: 32px; padding: 0 14px; border: 1px solid var(--hs-border); border-bottom: 0; border-radius: 10px 10px 0 0; background: var(--hs-field); color: var(--hs-text-muted); font: 13px var(--d-mono); cursor: pointer; }
.tabs__list button[aria-selected='true'] { background: var(--d-code-bg); color: #fff; border-color: var(--d-code-bg); }
.tabs .code { margin-top: 0; }
.tabs .code pre { border-top-left-radius: 0; }
.tabs [role='tabpanel'][hidden] { display: none; }

/* ---- Tables ------------------------------------------------------------------------------------- */
.table { overflow-x: auto; margin: 16px 0; border: 1px solid var(--hs-border); border-radius: 14px; background: var(--hs-surface); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.8; }
th, td { padding: 10px 14px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--hs-border); }
th { font-size: 13px; color: var(--hs-text-muted); background: var(--hs-field); font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }

/* ---- Changelog and FAQ -------------------------------------------------------------------------- */
.changes { list-style: none; padding: 0; margin: 16px 0; border-inline-start: 2px solid var(--hs-border); }
.changes > li { position: relative; padding: 0 22px 18px; margin: 0; }
.changes > li::before { content: ''; position: absolute; inset-inline-start: -7px; top: 9px; width: 12px; height: 12px; border-radius: 50%; background: var(--hs-brand); box-shadow: 0 0 0 4px var(--hs-bg); }
.changes time { font-size: 13px; font-weight: 800; color: var(--hs-accent-text); }
.changes ul { margin: 4px 0 0; }
details.faq { border: 1px solid var(--hs-border); border-radius: 14px; background: var(--hs-surface); margin: 10px 0; }
details.faq summary { padding: 14px 18px; cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details.faq summary::after { content: '+'; color: var(--hs-text-muted); font-size: 20px; line-height: 1; }
details.faq[open] summary::after { content: '−'; }
details.faq > div { padding: 0 18px 14px; }
.empty-search { display: none; padding: 40px; text-align: center; color: var(--hs-text-muted); border: 1px dashed var(--hs-border); border-radius: 16px; margin-top: 30px; }
.empty-search.is-shown { display: block; }

/* ---- Animated scenes ----------------------------------------------------------------------------
   A scene is a small looping illustration. Elements with data-at="n" appear at step n (and leave at
   data-until="n"); docs.js advances the steps while the scene is on screen. Without motion, or without
   JavaScript, the final state shows. */
.scene {
  position: relative;
  margin: 22px 0;
  padding: 22px;
  border-radius: 20px;
  border: 1px solid var(--hs-border);
  background:
    radial-gradient(circle at 15% 10%, var(--hs-brand-soft), transparent 45%),
    var(--d-stage);
  overflow: hidden;
}
.scene__stage { position: relative; display: flex; gap: 18px; align-items: stretch; justify-content: center; flex-wrap: wrap; min-height: 260px; }
.scene__caption { margin: 16px 0 0; min-height: 3.6em; text-align: center; font-size: 15px; font-weight: 600; }
.js .scene__caption span { display: none; }
.scene__caption span + span { margin-inline-start: 6px; }
.js .scene__caption span.is-current { display: inline; animation: caption-in 0.35s ease; }
.scene__controls { position: absolute; top: 10px; inset-inline-end: 10px; display: flex; gap: 6px; z-index: 3; }
.scene__controls button { width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--hs-border); background: var(--hs-surface); color: var(--hs-text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.scene__progress { display: flex; gap: 5px; justify-content: center; margin-top: 10px; }
.scene__progress i { width: 18px; height: 4px; border-radius: 2px; background: var(--hs-border); transition: background 0.3s ease; }
.scene__progress i.is-done { background: var(--hs-brand); }
@keyframes caption-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.scene [data-at] { transition: opacity 0.45s ease, transform 0.45s var(--hs-ease-out), max-height 0.45s ease; }
.scene.is-playing [data-at]:not(.is-on) { opacity: 0; transform: translateY(8px) scale(0.98); }
.scene.is-playing [data-at].pop:not(.is-on) { transform: scale(0.6); }
.scene.is-playing [data-at].grow:not(.is-on) { max-height: 0; margin: 0; padding-block: 0; overflow: hidden; }
.scene .gone { transition: opacity 0.4s ease, transform 0.4s ease; }
.scene .gone.is-off { opacity: 0; transform: scale(0.7); }

/* Three panes side by side (site, panel, Telegram), stacked on narrow screens. */
.scene__stage.trio { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 0.8fr); align-items: start; }
.trio .mini-window, .trio .mini-phone { width: auto; }
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.duo .mini-window, .duo .mini-phone { width: auto; }
@media (max-width: 760px) {
  .scene__stage.trio, .scene__stage.duo { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .trio .mini-window, .trio .mini-phone, .duo .mini-window, .duo .mini-phone { width: 100%; max-width: 340px; }
}

/* Mini interface parts used by the scenes. */
.mini { --mb: #0f766e; font-size: 12px; line-height: 1.6; }
.mini-window { width: 300px; max-width: 100%; border-radius: 14px; background: var(--hs-surface); border: 1px solid var(--hs-border); box-shadow: var(--d-shadow); overflow: hidden; display: flex; flex-direction: column; position: relative; }
.mini-window__bar { height: 30px; display: flex; align-items: center; gap: 5px; padding: 0 10px; border-bottom: 1px solid var(--hs-border); background: var(--hs-field); }
.mini-window__bar b { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; }
.mini-url { margin-inline-start: 6px; flex: 1; height: 18px; border-radius: 6px; background: var(--hs-surface); font: 10.5px var(--d-mono); color: var(--hs-text-muted); display: flex; align-items: center; padding: 0 8px; direction: ltr; overflow: hidden; white-space: nowrap; position: relative; }
.mini-url span { position: absolute; left: 8px; transition: opacity 0.3s ease; }
.mini-window__title { font-size: 11px; font-weight: 700; color: var(--hs-text-muted); padding: 6px 12px 0; }
.mini-page { position: relative; flex: 1; min-height: 210px; padding: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-content: start; }
.mini-page i { display: block; height: 52px; border-radius: 8px; background: var(--hs-field); }
.mini-page i.wide { grid-column: 1 / -1; height: 40px; }
.mini-launcher { position: absolute; bottom: 12px; inset-inline-end: 12px; width: 40px; height: 40px; border-radius: 50%; background: var(--mb); display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px rgb(15 23 42 / 0.25); z-index: 2; }
.mini-launcher::before { content: '•••'; color: #fff; font-size: 13px; letter-spacing: 1px; }
.mini-launcher.is-pulse { animation: launcher-pulse 1.6s ease-in-out infinite; }
@keyframes launcher-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--mb) 45%, transparent), 0 6px 16px rgb(15 23 42 / 0.25); } 50% { box-shadow: 0 0 0 10px transparent, 0 6px 16px rgb(15 23 42 / 0.25); } }
.mini-nudge { position: absolute; bottom: 60px; inset-inline-end: 12px; max-width: 190px; padding: 8px 10px; border-radius: 12px 12px 4px 12px; background: var(--hs-surface); border: 1px solid var(--hs-border); box-shadow: var(--d-shadow); z-index: 2; }
.mini-chat { position: absolute; inset: 8px 8px 58px; border-radius: 12px; overflow: hidden; background: var(--hs-bg); border: 1px solid var(--hs-border); box-shadow: var(--d-shadow); display: flex; flex-direction: column; z-index: 2; }
.mini-chat__head { background: var(--mb); color: #fff; padding: 6px 10px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.mini-chat__head small { font-weight: 400; opacity: 0.85; }
.mini-chat__log { flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.mini-chat__composer { margin: 0 6px 6px; height: 26px; border-radius: 13px; border: 1px solid var(--hs-border); background: var(--hs-surface); display: flex; align-items: center; padding: 0 10px; color: var(--hs-text-muted); overflow: hidden; white-space: nowrap; }
.bubble { max-width: 82%; padding: 5px 10px; border-radius: 12px; background: var(--hs-surface); border: 1px solid var(--hs-border); align-self: flex-end; }
.bubble.me { align-self: flex-start; background: var(--mb); border-color: var(--mb); color: #fff; }
.bubble small { display: block; font-size: 10px; opacity: 0.7; }
.bubble.note { background: var(--hs-note); border: 1px dashed var(--hs-note-border); color: var(--hs-note-text); }
.bubble.sys { align-self: center; background: var(--hs-chip); border: 0; font-size: 11px; color: var(--hs-text-muted); }
.typing { display: inline-flex; gap: 3px; padding: 7px 10px; border-radius: 12px; background: var(--hs-surface); border: 1px solid var(--hs-border); align-self: flex-end; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--hs-text-muted); animation: dot 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-3px); opacity: 1; } }
.chips { display: flex; flex-wrap: wrap; gap: 5px; align-self: flex-end; justify-content: flex-end; }
.chip { padding: 2px 10px; border-radius: 999px; border: 1px solid var(--mb); color: var(--mb); background: var(--hs-surface); transition: background 0.3s ease, color 0.3s ease; }
.chip.is-marked { background: var(--mb); color: #fff; }
.stars { display: flex; gap: 3px; font-size: 18px; color: var(--hs-border); direction: ltr; justify-content: center; }
.stars b { transition: color 0.2s ease; }
.stars b.is-marked { color: #f59e0b; }
.mini-row.is-marked { background: var(--hs-brand-soft); }
.mini-launcher.is-marked { transform: scale(0.9); }
.mini-inbox { width: 280px; max-width: 100%; }
.mini-row { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--hs-border); }
.mini-row .av { width: 26px; height: 26px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; background: #fde68a; font-weight: 800; color: #92400e; }
.mini-row div { flex: 1; min-width: 0; }
.mini-row b { display: block; }
.mini-row span { color: var(--hs-text-muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-row em { font-style: normal; min-width: 18px; height: 18px; border-radius: 9px; background: var(--hs-badge); color: #fff; font-size: 10px; display: flex; align-items: center; justify-content: center; }
.mini-row.is-active { background: var(--hs-brand-soft); }
.ghost { color: var(--hs-text-muted); font-style: italic; opacity: 0.85; }
.mini-phone { width: 220px; border-radius: 26px; border: 6px solid #0f172a; background: #dbeafe; overflow: hidden; box-shadow: var(--d-shadow); display: flex; flex-direction: column; }
:root[data-theme='dark'] .mini-phone { background: #172036; }
.mini-phone__head { background: #3b82f6; color: #fff; padding: 8px 10px; font-weight: 700; }
.mini-phone__head small { display: block; font-weight: 400; opacity: 0.85; }
.mini-phone__log { flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 190px; }
.tg { align-self: flex-start; background: #fff; color: #0f172a; padding: 5px 9px; border-radius: 10px; max-width: 90%; }
.tg.me { align-self: flex-end; background: #dcfce7; }
.tg-buttons { display: flex; gap: 4px; }
.tg-buttons span { flex: 1; text-align: center; padding: 3px; border-radius: 6px; background: rgb(255 255 255 / 0.7); color: #1d4ed8; font-size: 11px; }
.agents { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 620px; }
.agent { border: 1px solid var(--hs-border); border-radius: 14px; background: var(--hs-surface); padding: 10px; min-height: 170px; display: flex; flex-direction: column; gap: 6px; }
.agent header { display: flex; align-items: center; gap: 6px; font-weight: 800; }
.agent header i { width: 8px; height: 8px; border-radius: 50%; background: var(--hs-online); }
.agent header i.off { background: #94a3b8; }
.agent small { color: var(--hs-text-muted); }
.ticket { padding: 4px 8px; border-radius: 8px; background: var(--hs-field); font-size: 11px; }
.ticket.new { background: var(--hs-brand-soft); border: 1px solid var(--hs-brand); font-weight: 700; }
.queue { width: 100%; max-width: 620px; display: flex; justify-content: center; }
.flowline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; width: 100%; }
.node { min-width: 130px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--hs-border); background: var(--hs-surface); box-shadow: var(--d-shadow); text-align: center; font-weight: 700; font-size: 13px; }
.node small { display: block; font-weight: 400; color: var(--hs-text-muted); font-size: 11px; }
.node .ok { color: var(--hs-success); }
.arrow { position: relative; width: 70px; height: 2px; background: repeating-linear-gradient(to left, var(--hs-border) 0 6px, transparent 6px 10px); }
.arrow::after { content: ''; position: absolute; left: -2px; top: -4px; border: 5px solid transparent; border-right-color: var(--hs-text-muted); }
.packet { position: absolute; top: -12px; right: 0; padding: 0 6px; border-radius: 6px; background: var(--hs-brand); color: #fff; font: 10px var(--d-mono); white-space: nowrap; }
.scene.is-playing .packet.is-on { animation: travel 1.4s var(--hs-ease-out) forwards; }
@keyframes travel { from { right: 0; } to { right: calc(100% - 30px); } }
.flowline.col { flex-direction: column; }
.flowline.col .arrow { width: 2px; height: 34px; background: repeating-linear-gradient(to bottom, var(--hs-border) 0 6px, transparent 6px 10px); }
.flowline.col .packet { right: auto; left: 14px; top: 9px; }
.scene.is-playing .flowline.col .packet.is-on { animation: none; }
.flowline.col .arrow::after { left: -4px; top: auto; bottom: -6px; border-right-color: transparent; border-top-color: var(--hs-text-muted); }
.sizes-demo { display: flex; gap: 30px; align-items: flex-end; justify-content: center; }
.sizes-demo figure { margin: 0; text-align: center; }
.sizes-demo .mini-launcher { position: static; margin: 0 auto 8px; transition: width 0.6s var(--hs-ease-out), height 0.6s var(--hs-ease-out); }
.sizes-demo .device { width: 150px; height: 110px; border-radius: 10px; border: 2px solid var(--hs-border); background: var(--hs-surface); position: relative; display: flex; align-items: flex-end; justify-content: flex-end; padding: 8px; }
.sizes-demo .device.phone { width: 70px; height: 130px; border-radius: 14px; }

@media (prefers-reduced-motion: reduce) {
  .mini-launcher.is-pulse, .typing i { animation: none; }
}

/* ---- Footer ------------------------------------------------------------------------------------- */
.foot { margin-top: 80px; padding-top: 24px; border-top: 1px solid var(--hs-border); color: var(--hs-text-muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }

/* ---- Small screens ------------------------------------------------------------------------------ */
@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 0 16px; }
  .menu-button { display: inline-flex; }
  .aside {
    position: fixed;
    top: var(--d-header);
    right: 0;
    bottom: auto;
    left: auto;
    height: calc(100dvh - var(--d-header));
    width: min(320px, 86vw);
    max-height: none;
    padding: 20px;
    background: var(--hs-surface);
    border-inline-start: 1px solid var(--hs-border);
    box-shadow: var(--d-shadow);
    transform: translateX(110%);
    transition: transform 0.25s ease;
    z-index: 15;
  }
  body.is-menu-open .aside { transform: none; }
  main { padding-top: 20px; }
  .top { padding: 0 12px; gap: 8px; }
  .top__search input { width: 100%; }
  .top__search { flex: 1; min-width: 0; }
  .top__brand span { display: none; }
}
@media (max-width: 640px) {
  .top__docs { display: none; }
  .aside__docs { display: flex; gap: 6px; margin-bottom: 18px; }
  .aside__docs a { flex: 1; text-align: center; padding: 8px; border-radius: 10px; background: var(--hs-field); color: var(--hs-text); text-decoration: none; font-weight: 700; }
  .feature { padding: 18px; border-radius: 18px; }
  h2 { font-size: 22px; margin-top: 56px; }
  .scene { padding: 14px; }
  .scene__stage { min-height: 0; }
  .mini-window { width: 100%; }
  .mini-phone { width: 100%; max-width: 260px; }
  .arrow { width: 36px; }
  .agents { grid-template-columns: 1fr; }
  .agent { min-height: 0; }
}

@media print {
  .top, .aside, .scene__controls, .code__copy { display: none; }
  .layout { display: block; }
  .feature { break-inside: avoid; }
  body { background: #fff; }
}

/* ---- Landing ------------------------------------------------------------------------------------ */
.landing { max-width: 820px; margin: 0 auto; padding: 48px 20px 80px; }
.landing .hero { text-align: center; }
