/* ==========================================================================
   Host An App — docs.css
   --------------------------------------------------------------------------
   Docs page + API-docs explorer: sidebar, search, endpoint cards, generated
   Projects reference, product switch, architecture diagram, animated docs
   blocks. Requires core.css. See AGENTS.md (CSS: modular stylesheets).
   ========================================================================== */
/* ==========================================================================
   Docs page (paper theme — body.paper)
   ========================================================================== */

.docs-layout { display: flex; flex: 1; flex-direction: column; min-height: 0; }
@media (min-width: 1024px) { .docs-layout { flex-direction: row; } }
[hidden] { display: none !important; }
.docs-content section { scroll-margin-top: 140px; }
/* ----- Documentation search (client-side, generated index) ----- */

/* ----- API explorer sidebar: truncation + filter ----- */

.sidebar-filter {
    display: block;
    width: calc(100% - 1.5rem);
    margin: .35rem .75rem .5rem;
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--paper-bright);
    font: inherit;
    font-size: .7rem;
    color: var(--ink);
}

.sidebar-filter:focus {
    outline: none;
    border-color: var(--orange);
}

.sidebar-endpoints__group[hidden] { display: none; }

.sidebar-endpoints__tag {
    margin-top: .5rem;
    padding: 0 .75rem;
    font-family: var(--mono);
    font-size: .65rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
}

.sidebar-endpoints__link {
    display: flex;
    align-items: center;
    gap: .3rem;
    min-width: 0;
}

.sidebar-endpoints__link[hidden] { display: none; }

.sidebar-endpoints__link .badge {
    flex-shrink: 0;
    font-size: .55rem;
}

/* One line, never three: the full path lives in the link's title. */
.sidebar-endpoints__path {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-empty {
    margin: .35rem .75rem .5rem;
    font-size: .7rem;
    color: var(--muted);
}

.docs-search-trigger {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper-bright);
    color: var(--muted);
    font: inherit;
    font-size: 12.5px;
    cursor: pointer;
}

.docs-search-trigger:hover { color: var(--ink); border-color: var(--border-active); }
.docs-search-trigger__icon { font-size: 14px; line-height: 1; }
.docs-search-trigger__key {
    font-family: var(--mono);
    font-size: 10.5px;
    padding: 1px 5px;
    border: 1px solid var(--line);
    border-radius: 4px;
}

.docs-search {
    position: fixed;
    inset: 0;
    z-index: 90;
}

.docs-search__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(23, 23, 21, .38);
    backdrop-filter: blur(2px);
}

.docs-search__dialog {
    position: relative;
    width: min(680px, calc(100vw - 32px));
    margin: 12vh auto 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--paper);
    box-shadow: 0 28px 80px rgba(23, 23, 21, .22);
    overflow: hidden;
}

.docs-search__bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
}

.docs-search__icon { color: var(--muted); font-size: 16px; }

.docs-search__input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 15px;
    color: var(--ink);
    outline: none;
}

.docs-search__close {
    font-family: var(--mono);
    font-size: 11px;
    padding: 3px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--paper-bright);
    color: var(--muted);
    cursor: pointer;
}

.docs-search__results {
    list-style: none;
    margin: 0;
    padding: 6px;
    max-height: 54vh;
    overflow-y: auto;
}

.docs-search__result a {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 9px 11px;
    border-radius: 9px;
    text-decoration: none;
    color: inherit;
}

.docs-search__result a:hover,
.docs-search__result.is-active a { background: var(--orange-soft); }

