/* ==========================================================================
   ru-openrouter.ru — Документация API (/v2/docs, /v2/docs/{slug})
   Страничные стили, подключаются в public/docs.twig
   Глобальные переменные тем — в public.css
   ========================================================================== */

.docs {
    --docs-sidebar-w: 282px;
    --doc-code-bg: #0d1424;
    --doc-code-text: #e6edf3;
    --doc-code-border: rgba(255, 255, 255, 0.08);
    --doc-inline-code-bg: rgba(14, 165, 233, 0.12);
    --doc-inline-code-text: #7dd3fc;
    --doc-accent-tint: rgba(14, 165, 233, 0.14);
}

html[data-theme="light"] .docs {
    --doc-code-border: rgba(13, 20, 36, 0.25);
    --doc-inline-code-bg: rgba(2, 132, 199, 0.10);
    --doc-inline-code-text: #0369a1;
    --doc-accent-tint: rgba(2, 132, 199, 0.10);
}
.site-main > .container { padding-top: 0px !important; }

/* Блокировка прокрутки при открытом мобильном сайдбаре */
body.docs-no-scroll { overflow: hidden; }

/* ===== Каркас: sidebar + контент ===== */
.docs-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.docs-main { min-width: 0; padding-top: 50px; }

/* ===== Кнопка вызова сайдбара (закреплена под шапкой) ===== */
.docs-sidebar-toggle {
    position: fixed;
    top: calc(47px + 10px);
    left: 10px;
    z-index: 9000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 80px;
    height: 40px;
    padding: 0 12px;
    color: var(--text);
    background: var(--glass-bg-strong);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    cursor: pointer;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
    transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.docs-sidebar-toggle:hover { background: var(--glass-hi); border-color: var(--accent); }
.docs-sidebar-toggle svg { width: 20px; height: 20px; }

.docs-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
}
.docs-sidebar-backdrop.is-visible { opacity: 1; visibility: visible; }

/* ===== Сайдбар ===== */
.docs-sidebar {
    background: var(--glass-bg-strong);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    box-shadow: var(--shadow);
    padding: 14px;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 10000;
    width: min(340px, 88vw);
    transform: translateX(-105%);
    transition: transform .35s cubic-bezier(.4, 0, .2, 1);
    overflow-y: auto;
    overscroll-behavior: contain;
}
.docs-sidebar.is-open { transform: translateX(0); }

.docs-sidebar__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 2px 4px 14px;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 12px;
}
.docs-sidebar__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-3));
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.35);
}
.docs-sidebar__badge svg { width: 20px; height: 20px; }
.docs-sidebar__heading { display: flex; flex-direction: column; min-width: 0; }
.docs-sidebar__title { font-size: 1rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.docs-sidebar__subtitle { font-size: 0.75rem; color: var(--text-muted); }
.docs-sidebar__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin-left: auto;
    flex-shrink: 0;
    color: var(--text);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    cursor: pointer;
    transition: background .2s ease;
}
.docs-sidebar__close:hover { background: var(--glass-hi); }
.docs-sidebar__close svg { width: 16px; height: 16px; }

/* ===== Поиск в сайдбаре ===== */
.docs-search { position: relative; margin-bottom: 12px; }
.docs-search__icon {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    color: var(--text-muted);
    display: inline-flex;
    pointer-events: none;
}
.docs-search__icon svg { width: 16px; height: 16px; }
.docs-search__input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    outline: none;
    transition: border-color .2s ease, background .2s ease;
}
.docs-search__input::placeholder { color: var(--text-muted); }
.docs-search__input:focus { border-color: var(--accent); background: var(--glass-bg); }

.docs-search__results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 60;
    display: none;
    background: var(--glass-bg-strong);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.30);
    overflow: hidden;
    max-height: 320px;
    overflow-y: auto;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.docs-search__results.is-active { display: block; }
.docs-search__item {
    display: block;
    padding: 10px 12px;
    text-decoration: none;
    border-bottom: 1px solid var(--glass-border);
}
.docs-search__item:last-child { border-bottom: 0; }
.docs-search__item:hover { background: var(--surface-2); }
.docs-search__item-title { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text); }
.docs-search__item-text {
    display: block;
    margin-top: 2px;
    font-size: 0.78rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
}
.docs-search__empty { padding: 12px; font-size: 0.85rem; color: var(--text-muted); text-align: center; }

