/* ==========================================================================
   Scrupp API docs (/docs, /docs/*) — hand-written, no build step.

   Why a separate, self-contained sheet: the docs used to lean on
   build/css/light.css and build/css/tailwind.css, which are built on the
   server and are not in git, so nobody could see or reproduce what the docs
   actually looked like. Everything the docs need is here, scoped under
   `.docs` so it wins over the layered Tailwind components without touching
   the site header and footer.
   ========================================================================== */

.docs {
    --d-ink:        #0f172a;
    --d-text:       #334155;
    --d-muted:      #64748b;
    --d-faint:      #94a3b8;
    --d-line:       #e7e9ee;
    --d-line-soft:  #f0f2f5;
    --d-surface:    #ffffff;
    --d-subtle:     #f8fafc;
    --d-canvas:     #fbfbfc;
    --d-accent:     #b45309;
    --d-accent-bg:  #fffbeb;
    --d-accent-bd:  #fde68a;
    --d-brand:      #111827;
    --d-code-bg:    #0d1117;
    --d-code-line:  #1f2733;
    --d-code-text:  #e6edf3;
    --d-radius:     14px;
    --d-radius-sm:  8px;
    --d-mono:       "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

    background: var(--d-canvas);
    color: var(--d-text);
    font-family: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    border-top: 1px solid var(--d-line);
}

.docs *, .docs *::before, .docs *::after { box-sizing: border-box; }

/* ---------- shell ---------- */

.docs .docs-shell {
    max-width: 1240px;
    margin: 0 auto;
    padding: 32px 24px 80px;
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}

.docs .docs-content { min-width: 0; display: flex; flex-direction: column; gap: 20px; }

/* ---------- sidebar ---------- */

.docs .docs-aside { position: sticky; top: 88px; max-height: calc(100vh - 104px); overflow-y: auto; padding-right: 4px; }
.docs .docs-aside::-webkit-scrollbar { width: 6px; }
.docs .docs-aside::-webkit-scrollbar-thumb { background: var(--d-line); border-radius: 3px; }

.docs .docs-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 16px; }
.docs .docs-brand__version { margin-left: auto; }
.docs .docs-brand__title { font-size: 15px; font-weight: 700; color: var(--d-ink); letter-spacing: -0.01em; text-decoration: none; }
.docs .docs-brand__version {
    font-family: var(--d-mono); font-size: 11px; font-weight: 600; color: var(--d-muted);
    border: 1px solid var(--d-line); background: var(--d-surface); border-radius: 999px; padding: 2px 8px;
}

.docs .docs-menu-toggle { display: none; }

.docs .docs-nav-group + .docs-nav-group { margin-top: 20px; }
.docs .docs-nav-label {
    padding: 0 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--d-faint);
}
.docs .docs-nav { display: flex; flex-direction: column; gap: 1px; }

.docs .docs-link {
    display: block; padding: 6px 10px; border-radius: var(--d-radius-sm);
    font-size: 14px; color: var(--d-text); text-decoration: none; line-height: 1.45;
    border-left: 2px solid transparent;
    transition: background-color .12s ease, color .12s ease;
}
.docs .docs-link:hover { background: var(--d-line-soft); color: var(--d-ink); }
.docs .docs-link--active,
.docs .docs-link--active:hover { background: var(--d-surface); color: var(--d-ink); font-weight: 600; border-left-color: var(--d-accent); box-shadow: 0 0 0 1px var(--d-line); }

.docs .docs-base {
    margin-top: 24px; padding: 14px; border: 1px solid var(--d-line); border-radius: 12px; background: var(--d-surface);
}
.docs .docs-base__label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--d-faint); }
.docs .docs-base__url {
    margin-top: 6px; font-family: var(--d-mono); font-size: 12.5px; color: var(--d-ink);
    background: var(--d-subtle); border: 1px solid var(--d-line); border-radius: 6px; padding: 6px 8px; word-break: break-all;
}
.docs .docs-base__links { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.docs .docs-base__links a { font-size: 13px; color: var(--d-text); text-decoration: none; display: flex; align-items: center; gap: 6px; }
.docs .docs-base__links a:hover { color: var(--d-accent); }
.docs .docs-base__links a::before { content: "↓"; font-size: 12px; color: var(--d-faint); }

/* ---------- cards / sections ---------- */

.docs .card {
    background: var(--d-surface); border: 1px solid var(--d-line); border-radius: var(--d-radius);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03); scroll-margin-top: 96px;
}
.docs .card--padded { padding: 32px; }
.docs section[id] { scroll-margin-top: 96px; }

