/* ── Docs CSS — Ratspeak Documentation ────────────────── */

:root {
    --bg-primary:    #1c2333;
    --bg-secondary:  #242d3f;
    --bg-tertiary:   #2d3748;
    --border:        #3a4759;
    --border-light:  #4a5a6e;
    --text-primary:  #e2e8f0;
    --text-secondary:#9eadbf;
    --text-muted:    #7e8fa2;
    --green:         #00D4AA;
    --green-dim:     #00A080;
    --red:           #FF6B6B;
    --blue:          #38BDF8;
    --purple:        #C084FC;
    --orange:        #F59E0B;
    --font-mono:     'JetBrains Mono', 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
    --font-sans:     'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    --glass-bg:      rgba(36, 45, 63, 0.75);
    --glass-border:  rgba(58, 71, 89, 0.55);
    --sidebar-width: 280px;
    --toc-width:     220px;
    --navbar-height: 56px;
    --content-max:   780px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
}

/* Noise texture */
body::after {
    content: '';
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 99999;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* ── Navbar ──────────────────────────────────────────── */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: var(--navbar-height);
    background: linear-gradient(180deg, rgba(28, 35, 51, 0.95) 0%, rgba(28, 35, 51, 0.9) 100%);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(0, 212, 170, 0.05), 0 4px 24px rgba(0, 0, 0, 0.3);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.navbar.scrolled {
    border-bottom-color: var(--border-light);
    box-shadow: 0 1px 0 rgba(0, 212, 170, 0.08), 0 8px 32px rgba(0, 0, 0, 0.5);
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-left a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.navbar-logo {
    flex-shrink: 0;
    filter: drop-shadow(0 0 6px rgba(0, 212, 170, 0.4));
}

.navbar-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.navbar-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s;
}

.navbar-link:hover {
    color: var(--text-primary);
}

.navbar-link--active {
    color: var(--green);
}

.nr-btn {
    background: rgba(0, 160, 128, 0.1);
    color: var(--green);
    border: 1px solid rgba(0, 212, 170, 0.3);
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.25s ease;
    white-space: nowrap;
    letter-spacing: 0.3px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nr-btn:hover {
    background: rgba(0, 160, 128, 0.2);
    border-color: rgba(0, 212, 170, 0.5);
    color: var(--green);
    box-shadow: 0 0 20px rgba(0, 212, 170, 0.15);
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
}

/* ── Layout ──────────────────────────────────────────── */

.docs-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--toc-width);
    min-height: 100vh;
    padding-top: var(--navbar-height);
}

/* ── Sidebar ─────────────────────────────────────────── */

.docs-sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    padding: 16px 0 0;
    z-index: 50;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.docs-sidebar::-webkit-scrollbar {
    width: 0;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

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

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 49;
}

/* ── Sidebar Search ──────────────────────────────────── */

.sidebar-search {
    position: relative;
    padding: 0 16px 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

.sidebar-search__icon {
    position: absolute;
    left: 28px;
    top: 10px;
    color: var(--text-muted);
    pointer-events: none;
}

.sidebar-search__input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 36px 8px 38px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sidebar-search__input::placeholder {
    color: var(--text-muted);
}

.sidebar-search__input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 2px rgba(0, 212, 170, 0.15);
}

.sidebar-search__kbd {
    position: absolute;
    right: 28px;
    top: 9px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.6;
    pointer-events: none;
}

/* ── Search Results ──────────────────────────────────── */

.search-results {
    display: none;
    padding: 0 16px;
    max-height: 400px;
    overflow-y: auto;
}

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

.search-result {
    display: block;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(58, 71, 89, 0.3);
}

.search-result:last-child {
    border-bottom: none;
}

.search-result:hover,
.search-result.focused {
    background: var(--bg-tertiary);
}