/* ===== Навигация ===== */
.docs-nav__list {
    list-style: none;
    margin: 0 0 4px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.docs-nav__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 0.875rem;
    line-height: 1.35;
    color: var(--text-muted);
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}
.docs-nav__link svg { width: 16px; height: 16px; flex-shrink: 0; }
.docs-raw-icon { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; }
.docs-raw-icon svg { width: 16px; height: 16px; flex-shrink: 0; }
.docs-welcome-card__icon .docs-raw-icon svg { width: 18px; height: 18px; }
.docs-nav__section-name .docs-raw-icon svg { width: 16px; height: 16px; }
.docs-nav__link:hover { color: var(--text); background: var(--surface-2); }
.docs-nav__link.is-active {
    color: var(--text);
    background: var(--doc-accent-tint);
    box-shadow: inset 2px 0 0 var(--accent);
}
.docs-nav__section { margin-bottom: 4px; }
.docs-nav__section-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    background: none;
    border: 0;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    transition: background .15s ease;
}
.docs-nav__section-btn:hover { background: var(--surface-2); }
.docs-nav__section-name {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.docs-nav__section-name svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--accent-2); }
.docs-nav__chevron { display: inline-flex; color: var(--text-muted); transition: transform .25s ease; }
.docs-nav__chevron svg { width: 16px; height: 16px; }
.docs-nav__section.is-open .docs-nav__chevron { transform: rotate(180deg); }
.docs-nav__section .docs-nav__list { display: none; padding: 2px 0 4px 14px; }
.docs-nav__section.is-open .docs-nav__list { display: flex; }
.docs-nav__list--standalone { margin-bottom: 6px; }

/* ===== Хлебные крошки ===== */
.docs-breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
    font-size: 0.84rem;
    color: var(--text-muted);
}
.docs-breadcrumbs a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-2);
    text-decoration: none;
}
.docs-breadcrumbs a:hover { text-decoration: underline; }
.docs-breadcrumbs a svg { width: 14px; height: 14px; }
.docs-breadcrumbs__sep { display: inline-flex; color: var(--text-muted); opacity: .6; }
.docs-breadcrumbs__sep svg { width: 12px; height: 12px; }
.docs-breadcrumbs__current { color: var(--text); }

/* ===== Типографика контента документации ===== */
.doc-content { font-size: 0.95rem; line-height: 1.75; }
.doc-content h1 {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
    margin: 8px 0 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.doc-content h1:first-child { margin-top: 0; }
.doc-content h2 {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text);
    margin: 34px 0 14px;
}
.doc-content h3 {
    font-size: 1.15rem;
    font-weight: 650;
    color: var(--text);
    margin: 28px 0 12px;
}
.doc-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 24px 0 10px;
}
.doc-content p { margin: 0 0 14px; }
.doc-content a { color: var(--accent-2); }
.doc-content a:hover { text-decoration: underline; }
.doc-content strong { color: var(--text); font-weight: 600; }
.doc-content ul, .doc-content ol { margin: 0 0 14px; padding-left: 1.5rem; }
.doc-content li { margin-bottom: 6px; }
.doc-content li > ul, .doc-content li > ol { margin-top: 6px; margin-bottom: 6px; }
.doc-content img { max-width: 100%; height: auto; border-radius: 10px; }
.doc-content hr { border: 0; border-top: 1px solid var(--border); margin: 28px 0; }

/* Инлайн-код и блоки кода */
.doc-content code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.85em;
    color: var(--doc-inline-code-text);
    background: var(--doc-inline-code-bg);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 2px 6px;
    word-break: break-word;
}
.doc-content pre {
    background: var(--doc-code-bg);
    border: 1px solid var(--doc-code-border);
    border-radius: 12px;
    padding: 16px 18px;
    margin: 16px 0;
    overflow-x: auto;
    font-size: 0.84rem;
    line-height: 1.55;
}
.doc-content pre code {
    display: block;
    background: transparent;
    border: 0;
    padding: 0;
    color: var(--doc-code-text);
    font-size: inherit;
    white-space: pre;
    word-break: normal;
}