.docs-search__result-title { font-weight: 600; font-size: 13.5px; }
.docs-search__result-page { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.docs-search__result-text {
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.45;
}

.docs-search__hint {
    margin: 0;
    padding: 12px 16px 14px;
    font-size: 12.5px;
    color: var(--muted);
    border-top: 1px solid var(--line);
}

@media (max-width: 640px) {

    .docs-search-trigger span:not(.docs-search-trigger__icon) { display: none; }
    .docs-search__dialog { margin-top: 6vh; }
}

.docs-sidebar { padding: 1.75rem 0.9rem; border-right: 1px solid var(--line); }
@media (min-width: 1024px) { .docs-sidebar { position: fixed; top: 80px; left: 0; bottom: 0; width: 250px; overflow-y: auto; } }
.docs-sidebar-inner { display: flex; flex-direction: column; gap: 1.25rem; }
.docs-nav-toggle { display: none; }

/* Mobile: the sidebar becomes a tappable, collapsible "On this page" menu.
   No more hidden horizontal scroll — one obvious control that expands the
   section list vertically. */
@media (max-width: 1023px) {

  .docs-sidebar {
    position: sticky; top: 80px; z-index: 40;
    padding: 0.6rem 1.25rem 0.75rem; border-right: 0; border-bottom: 1px solid var(--line);
    background: var(--header-bg);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  }
  .docs-nav-toggle {
    display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 0.75rem;
    padding: 0.5rem 0.25rem; margin: 0; background: none; border: 0;
    font-family: var(--font-sans); font-size: 0.8125rem; font-weight: 600;
    letter-spacing: -0.01em; color: var(--ink); cursor: pointer; text-align: left;
  }
  .docs-nav-toggle__label { display: inline-flex; align-items: center; gap: 0.5rem; }
  .docs-nav-toggle__label::before { content: ''; width: 0.375rem; height: 0.375rem; border-radius: 50%; background: var(--orange); }
  .docs-nav-toggle__icon {
    display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem;
    border-radius: 0.5rem; background: var(--orange-soft); color: var(--orange);
    font-size: 1.125rem; font-weight: 500; line-height: 1;
    transition: transform 0.18s ease;
  }
  .docs-nav-toggle[aria-expanded='true'] .docs-nav-toggle__icon { transform: rotate(45deg); }
  .docs-sidebar-inner {
    display: none; flex-direction: column; gap: 0.125rem;
    padding-top: 0.5rem; margin-top: 0.5rem; border-top: 1px solid var(--line);
  }
  .docs-sidebar-inner.is-open { display: flex; }
  .sidebar-group { flex-direction: column; gap: 0.125rem; padding: 0.25rem 0; }
  .docs-sidebar .section-title { display: block; }
  .docs-sidebar .nav-link { white-space: normal; flex-shrink: 0; padding: 0.5rem 0.75rem; border-radius: 0.5rem; }
  /* Long endpoint paths (e.g. webhook routes) must wrap, not overflow. */
  .docs-sidebar .nav-link { overflow-wrap: anywhere; word-break: break-word; }
  .docs-sidebar .nav-link .badge { flex-shrink: 0; }
}

/* Small screens: let endpoint cards wrap so long paths fit the viewport. */
@media (max-width: 639px) {

  .endpoint-head { flex-wrap: wrap; row-gap: 0.25rem; }
  .endpoint-head .endpoint-path { overflow-wrap: anywhere; word-break: break-word; min-width: 0; flex: 1 1 100%; }
  .endpoint-head .endpoint-summary { max-width: 100%; text-align: left; margin-left: 0; flex-basis: 100%; }
}
.sidebar-group { display: flex; flex-direction: column; gap: 0.125rem; }
.section-title { font-size: 0.625rem; font-family: var(--font-mono); font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 0.5rem; padding: 0 0.75rem; }
.nav-link { display: block; padding: 0.4rem 0.75rem; font-size: 0.8125rem; color: var(--muted); border-radius: 0.5rem; transition: color 0.15s ease, background 0.15s ease; font-family: var(--font-sans); }
.nav-link:hover { color: var(--ink); background: var(--bg-surface-hover); }
.nav-link.active { color: var(--orange); background: var(--orange-soft); font-weight: 600; }

.docs-content { flex: 1; min-width: 0; }
@media (min-width: 1024px) { .docs-content { margin-left: 250px; } }
.docs-content__inner { max-width: 50rem; margin-inline: auto; padding: 2.75rem 1.5rem 5rem; }
@media (min-width: 640px) { .docs-content__inner { padding: 3rem 2.5rem 5rem; } }
.docs-content section { margin-bottom: 4rem; }
.docs-content h1 { margin: 0 0 1.25rem; font-size: clamp(2.125rem, 5vw, 2.875rem); font-weight: 700; letter-spacing: -0.055em; line-height: 1.0; color: var(--ink); }
.docs-content h1 em, .docs-content h2 em { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.02em; }
.docs-content h2 { margin: 0 0 1rem; font-size: 1.375rem; font-weight: 700; letter-spacing: -0.035em; color: var(--ink); }
.docs-content h3 { margin: 0 0 0.75rem; font-size: 0.9375rem; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.docs-content h4 { margin: 0 0 0.25rem; font-size: 0.875rem; font-weight: 700; color: var(--ink); }
.docs-content p { margin: 0 0 1rem; font-size: 0.875rem; color: var(--muted); line-height: 1.65; }
.docs-content p strong { color: var(--ink); font-weight: 600; }
.docs-content code { font-size: 0.8125rem; }
.docs-content .lead { font-size: 1rem; max-width: 38rem; margin-bottom: 2rem; color: var(--muted); }
.docs-content .code-block { margin-bottom: 1.5rem; }
.docs-content .doc-card { margin-bottom: 0; }
.docs-content ol { margin: 0 0 1rem; padding-left: 1.25rem; font-size: 0.875rem; color: var(--muted); line-height: 1.7; display: flex; flex-direction: column; gap: 0.5rem; }
.docs-content ol li::marker { color: var(--orange); font-family: var(--font-mono); font-size: 0.75rem; }

.docs-content .table-card { background: var(--bg-surface); border: 1px solid var(--line-strong); border-radius: 1rem; overflow-x: auto; margin: 0 -1.5rem 1.5rem; }
@media (max-width: 639px) { .docs-content .table-card { margin-inline: -1rem; } }
@media (min-width: 640px) { .docs-content .table-card { margin-inline: 0; } }
.docs-content .table-card .param-table th, .docs-content .table-card .param-table td { padding-inline: 1rem; }
.docs-content .stack { display: flex; flex-direction: column; gap: 0.75rem; }
.docs-content .row { display: flex; align-items: center; gap: 0.75rem; }

/* ——— Generated Projects reference (docs) ———
   Body rendered by `make docs-projects` from internal/projects/docs.md
   (goldmark output, headings demoted one level). Scoped under .docs-md so
   the hand-written page keeps its own components untouched. */
.docs-md h3 { margin-top: 2rem; }
.docs-md h4 { margin-top: 1.5rem; }
.docs-md .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.docs-md strong { color: var(--ink); font-weight: 600; }
.docs-md table { width: 100%; border-collapse: collapse; margin: 0 0 1.5rem; font-size: 0.8125rem; }
.docs-md th { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--line-strong); font-family: var(--font-mono); font-size: 0.625rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.docs-md td { padding: 0.625rem 0.75rem; border-bottom: 1px solid var(--line-strong); color: var(--muted); vertical-align: top; }
.docs-md tr:last-child td { border-bottom: 0; }

/* ——— Product switch (docs): sticky segmented control, one track at a time ——— */
.doc-switch { position: sticky; top: 80px; z-index: 30; margin: 2.5rem -1.5rem 2rem; padding: 0.625rem 1.5rem; background: var(--header-bg); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
@media (min-width: 640px) { .doc-switch { margin-inline: -2.5rem; padding-inline: 2.5rem; } }
.doc-switch__tabs { display: flex; gap: 0.375rem; background: rgba(23, 23, 21, 0.05); border: 1px solid var(--line); border-radius: 999px; padding: 0.3rem; }
.doc-switch__tab { flex: 1; display: flex; align-items: center; justify-content: center; gap: 0.625rem; padding: 0.55rem 1rem; border: none; border-radius: 999px; background: transparent; cursor: pointer; font: inherit; color: var(--muted); transition: background .15s ease, color .15s ease, box-shadow .15s ease; }
.doc-switch__tab:hover { color: var(--ink); }
.doc-switch__tab:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.doc-switch__tab.is-active { background: var(--ink-panel); color: var(--on-ink); box-shadow: 0 4px 14px rgba(23, 23, 21, 0.18); }
.doc-switch__num { display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 999px; font-family: var(--font-mono); font-size: 0.75rem; font-weight: 700; color: var(--post-ink); background: var(--orange-soft); flex-shrink: 0; }
.doc-switch__tab.is-active .doc-switch__num { color: var(--on-accent); background: var(--orange); }
.doc-switch__text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.doc-switch__name { font-size: 0.9375rem; font-weight: 700; letter-spacing: -0.02em; }
.doc-switch__hint { font-family: var(--font-mono); font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.07em; }
/* Inactive tabs draw the hint over the track (rgba(23,23,21,.05) on --paper):
   --muted alone composites to 4.49:1 there, so the hint takes the darker
   --text (11.6:1). The active tab keeps its inherited white on --ink. */
.doc-switch__tab:not(.is-active) .doc-switch__hint { color: var(--text); }
@media (max-width: 479px) { .doc-switch__hint { display: none; } }

/* ——— Model diagram (docs, managed): an animated architecture diagram ———
   Owner chain (vertical): you → namespace → project.
   Request path (horizontal, inside the project): users → frontends → backend.
   Color key: blue = public pages/entry · green = private data · amber = the
   action call · orange = the credential and everything it unlocks. */
.doc-arch { display: flex; flex-direction: column; margin: 0 0 1.75rem; }

/* owner apex — the root of the ownership chain */
.doc-arch__owner {
    display: flex; align-items: center; gap: 0.7rem;
    width: fit-content; max-width: 100%; margin: 0 auto;
    padding: 0.55rem 1rem;
    border: 1.5px solid rgba(181, 58, 10, 0.42);
    border-radius: 1rem;
    background: var(--orange-soft);
    box-shadow: 0 2px 0 rgba(181, 58, 10, 0.07) inset;
}
.doc-arch__owner-icon {
    width: 36px; height: 36px; flex-shrink: 0;
    display: grid; place-items: center;
    border-radius: 0.7rem; background: #fff;
    border: 1px solid rgba(181, 58, 10, 0.42); color: var(--orange);
}
.doc-arch__owner-icon svg { width: 19px; height: 19px; }
.doc-arch__owner-meta { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.doc-arch__owner-name { display: flex; align-items: center; gap: 0.55rem; font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); flex-wrap: wrap; }
.doc-arch__owner-role { font-family: var(--font-mono); font-size: 0.52rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.13em; color: var(--orange); padding: 0.06rem 0.4rem; border-radius: 999px; border: 1px solid rgba(181, 58, 10, 0.3); }
.doc-arch__owner-desc { font-family: var(--font-mono); font-size: 0.68rem; line-height: 1.5; color: var(--muted); letter-spacing: 0.02em; }

/* vertical spine connector (owner → namespace) */
.doc-arch__spine { position: relative; height: 2.3rem; display: flex; align-items: center; justify-content: center; }
.doc-arch__spine-rail { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; transform: translateX(-50%); border-radius: 2px; background: linear-gradient(180deg, rgba(181, 58, 10, 0.55), rgba(181, 58, 10, 0.16)); }
.doc-arch__spine-dot {
    position: absolute; top: -5px; left: 50%; width: 9px; height: 9px; margin-left: -4.5px;
    border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 3px rgba(181, 58, 10, 0.18);
    animation: doc-arch-flow 1.9s ease-in-out infinite;
}
.doc-arch__spine-label {
    position: relative; z-index: 1; padding: 0.13rem 0.6rem;
    font-family: var(--font-mono); font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.13em;
    color: var(--orange); background: var(--paper); border: 1px solid rgba(181, 58, 10, 0.26);
    border-radius: 999px; white-space: nowrap;
}
@keyframes doc-arch-flow { 0% { top: -5px; opacity: 0; } 14% { opacity: 1; } 86% { opacity: 1; } 100% { top: calc(100% - 5px); opacity: 0; } }

/* namespace = the account envelope */
.doc-arch__scope { border: 1.5px dashed var(--border-active); border-radius: 1.25rem; padding: 1.05rem 1.05rem 1.1rem; background: var(--bg-surface); }
.doc-arch__scope-head { display: flex; align-items: center; gap: 0.65rem; margin-bottom: 0.85rem; }
.doc-arch__scope-icon { width: 33px; height: 33px; flex-shrink: 0; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 0.55rem; background: var(--paper-bright); color: var(--orange); }
.doc-arch__scope-icon svg { width: 16px; height: 16px; }
.doc-arch__scope-text { display: flex; flex-direction: column; gap: 0.05rem; min-width: 0; }
.doc-arch__scope-title { font-size: 0.9375rem; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.doc-arch__scope-sub { font-family: var(--font-mono); font-size: 0.64rem; color: var(--muted); letter-spacing: 0.02em; }
.doc-arch__scope-count { margin-left: auto; flex-shrink: 0; padding: 0.28rem 0.6rem; border: 1px solid var(--line); border-radius: 999px; background: var(--paper-bright); font-family: var(--font-mono); font-size: 0.62rem; color: var(--muted); white-space: nowrap; }

.doc-arch__projects { display: flex; flex-direction: column; gap: 0.6rem; }
.doc-arch__project { background: var(--paper-bright); border: 1px solid var(--line); border-radius: 1rem; overflow: hidden; }
.doc-arch__project--stub { opacity: 0.7; }
.doc-arch__proj-head { display: flex; align-items: center; gap: 0.55rem; padding: 0.55rem 0.85rem; border-bottom: 1px solid var(--line); }
.doc-arch__project--stub .doc-arch__proj-head { border-bottom: none; }
.doc-arch__proj-icon { width: 25px; height: 25px; flex-shrink: 0; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 0.45rem; background: var(--paper-bright); color: var(--muted); }
.doc-arch__proj-icon svg { width: 13px; height: 13px; }
.doc-arch__proj-name { font-size: 0.8rem; font-weight: 700; color: var(--ink); }
.doc-arch__proj-label { margin-left: auto; font-family: var(--font-mono); font-size: 0.62rem; color: var(--muted); letter-spacing: 0.02em; text-align: right; }
.doc-arch__proj-body { padding: 0.8rem; }

/* the request path as one connected horizontal row */
.doc-arch__row { display: grid; grid-template-columns: auto 2.6rem minmax(0, 1fr) 5.4rem minmax(0, 1.35fr); gap: 0.35rem; align-items: stretch; }

.doc-arch__node { display: flex; flex-direction: column; justify-content: center; gap: 0.45rem; border-radius: 0.75rem; padding: 0.6rem 0.7rem; }
.doc-arch__node-name { font-size: 0.8rem; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.doc-arch__node-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; font-size: 0.8rem; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.doc-arch__node-head em { font-style: normal; font-family: var(--font-mono); font-size: 0.66rem; color: var(--muted); font-weight: 400; }
.doc-arch__node-note { font-family: var(--font-mono); font-size: 0.58rem; line-height: 1.5; color: var(--muted); }

/* the public audience (external actors) consuming the frontend */
.doc-arch__aud { align-items: center; text-align: center; border: 1.5px solid rgba(119, 118, 108, 0.28); background: rgba(23, 23, 21, 0.04); }
.doc-arch__aud-icon { width: 34px; height: 34px; margin: 0 auto; display: grid; place-items: center; border-radius: 999px; background: var(--paper-bright); border: 1px solid var(--line); color: var(--muted); }
.doc-arch__aud-icon svg { width: 17px; height: 17px; }

/* frontends plane (public) */
.doc-arch__fe { border: 1px solid rgba(63, 97, 255, 0.32); background: rgba(63, 97, 255, 0.06); }
.doc-arch__fe-types { font-family: var(--font-mono); font-size: 0.58rem; line-height: 1.7; color: var(--muted); }

/* backend plane (private): actions surface on the left, data core on the right */
.doc-arch__be { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 0.5rem; border: 1px solid rgba(32, 165, 107, 0.34); background: rgba(32, 165, 107, 0.06); padding: 0.5rem 0.6rem; min-width: 0; }
.doc-arch__be-acts { display: flex; flex-direction: column; gap: 0.25rem; align-items: stretch; border: 1px dashed rgba(185, 122, 31, 0.5); background: rgba(185, 122, 31, 0.08); border-radius: 0.55rem; padding: 0.4rem 0.5rem; }
.doc-arch__be-acts .doc-arch__node-name { font-size: 0.56rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--warning); }
.doc-arch__act { font-family: var(--font-mono); font-size: 0.58rem; color: var(--muted); background: var(--paper-bright); border: 1px solid var(--line); border-radius: 0.35rem; padding: 0.1rem 0.4rem; text-align: left; }
.doc-arch__be-core { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.doc-arch__db-icon { color: var(--green); flex-shrink: 0; display: grid; place-items: center; }
.doc-arch__db-icon svg { width: 26px; height: 26px; }
.doc-arch__db-text { display: flex; flex-direction: column; gap: 0.2rem; align-items: flex-start; min-width: 0; }

.doc-arch__pill { align-self: flex-start; font-family: var(--font-mono); font-size: 0.5rem; text-transform: uppercase; letter-spacing: 0.1em; padding: 0.12rem 0.5rem; border-radius: 999px; white-space: nowrap; }
.doc-arch__pill--pub { color: var(--blue); background: rgba(63, 97, 255, 0.12); border: 1px solid rgba(63, 97, 255, 0.3); }
.doc-arch__pill--own { color: var(--orange); background: var(--orange-soft); border: 1px solid rgba(181, 58, 10, 0.34); }

/* horizontal connectors joining the nodes (animated request flow) */
.doc-arch__cn { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.3rem; min-height: 6rem; }
.doc-arch__cn-rail { position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; border-radius: 2px; background: linear-gradient(90deg, rgba(119, 118, 108, 0.45), rgba(119, 118, 108, 0.12)); }
.doc-arch__cn--op .doc-arch__cn-rail { background: linear-gradient(90deg, rgba(185, 122, 31, 0.5), rgba(185, 122, 31, 0.16)); }
.doc-arch__cn-rail::after {
    content: ""; position: absolute; right: -1px; top: 50%; margin-top: -4px;
    width: 0; height: 0;
    border-top: 4px solid transparent; border-bottom: 4px solid transparent;
}
.doc-arch__cn--pub .doc-arch__cn-rail::after { border-left: 6px solid rgba(119, 118, 108, 0.6); }
.doc-arch__cn--op .doc-arch__cn-rail::after { border-left: 6px solid rgba(185, 122, 31, 0.7); }
.doc-arch__cn-dot {
    position: absolute; left: -5px; top: 50%; width: 8px; height: 8px; margin-top: -4px;
    border-radius: 50%; background: var(--muted);
    animation: doc-arch-run 1.5s linear infinite;
}
.doc-arch__cn--op .doc-arch__cn-dot { background: var(--warning); box-shadow: 0 0 0 3px rgba(185, 122, 31, 0.18); animation-delay: 0.5s; }
@keyframes doc-arch-run { 0% { left: -4px; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { left: calc(100% - 2px); opacity: 0; } }
.doc-arch__cn-label { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 0.05rem; font-family: var(--font-mono); font-size: 0.56rem; font-weight: 700; line-height: 1.2; color: var(--warning); text-align: center; background: var(--paper-bright); border: 1px solid rgba(185, 122, 31, 0.26); border-radius: 0.45rem; padding: 0.24rem 0.4rem; box-shadow: 0 2px 8px rgba(23, 23, 21, 0.05); }
.doc-arch__cn--pub .doc-arch__cn-label { color: var(--muted); font-size: 0.5rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; border-color: var(--line); }
.doc-arch__cn-label em { font-style: normal; font-weight: 500; font-size: 0.48rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }

/* compact textual restatement of the data path, under the row */
.doc-arch__path { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.7rem; padding-top: 0.65rem; border-top: 1px dashed var(--line); }
.doc-arch__path-step { padding: 0.28rem 0.5rem; border: 1px solid var(--line); border-radius: 0.45rem; background: var(--paper-bright); font-family: var(--font-mono); font-size: 0.62rem; color: var(--muted); }
.doc-arch__path-step--pub { color: var(--blue); border-color: rgba(63, 97, 255, 0.3); }
.doc-arch__path-step--op { color: var(--warning); border-color: rgba(185, 122, 31, 0.38); font-weight: 500; background: rgba(185, 122, 31, 0.08); }
.doc-arch__path-step--be { color: var(--green); border-color: rgba(32, 165, 107, 0.34); }
.doc-arch__path-arr { font-size: 0.7rem; color: var(--muted); }

/* entrance cascade: top-down build, loops start after the section is visible */
@keyframes doc-arch-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes doc-arch-glow {
    0%, 100% { box-shadow: 0 2px 0 rgba(181, 58, 10, 0.07) inset, 0 0 0 0 rgba(181, 58, 10, 0); }
    50% { box-shadow: 0 2px 0 rgba(181, 58, 10, 0.08) inset, 0 0 0 8px rgba(181, 58, 10, 0.13); }
}
.reveal.visible .doc-arch__owner    { animation: doc-arch-rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.65s both, doc-arch-glow 3s ease-in-out 2.6s infinite; }
.reveal.visible .doc-arch__spine    { animation: doc-arch-rise 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) 0.95s both; }
.reveal.visible .doc-arch__scope    { animation: doc-arch-rise 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) 1.2s both; }
.reveal.visible .doc-arch__project  { animation: doc-arch-rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 1.45s both; }
.reveal.visible .doc-arch__project--stub { animation: doc-arch-rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 1.6s both; }
.reveal.visible .doc-arch__path     { animation: doc-arch-rise 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) 1.85s both; }
/* the live request flow pulses on the action call */
@keyframes doc-arch-opflow { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(185, 122, 31, 0); } 50% { transform: scale(1.03); box-shadow: 0 0 0 5px rgba(185, 122, 31, 0.18); } }
.reveal.visible .doc-arch__path-step--op { animation: doc-arch-opflow 2.6s ease-in-out 2.6s infinite; }
.reveal.visible .doc-arch__cn--op .doc-arch__cn-label { animation: doc-arch-opflow 2.6s ease-in-out 2.6s infinite; }

@media (max-width: 720px) {

    .doc-arch__row { grid-template-columns: minmax(0, 1fr); }
    .doc-arch__cn { min-height: 2.4rem; }
    .doc-arch__cn-rail { top: 0; bottom: 0; left: 50%; width: 2px; height: auto; margin: 0 0 0 -1px; background: linear-gradient(180deg, rgba(119, 118, 108, 0.4), rgba(119, 118, 108, 0.14)); }
    .doc-arch__cn--op .doc-arch__cn-rail { background: linear-gradient(180deg, rgba(185, 122, 31, 0.5), rgba(185, 122, 31, 0.16)); }
    .doc-arch__cn-rail::after { top: auto; right: auto; bottom: -1px; left: 50%; margin: 0 0 0 -4px; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: none; border-right: none; border-bottom: 6px solid rgba(185, 122, 31, 0.7); border-left: 4px solid transparent; border-right: 4px solid transparent; margin-left: -4px; }
    .doc-arch__cn--pub .doc-arch__cn-rail::after { border-bottom-color: rgba(119, 118, 108, 0.6); }
    .doc-arch__cn-dot { left: 50%; top: -4px; margin: 0 0 0 -4px; animation-name: doc-arch-fall; }
    .doc-arch__cn--op .doc-arch__cn-dot { animation-delay: 0.4s; }
    @keyframes doc-arch-fall { 0% { top: -4px; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { top: calc(100% - 2px); opacity: 0; } }
    .doc-arch__be { grid-template-columns: minmax(0, 1fr); }
    .doc-arch__be-acts { flex-direction: row; align-items: center; }
    .doc-arch__scope-sub, .doc-arch__proj-label { display: none; }
}
.docs-md ul { margin: 0 0 1rem; padding-left: 1.25rem; font-size: 0.875rem; color: var(--muted); line-height: 1.7; display: flex; flex-direction: column; gap: 0.5rem; }
.docs-md ul li::marker { color: var(--orange); font-family: var(--font-mono); font-size: 0.75rem; }
.docs-md pre { background: #181817; border: 1px solid #30302e; border-radius: 10px; padding: 1.125rem 1.25rem; margin: 0 0 1.5rem; overflow-x: auto; font-family: var(--font-mono); font-size: 0.8125rem; line-height: 1.8; color: #deddd8; }
/* Bare code fences in the docs/api-docs prose (not the .code-block chrome)
   must scroll instead of widening the page. Today every rendered <pre> sits
   in a .code-block or .docs-md wrapper that already scrolls; this rule is
   the safety net for future bare fences under .docs-content, plus the
   touch-momentum hint. */
.docs-content pre { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.docs-md pre code { font-size: inherit; background: none; border: none; padding: 0; border-radius: 0; color: inherit; }

/* ——— MCP setup tabs (docs) ——— */

/* white-logo pills need dark square so white SVG is always legible (inactive tab is light) */

/* ==========================================================================
   DOCS PAGE (hostan.app/docs) — animated paper theme
   Editorial, text-first docs with layered motion: scroll progress, ambient
   blobs, marquee, staggered reveals, counters, accordion and a live
   "publishing machine" terminal. All BEM under .doc-*.
   ========================================================================== */

/* Scroll progress bar */
.doc-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 2000;
    background: var(--orange);
    transform: scaleX(0);
    transform-origin: 0 50%;
    pointer-events: none;
}

/* Ambient background blobs */
.doc-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.doc-bg__blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .5;
}
.doc-bg__blob--a {
    width: 520px;
    height: 520px;
    top: -160px;
    right: -120px;
    background: radial-gradient(circle at 30% 30%, rgba(181, 58, 10, .28), transparent 70%);
    animation: docDrift 22s ease-in-out infinite alternate;
}
.doc-bg__blob--b {
    width: 420px;
    height: 420px;
    top: 30%;
    left: -160px;
    background: radial-gradient(circle at 30% 30%, rgba(23, 23, 21, .09), transparent 70%);
    animation: docDrift 28s ease-in-out infinite alternate-reverse;
}
.doc-bg__blob--c {
    width: 340px;
    height: 340px;
    bottom: 8%;
    right: 10%;
    background: radial-gradient(circle at 30% 30%, rgba(181, 58, 10, .12), transparent 70%);
    animation: docDrift 32s ease-in-out infinite alternate;
}
@keyframes docDrift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(-30px, 40px, 0) scale(1.12); }
}

/* Hero */
.doc-hero {
    position: relative;
    padding-top: 1rem;
}
.doc-kicker {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--orange);
    margin-bottom: 1rem;
}
.doc-title {
    margin-bottom: 1.25rem !important;
}
.doc-title__grad {
    background: linear-gradient(90deg, var(--orange), #d43d1f, var(--orange));
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: docGradShift 9s ease-in-out infinite;
}
@keyframes docGradShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Hero actions */
.doc-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1.5rem 0 2rem;
}
.doc-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.25rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), box-shadow .25s ease;
}
.doc-cta__arrow {
    display: inline-block;
    transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
}
.doc-cta:hover { transform: translateY(-2px); }
.doc-cta:hover .doc-cta__arrow { transform: translate(2px, -2px); }
.doc-cta--primary {
    background: var(--ink-panel);
    color: var(--on-ink);
    box-shadow: 0 12px 30px rgba(23, 23, 21, .18);
}
.doc-cta--primary:hover { box-shadow: 0 16px 38px rgba(181, 58, 10, .28); }
.doc-cta--ghost {
    background: var(--bg-surface);
    border: 1px solid var(--line);
    color: var(--ink);
}