.search-result__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.search-result__section {
    font-size: 11px;
    color: var(--green);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-result__snippet {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.search-results__empty {
    padding: 16px 12px;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}

.search-result mark {
    background: rgba(0, 212, 170, 0.2);
    color: inherit;
    border-radius: 2px;
    padding: 0 1px;
}

/* ── Sidebar Nav ─────────────────────────────────────── */

.sidebar-nav {
    padding: 0 8px;
    flex: 1;
    overflow-y: auto;
}

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

.sidebar-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.2s, background 0.15s;
    user-select: none;
}

.sidebar-section__header:hover {
    color: var(--text-secondary);
    background: rgba(45, 55, 72, 0.3);
}

.sidebar-section__chevron {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.sidebar-section.collapsed .sidebar-section__chevron {
    transform: rotate(-90deg);
}

.sidebar-section__items {
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.sidebar-section.collapsed .sidebar-section__items {
    max-height: 0 !important;
}

.sidebar-link {
    display: block;
    padding: 6px 12px 6px 20px;
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    border-left: 2px solid transparent;
    margin-left: 8px;
    transition: all 0.15s;
    line-height: 1.4;
}

.sidebar-link:hover {
    color: var(--text-primary);
    background: rgba(45, 55, 72, 0.3);
}

.sidebar-link.active {
    color: var(--green);
    border-left-color: var(--green);
    background: rgba(0, 212, 170, 0.06);
    font-weight: 500;
}

/* ── Main Content ────────────────────────────────────── */

.docs-content {
    grid-column: 2;
    max-width: var(--content-max);
    width: 100%;
    padding: 32px 48px 80px;
    margin: 0 auto;
    overflow-x: hidden;
    min-height: calc(100vh - var(--navbar-height));
}

/* ── Breadcrumbs ─────────────────────────────────────── */

.docs-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

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

.docs-breadcrumbs a:hover {
    color: var(--green);
}

.docs-breadcrumbs__sep {
    color: var(--border-light);
    font-size: 10px;
}

.docs-breadcrumbs__current {
    color: var(--text-secondary);
}

/* ── Article Typography ──────────────────────────────── */

.docs-article {
    line-height: 1.7;
    color: var(--text-secondary);
}

.docs-article h1 {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 32px;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.docs-article h1 + p {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 32px;
    line-height: 1.6;
}

.docs-article h2 {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 22px;
    color: var(--text-primary);
    margin-top: 48px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    line-height: 1.3;
}

.docs-article h3 {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 17px;
    color: var(--text-primary);
    margin-top: 32px;
    margin-bottom: 12px;
    line-height: 1.4;
}

.docs-article h4 {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    margin-top: 24px;
    margin-bottom: 8px;
}

.docs-article p {
    margin-bottom: 16px;
    font-size: 15px;
    line-height: 1.7;
}

.docs-article a {
    color: var(--green);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.docs-article a:hover {
    border-bottom-color: var(--green);
}

.docs-article strong {
    color: var(--text-primary);
    font-weight: 600;
}

.docs-article ul,
.docs-article ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.docs-article li {
    margin-bottom: 6px;
    font-size: 15px;
    line-height: 1.6;
}

.docs-article li::marker {
    color: var(--green);
}

.docs-article hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--border) 50%, transparent 100%);
    margin: 32px 0;
}

.docs-article img {
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin: 16px 0;
}

/* ── Heading Anchors ─────────────────────────────────── */

.heading-anchor {
    color: var(--text-muted);
    text-decoration: none;
    opacity: 0;
    margin-left: 8px;
    font-size: 0.85em;
    transition: opacity 0.2s;
    border-bottom: none !important;
}

.docs-article h2:hover .heading-anchor,
.docs-article h3:hover .heading-anchor,
.docs-article h4:hover .heading-anchor {
    opacity: 0.6;
}

.heading-anchor:hover {
    opacity: 1 !important;
    color: var(--green) !important;
}

/* ── Code ────────────────────────────────────────────── */

.docs-article code {
    font-family: var(--font-mono);
    font-size: 13px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    color: var(--green);
}

.docs-article pre {
    position: relative;
    margin-bottom: 20px;
    border-radius: 10px;
    overflow: hidden;
}

.docs-article pre code {
    display: block;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 20px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.docs-article pre code::-webkit-scrollbar {
    height: 4px;
}

.docs-article pre code::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

/* Copy button */
.code-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s, background 0.2s;
    z-index: 2;
}

.docs-article pre:hover .code-copy-btn {
    opacity: 1;
}

.code-copy-btn:hover {
    color: var(--green);
    background: var(--bg-secondary);
}

.code-copy-btn.copied {
    color: var(--green);
}

/* ── Tables ──────────────────────────────────────────── */

.docs-article table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 13px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.docs-article thead th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.docs-article tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(58, 71, 89, 0.3);
    color: var(--text-secondary);
}

.docs-article tbody tr:last-child td {
    border-bottom: none;
}

.docs-article tbody tr:hover {
    background: rgba(45, 55, 72, 0.2);
}

.table-wrapper {
    overflow-x: auto;
    margin-bottom: 20px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.table-wrapper::-webkit-scrollbar {
    height: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.table-wrapper table {
    margin-bottom: 0;
}

/* ── Admonitions ─────────────────────────────────────── */

.admonition {
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    border-left: 3px solid;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
}

.admonition__title {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admonition__title svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.admonition p:last-child {
    margin-bottom: 0;
}

.admonition--note {
    border-left-color: var(--blue);
}
.admonition--note .admonition__title {
    color: var(--blue);
}

.admonition--warning {
    border-left-color: var(--orange);
}
.admonition--warning .admonition__title {
    color: var(--orange);
}

.admonition--tip {
    border-left-color: var(--green);
}
.admonition--tip .admonition__title {
    color: var(--green);
}

.admonition--info {
    border-left-color: var(--purple);
}
.admonition--info .admonition__title {
    color: var(--purple);
}

/* ── Blockquotes (non-admonition) ────────────────────── */

.docs-article blockquote {
    border-left: 3px solid var(--border);
    padding: 12px 20px;
    margin-bottom: 16px;
    color: var(--text-muted);
    font-style: italic;
    background: rgba(36, 45, 63, 0.4);
    border-radius: 0 8px 8px 0;
}

.docs-article blockquote.admonition {
    font-style: normal;
}

/* ── Prev/Next Navigation ────────────────────────────── */

.docs-prev-next {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.docs-prev-next__link {
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s;
}

.docs-prev-next__link:hover {
    border-color: var(--green);
    background: rgba(0, 212, 170, 0.04);
    box-shadow: 0 0 20px rgba(0, 212, 170, 0.08);
}

.docs-prev-next__link--next {
    text-align: right;
    align-items: flex-end;
}

.docs-prev-next__label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.docs-prev-next__title {
    font-size: 14px;
    color: var(--green);
    font-weight: 600;
}

/* ── Table of Contents ───────────────────────────────── */

.docs-toc {
    position: fixed;
    top: var(--navbar-height);
    right: 0;
    width: var(--toc-width);
    height: calc(100vh - var(--navbar-height));
    padding: 24px 16px 24px 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.docs-toc__header {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding-left: 12px;
}

.docs-toc__nav {
    border-left: 1px solid var(--border);
}

.toc-link {
    display: block;
    padding: 4px 12px;
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
    border-left: 2px solid transparent;
    margin-left: -1px;
    transition: all 0.15s;
    line-height: 1.4;
}

.toc-link:hover {
    color: var(--text-secondary);
}

.toc-link.active {
    color: var(--green);
    border-left-color: var(--green);
}

.toc-link--h3 {
    padding-left: 24px;
    font-size: 11px;
}

/* ── Loading State ───────────────────────────────────── */

.docs-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 80px 0;
    color: var(--text-muted);
    font-size: 14px;
}

.docs-loading__spinner {
    width: 28px;
    height: 28px;
    border: 2px solid var(--border);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── 404 Page ────────────────────────────────────────── */

.docs-404 {
    text-align: center;
    padding: 80px 0;
}

.docs-404 h1 {
    font-size: 64px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.docs-404 p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.docs-404 a {
    color: var(--green);
    text-decoration: none;
}

/* ── Screenshot Placeholder ──────────────────────────── */

.screenshot-placeholder {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    margin: 20px 0;
    background: rgba(36, 45, 63, 0.3);
}

.screenshot-placeholder svg {
    display: block;
    margin: 0 auto 12px;
}

/* ── Glossary ────────────────────────────────────────── */

.glossary-empty {
    padding: 24px 0;
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
}

.glossary-search {
    position: relative;
    margin-bottom: 24px;
    max-width: 400px;
}

.glossary-search__icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.glossary-search input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px 10px 40px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.glossary-search input::placeholder {
    color: var(--text-muted);
}

.glossary-search input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 2px rgba(0, 212, 170, 0.15);
}

.glossary-category {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 8px;
}

.glossary-category--protocol { background: rgba(56, 189, 248, 0.15); color: var(--blue); }
.glossary-category--crypto { background: rgba(192, 132, 252, 0.15); color: var(--purple); }
.glossary-category--interface { background: rgba(245, 158, 11, 0.15); color: var(--orange); }
.glossary-category--messaging { background: rgba(0, 212, 170, 0.15); color: var(--green); }
.glossary-category--tool { background: rgba(255, 107, 107, 0.15); color: var(--red); }

/* ── Pull Quotes (Zen page) ──────────────────────────── */

.pull-quote {
    border-left: 3px solid var(--green);
    padding: 20px 24px;
    margin: 24px 0;
    background: rgba(0, 212, 170, 0.04);
    border-radius: 0 8px 8px 0;
    font-size: 16px;
    color: var(--text-primary);
    font-style: italic;
    line-height: 1.7;
}

/* ── SVG Diagrams ────────────────────────────────────── */

.docs-diagram {
    margin: 24px 0;
    text-align: center;
}

.docs-diagram svg {
    max-width: 100%;
    height: auto;
}

.docs-diagram figcaption {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    font-style: italic;
}

/* ── Responsive ──────────────────────────────────────── */

@media (max-width: 1100px) {
    .docs-layout {
        grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    }

    .docs-toc {
        display: none;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 16px;
    }

    .navbar-right {
        display: none;
    }

    .sidebar-toggle {
        display: flex;
    }

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

    .docs-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: none;
    }

    .docs-sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
    }

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

    .docs-content {
        grid-column: 1;
        padding: 24px 20px 60px;
    }

    .docs-article h1 {
        font-size: 26px;
    }

    .docs-article h2 {
        font-size: 19px;
    }

    .docs-prev-next {
        grid-template-columns: 1fr;
    }

    .docs-breadcrumbs {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .docs-content {
        padding: 16px 14px 48px;
    }

    .docs-article pre code {
        font-size: 12px;
        padding: 12px 14px;
    }

    .docs-article table {
        font-size: 12px;
    }

    .docs-article thead th,
    .docs-article tbody td {
        padding: 8px 10px;
    }

    .docs-diagram {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .docs-diagram svg {
        min-width: 500px;
    }
}

/* ── Sidebar Footer ──────────────────────────────────── */

.sidebar-footer {
    flex-shrink: 0;
    text-align: center;
    padding: 16px 16px 20px;
    border-top: 1px solid var(--border);
}

.sidebar-footer-divider {
    display: none;
}

.sidebar-footer-logo {
    display: block;
    width: 20px;
    height: 20px;
    margin: 0 auto 6px;
    opacity: 0.4;
}

.sidebar-footer-built {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.sidebar-footer-built a {
    color: var(--green);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.sidebar-footer-built a:hover {
    border-bottom-color: var(--green);
}

.sidebar-footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 11px;
}

.sidebar-footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.sidebar-footer-links a:hover {
    color: var(--text-primary);
}

.sidebar-footer-dot {
    color: var(--border);
    font-size: 10px;
}

/* ── Animations ──────────────────────────────────────── */

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 8px var(--green), 0 0 16px rgba(0, 212, 170, 0.2); }
    50%      { box-shadow: 0 0 12px var(--green), 0 0 24px rgba(0, 212, 170, 0.35); }
}

/* Prism overrides */
pre[class*="language-"],
code[class*="language-"] {
    text-shadow: none !important;
}

.token.comment { color: var(--text-muted) !important; }
.token.keyword { color: var(--purple) !important; }
.token.string { color: var(--green) !important; }
.token.function { color: var(--blue) !important; }
.token.number { color: var(--orange) !important; }
.token.operator { color: var(--text-secondary) !important; }
.token.boolean { color: var(--orange) !important; }