/* Таблицы (в контейнере с горизонтальной прокруткой) */
.doc-content__table-wrap {
    overflow-x: auto;
    margin: 16px 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    -webkit-overflow-scrolling: touch;
}
.doc-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
    margin: 0;
}
.doc-content th, .doc-content td {
    border: 1px solid var(--border);
    padding: 9px 12px;
    text-align: left;
    vertical-align: top;
}
.doc-content th {
    background: var(--surface-2);
    color: var(--text);
    font-weight: 600;
    white-space: nowrap;
}
.doc-content td { color: var(--text); }
.doc-content td code, .doc-content th code { white-space: nowrap; }

/* Цитаты-заметки */
.doc-content blockquote {
    margin: 16px 0;
    padding: 12px 16px;
    border-left: 3px solid var(--accent);
    border-radius: 0 12px 12px 0;
    background: var(--surface-2);
    color: var(--text-muted);
}

/* SVG-иконки внутри контента: перекрашиваем под темы новой версии */
.doc-content svg { flex-shrink: 0; }
.doc-content svg[stroke="#333"] { stroke: var(--text-muted); }
.doc-content svg[stroke="#856404"] { stroke: #fbbf24; }

/* ===== Оглавление (welcome) ===== */
.docs-welcome__head {
    position: relative;
    text-align: center;
    padding: 26px 16px 30px;
    margin-bottom: 26px;
    overflow: hidden;
    margin-top:-50px;
}
.docs-welcome__glow {
    position: absolute;
    inset: -40% -20% auto;
    height: 220px;
    background: radial-gradient(50% 60% at 50% 30%, rgba(14, 165, 233, 0.22) 0%, transparent 70%);
    pointer-events: none;
}
.docs-welcome__icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-3));
    box-shadow: 0 12px 30px rgba(14, 165, 233, 0.4);
    margin-bottom: 16px;
}
.docs-welcome__icon svg { width: 28px; height: 28px; }
.docs-welcome__title {
    position: relative;
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 10px;
}
.docs-welcome__lead {
    position: relative;
    max-width: 720px;
    margin: 0 auto;
    color: var(--text-muted);
    font-size: 1rem;
}
.docs-welcome__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}
.docs-welcome-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    text-decoration: none;
    backdrop-filter: blur(10px);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.docs-welcome-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 14px 34px rgba(14, 165, 233, 0.18);
}
.docs-welcome-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: var(--accent-2);
    background: var(--doc-accent-tint);
}
.docs-welcome-card__icon svg { width: 18px; height: 18px; }
.docs-welcome-card__title { font-size: 0.95rem; font-weight: 650; color: var(--text); line-height: 1.3; }
.docs-welcome-card__text {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== Предыдущая / следующая ===== */
.docs-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 34px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
}
.docs-pager__link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    text-decoration: none;
    transition: border-color .2s ease, background .2s ease;
}
.docs-pager__link:hover { border-color: var(--accent); background: var(--glass-hi); }
.docs-pager__link--next { text-align: right; }
.docs-pager__label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.docs-pager__label svg { width: 14px; height: 14px; }
.docs-pager__title { font-size: 0.92rem; font-weight: 600; color: var(--text); }
.docs-pager__spacer { display: block; }

/* ===== Состояния (не найдено) ===== */
.docs-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    backdrop-filter: blur(10px);
}
.docs-state__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    color: var(--text-muted);
    background: var(--surface-2);
    margin-bottom: 16px;
}
.docs-state__icon svg { width: 26px; height: 26px; }
.docs-state__title { font-size: 1.4rem; font-weight: 700; color: var(--text); margin: 0 0 8px; }
.docs-state__text { color: var(--text-muted); max-width: 480px; margin: 0 auto 20px; }
.docs-state__btn { min-width: 200px; }

/* ===== Адаптивность ===== */
@media (min-width: 992px) {
    .docs-layout { grid-template-columns: var(--docs-sidebar-w) minmax(0, 1fr); gap: 28px; }
    .docs-sidebar {
        position: sticky;
        top: 84px;
        bottom: auto;
        width: auto;
        max-height: calc(100vh - 104px);
        transform: none;
        transition: none;
    }
    .docs-sidebar__close { display: none; }
    .docs-sidebar-toggle { display: none; }
    .docs-sidebar-backdrop { display: none; }
}

@media (max-width: 575.98px) {
    .doc-content h1 { font-size: 1.45rem; }
    .doc-content h2 { font-size: 1.25rem; }
    .doc-content pre { padding: 12px 14px; font-size: 0.78rem; }
    .docs-pager { grid-template-columns: 1fr; }
    .docs-pager__link--next { text-align: left; }
    .docs-welcome__title { font-size: 1.5rem; }
    .docs-ai-panel { width: calc(100vw - 24px); right: 12px; bottom: 84px; max-height: calc(100vh - 110px); }
}