/* The publishing machine (terminal) */
.doc-terminal {
    /* Dark panel on a paper page: the shared paper accent (#b53a0a) is
       link ink for light surfaces only — on this #1d1d1b panel it measures
       2.87:1. The bright burnt-orange keeps the terminal's prompt, cursor
       and URL link readable (5.97:1). */
    --orange: #ff6b3d;
    --term-ink: #deddd8;
    --term-bg: #1d1d1b;
    max-width: 34rem;
    background: var(--term-bg);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(23, 23, 21, .22);
    font-family: var(--mono);
    margin: 1.5rem 0 0.5rem;
    transition: box-shadow .4s ease;
}
.doc-terminal.is-live { box-shadow: 0 24px 70px rgba(181, 58, 10, .28); }
.doc-terminal__head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.doc-terminal__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4a4a47;
}
.doc-terminal__dot:nth-child(1) { background: #ff512b; }
.doc-terminal__dot:nth-child(2) { background: #4a4a46; }
.doc-terminal__dot:nth-child(3) { background: #5c5c57; }
.doc-terminal__label {
    margin-left: auto;
    font-size: 0.68rem;
    color: #9a9893;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.doc-terminal__body {
    padding: 1rem 1.1rem;
    min-height: 4.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.doc-terminal__row {
    display: block;
    font-size: 0.85rem;
    color: var(--term-ink);
    white-space: pre-wrap;
    word-break: break-word;
}
.doc-terminal__prompt { color: var(--orange); }
.doc-terminal__row.is-typing .doc-terminal__text::after {
    content: "▌";
    color: var(--orange);
    animation: docCursor .9s step-end infinite;
}
@keyframes docCursor { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.doc-terminal__url {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.1rem 1rem;
    font-size: 0.85rem;
}
.doc-terminal__check {
    color: var(--orange);
    font-weight: 700;
    animation: docCheckPop .5s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes docCheckPop {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.doc-terminal__url a {
    color: var(--orange);
    text-decoration: none;
    border-bottom: 1px dotted rgba(181, 58, 10, .5);
    word-break: break-all;
}
.doc-terminal__url a:hover { text-decoration: underline; }

/* Content-type marquee */
.doc-marquee {
    position: relative;
    overflow: hidden;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 1rem 0;
    margin: 2.5rem 0 3.5rem;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.doc-marquee__track {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    width: max-content;
    animation: docMarquee 26s linear infinite;
}
.doc-marquee__item {
    font-family: var(--serif);
    font-size: 1.5rem;
    color: var(--muted);
    white-space: nowrap;
}
.doc-marquee__dot { color: var(--orange); font-size: 0.9rem; }
@keyframes docMarquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* Section lead */
.doc-section-lead {
    max-width: 40rem;
    color: var(--muted);
}

/* Sub-heading inside a docs section (the section itself owns the h2). */
.doc-subhead {
    font-size: 17px;
    font-weight: 700;
    margin: 34px 0 0;
}

/* Publishing cards grid */
.doc-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}
.doc-cardx {
    background: var(--paper-bright);
    border: 1px solid var(--line);
    border-radius: 1rem;
    padding: 1.25rem;
    transition: transform .35s cubic-bezier(.34, 1.56, .64, 1), box-shadow .35s ease, border-color .35s ease, opacity .7s cubic-bezier(.2, .8, .2, 1);
}
.doc-cardx:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 40px rgba(23, 23, 21, .10);
    border-color: rgba(23, 23, 21, .22);
}
.doc-cardx__icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--orange-soft);
    color: var(--ink);
    margin-bottom: 0.9rem;
    transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), color .3s ease;
}
.doc-cardx__icon svg { width: 20px; height: 20px; }
.doc-cardx:hover .doc-cardx__icon { transform: scale(1.12) rotate(-4deg); color: var(--orange); }
.doc-cardx h4 { margin-bottom: 0.4rem; }
.doc-cardx p { font-size: 0.8rem; margin: 0; }

/* Steps */
.doc-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 1.5rem;
    position: relative;
}
.doc-steps::before {
    content: "";
    position: absolute;
    left: 23px;
    top: 18px;
    bottom: 18px;
    width: 2px;
    background: var(--orange);
    opacity: .28;
}
.doc-step {
    position: relative;
    display: flex;
    gap: 1.1rem;
    padding: 0.4rem 0 1.4rem;
}
.doc-step__num {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--paper-bright);
    border: 1px solid var(--line);
    font-family: var(--serif);
    font-size: 1.3rem;
    color: var(--orange);
    transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), background .3s ease, color .3s ease;
}
.doc-step:hover .doc-step__num {
    transform: scale(1.12);
    background: var(--ink-panel);
    color: var(--on-ink);
    border-color: var(--ink-panel);
}
.doc-step__body h4 { margin-bottom: 0.3rem; }
.doc-step__body p { font-size: 0.85rem; margin: 0; }

