body { background-color: #0d0d0d; color: #e5e5e5; }
* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0d0d0d; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

.docs-content h2 { font-size: 1.875rem; font-weight: 700; margin-top: 3rem; margin-bottom: 1rem; color: white; border-bottom: 2px solid #a855f7; padding-bottom: 0.5rem; }
.docs-content h3 { font-size: 1.5rem; font-weight: 600; margin-top: 2rem; margin-bottom: 0.75rem; color: #d8b4fe; }
.docs-content h4 { font-size: 1.25rem; font-weight: 600; margin-top: 1.5rem; margin-bottom: 0.5rem; color: #e5e5e5; }
.docs-content p { margin-bottom: 1rem; line-height: 1.7; color: #d1d5db; }
.docs-content ul, .docs-content ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.docs-content li { margin-bottom: 0.5rem; line-height: 1.6; color: #d1d5db; }
.docs-content ul li { list-style-type: disc; }
.docs-content ol li { list-style-type: decimal; }
.docs-content code { background: #1a1a1a; padding: 0.2rem 0.4rem; border-radius: 0.25rem; font-family: 'JetBrains Mono', monospace; font-size: 0.875rem; color: #a855f7; }
.docs-content pre { background: #1a1a1a; padding: 1rem; border-radius: 0.5rem; overflow-x: auto; margin-bottom: 1rem; border: 1px solid #333; }
.docs-content pre code { background: transparent; padding: 0; color: #d1d5db; }
.docs-content a { color: #a855f7; text-decoration: none; transition: color 0.2s; }
.docs-content a:hover { color: #d8b4fe; text-decoration: underline; }
.docs-content table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; }
.docs-content table th { background: #1a1a1a; padding: 0.75rem; text-align: left; border: 1px solid #333; font-weight: 600; color: #a855f7; }
.docs-content table td { padding: 0.75rem; border: 1px solid #333; vertical-align: top; }
.docs-content table tr:nth-child(even) { background: #161616; }

.sidebar-nav { position: sticky; top: 5rem; max-height: calc(100vh - 6rem); overflow-y: auto; }
.sidebar-nav a { display: block; padding: 0.5rem 1rem; color: #9ca3af; font-size: 0.875rem; transition: all 0.2s; border-left: 2px solid transparent; }
.sidebar-nav a:hover { color: white; border-left-color: #a855f7; background: rgba(168, 85, 247, 0.1); }
.sidebar-nav a.active { color: #a855f7; border-left-color: #a855f7; background: rgba(168, 85, 247, 0.1); font-weight: 600; }
.sidebar-nav .nav-label { display: block; padding: 1rem 1rem 0.375rem; color: #d8b4fe; font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; border-top: 1px solid #333; margin-top: 0.5rem; }
.sidebar-nav .nav-label:first-child { border-top: none; margin-top: 0; }

.alert { padding: 1rem; border-radius: 0.5rem; margin-bottom: 1.5rem; border-left: 4px solid; }
.alert-info { background: rgba(59, 130, 246, 0.1); border-color: #3b82f6; color: #93c5fd; }
.alert-warning { background: rgba(245, 158, 11, 0.1); border-color: #f59e0b; color: #fcd34d; }
.alert-success { background: rgba(34, 197, 94, 0.1); border-color: #22c55e; color: #86efac; }

.feature-box { background: #1a1a1a; border: 1px solid #333; border-radius: 0.5rem; padding: 1.5rem; margin-bottom: 1.5rem; }
.feature-box h5 { color: #a855f7; font-weight: 600; margin-bottom: 0.75rem; font-size: 1.1rem; }

.badge { display: inline-block; padding: 0.25rem 0.75rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; margin-right: 0.5rem; margin-bottom: 0.5rem; }
.badge-free { background: rgba(34, 197, 94, 0.2); color: #86efac; border: 1px solid #22c55e; }
.badge-paid { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border: 1px solid #ef4444; }
.badge-simple { background: rgba(59, 130, 246, 0.2); color: #93c5fd; border: 1px solid #3b82f6; }

.mermaid { background: #1a1a1a; border-radius: 0.5rem; padding: 1.5rem; margin-bottom: 1.5rem; border: 1px solid #333; }

.mermaid-wrapper { position: relative; display: block; }
.mermaid-wrapper:hover .mermaid-view-btn { opacity: 1; }
.mermaid-view-btn {
    opacity: 0; position: absolute; top: 0.6rem; right: 0.6rem;
    background: rgba(168,85,247,0.85); color: #fff; border: none; border-radius: 0.375rem;
    padding: 0.3rem 0.75rem; font-size: 0.75rem; font-weight: 600; cursor: pointer;
    transition: opacity 0.2s, background 0.2s; z-index: 10; display: flex; align-items: center; gap: 0.4rem;
}
.mermaid-view-btn:hover { background: #a855f7; }

#diagram-modal {
    display: none; position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.85); backdrop-filter: blur(4px);
    align-items: center; justify-content: center;
}
#diagram-modal.open { display: flex; }
#diagram-modal-box {
    background: #1a1a1a; border: 1px solid #333; border-radius: 0.75rem;
    width: 80vw; height: 75vh;
    min-width: 320px; min-height: 240px;
    max-width: 98vw; max-height: 96vh;
    display: flex; flex-direction: column; overflow: hidden;
    resize: both;
}
#diagram-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.75rem 1rem; border-bottom: 1px solid #333; flex-shrink: 0;
}
#diagram-modal-header span { font-weight: 600; color: #d8b4fe; font-size: 0.9rem; }
#diagram-modal-controls { display: flex; gap: 0.5rem; align-items: center; }
.dm-btn {
    background: #2a2a2a; border: 1px solid #444; color: #e5e5e5;
    border-radius: 0.375rem; padding: 0.3rem 0.65rem; cursor: pointer;
    font-size: 0.8rem; transition: background 0.15s;
}
.dm-btn:hover { background: #333; }
#diagram-modal-body {
    overflow: auto; flex: 1; display: flex; align-items: center; justify-content: center;
    padding: 1.5rem; cursor: grab;
}
#diagram-modal-body:active { cursor: grabbing; }
#diagram-modal-svg-wrap {
    transform-origin: center center; transition: transform 0.15s;
    display: inline-block;
}
#diagram-modal-svg-wrap svg { max-width: none !important; height: auto; display: block; }

details { border: 1px solid #333; border-radius: 0.5rem; padding: 1rem; background: #161616; margin-bottom: 1rem; }
details[open] { background: #1a1a1a; }
details summary { cursor: pointer; user-select: none; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }
details summary:hover { color: #d8b4fe; }
details summary i { transition: transform 0.2s; }
details[open] summary i { transform: rotate(90deg); }