.docs .page-title {
    margin: 0; font-size: 30px; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; color: var(--d-ink);
}
.docs h2.page-title { font-size: 22px; }
.docs .page-subtitle { margin: 10px 0 0; font-size: 16px; line-height: 1.6; color: var(--d-muted); max-width: 72ch; }

.docs h2 { color: var(--d-ink); letter-spacing: -0.015em; }
.docs h2.text-lg, .docs h2.text-2xl { font-size: 20px; line-height: 1.3; font-weight: 650; margin: 0; }
.docs h3 { color: var(--d-ink); font-size: 16px; font-weight: 650; margin: 0; }

.docs .divider { height: 1px; background: var(--d-line); margin: 24px 0; border: 0; }

.docs .mini-card,
.docs .docs-card {
    background: var(--d-surface); border: 1px solid var(--d-line); border-radius: 12px; padding: 20px; min-width: 0;
}
.docs .mini-card + .mini-card { margin-top: 12px; }
.docs .grid > .mini-card + .mini-card { margin-top: 0; }

.docs .info-box {
    background: var(--d-subtle); border: 1px solid var(--d-line); border-radius: 12px; padding: 18px 20px; color: var(--d-text);
}
.docs .info-box .info-box { background: var(--d-surface); }
.docs .info-box__title { font-size: 12px; font-weight: 700; color: var(--d-ink); letter-spacing: 0.01em; }

.docs .docs-section-label,
.docs .mini-card > .text-xs.font-semibold:first-child,
.docs .mini-card > .text-xs.font-semibold {
    font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--d-muted);
}

/* ---------- prose ---------- */

.docs .prose-lite { font-size: 15px; line-height: 1.7; color: var(--d-text); }
.docs .prose-lite p { margin: 12px 0 0; }
.docs .prose-lite > p:first-child { margin-top: 0; }
.docs .prose-lite ol,
.docs .prose-lite ul,
.docs .docs-content ol,
.docs .docs-content ul.list { margin: 0; padding-left: 20px; }
.docs .prose-lite ol { list-style: decimal; }
.docs .prose-lite ul { list-style: disc; }
.docs .prose-lite li + li { margin-top: 6px; }
.docs b, .docs strong { color: var(--d-ink); font-weight: 600; }

.docs .hint { margin-top: 8px; font-size: 13px; line-height: 1.55; color: var(--d-muted); }

.docs a.docs-link-underline,
.docs a.link-underline,
.docs .prose-lite a,
.docs .hint a {
    color: var(--d-accent); text-decoration: underline; text-decoration-color: var(--d-accent-bd);
    text-underline-offset: 3px; text-decoration-thickness: 1.5px;
}
.docs a.docs-link-underline:hover,
.docs a.link-underline:hover,
.docs .prose-lite a:hover { text-decoration-color: var(--d-accent); }

/* ---------- code ---------- */

.docs .code-pill,
.docs .badge-mono {
    font-family: var(--d-mono); font-size: 0.86em; font-weight: 500; color: var(--d-ink);
    background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 6px; padding: 1px 6px;
    white-space: nowrap; word-break: normal;
}
.docs td .code-pill { white-space: nowrap; }