/* Callouts */
.doc-callout {
    display: flex;
    gap: 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: 1rem;
    padding: 1.25rem;
    margin-top: 1.25rem;
    transition: border-color .3s ease, box-shadow .3s ease;
}
.doc-callout:hover {
    border-color: rgba(23, 23, 21, .2);
    box-shadow: 0 14px 34px rgba(23, 23, 21, .07);
}

.doc-callout__badge {
    flex-shrink: 0;
    align-self: flex-start;
    font-family: var(--mono);
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--orange);
    background: var(--orange-soft);
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
}
.doc-callout__body p { font-size: 0.875rem; }

/* Counters */
.doc-counters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin: 1.75rem 0 1.25rem;
}
.doc-counter {
    background: var(--paper-bright);
    border: 1px solid var(--line);
    border-radius: 1rem;
    padding: 1.5rem 1.25rem;
    text-align: center;
    transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), box-shadow .3s ease, opacity .7s cubic-bezier(.2, .8, .2, 1);
}
.doc-counter:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 34px rgba(23, 23, 21, .09);
}
.doc-counter__num {
    font-family: var(--serif);
    font-size: clamp(2rem, 4vw, 2.75rem);
    line-height: 1;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.doc-counter__num:not([data-count="0"]):before {
    content: "";
    display: block;
    width: 28px;
    height: 3px;
    margin: 0 auto 0.6rem;
    border-radius: 2px;
    background: var(--orange);
}
.doc-counter__label {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--muted);
}

