/**
 * Стили для публичной страницы документации /docs
 * Дизайн в стиле проекта ru-openrouter.ru (светлая тема)
 */

 .header-content {
        padding: 6px 0px;
        max-width: 95%;
 }
 @media (max-width: 768px) {
    .header-content {
        padding: 10px 0px;
    }
    }
/* ============================================
   SVG ICONS
   ============================================ */
.svg-icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.svg-icon--sm {
    width: 14px;
    height: 14px;
}

.svg-icon--lg {
    width: 24px;
    height: 24px;
}

.svg-icon--xl {
    width: 48px;
    height: 48px;
}

/* ============================================
   LAYOUT
   ============================================ */
.docs-layout {
    display: flex;
    min-height: calc(100vh - 60px);
    margin: 0 auto;
    position: relative;
}

/* Docs page: main на всю высоту, футер скрыт, хедер фиксирован */
.docs-page .header {
    height: 60px;
    box-sizing: border-box;
    border-bottom: none;
}

.main-docs-page {
    min-height: calc(100vh - 60px);
}

.main-docs-page + .footer {
    display: none;
}

/* ============================================
   SIDEBAR
   ============================================ */
.docs-sidebar {
    width: 280px;
    min-width: 280px;
    border-right: 1px solid var(--border-color, #e2e8f0);
    padding: 24px 0;
    height: calc(100vh - 60px);
    position: sticky;
    top: 60px;
    overflow-y: auto;
    background: var(--card-bg, #ffffff);
    z-index: 10;
    align-self: flex-start;
}

.docs-sidebar .sidebar-header {
    padding: 0 20px 16px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    margin-bottom: 12px;
}

.docs-sidebar .sidebar-header h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color, #1e293b);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.docs-sidebar .sidebar-header p {
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
    margin: 4px 0 0;
}

/* Search */
.sidebar-search {
    padding: 0 20px 16px;
    position: relative;
}

.sidebar-search input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    background: var(--bg-color, #f8fafc);
    color: var(--text-color, #1e293b);
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.sidebar-search input::placeholder {
    color: var(--text-muted, #64748b);
}

.sidebar-search input:focus {
    border-color: var(--primary-color, #2563eb);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.sidebar-search .search-icon {
    position: absolute;
    left: 32px;
    top: 32%;
    transform: translateY(-50%);
    color: var(--text-muted, #64748b);
    font-size: 0.85rem;
    pointer-events: none;
}

/* Search results */
.sidebar-search-results {
    position: absolute;
    top: 100%;
    left: 20px;
    right: 20px;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 50;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.sidebar-search-results.active {
    display: block;
}

.sidebar-search-results a {
    display: block;
    padding: 10px 14px;
    color: var(--text-color, #1e293b);
    text-decoration: none;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    transition: all 0.15s ease;
}

.sidebar-search-results a:last-child {
    border-bottom: none;
}

.sidebar-search-results a:hover {
    background: rgba(37, 99, 235, 0.05);
    color: var(--primary-color, #2563eb);
}

.sidebar-search-results .result-title {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-search-results .result-title svg {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px;
    max-height: 16px;
    flex-shrink: 0;
}

.sidebar-search-results .result-excerpt {
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-search-results .no-results {
    padding: 16px;
    text-align: center;
    color: var(--text-muted, #64748b);
    font-size: 0.85rem;
}

/* Navigation tree */
.sidebar-nav {
    padding: 0 12px;
}

.sidebar-nav .nav-section {
    margin-bottom: 4px;
}

.sidebar-nav .nav-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s ease;
    text-decoration: none;
}

.sidebar-nav .nav-section-title:hover {
    color: var(--text-color, #1e293b);
    background: var(--bg-color, #f8fafc);
}

.sidebar-nav .nav-section-title .section-icon {
    margin-right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-nav .nav-section-title .section-icon svg {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px;
    max-height: 18px;
}

.sidebar-nav .nav-section-title .collapse-icon {
    font-size: 0.65rem;
    transition: transform 0.2s ease;
}

.sidebar-nav .nav-section-title .collapse-icon.collapsed {
    transform: rotate(-90deg);
}

.sidebar-nav .nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav .nav-links.collapsed {
    display: none;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px 7px 28px;
    font-size: 0.85rem;
    color: var(--text-color, #1e293b);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.15s ease;
    line-height: 1.4;
}

.sidebar-nav .nav-link:hover {
    color: var(--primary-color, #2563eb);
    background: rgba(37, 99, 235, 0.05);
}

.sidebar-nav .nav-link.active {
    color: var(--primary-color, #2563eb);
    background: rgba(37, 99, 235, 0.08);
    font-weight: 600;
}

.sidebar-nav .nav-link .page-icon {
    font-size: 0.9rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}

.sidebar-nav .nav-link .page-icon svg {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px;
    max-height: 16px;
}

/* Sidebar toggle (mobile) */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 68px;
    left: 9px;
    z-index: 100;
    padding: 10px 14px;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    color: var(--text-color, #1e293b);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    align-items: center;
    gap: 8px;
}

.sidebar-toggle:hover {
    background: var(--bg-color, #f8fafc);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.docs-main {
    flex: 1;
    padding: 40px 56px;
    max-width: 860px;
    min-width: 0;
}

/* Breadcrumbs */
.docs-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
    flex-wrap: wrap;
}

.docs-breadcrumbs a {
    color: var(--text-muted, #64748b);
    text-decoration: none;
    transition: color 0.15s ease;
}

.docs-breadcrumbs a:hover {
    color: var(--primary-color, #2563eb);
}

.docs-breadcrumbs .separator {
    color: #94a3b8;
    font-size: 0.7rem;
}

.docs-breadcrumbs .current {
    color: var(--text-color, #1e293b);
    font-weight: 500;
}

/* Typography */
.docs-main h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-color, #1e293b);
    margin: 0 0 16px;
    line-height: 1.3;
}

.docs-main h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color, #1e293b);
    margin: 32px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.docs-main h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-color, #1e293b);
    margin: 24px 0 10px;
}

.docs-main p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-color, #1e293b);
    margin: 0 0 16px;
}

.docs-main p.lead {
    font-size: 1.1rem;
    color: var(--text-muted, #64748b);
    line-height: 1.8;
}

.docs-main ul, .docs-main ol {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-color, #1e293b);
    margin: 0 0 16px;
    padding-left: 24px;
}

.docs-main li {
    margin-bottom: 6px;
}

.docs-main li strong {
    color: var(--text-color, #1e293b);
}

.docs-main a {
    color: var(--primary-color, #2563eb);
    text-decoration: none;
    transition: color 0.15s ease;
}

.docs-main a:hover {
    color: var(--primary-hover, #1d4ed8);    
}

.docs-main code {
    font-family: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
    font-size: 0.85em;
    padding: 2px 6px;    
    border-radius: 4px;
    background: rgba(255, 255, 255, 0) !important;
    color: #3894c3;
}

.docs-main pre {
    margin: 16px 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color, #e2e8f0);
}

/* Code blocks */
.code {
    background: #f8fafc;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    padding: 16px 20px;
    overflow-x: auto;
    margin: 16px 0;
    position: relative;
}

.code code {
    background: none;
    padding: 0;
    color: var(--text-color, #1e293b);
    font-size: 0.85rem;
    line-height: 1.6;
    white-space: pre;
}

/* Info boxes */
.info-box {
    padding: 16px 20px;
    border-radius: 8px;
    margin: 16px 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

.info-box.blue {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0369a1;
}

.info-box.amber {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.info-box.green {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.info-box.red {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.info-box strong {
    color: inherit;
}

.info-box code {
    background: rgba(255, 255, 255, 0.8);
    color: inherit;
}

/* Endpoint blocks */
.endpoint-block {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--bg-color, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    margin: 12px 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}

.endpoint-block .method {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.endpoint-block .method.get {
    background: #dcfce7;
    color: #16a34a;
}

.endpoint-block .method.post {
    background: #dbeafe;
    color: #2563eb;
}

.endpoint-block .method.put {
    background: #fef3c7;
    color: #d97706;
}

.endpoint-block .method.delete {
    background: #fef2f2;
    color: #dc2626;
}

.endpoint-block .path {
    color: var(--text-color, #1e293b);
}

.endpoint-block .copy-btn {
    padding: 4px 10px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted, #64748b);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-left: auto;
}

.endpoint-block .copy-btn:hover {
    background: var(--bg-color, #f8fafc);
    color: var(--text-color, #1e293b);
}

/* Tables */
.docs-main table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 0.9rem;
}

.docs-main table thead th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color, #e2e8f0);
    background: var(--bg-color, #f8fafc);
}

.docs-main table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    color: var(--text-color, #1e293b);
}

.docs-main table tbody tr:hover {
    background: var(--bg-color, #f8fafc);
}

.docs-main table tbody td code {
    font-size: 0.8rem;
}

/* Steps */
.steps {
    list-style: none;
    padding: 0;
    counter-reset: step-counter;
}

.steps li {
    counter-increment: step-counter;
    padding: 16px 20px 16px 50px;
    position: relative;
    background: var(--bg-color, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    margin-bottom: 12px;
}

.steps li::before {
    content: counter(step-counter);
    position: absolute;
    left: 14px;
    top: 16px;
    width: 26px;
    height: 26px;
    background: #dbeafe;
    color: var(--primary-color, #2563eb);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Method badges in tables */
.method-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.method-badge.get {
    background: #dcfce7;
    color: #16a34a;
}

.method-badge.post {
    background: #dbeafe;
    color: #2563eb;
}

/* ============================================
   PAGE NAVIGATION (prev/next)
   ============================================ */
.page-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color, #e2e8f0);
}

.page-nav a {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 20px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    flex: 1;
    max-width: 50%;
}

.page-nav a:hover {
    border-color: var(--primary-color, #2563eb);
    background: rgba(37, 99, 235, 0.05);
}

.page-nav a.next {
    text-align: right;
}

.page-nav .nav-label {
    font-size: 0.7rem;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.page-nav .nav-title {
    font-size: 0.9rem;
    color: var(--text-color, #1e293b);
    font-weight: 600;
}

.page-nav a:hover .nav-title {
    color: var(--primary-color, #2563eb);
}

/* ============================================
   WELCOME / LANDING PAGE
   ============================================ */
.docs-welcome {
    text-align: center;
    padding: 60px 20px;
}

.docs-welcome .welcome-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.docs-welcome h1 {
    font-size: 2.5rem;
    color: var(--text-color, #1e293b);
    margin: 0 0 12px;
}

.docs-welcome p.lead {
    font-size: 1.15rem;
    color: var(--text-muted, #64748b);
    max-width: 600px;
    margin: 0 auto 40px;
}

.docs-welcome .welcome-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.docs-welcome .welcome-section-card {
    padding: 24px;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.docs-welcome .welcome-section-card:hover {
    border-color: var(--primary-color, #2563eb);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.12);
    transform: translateY(-2px);
}

.docs-welcome .welcome-section-card .card-icon {
    font-size: 2rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.docs-welcome .welcome-section-card .card-icon svg {
    width: 32px !important;
    height: 32px !important;
    max-width: 32px;
    max-height: 32px;
}

.docs-welcome .welcome-section-card h3 {
    color: var(--text-color, #1e293b);
    margin: 0 0 6px;
    font-size: 1rem;
}

.docs-welcome .welcome-section-card p {
    color: var(--text-muted, #64748b);
    font-size: 0.85rem;
    margin: 0;
}

/* ============================================
   AI ASSISTANT
   ============================================ */
.docs-assistant-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color, #2563eb);
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
    transition: all 0.2s ease;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
}

.docs-assistant-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

.docs-assistant-panel {
    position: fixed;
    bottom: 88px;
    right: 24px;
    width: 480px;
    height: 600px;
    min-width: 320px;
    min-height: 400px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 120px);
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    resize: both;
    z-index: 5000;
}

.docs-assistant-panel.active {
    display: flex;
}

.docs-assistant-panel .assistant-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-color, #f8fafc);
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.docs-assistant-panel .assistant-header:active {
    cursor: grabbing;
}

.docs-assistant-panel .assistant-header .drag-handle {
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.4;
    margin-right: 8px;
}

.docs-assistant-panel .assistant-header .drag-handle span {
    width: 4px;
    height: 4px;
    background: var(--text-muted, #64748b);
    border-radius: 50%;
}

.docs-assistant-panel .assistant-header h3 {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-color, #1e293b);
    display: flex;
    align-items: center;
    gap: 8px;
}

.docs-assistant-panel .assistant-header .close-btn {
    background: none;
    border: none;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.docs-assistant-panel .assistant-header .close-btn:hover {
    color: var(--text-color, #1e293b);
}

.docs-assistant-panel .assistant-header .assistant-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

.docs-assistant-panel .assistant-header .clear-btn {
    background: none;
    border: none;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.docs-assistant-panel .assistant-header .clear-btn:hover {
    color: #ef4444;
}

.docs-assistant-panel .assistant-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.docs-assistant-panel .assistant-message {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.5;
    max-width: 100%;
}

.docs-assistant-panel .assistant-message.user {
    background: #dbeafe;
    color: var(--text-color, #1e293b);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.docs-assistant-panel .assistant-message.ai {
    background: var(--bg-color, #f8fafc);
    color: var(--text-color, #1e293b);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.docs-assistant-panel .assistant-message.ai p {
    margin: 0 0 8px;
    color: var(--text-color, #1e293b);
    font-size: 0.85rem;
    line-height: 1.5;
}

.docs-assistant-panel .assistant-message.ai p:last-child {
    margin-bottom: 0;
}

.docs-assistant-panel .assistant-message.ai code {
    font-size: 0.8rem;
    padding: 1px 4px;
    background: #f1f5f9;
    border-radius: 3px;
    color: #e11d48;
    text-wrap: auto;
}

/* Markdown-элементы в сообщениях AI */
.docs-assistant-panel .assistant-message.ai h1,
.docs-assistant-panel .assistant-message.ai h2,
.docs-assistant-panel .assistant-message.ai h3,
.docs-assistant-panel .assistant-message.ai h4 {
    margin: 0.75em 0 0.35em;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-color, #1e293b);
}
.docs-assistant-panel .assistant-message.ai h1 { font-size: 1.1rem; }
.docs-assistant-panel .assistant-message.ai h2 { font-size: 1rem; }
.docs-assistant-panel .assistant-message.ai h3 { font-size: 0.95rem; }
.docs-assistant-panel .assistant-message.ai ul,
.docs-assistant-panel .assistant-message.ai ol {
    margin: 0.4em 0;
    padding-left: 1.3em;
}
.docs-assistant-panel .assistant-message.ai li {
    margin: 0.2em 0;
    line-height: 1.5;
}
.docs-assistant-panel .assistant-message.ai blockquote {
    margin: 0.4em 0;
    padding: 0.4em 0.8em;
    border-left: 3px solid #cbd5e1;
    background: #f1f5f9;
    border-radius: 0 4px 4px 0;
    color: #475569;
    font-size: 0.85rem;
}
.docs-assistant-panel .assistant-message.ai table {
    margin: 0.4em 0;
    border-collapse: collapse;
    width: 100%;
    font-size: 0.8rem;
}
.docs-assistant-panel .assistant-message.ai th,
.docs-assistant-panel .assistant-message.ai td {
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    text-align: left;
}
.docs-assistant-panel .assistant-message.ai th {
    background: #f1f5f9;
    font-weight: 600;
}
.docs-assistant-panel .assistant-message.ai a {
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.docs-assistant-panel .assistant-message.ai a:hover {
    color: #1d4ed8;
}
.docs-assistant-panel .assistant-message.ai em {
    font-style: italic;
}
.docs-assistant-panel .assistant-message.ai hr {
    margin: 0.6em 0;
    border: none;
    border-top: 1px solid #e2e8f0;
}
.docs-assistant-panel .assistant-message.ai pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 10px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 6px 0;
    font-size: 0.78rem;
    line-height: 1.4;
}
.docs-assistant-panel .assistant-message.ai pre code {
    background: transparent;
    padding: 0;
    color: #e2e8f0;
    font-size: inherit;
}

.docs-assistant-panel .assistant-input {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color, #e2e8f0);
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.docs-assistant-panel .assistant-input .input-wrap {
    flex: 1;
    position: relative;
    display: flex;
}

.docs-assistant-panel .assistant-input textarea {
    flex: 1;
    padding: 10px 14px;
    padding-bottom: 22px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    background: var(--bg-color, #f8fafc);
    color: var(--text-color, #1e293b);
    font-size: 0.85rem;
    line-height: 1.5;
    outline: none;
    resize: none;
    overflow-y: auto;
    min-height: 40px;
    max-height: 150px;
    font-family: inherit;
    box-sizing: border-box;
    width: 100%;
}

.docs-assistant-panel .assistant-input textarea::placeholder {
    color: var(--text-muted, #64748b);
}

.docs-assistant-panel .assistant-input textarea:focus {
    border-color: var(--primary-color, #2563eb);
}

.docs-assistant-panel .assistant-input .input-counter {
    position: absolute;
    right: 10px;
    bottom: 4px;
    font-size: 0.65rem;
    color: var(--text-muted, #94a3b8);
    pointer-events: none;
    line-height: 1;
}

.docs-assistant-panel .assistant-input button {
    padding: 10px 16px;
    background: var(--primary-color, #2563eb);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    align-self: flex-end;
    height: 40px;
}

.docs-assistant-panel .assistant-input button:hover {
    background: var(--primary-hover, #1d4ed8);
}

.docs-assistant-panel .assistant-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
    align-items: center;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--text-muted, #64748b);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
    30% { opacity: 1; transform: scale(1.2); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .docs-main {
        padding: 24px 32px;
    }
}

@media (max-width: 768px) {
    .docs-sidebar {
        position: fixed;
        left: -300px;
        top: 0;
        height: 100vh;
        z-index: 100;
        transition: left 0.3s ease;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    }

    .docs-sidebar.active {
        left: 0;
    }

    .sidebar-toggle {
        display: inline-flex;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .docs-main {
        padding: 20px 16px;
    }

    .docs-main h1 {
        font-size: 1.5rem;
    }

    .docs-main h2 {
        font-size: 1.2rem;
    }

    .docs-main h3 {
        font-size: 1rem;
    }

    .docs-welcome .welcome-sections {
        grid-template-columns: 1fr;
    }

    .docs-assistant-panel {
        width: calc(100% - 32px);
        right: 16px;
        bottom: 80px;
        height: 60vh;
        max-width: calc(100vw - 32px);
        max-height: calc(100vh - 120px);
        resize: none;
    }

    .docs-assistant-panel .assistant-header .close-btn {
        padding: 12px;
        min-width: 48px;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .docs-assistant-panel .assistant-header .close-btn svg {
        width: 22px;
        height: 22px;
    }

    .docs-assistant-panel .assistant-header .clear-btn {
        padding: 12px;
        min-width: 48px;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .docs-assistant-panel .assistant-header .clear-btn svg {
        width: 22px;
        height: 22px;
    }

    .page-nav {
        flex-direction: column;
    }

    .page-nav a {
        max-width: 100%;
    }
}

/* Очень маленькие экраны (до 400px) */
@media (max-width: 400px) {
    .docs-main {
        padding: 16px 12px;
    }

    .docs-main h1 {
        font-size: 1.3rem;
    }

    .docs-main h2 {
        font-size: 1.05rem;
    }

    .docs-assistant-panel {
        width: calc(100% - 16px);
        right: 8px;
        bottom: 72px;
        height: 55vh;
        max-width: calc(100vw - 16px);
        border-radius: 10px;
    }

    .docs-assistant-panel .assistant-header {
        padding: 10px 12px;
    }

    .docs-assistant-panel .assistant-messages {
        padding: 12px;
    }

    .docs-assistant-panel .assistant-input {
        padding: 8px 12px;
    }

    .docs-assistant-toggle {
        width: 48px;
        height: 48px;
        bottom: 16px;
        right: 16px;
    }

    .docs-assistant-toggle svg {
        width: 20px;
        height: 20px;
    }

    .docs-welcome {
        padding: 32px 12px;
    }

    .docs-welcome h1 {
        font-size: 1.8rem;
    }
}

/* Scrollbar */
.docs-sidebar::-webkit-scrollbar {
    width: 4px;
}

.docs-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.docs-sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color, #e2e8f0);
    border-radius: 2px;
}

.docs-sidebar::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}