:root {
    --primary: #d4af37;
    --primary-dark: #b8960c;
    --primary-light: #e8c84a;
    --bg-dark: #1a0f08;
    --bg-card: #2a1810;
    --bg-sidebar: #221208;
    --bg-code: #120906;
    --text: #e8e8e8;
    --text-muted: #a09080;
    --text-light: #c8b8a8;
    --border: #402514;
    --border-light: #5a3520;
    --success: #4ade80;
    --info: #60a5fa;
    --warning: #fbbf24;
    --sidebar-width: 300px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
html, body { overflow-x: hidden; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    line-height: 1.7;
    font-size: 16px;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--primary);
    color: var(--bg-dark);
    padding: 0.75rem 1.5rem;
    z-index: 1000;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 4px 0;
}
.skip-link:focus {
    top: 0;
}

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    z-index: 50;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.sidebar-header h1 {
    font-size: 1.1rem;
    color: var(--primary);
    line-height: 1.3;
}
.sidebar-header h1 a {
    color: var(--primary);
    text-decoration: none;
}
.sidebar-header .subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
    overflow-y: auto;
}
.sidebar-nav ul {
    list-style: none;
}
.sidebar-nav > ul > li > a {
    display: block;
    padding: 0.5rem 1.5rem;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}
.sidebar-nav > ul > li > a:hover,
.sidebar-nav > ul > li > a:focus {
    background: rgba(212, 175, 55, 0.08);
    color: var(--primary);
}
.sidebar-nav > ul > li > a.active {
    color: var(--primary);
    border-left-color: var(--primary);
    background: rgba(212, 175, 55, 0.1);
}
.sidebar-nav > ul > li > ul {
    display: none;
}
.sidebar-nav > ul > li > a.active + ul,
.sidebar-nav > ul > li:hover > ul {
    display: block;
}
.sidebar-nav > ul > li > ul > li > a {
    display: block;
    padding: 0.3rem 1.5rem 0.3rem 2.25rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    transition: color 0.15s;
    border-left: 3px solid transparent;
}
.sidebar-nav > ul > li > ul > li > a:hover,
.sidebar-nav > ul > li > ul > li > a:focus {
    color: var(--primary-light);
}
.sidebar-nav > ul > li > ul > li > a.active {
    color: var(--primary-light);
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: border-color 0.15s, color 0.15s;
}
.lang-switch:hover,
.lang-switch:focus {
    border-color: var(--primary);
    color: var(--primary);
}

/* Mobile hamburger */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    z-index: 60;
    align-items: center;
    padding: 0 1rem;
}
.hamburger {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
}
.mobile-header .mobile-title {
    color: var(--primary);
    font-size: 1rem;
    font-weight: 600;
    margin-left: 0.75rem;
}
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 49;
}

/* Main content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
}
.content-wrapper {
    max-width: 860px;
    margin: 0 auto;
    padding: 2.5rem 3rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--primary);
    line-height: 1.3;
}
h1 { font-size: 2rem; margin: 2.5rem 0 1rem; }
h1:first-child { margin-top: 0; }
h2 { font-size: 1.6rem; margin: 2.5rem 0 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--border); }
h3 { font-size: 1.25rem; margin: 2rem 0 0.75rem; color: var(--text); }
h4 { font-size: 1.05rem; margin: 1.5rem 0 0.5rem; color: var(--text-light); }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--primary); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }

strong, b { color: var(--text); }
em, i { color: var(--text-light); }

/* Lists */
ul, ol {
    margin: 0 0 1rem 1.5rem;
}
li {
    margin-bottom: 0.35rem;
}
li::marker {
    color: var(--primary);
}

/* Cards / Info boxes */
.card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}
.tip {
    border-left: 4px solid var(--primary);
    background: rgba(212, 175, 55, 0.06);
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    border-radius: 0 6px 6px 0;
}
.tip-label {
    color: var(--primary);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.35rem;
}
.warning {
    border-left: 4px solid var(--warning);
    background: rgba(251, 191, 36, 0.06);
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    border-radius: 0 6px 6px 0;
}
.warning-label {
    color: var(--warning);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.35rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0 1.5rem;
    font-size: 0.92rem;
}
thead th {
    background: var(--bg-card);
    color: var(--primary);
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--border);
}
tbody td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
tbody tr:hover {
    background: rgba(212, 175, 55, 0.03);
}
caption {
    text-align: left;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    caption-side: top;
}

/* Code */
code {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    background: var(--bg-code);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.88em;
    color: var(--primary-light);
}

/* Command reference */
.command-table {
    font-size: 0.88rem;
}
.command-table td:first-child {
    white-space: nowrap;
    font-weight: 600;
    color: var(--primary-light);
    min-width: 180px;
}

/* Section intro */
.section-intro {
    font-size: 1.05rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    border-left: 3px solid var(--primary);
    padding-left: 1rem;
}

/* Voice command highlight */
.voice-cmd {
    display: inline;
    background: rgba(212, 175, 55, 0.1);
    color: var(--primary-light);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.92em;
}

/* Scroll to top button */
.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: var(--bg-dark);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.2s;
    z-index: 40;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.scroll-top:hover {
    transform: scale(1.1);
}
.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

/* Footer */
.doc-footer {
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.doc-footer a {
    color: var(--primary);
}

/* Focus indicators */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .sidebar, .mobile-header, .scroll-top, .sidebar-overlay { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .content-wrapper { max-width: 100%; padding: 0; }
    body { background: #fff; color: #000; font-size: 12pt; }
    h1, h2, h3, h4, h5, h6 { color: #000; }
    a { color: #000; text-decoration: underline; }
    .card, .tip, .warning { border: 1px solid #ccc; background: #f9f9f9; }
    table { font-size: 10pt; }
    thead th { background: #eee; color: #000; }
}

/* Responsive */
@media (max-width: 1024px) {
    .content-wrapper { padding: 2rem; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-overlay.active {
        display: block;
    }
    .mobile-header {
        display: flex;
    }
    .main-content {
        margin-left: 0;
        padding-top: 56px;
    }
    .content-wrapper {
        padding: 1.5rem 1rem;
    }
    html { scroll-padding-top: 72px; }
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.35rem; }
    table { font-size: 0.82rem; }
    thead th, tbody td { padding: 0.5rem 0.6rem; }
    .command-table td:first-child { min-width: auto; }
    .scroll-top { bottom: 1rem; right: 1rem; }
}

@media (max-width: 480px) {
    .content-wrapper { padding: 1rem 0.75rem; }
    h1 { font-size: 1.4rem; }
    h2 { font-size: 1.2rem; }
    table { display: block; overflow-x: auto; }
}