.docs .code-block {
    position: relative; margin-top: 12px; background: var(--d-code-bg); color: var(--d-code-text);
    border: 1px solid var(--d-code-line); border-radius: 10px; padding: 14px 16px;
    font-family: var(--d-mono); font-size: 12.5px; line-height: 1.65; overflow-x: auto; white-space: pre;
    tab-size: 2;
}
.docs .code-block code,
.docs .code-block .code-block__pre {
    font-family: inherit; font-size: inherit; color: inherit; background: none; border: 0; padding: 0; white-space: pre;
}
.docs div.code-block .code-block__pre { white-space: pre-wrap; word-break: break-all; }
.docs .code-block::-webkit-scrollbar { height: 8px; }
.docs .code-block::-webkit-scrollbar-thumb { background: #30363d; border-radius: 4px; }

.docs .code-copy {
    position: absolute; top: 8px; right: 8px; font-family: "DM Sans", system-ui, sans-serif; font-size: 11.5px; font-weight: 600;
    color: #c9d1d9; background: #161b22; border: 1px solid #30363d; border-radius: 6px; padding: 3px 8px; cursor: pointer;
    opacity: 0; transition: opacity .15s ease;
}
.docs .code-block:hover .code-copy,
.docs .code-copy:focus-visible { opacity: 1; }
.docs .code-copy[data-done] { color: #3fb950; }

/* ---------- tables ---------- */

.docs .table-wrap,
.docs .docs-table-wrap { margin-top: 12px; border: 1px solid var(--d-line); border-radius: 10px; overflow-x: auto; background: var(--d-surface); }
.docs table.table,
.docs table.docs-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.docs .table-th {
    text-align: left; padding: 10px 14px; background: var(--d-subtle); color: var(--d-muted);
    font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; border-bottom: 1px solid var(--d-line);
    white-space: nowrap;
}
.docs .table-td { padding: 10px 14px; vertical-align: top; color: var(--d-text); border-bottom: 1px solid var(--d-line-soft); line-height: 1.5; }
.docs tbody .table-tr:last-child .table-td { border-bottom: 0; }
.docs tbody .table-tr:hover .table-td { background: #fcfcfd; }

/* ---------- badges, methods, dots ---------- */

.docs .badge {
    display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px;
    font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap;
    color: var(--d-text); background: var(--d-subtle); border: 1px solid var(--d-line);
}
.docs .badge--active  { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.docs .badge--warn    { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.docs .badge--premium { color: #6d28d9; background: #f5f3ff; border-color: #ddd6fe; }

.docs .badge-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--d-faint); }
.docs .badge-dot--active { background: #10b981; }
.docs .badge-dot--warn   { background: #f59e0b; }

.docs .status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--d-faint); }
.docs .status-dot--active  { background: #10b981; }
.docs .status-dot--info    { background: #3b82f6; }
.docs .status-dot--pending { background: #f59e0b; }

.docs .method {
    display: inline-flex; align-items: center; justify-content: center; min-width: 52px; height: 24px; padding: 0 8px;
    border-radius: 6px; font-family: var(--d-mono); font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em; flex-shrink: 0;
    border: 1px solid transparent;
}
.docs .method--get    { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.docs .method--post   { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.docs .method--put    { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.docs .method--patch  { color: #6d28d9; background: #f5f3ff; border-color: #ddd6fe; }
.docs .method--delete { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }

/* endpoint path under the title: show as a monospace line, not a chip */
.docs .endpoint-path .code-pill { background: none; border: 0; padding: 0; font-size: 14px; color: var(--d-text); white-space: normal; word-break: break-all; }

.docs .anchor-link {
    display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px;
    color: var(--d-faint); text-decoration: none; font-weight: 600; font-size: 16px; border: 1px solid transparent;
}
.docs .anchor-link:hover { color: var(--d-accent); border-color: var(--d-line); background: var(--d-subtle); }

/* ---------- buttons ---------- */

.docs .btn, .docs .btn-dark, .docs .btn-outline {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px;
    border-radius: 10px; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer;
    transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.docs .btn--sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.docs .btn-dark, .docs .btn--primary { background: var(--d-brand); color: #fff; border: 1px solid var(--d-brand); }
.docs .btn-dark:hover, .docs .btn--primary:hover { background: #000; border-color: #000; }
.docs .btn-outline, .docs .btn--ghost { background: var(--d-surface); color: var(--d-ink); border: 1px solid var(--d-line); }
.docs .btn-outline:hover, .docs .btn--ghost:hover { border-color: #cbd5e1; background: var(--d-subtle); }

/* ---------- docs home ---------- */

.docs .docs-hero { padding: 40px 36px; }
.docs .docs-eyebrow {
    display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--d-accent); background: var(--d-accent-bg); border: 1px solid var(--d-accent-bd);
    border-radius: 999px; padding: 4px 10px; margin-bottom: 16px;
}
.docs .docs-hero .page-title { font-size: 36px; }
.docs .docs-hero__actions { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 10px; }
.docs .docs-hero__facts { margin-top: 28px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.docs .docs-fact { border-top: 1px solid var(--d-line); padding-top: 12px; }
.docs .docs-fact__title { font-size: 14px; font-weight: 650; color: var(--d-ink); }
.docs .docs-fact__text { margin-top: 2px; font-size: 13.5px; color: var(--d-muted); line-height: 1.5; }

.docs .docs-steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 16px; }
.docs .docs-steps > li { counter-increment: step; position: relative; padding-left: 44px; }
.docs .docs-steps > li::before {
    content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
    color: var(--d-ink); background: var(--d-subtle); border: 1px solid var(--d-line);
}
.docs .docs-steps__title { font-size: 15px; font-weight: 650; color: var(--d-ink); line-height: 28px; }
.docs .docs-steps__text { font-size: 14px; color: var(--d-muted); }

.docs .docs-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.docs .docs-tile {
    display: block; padding: 18px; border: 1px solid var(--d-line); border-radius: 12px; background: var(--d-surface);
    text-decoration: none; color: inherit; transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.docs .docs-tile:hover { border-color: #cbd5e1; box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06); transform: translateY(-1px); }
.docs .docs-tile__title { font-size: 15px; font-weight: 650; color: var(--d-ink); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.docs .docs-tile__title::after { content: "→"; color: var(--d-faint); font-weight: 500; transition: transform .12s ease, color .12s ease; }
.docs .docs-tile:hover .docs-tile__title::after { color: var(--d-accent); transform: translateX(2px); }
.docs .docs-tile__text { margin-top: 4px; font-size: 13.5px; line-height: 1.5; color: var(--d-muted); }

.docs .docs-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.docs .docs-heading h2 { margin: 0; font-size: 20px; font-weight: 700; }
.docs .docs-heading p { margin: 4px 0 0; font-size: 14px; color: var(--d-muted); }

/* ---------- utilities the docs templates use ---------- */
/* Defined here so the docs do not depend on a Tailwind build that is not in git. */

.docs .flex { display: flex; }
.docs .grid { display: grid; }
.docs .flex-col { flex-direction: column; }
.docs .flex-wrap { flex-wrap: wrap; }
.docs .items-start { align-items: flex-start; }
.docs .items-center { align-items: center; }
.docs .justify-between { justify-content: space-between; }
.docs .min-w-0 { min-width: 0; }
.docs .shrink-0 { flex-shrink: 0; }
.docs .w-full { width: 100%; }
.docs .gap-2 { gap: 8px; }
.docs .gap-3 { gap: 12px; }
.docs .space-y-1 > * + * { margin-top: 4px; }
.docs .space-y-2 > * + * { margin-top: 8px; }
.docs .space-y-3 > * + * { margin-top: 12px; }
.docs .space-y-4 > * + * { margin-top: 16px; }
.docs .m-0 { margin: 0; }
.docs .mb-0 { margin-bottom: 0; }
.docs .mt-1 { margin-top: 4px; }
.docs .mt-2 { margin-top: 8px; }
.docs .mt-3 { margin-top: 12px; }
.docs .p-3 { padding: 12px; }
.docs .p-4 { padding: 16px; }
.docs .pl-5 { padding-left: 20px; }
.docs .list-disc { list-style: disc; }
.docs .text-xs { font-size: 12px; line-height: 1.5; }
.docs .text-sm { font-size: 14px; line-height: 1.6; }
.docs .text-lg { font-size: 18px; line-height: 1.4; }
.docs .text-2xl { font-size: 22px; line-height: 1.3; }
.docs .font-semibold { font-weight: 600; }
.docs .tracking-tight { letter-spacing: -0.015em; }
.docs .break-words { overflow-wrap: anywhere; }
.docs .underline { text-decoration: underline; }
.docs .underline-offset-4 { text-underline-offset: 4px; }
.docs .rounded-xl { border-radius: 12px; }
.docs .border { border: 1px solid var(--d-line); }
.docs .border-divider,
.docs .border-slate-200 { border-color: var(--d-line); }
.docs .bg-slate-50,
.docs .bg-surface-alt { background: var(--d-subtle); }
.docs .text-slate-900,
.docs .text-primary,
.docs .text-label,
.docs .text-body { color: var(--d-ink); }
.docs .text-slate-700,
.docs .text-secondary { color: var(--d-text); }
.docs .text-slate-600,
.docs .text-slate-500,
.docs .text-muted,
.docs .text-meta { color: var(--d-muted); }
.docs .text-faint { color: var(--d-faint); }
.docs .sm\:flex-row { }
.docs .md\:grid-cols-2,
.docs .md\:grid-cols-3 { grid-template-columns: minmax(0, 1fr); }

@media (min-width: 640px) {
    .docs .sm\:flex-row { flex-direction: row; }
    .docs .sm\:items-start { align-items: flex-start; }
    .docs .sm\:justify-between { justify-content: space-between; }
}
@media (min-width: 768px) {
    .docs .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .docs .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- responsive shell ---------- */

@media (max-width: 1023px) {
    .docs .docs-shell { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 16px 16px 64px; }
    .docs .docs-aside {
        position: static; max-height: none; overflow: visible; padding: 12px; background: var(--d-surface);
        border: 1px solid var(--d-line); border-radius: var(--d-radius);
    }
    .docs .docs-brand { padding: 0; }
    .docs .docs-brand__version { margin-left: 0; }
    .docs .docs-menu-toggle { margin-left: auto; }
    .docs .docs-menu-toggle {
        display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 8px;
        border: 1px solid var(--d-line); background: var(--d-subtle); color: var(--d-ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
    }
    .docs .docs-aside__body { display: none; margin-top: 16px; }
    .docs .docs-aside[data-open] .docs-aside__body { display: block; }
    .docs .card--padded { padding: 22px 18px; }
    .docs .docs-hero { padding: 28px 20px; }
    .docs .page-title, .docs .docs-hero .page-title { font-size: 26px; }
    .docs .docs-tiles, .docs .docs-hero__facts { grid-template-columns: minmax(0, 1fr); }
    .docs .code-copy { opacity: 1; }
}
@media (min-width: 640px) and (max-width: 1023px) {
    .docs .docs-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- /docs/api/claude: "how it works" demo (.cdemo) ----------
   An example Claude conversation that plays itself. Every line keeps its place
   in the layout from the start (only opacity and a small lift change), so the
   page below never jumps while it plays. Hidden states apply only once the
   script has added .cdemo--js: without JS, or with reduced motion, the whole
   conversation is simply shown. */

.docs .cdemo { margin: 24px 0 0; }

.docs .cdemo__window {
    border: 1px solid var(--d-line); border-radius: var(--d-radius); overflow: hidden;
    background: var(--d-subtle); box-shadow: 0 10px 30px -18px rgba(15, 23, 42, 0.25);
}
.docs .cdemo__bar {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px;
    background: var(--d-surface); border-bottom: 1px solid var(--d-line);
}
.docs .cdemo__dots { display: inline-flex; gap: 6px; }
.docs .cdemo__dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--d-line); display: block; }
.docs .cdemo__bar-title { font-size: 13px; font-weight: 650; color: var(--d-ink); }
.docs .cdemo__bar-tag {
    margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--d-muted);
}

.docs .cdemo__chat { padding: 18px; display: flex; flex-direction: column; gap: 10px; }

.docs .cdemo__msg { font-size: 14px; line-height: 1.55; max-width: 560px; }
.docs .cdemo__msg b { color: var(--d-ink); }
.docs .cdemo__msg--user {
    align-self: flex-end; background: var(--d-brand); color: #f8fafc;
    padding: 10px 14px; border-radius: 14px 14px 4px 14px;
}
.docs .cdemo__msg--claude { color: var(--d-text); padding: 2px 2px; }

.docs .cdemo__typed::after {
    content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 1px;
    vertical-align: -2px; background: currentColor; opacity: 0;
}
.docs .cdemo--js .cdemo__msg--user.is-shown:not(.is-done) .cdemo__typed::after { animation: cdemo-caret 0.9s steps(1) infinite; }

.docs .cdemo__tool {
    align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
    padding: 7px 12px; border: 1px solid var(--d-line); border-radius: 999px; background: var(--d-surface);
    font-size: 13px; color: var(--d-muted);
}
.docs .cdemo__tool-name b { color: var(--d-ink); font-weight: 600; }
.docs .cdemo__tool-state {
    font-family: var(--d-mono); font-size: 11px; color: var(--d-accent);
    background: var(--d-accent-bg); border: 1px solid var(--d-accent-bd); border-radius: 999px; padding: 1px 7px;
    white-space: nowrap;
}
/* Finished: a green tick. Running (only with JS): a spinner. */
.docs .cdemo__tool-icon {
    flex: none; width: 14px; height: 14px; border-radius: 50%; position: relative; background: #10b981;
}
.docs .cdemo__tool-icon::after {
    content: ""; position: absolute; left: 4px; top: 2px; width: 4px; height: 7px;
    border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.docs .cdemo--js .cdemo__tool:not(.is-done) .cdemo__tool-icon {
    background: transparent; border: 2px solid var(--d-line); border-top-color: var(--d-accent);
    animation: cdemo-spin 0.8s linear infinite;
}
.docs .cdemo--js .cdemo__tool:not(.is-done) .cdemo__tool-icon::after { display: none; }

.docs .cdemo__table {
    border: 1px solid var(--d-line); border-radius: 10px; background: var(--d-surface); overflow: hidden;
    font-size: 13px;
}
.docs .cdemo__row {
    display: grid; grid-template-columns: 1.1fr 1.3fr 1fr 1.4fr; gap: 12px;
    padding: 8px 12px; border-top: 1px solid var(--d-line-soft); color: var(--d-text);
}
.docs .cdemo__row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docs .cdemo__row b { color: var(--d-ink); font-weight: 600; }
.docs .cdemo__row--head {
    border-top: 0; background: var(--d-subtle);
    font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--d-faint);
}
.docs .cdemo__mail { font-family: var(--d-mono); font-size: 12px; color: #047857; }
.docs .cdemo__mail--none { color: var(--d-faint); font-family: inherit; font-style: italic; }
.docs .cdemo__more { padding: 7px 12px; border-top: 1px solid var(--d-line-soft); font-size: 12px; color: var(--d-muted); }

.docs ol.cdemo__steps {
    list-style: none; margin: 14px 0 0; padding: 0;
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
}
.docs .cdemo__steps li {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin: 0;
    border: 1px solid var(--d-line); border-radius: 10px; background: var(--d-surface);
    font-size: 13.5px; font-weight: 600; color: var(--d-ink);
    transition: border-color .3s ease, background-color .3s ease, color .3s ease;
}
.docs .cdemo__step-n {
    flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center;
    font-size: 12px; font-weight: 700; background: var(--d-line-soft); color: var(--d-muted);
    transition: background-color .3s ease, color .3s ease;
}
.docs .cdemo--js .cdemo__steps li { color: var(--d-muted); }
.docs .cdemo--js .cdemo__steps li.is-active { color: var(--d-ink); border-color: var(--d-accent-bd); background: var(--d-accent-bg); }
.docs .cdemo--js .cdemo__steps li.is-active .cdemo__step-n { background: var(--d-accent); color: #fff; }

.docs .cdemo__caption { margin-top: 8px; font-size: 12px; color: var(--d-faint); }

/* Playback states. */
.docs .cdemo--js [data-at] {
    opacity: 0; transform: translateY(6px);
    transition: opacity .35s ease, transform .35s ease;
}
.docs .cdemo--js [data-at].is-shown { opacity: 1; transform: none; }
.docs .cdemo--js .cdemo__table .cdemo__row,
.docs .cdemo--js .cdemo__table .cdemo__more { opacity: 0; transition: opacity .3s ease; }
.docs .cdemo--js .cdemo__table.is-shown .cdemo__row,
.docs .cdemo--js .cdemo__table.is-shown .cdemo__more { opacity: 1; }
.docs .cdemo--js .cdemo__table.is-shown .cdemo__row:nth-child(2) { transition-delay: .15s; }
.docs .cdemo--js .cdemo__table.is-shown .cdemo__row:nth-child(3) { transition-delay: .3s; }
.docs .cdemo--js .cdemo__table.is-shown .cdemo__row:nth-child(4) { transition-delay: .45s; }
.docs .cdemo--js .cdemo__table.is-shown .cdemo__row:nth-child(5) { transition-delay: .6s; }
.docs .cdemo--js .cdemo__table.is-shown .cdemo__more { transition-delay: .75s; }

@keyframes cdemo-spin  { to { transform: rotate(360deg); } }
@keyframes cdemo-caret { 0% { opacity: 1; } 50% { opacity: 0; } }

@media (max-width: 639px) {
    .docs .cdemo__chat { padding: 14px; }
    .docs .cdemo__bar-tag { display: none; }
    /* Two lines per lead: name and email, then title at company. */
    .docs .cdemo__row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 2px 10px; }
    .docs .cdemo__row--head { display: none; }
    .docs .cdemo__row > span:nth-child(2),
    .docs .cdemo__row > span:nth-child(3) { grid-row: 2; font-size: 12px; color: var(--d-muted); }
    .docs .cdemo__row > span:nth-child(2) { grid-column: 1; }
    .docs .cdemo__row > span:nth-child(3) { grid-column: 2; text-align: right; }
    .docs .cdemo__row > span:nth-child(4) { grid-column: 2; grid-row: 1; text-align: right; }
    .docs ol.cdemo__steps { grid-template-columns: 1fr; gap: 6px; }
}