/* API reference split */

/* Grid tracks are minmax(auto, 1fr): without min-width 0 the no-wrap <pre> in the
   code column forces the grid (and the page, and the sticky header) wider than
   phone viewports. Let the pre scroll inside its card instead. */

/* FAQ accordion */
.doc-faq {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 1.25rem;
}
.doc-faq__item {
    background: var(--paper-bright);
    border: 1px solid var(--line);
    border-radius: 0.9rem;
    overflow: hidden;
    transition: border-color .3s ease, box-shadow .3s ease;
}
.doc-faq__item:hover { border-color: rgba(23, 23, 21, .22); }
.doc-faq__item.is-open { border-color: rgba(181, 58, 10, .4); box-shadow: 0 12px 30px rgba(181, 58, 10, .08); }
.doc-faq__trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    background: transparent;
    border: 0;
    cursor: pointer;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--ink);
}
.doc-faq__icon {
    flex-shrink: 0;
    font-size: 1.1rem;
    color: var(--orange);
    transition: transform .3s cubic-bezier(.34, 1.56, .64, 1);
}
.doc-faq__item.is-open .doc-faq__icon { transform: rotate(45deg); }
.doc-faq__panel {
    padding: 0 1.1rem 1rem;
    font-size: 0.875rem;
    color: var(--muted);
}
.doc-faq__panel:not([hidden]) {
    animation: docPanelIn .3s cubic-bezier(.2, .8, .2, 1);
}
@keyframes docPanelIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: none; }
}
.doc-faq__panel p { margin: 0; }