/* ===== Подсветка кода (Prism) ===== */
/* Блок кода из контента: тёмный фон держим в обеих темах, Prism красит токены */
.doc-content pre code[class*="language-"] {
    background: transparent;
    border: 0;
}
/* Приглушающая подложка, чтобы контраст токенов оставался читаемым поверх стекла */
.doc-content pre { box-shadow: inset 0 0 0 1px var(--doc-code-border); }

/* ===== AI Ассистент по документации ===== */
.docs-ai-toggle {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 10300;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-3));
    border: 0;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(14, 165, 233, 0.45);
    transition: transform .2s ease, box-shadow .2s ease;
}
.docs-ai-toggle:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(14, 165, 233, 0.55); }
.docs-ai-toggle svg { width: 24px; height: 24px; }

.docs-ai-panel {
    position: fixed;
    right: 20px;
    bottom: 86px;
    z-index: 10400;
    display: flex;
    flex-direction: column;
    width: min(360px, calc(100vw - 40px));
    height: min(520px, 70vh);
    min-width: 280px;
    min-height: 320px;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 90px);
    resize: both;
    overflow: hidden;
    background: var(--glass-bg-strong);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(.98);
    transform-origin: bottom right;
    transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
}
.docs-ai-panel.is-open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

.docs-ai-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--glass-border);
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}
.docs-ai-head:active { cursor: grabbing; }
.docs-ai-panel.is-dragging { user-select: none; -webkit-user-select: none; }
.docs-ai-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}
.docs-ai-title svg { width: 18px; height: 18px; color: var(--accent-2); }
.docs-ai-actions { display: inline-flex; align-items: center; gap: 6px; }
.docs-ai-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 9px;
    color: var(--text-muted);
    background: var(--surface-2);
    cursor: pointer;
    transition: color .15s ease, background .15s ease;
}
.docs-ai-btn:hover { color: var(--text); background: var(--glass-hi); }
.docs-ai-btn svg { width: 16px; height: 16px; }

.docs-ai-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overscroll-behavior: contain;
}
.docs-ai-msg {
    max-width: 92%;
    padding: 9px 12px;
    border-radius: 13px;
    font-size: 0.86rem;
    line-height: 1.55;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.docs-ai-msg p { margin: 0; white-space: pre-wrap; }
.docs-ai-msg--ai {
    align-self: flex-start;
    background: var(--surface-2);
    color: var(--text);
    border-top-left-radius: 5px;
}
.docs-ai-msg--user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--accent), var(--accent-3));
    color: #fff;
    border-top-right-radius: 5px;
}
.docs-ai-msg code {
    font-family: "SFMono-Regular", Consolas, Menlo, monospace;
    font-size: 0.82em;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 4px;
    padding: 1px 4px;
}
.docs-ai-msg pre {
    background: #0d1424;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 10px;
    overflow-x: auto;
    margin: 8px 0;
}

.docs-ai-typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.docs-ai-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: docsAiBounce 1.2s infinite ease-in-out;
}
.docs-ai-typing span:nth-child(2) { animation-delay: .15s; }
.docs-ai-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes docsAiBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: .5; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.docs-ai-form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--glass-border);
}
.docs-ai-input-wrap { position: relative; flex: 1; min-width: 0; }
.docs-ai-textarea {
    width: 100%;
    max-height: 150px;
    padding: 9px 12px 18px;
    font-size: 0.86rem;
    font-family: inherit;
    line-height: 1.4;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--glass-border);
    border-radius: 11px;
    resize: none;
    outline: none;
}
.docs-ai-textarea:focus { border-color: var(--accent); }
.docs-ai-counter {
    position: absolute;
    right: 8px;
    bottom: 5px;
    font-size: 0.68rem;
    color: var(--text-muted);
    pointer-events: none;
}
.docs-ai-send {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    font-weight: 600;
}
.docs-ai-send svg { width: 18px; height: 18px; }
.docs-ai-send.is-loading svg { display: none; }
.docs-ai-send.is-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: docsAiSpin .7s linear infinite;
}
@keyframes docsAiSpin { to { transform: rotate(360deg); } }