/* Docs health dot: green when ok, red when down — the same semantics as the
   landing and API docs (no docs-specific orange override; orange reads as an
   error). Warm code-property accents for /docs stay here. */

/* Small print + flush helpers (replace inline styles in the markup) */
.docs-content .doc-note {
    font-size: 0.8125rem;
    color: var(--muted);
    margin-top: 1rem;
}

.docs-content a.doc-link { color: var(--accent); }
.docs-content a.doc-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Stagger reveals within grids/steps/counters. Delays only apply while the
   element has not yet revealed (via :not(.visible)) so they do not linger and
   delay later hover transitions. */
.doc-cards .reveal:not(.visible):nth-child(1), .doc-steps .reveal:not(.visible):nth-child(1) { transition-delay: 0.05s; }
.doc-cards .reveal:not(.visible):nth-child(2), .doc-steps .reveal:not(.visible):nth-child(2) { transition-delay: 0.10s; }
.doc-cards .reveal:not(.visible):nth-child(3), .doc-steps .reveal:not(.visible):nth-child(3) { transition-delay: 0.15s; }
.doc-cards .reveal:not(.visible):nth-child(4), .doc-steps .reveal:not(.visible):nth-child(4) { transition-delay: 0.20s; }
.doc-cards .reveal:not(.visible):nth-child(5) { transition-delay: 0.25s; }
.doc-counters .reveal:not(.visible):nth-child(1) { transition-delay: 0.05s; }
.doc-counters .reveal:not(.visible):nth-child(2) { transition-delay: 0.10s; }
.doc-counters .reveal:not(.visible):nth-child(3) { transition-delay: 0.15s; }

/* Mobile refinements */
@media (max-width: 640px) {

    body.docs .docs-content__inner { padding: 2rem 1.1rem 4rem; }
    /* The switch bleeds to the container edge; its negative margin must match
       the narrower mobile padding, or it overflows the viewport by 0.4rem. */
    body.docs .doc-switch { margin-inline: -1.1rem; padding-inline: 1.1rem; }
    body.docs .header-right { gap: 10px; }
    body.docs #statusMeta { display: none; }
    .doc-hero__actions { flex-direction: column; align-items: stretch; }
    .doc-cta { justify-content: center; }
    .doc-marquee { margin: 2rem 0 2.5rem; padding: 0.85rem 0; }
    .doc-marquee__item { font-size: 1.15rem; }
    .doc-callout { flex-direction: column; gap: 0.75rem; }
    .doc-step { gap: 0.9rem; }
    .doc-step__num { width: 40px; height: 40px; font-size: 1.1rem; }
    .doc-steps::before { left: 19px; }
    .doc-counter { padding: 1.25rem 1rem; }
    .doc-cardx { padding: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {

    .doc-marquee__track { animation: none; }
    .doc-title__grad, .doc-bg__blob { animation: none; }
    .doc-terminal__row.is-typing .doc-terminal__text::after { animation: none; }
    .doc-faq__panel:not([hidden]) { animation: none; }
    /* the doc-arch cascade/loops use delayed animations that would otherwise
       leave the diagram hidden until each delay elapses; render it statically */
    .doc-arch__owner, .doc-arch__spine, .doc-arch__scope,
    .doc-arch__project, .doc-arch__path, .doc-arch__path-step--op,
    .doc-arch__cn .doc-arch__cn-label {
        animation: none !important;
    }
    .doc-arch__spine-dot { animation: none; top: calc(50% - 4.5px); opacity: 1; }
    .doc-arch__cn-dot { animation: none; opacity: 1; left: 50%; top: 50%; margin-left: -4px; margin-top: -4px; }
}

/* ==========================================================================
   API reference explorer (api-docs page)
   ========================================================================== */

.api-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0 1.25rem; }
.api-meta .badge { font-size: .625rem; }
.api-meta a.badge { text-decoration: underline; }

/* Collapsible endpoint cards */
.endpoint-card { background: var(--bg-surface); border: 1px solid var(--line); border-radius: 1rem; overflow: hidden; margin-bottom: 1.25rem; scroll-margin-top: 84px; }
.endpoint-head { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; }
.endpoint-head:hover { background: var(--bg-surface-hover); }
.endpoint-path { font-family: var(--mono); font-size: .8125rem; font-weight: 600; color: var(--ink); }
.endpoint-summary { font-size: .8125rem; color: var(--muted); margin-left: auto; text-align: right; max-width: 45%; }
.endpoint-body { display: none; padding: 1.25rem; }
.endpoint-card.is-open .endpoint-body { display: block; }
.endpoint-card.is-open .endpoint-head { background: var(--bg-surface-hover); }

.try-row { display: flex; gap: .5rem; margin-top: .75rem; flex-wrap: wrap; }
.api-try { margin-bottom: 1.5rem; }
.api-try h4 { margin-bottom: .4rem; }
.api-try p { font-size: .75rem; margin: 0; }
.mini-btn { font-family: var(--mono); font-size: .6875rem; padding: .45rem .7rem; border-radius: .5rem; border: 1px solid var(--line); background: var(--ink-panel); color: var(--on-ink); cursor: pointer; }
.mini-btn--ghost { background: var(--bg-surface); color: var(--ink); }
.mini-btn:hover { transform: translateY(-1px); }

.resp-row { display: flex; gap: .5rem; align-items: center; margin: .4rem 0; font-size: .8125rem; }
.resp-code { font-family: var(--mono); font-weight: 600; min-width: 2.5rem; }

.openapi-error { padding: 2rem; text-align: center; color: var(--muted); }
.api-hint { font-size: .8125rem; color: var(--muted); margin-top: -.5rem; margin-bottom: 1rem; }
