/* ==================== CSS VARIABLES ==================== */
:root {
    --accent: #f5b81b;
    --accent-hover: #e5a80a;
    --accent-glow: rgba(245, 184, 27, 0.15);
    --bg: #f8f7f4;
    --bg-secondary: #f0efe9;
    --card: #ffffff;
    --text: #1a1a1a;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e5e0;
    --border-light: #f0f0eb;
    --success: #10b981;
    --success-bg: #ecfdf5;
    --error: #ef4444;
    --error-bg: #fef2f2;
    --info: #3b82f6;
    --info-bg: #eff6ff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== RESET ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scrollbar-gutter: stable; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ==================== HEADER ==================== */
.top-navbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-light);
    padding: 0 2.5rem;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo { display: flex; align-items: center; gap: 12px; }
.logo img { height: 42px; width: auto; }
.logo-text { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; }

.main-nav {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: 10px;
}

.main-nav-btn {
    padding: 0.55rem 1.25rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.main-nav-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.6); }

.main-nav-btn.active {
    background: var(--card);
    color: var(--text);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

/* ==================== LAYOUT ==================== */
.container {
    display: flex;
    max-width: 1440px;
    margin: 2rem auto;
    padding: 0 2rem;
    gap: 2rem;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: 272px;
    min-width: 272px;
    max-width: 272px;
    flex-shrink: 0;
    align-self: flex-start;
}

.sidebar-inner {
    position: sticky;
    top: 72px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 0.25rem;
}

.sidebar-inner::-webkit-scrollbar { width: 3px; }
.sidebar-inner::-webkit-scrollbar-track { background: transparent; }
.sidebar-inner::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius: 10px; }

.sidebar-group {
    margin-bottom: 0.35rem;
    background: var(--card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    padding: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    transition: box-shadow 0.25s ease;
}

.sidebar-group:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.sidebar-group:last-child { margin-bottom: 0; }

.sidebar-group-title {
    color: var(--text-muted);
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    font-weight: 700;
    padding: 0.5rem 0.65rem 0.35rem;
    text-transform: uppercase;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.55rem 0.65rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.85rem;
    font-weight: 450;
    position: relative;
}

.sidebar a i {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    opacity: 0.5;
    transition: all 0.2s ease;
    border-radius: 6px;
    flex-shrink: 0;
}

.sidebar a:hover { background: var(--bg-secondary); color: var(--text); transform: translateX(2px); }
.sidebar a:hover i { opacity: 0.8; }
.sidebar a.active { background: var(--accent); color: #1a1a1a; font-weight: 600; box-shadow: 0 2px 8px rgba(245, 184, 27, 0.35); }
.sidebar a.active i { opacity: 1; color: #1a1a1a; }

/* ==================== SIDEBAR COLLAPSIBLE ==================== */
.sidebar-group-divider { height: 1px; background: var(--border-light); margin: 0.35rem 0.5rem; }

.sidebar-group-header {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; padding: 0.6rem 0.65rem; background: none; border: none;
    cursor: pointer; font-family: inherit; font-size: 0.85rem; font-weight: 600;
    color: var(--text); transition: background 0.2s ease; border-radius: 8px;
}
.sidebar-group-header:hover { background: var(--bg-secondary); }
.sidebar-group-header.active { background: var(--accent); color: #1a1a1a; font-weight: 600; box-shadow: 0 2px 8px rgba(245, 184, 27, 0.35); }

.sidebar-group-header-left { display: flex; align-items: center; gap: 10px; }
.sidebar-group-header-left i { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; opacity: 0.65; }

.sidebar-group-chevron { font-size: 0.65rem; opacity: 0.35; transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1); }
.sidebar-group-header.active .sidebar-group-chevron { transform: rotate(180deg); }

.sidebar-submenu { max-height: 0; overflow: hidden; transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease; opacity: 0; }
.sidebar-submenu--expanded { max-height: 700px; opacity: 1; }

.sidebar-submenu a {
    display: flex; align-items: center; gap: 10px; padding: 0.45rem 0.65rem 0.45rem 1.2rem;
    color: var(--text-secondary); text-decoration: none; border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); font-size: 0.83rem; font-weight: 450;
    position: relative; margin: 1px 0.5rem; width: calc(100% - 1rem);
}
.sidebar-submenu a::before { content: ''; position: absolute; left: 0.35rem; top: 50%; transform: translateY(-50%); width: 3px; height: 0; background: var(--accent); border-radius: 2px; transition: height 0.25s cubic-bezier(0.4, 0, 0.2, 1); }
.sidebar-submenu a:hover { background: var(--bg-secondary); color: var(--text); }
.sidebar-submenu a:hover::before { height: 55%; }
.sidebar-submenu a.active { background: var(--accent-glow); color: var(--accent-hover); font-weight: 600; }
.sidebar-submenu a.active::before { height: 55%; background: var(--accent-hover); }
.sidebar-submenu a i { width: 18px; font-size: 0.78rem; opacity: 0.5; transition: opacity 0.2s ease; }
.sidebar-submenu a:hover i { opacity: 0.8; }
.sidebar-submenu a.active i { opacity: 1; }

/* ==================== SIDEBAR DIRECT LINK ==================== */
.sidebar-group > a[data-target] {
    display: flex; align-items: center; gap: 10px; padding: 0.6rem 0.65rem;
    color: var(--text); text-decoration: none; border-radius: 8px; font-size: 0.85rem;
    font-weight: 600; transition: all 0.2s ease; margin: 0.25rem 0.5rem;
    background: linear-gradient(135deg, var(--accent-glow) 0%, rgba(245, 184, 27, 0.08) 100%);
    border: 1px solid rgba(245, 184, 27, 0.2);
}
.sidebar-group > a[data-target]:hover {
    background: var(--accent); color: #1a1a1a; border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(245, 184, 27, 0.3);
}
.sidebar-group > a[data-target].active { background: var(--accent); color: #1a1a1a; font-weight: 600; }
.sidebar-group > a[data-target] i {
    width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; color: var(--accent-hover);
}
.sidebar-group > a[data-target]:hover i,
.sidebar-group > a[data-target].active i { color: #1a1a1a; }

/* ==================== WEB INTERFACE LINK ==================== */
.web-link { display: flex; align-items: center; gap: 10px; padding: 0.6rem 0.65rem; color: var(--text-secondary); text-decoration: none; border-radius: 8px; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); font-size: 0.85rem; font-weight: 500; }
.web-link i { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; opacity: 0.5; transition: opacity 0.2s ease; }
.web-link:hover { background: var(--bg-secondary); color: var(--text); }
.web-link:hover i { opacity: 0.8; }
.web-link.active { background: var(--accent); color: #1a1a1a; font-weight: 600; box-shadow: 0 2px 8px rgba(245, 184, 27, 0.35); }
.web-link.active i { opacity: 1; color: #1a1a1a; }
.web-nested { margin: 1px 0; }

/* ==================== SIDEBAR NESTED SUBMENU ==================== */
.sidebar-submenu-nested { margin: 1px 0; }
.sidebar-group-header--sub { padding: 0.55rem 0.65rem 0.55rem 1.2rem; font-size: 0.83rem; width: calc(100% - 1rem); margin: 1px 0.5rem; }
.sidebar-group-header--sub .sidebar-group-chevron { transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1); transform: rotate(0deg); }
.sidebar-submenu-nested--expanded > .sidebar-group-header--sub .sidebar-group-chevron { transform: rotate(180deg) !important; }
.sidebar-submenu-inner { max-height: 0; overflow: hidden; transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease; opacity: 0; }
.sidebar-submenu-nested--expanded .sidebar-submenu-inner { max-height: none; overflow-y: visible; opacity: 1; scrollbar-width: none; -ms-overflow-style: none; }
.sidebar-submenu-inner::-webkit-scrollbar { width: 0; height: 0; }
.sidebar-submenu-inner a { padding: 0.4rem 0.65rem 0.4rem 2.2rem; }
.sidebar-submenu-inner a::before { left: 1.45rem; }
.sidebar-submenu-inner a.active { background: var(--accent-glow); color: var(--accent-hover); font-weight: 600; }
.sidebar-submenu-inner a.active::before { height: 55%; background: var(--accent-hover); }
.sidebar-submenu-inner a.active i { opacity: 1; }

/* Sidebar groups visibility per tab */
.sidebar-group[data-tab] { display: none; }
.sidebar-group[data-tab].active { display: block; }
.sidebar-group:not([data-tab]) { display: block; }

/* ==================== CONTENT ==================== */
.content { flex: 1; min-width: 0; overflow: hidden; }
.doc-section { display: none; }
.doc-section.active { display: block; }

/* ==================== HERO ==================== */
.hero {
    background: var(--card); border: 1px solid var(--border-light);
    border-radius: var(--radius-xl); padding: 3rem; margin-bottom: 1.5rem;
    display: flex; align-items: center; justify-content: space-between; gap: 3rem;
    box-shadow: var(--shadow-sm); overflow: hidden; position: relative;
}
.hero::before {
    content: ''; position: absolute; top: -50%; right: -20%;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(245, 184, 27, 0.08) 0%, transparent 70%);
    pointer-events: none;
}
.hero-content { flex: 1; position: relative; z-index: 1; }
.hero h1 { font-size: 2.5rem; font-weight: 700; line-height: 1.15; margin-bottom: 0.75rem; letter-spacing: -0.025em; position: relative; z-index: 1; }
.hero p { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 1.5rem; position: relative; z-index: 1; }
.hero-features { display: flex; flex-wrap: wrap; gap: 0.5rem; position: relative; z-index: 1; }
.feature-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 100px; padding: 0.4rem 0.9rem; font-size: 0.8rem; font-weight: 500; color: var(--text-secondary); }
.feature-chip i { font-size: 0.75rem; color: var(--accent); }
.hero-logo { flex-shrink: 0; position: relative; z-index: 1; }
.hero-logo img { height: 120px; width: auto; opacity: 0.9; }

/* ==================== CARDS ==================== */
.card { background: var(--card); border: 1px solid var(--border-light); border-radius: var(--radius-xl); padding: 2rem; margin-bottom: 1.5rem; box-shadow: var(--shadow-sm); overflow: hidden; }

/* ==================== TYPOGRAPHY ==================== */
h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem; letter-spacing: -0.02em; color: var(--text); }
h3 { font-size: 1.2rem; font-weight: 600; margin: 1.75rem 0 0.75rem; color: var(--text); }
p { color: var(--text-secondary); margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }
ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; color: var(--text-secondary); }
li { margin-bottom: 0.35rem; }
li::marker { color: var(--accent); }
code { background: var(--bg-secondary); padding: 0.15rem 0.45rem; border-radius: 4px; font-family: 'JetBrains Mono', monospace; font-size: 0.85em; color: var(--error); }
strong { font-weight: 600; color: var(--text); }
hr { border: none; border-top: 1px solid var(--border-light); margin: 1.25rem 0; }

/* ==================== CODE BLOCKS ==================== */
pre {
    background: linear-gradient(135deg, #1e1e2e 0%, #181825 100%);
    border: 1px solid #313244; padding: 1.5rem;
    border-radius: var(--radius-lg); font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem; line-height: 1.7; overflow-x: auto; margin: 1rem 0;
    color: #cdd6f4; position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2), 0 4px 12px rgba(0,0,0,0.15);
}
pre code { background: none; padding: 0; color: inherit; font-size: inherit; }

/* ==================== ALERTS ==================== */
.alert {
    padding: 1.1rem 1.25rem; border-radius: var(--radius-lg); margin: 1.25rem 0;
    font-size: 0.9rem; display: flex; gap: 0.75rem; align-items: flex-start;
    border: 1px solid transparent; position: relative;
}
.alert i { margin-top: 2px; flex-shrink: 0; font-size: 1rem; }
.alert-info { background: linear-gradient(135deg, var(--info-bg) 0%, #dbeafe 100%); border-color: rgba(59, 130, 246, 0.15); color: #1e40af; box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08); }
.alert-success { background: linear-gradient(135deg, var(--success-bg) 0%, #d1fae5 100%); border-color: rgba(16, 185, 129, 0.15); color: #065f46; box-shadow: 0 2px 8px rgba(16, 185, 129, 0.08); }
.alert-warning { background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%); border-color: rgba(245, 184, 27, 0.2); color: #92400e; box-shadow: 0 2px 8px rgba(245, 184, 27, 0.1); }
.alert-error { background: linear-gradient(135deg, var(--error-bg) 0%, #fee2e2 100%); border-color: rgba(239, 68, 68, 0.15); color: #991b1b; box-shadow: 0 2px 8px rgba(239, 68, 68, 0.08); }

/* ==================== IMAGES ==================== */
.image-card {
    background: linear-gradient(145deg, #fafaf8 0%, #f5f4f0 100%);
    border: 1px solid var(--border); border-radius: var(--radius-xl);
    padding: 1rem; margin: 1.5rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04), inset 0 1px 0 rgba(255,255,255,0.8);
    transition: all 0.3s ease;
}
.image-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.08); transform: translateY(-2px); }
.image-card img { width: 100%; border-radius: var(--radius-lg); max-width: 100%; display: block; border: 1px solid var(--border-light); }
.image-caption { text-align: center; font-size: 0.82rem; color: var(--text-muted); margin-top: 0.85rem; font-weight: 500; letter-spacing: 0.01em; }

/* ==================== SCREEN LAYOUT ==================== */
.screen-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 1.5rem; }
.feature-list { display: flex; flex-direction: column; gap: 0.75rem; }
.feature-item {
    display: flex; gap: 1rem; padding: 1rem 1.25rem;
    border-radius: var(--radius-lg); border: 1px solid var(--border-light);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, var(--card) 0%, #fafaf8 100%);
}
.feature-item:hover {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, #e8e7e1 100%);
    border-color: var(--accent); box-shadow: 0 4px 12px rgba(245, 184, 27, 0.1);
    transform: translateY(-1px);
}
.feature-icon {
    width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--accent-glow) 0%, rgba(245, 184, 27, 0.08) 100%);
    border: 1px solid rgba(245, 184, 27, 0.2); border-radius: var(--radius-md);
    color: var(--accent-hover); flex-shrink: 0; transition: all 0.25s ease;
}
.feature-item:hover .feature-icon {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: #1a1a1a; border-color: transparent; box-shadow: 0 4px 12px rgba(245, 184, 27, 0.3);
}
.feature-icon i { font-size: 1.1rem; }
.feature-text h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.35rem; color: var(--text); line-height: 1.3; }
.feature-text p { font-size: 0.85rem; color: var(--text-secondary); margin: 0; line-height: 1.5; }

/* ==================== MAIN SCREEN PREVIEW ==================== */
.main-screen-preview { position: relative; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; height: 400px; width: 100%; }
.main-screen-image { position: absolute; inset: 0; opacity: 0; transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1); display: flex; align-items: center; justify-content: center; will-change: opacity; }
.main-screen-image.active { position: absolute; opacity: 1; z-index: 1; }
.main-screen-image img { width: 100%; height: 100%; object-fit: contain; padding: 1rem; }
.main-screen-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.main-screen-grid .feature-item { cursor: pointer; transition: all 0.25s ease; }
.main-screen-grid .feature-item:hover { background: var(--accent-glow); border-color: var(--accent); transform: translateY(-2px); }
.main-screen-grid .feature-item:hover .feature-icon { background: var(--accent); color: #1a1a1a; }

/* ==================== STATUS BANNERS ==================== */
.status-showcase { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.status-card { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); }
.status-card img { width: 100%; display: block; }
.status-card-label { padding: 0.75rem 1rem; font-size: 0.85rem; font-weight: 500; text-align: center; }
.status-card.success .status-card-label { background: var(--success-bg); color: #065f46; border-top: 1px solid rgba(16, 185, 129, 0.2); }
.status-card.error .status-card-label { background: var(--error-bg); color: #991b1b; border-top: 1px solid rgba(239, 68, 68, 0.2); }

/* ==================== STEPS ==================== */
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li { counter-increment: step; display: flex; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border-light); }
.steps li:last-child { border-bottom: none; }
.steps li::before { content: counter(step); width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background: var(--accent-glow); color: var(--accent-hover); border-radius: 50%; font-size: 0.8rem; font-weight: 700; flex-shrink: 0; margin-top: 2px; }

/* ==================== SLIDER ==================== */
.cal-slider { position: relative; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin: 1.25rem 0; }
.cal-slider-track { display: flex; transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1); }
.cal-slider-slide { min-width: 100%; position: relative; }
.cal-slider-slide img { width: 100%; display: block; border-radius: 0; }
.cal-slider-caption { padding: 0.85rem 1.25rem; text-align: center; font-size: 0.85rem; color: var(--text-secondary); background: var(--card); border-top: 1px solid var(--border-light); }
.cal-slider-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 50%; border: none; background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(6px); color: var(--text); font-size: 0.85rem; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); transition: all 0.2s ease; z-index: 2; }
.cal-slider-btn:hover { background: var(--card); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18); }
.cal-slider-btn--prev { left: 0.75rem; }
.cal-slider-btn--next { right: 0.75rem; }
.cal-slider-dots { display: flex; justify-content: center; gap: 8px; padding: 0.75rem 1rem; background: var(--card); }
.cal-slider-dot { width: 8px; height: 8px; border-radius: 50%; border: none; background: var(--border); cursor: pointer; transition: all 0.25s ease; padding: 0; }
.cal-slider-dot.active { background: var(--accent); box-shadow: 0 0 6px rgba(245, 184, 27, 0.4); width: 22px; border-radius: 4px; }
.cal-slider-step { position: absolute; top: 0.75rem; right: 0.75rem; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(4px); color: #fff; font-size: 0.72rem; font-weight: 600; padding: 0.3rem 0.65rem; border-radius: 100px; z-index: 2; letter-spacing: 0.02em; }

/* ==================== SECTION HEADER (algorithms) ==================== */
.section-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 2px solid var(--border-light); }
.section-header-icon {
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    border-radius: var(--radius-md); color: #1a1a1a; font-size: 1rem;
    box-shadow: 0 4px 12px rgba(245, 184, 27, 0.3);
}
.section-header-text h2 { margin: 0; font-size: 1.35rem; }
.section-header-text p { margin: 0.15rem 0 0; font-size: 0.85rem; color: var(--text-muted); }

/* ==================== TEMPLATE BADGE ==================== */
.template-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: linear-gradient(135deg, var(--accent-glow) 0%, rgba(245, 184, 27, 0.05) 100%);
    border: 1px solid rgba(245, 184, 27, 0.25); border-radius: 100px;
    padding: 0.5rem 1rem; font-size: 0.8rem; font-weight: 600; color: var(--accent-hover);
    margin-bottom: 1rem; font-family: 'JetBrains Mono', monospace; letter-spacing: 0.02em;
}
.template-badge i { font-size: 0.85rem; color: var(--accent); }

/* ==================== CODE STEP ==================== */
.code-step {
    display: flex; align-items: flex-start; gap: 1rem; padding: 1.5rem;
    background: var(--card); border: 1px solid var(--border-light);
    border-radius: var(--radius-xl); margin: 1.25rem 0; transition: all 0.25s ease;
}
.code-step:hover { border-color: var(--accent); box-shadow: 0 4px 12px rgba(245, 184, 27, 0.08); }
.code-step-number {
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    border-radius: 50%; color: #1a1a1a; font-size: 0.85rem; font-weight: 700; flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(245, 184, 27, 0.3);
}
.code-step-content { flex: 1; min-width: 0; }
.code-step-content h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text); }
.code-step-content p { font-size: 0.85rem; color: var(--text-secondary); margin: 0; line-height: 1.5; }

/* ==================== TABLES ==================== */
table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.9rem; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border-light); }
th { background: var(--bg-secondary); font-weight: 600; color: var(--text); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; }
td { color: var(--text-secondary); }
tr:hover td { background: var(--bg-secondary); }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1100px) {
    .screen-layout { grid-template-columns: 1fr; }
    .hero { flex-direction: column; text-align: center; padding: 2rem; }
    .hero-features { justify-content: center; }
}

.hamburger { display: none; background: none; border: none; padding: 0.5rem; cursor: pointer; color: var(--text); font-size: 1.25rem; }
.mobile-nav-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 200; }
.mobile-nav-overlay.active { display: block; }
.mobile-nav-menu { position: fixed; top: 72px; right: 1rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); padding: 0.5rem; z-index: 201; display: none; min-width: 200px; }
.mobile-nav-menu.active { display: block; }
.mobile-nav-menu button, .mobile-nav-menu a {
    width: 100%; padding: 0.75rem 1rem; border: none; background: transparent;
    color: var(--text-secondary); font-weight: 500; border-radius: var(--radius-sm);
    cursor: pointer; font-size: 0.9rem; font-family: inherit; display: flex;
    align-items: center; gap: 8px; text-align: left; transition: var(--transition);
    text-decoration: none;
}
.mobile-nav-menu button:hover, .mobile-nav-menu a:hover { background: var(--bg-secondary); color: var(--text); }
.mobile-nav-menu button.active, .mobile-nav-menu a.active { background: var(--accent-glow); color: var(--accent-hover); font-weight: 600; }

@media (max-width: 900px) {
    .container { flex-direction: column; }
    .sidebar { width: 100%; min-width: 0; max-width: 100%; }
    .sidebar-inner { position: static; max-height: none; display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0; }
    .sidebar-group { flex: 1 1 auto; min-width: 140px; margin-bottom: 0; }
    .sidebar-group-title { padding: 0.4rem 0.65rem 0.2rem; }
    .top-navbar { padding: 0 1rem; }
    .main-nav { display: none; }
    .hamburger { display: block; }
}

@media (max-width: 640px) {
    .top-navbar { height: 64px; padding: 0 0.75rem; }
    .logo img { height: 36px; }
    .logo-text { font-size: 1.05rem; }
    .container { width: 100%; margin: 1rem auto; padding: 0 1rem; gap: 1rem; }
    .content { width: 100%; min-width: 0; }
    .hero { padding: 1.25rem; }
    .hero-logo img { max-width: 100%; height: auto; }
    table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    pre, code { max-width: 100%; overflow-wrap: anywhere; }
    .search-overlay { padding-top: 0; align-items: stretch; }
    .search-modal { max-width: 100%; max-height: 100vh; border-radius: 0; height: 100%; }
    .search-input-wrap { padding: 12px 16px; }
    .search-footer { padding: 8px 16px; }
}

/* ==================== HEADING ANCHORS ==================== */
h2, h3 { position: relative; }
.heading-anchor {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; margin-left: 8px; border-radius: 6px;
    background: var(--bg-secondary); border: 1px solid var(--border);
    color: var(--text-muted); font-size: 0.7rem; text-decoration: none;
    opacity: 0; transition: all 0.2s ease; vertical-align: middle;
    cursor: pointer; flex-shrink: 0;
}
h2:hover .heading-anchor, h3:hover .heading-anchor, .heading-anchor:focus { opacity: 1; }
.heading-anchor:hover { background: var(--accent); border-color: var(--accent); color: #1a1a1a; transform: scale(1.1); }
.heading-anchor.copied { background: rgba(16, 185, 129, 0.15); border-color: rgba(16, 185, 129, 0.3); color: #10b981; }

/* ==================== LIGHTBOX ==================== */
.lightbox-overlay {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px); z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: opacity 0.25s ease, visibility 0.25s ease;
    cursor: zoom-out;
}
.lightbox-overlay.active { opacity: 1; visibility: visible; }
.lightbox-overlay img {
    max-width: 90vw; max-height: 90vh; object-fit: contain; border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.92); transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1); cursor: default;
}
.lightbox-overlay.active img { transform: scale(1); }
.lightbox-close {
    position: absolute; top: 1.25rem; right: 1.25rem;
    width: 44px; height: 44px; border-radius: 50%; border: none;
    background: rgba(255, 255, 255, 0.15); color: #fff; font-size: 1.15rem;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.3); transform: scale(1.1); }
.lightbox-caption {
    position: absolute; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(8px); color: #fff;
    padding: 0.5rem 1.25rem; border-radius: 100px; font-size: 0.85rem; font-weight: 500;
    white-space: nowrap; max-width: 80vw; overflow: hidden; text-overflow: ellipsis;
}
.doc-section img:not(.lightbox-overlay img) { cursor: zoom-in; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.doc-section img:not(.lightbox-overlay img):hover { transform: scale(1.01); }

/* ==================== PROGRESS BAR ==================== */
.progress-bar {
    position: fixed; top: 0; left: 0; width: 0; height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    z-index: 10001; transition: width 0.1s linear; border-radius: 0 2px 2px 0;
}

/* ==================== BREADCRUMBS ==================== */
.breadcrumbs { display: flex; align-items: center; gap: 6px; padding: 0.75rem 0; margin-bottom: 0.5rem; font-size: 0.8rem; color: var(--text-muted); }
.breadcrumbs a { color: var(--text-secondary); text-decoration: none; transition: color 0.2s ease; }
.breadcrumbs a:hover { color: var(--accent-hover); }
.breadcrumbs-sep { font-size: 0.65rem; opacity: 0.5; }
.breadcrumbs-current { color: var(--text); font-weight: 500; }

/* ==================== SCROLL TO TOP ==================== */
.scroll-to-top {
    position: fixed; bottom: 2rem; right: 2rem; width: 48px; height: 48px;
    background: var(--accent); color: #1a1a1a; border: none; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; box-shadow: 0 4px 16px rgba(245, 184, 27, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); opacity: 0; visibility: hidden; z-index: 1000;
}
.scroll-to-top.visible { opacity: 1; visibility: visible; }
.scroll-to-top:hover { background: var(--accent-hover); transform: translateY(-3px); box-shadow: 0 6px 24px rgba(245, 184, 27, 0.5); }
.scroll-to-top:active { transform: translateY(-1px); }

/* ==================== COPY BUTTON ==================== */
.copy-btn {
    position: absolute; top: 0.75rem; right: 0.75rem;
    display: flex; align-items: center; gap: 6px;
    background: rgba(245, 184, 27, 0.15); color: var(--accent);
    border: 1px solid rgba(245, 184, 27, 0.3); border-radius: 6px;
    padding: 0.3rem 0.65rem; font-size: 0.7rem; font-weight: 600;
    font-family: 'Inter', sans-serif; cursor: pointer;
    transition: all 0.2s ease; z-index: 10; letter-spacing: 0.02em;
}
.copy-btn:hover { background: var(--accent); color: #1a1a1a; border-color: var(--accent); box-shadow: 0 2px 8px rgba(245, 184, 27, 0.3); }
.copy-btn.copied { background: rgba(16, 185, 129, 0.2); color: #10b981; border-color: rgba(16, 185, 129, 0.4); }
.copy-btn.copied:hover { background: #10b981; color: #fff; }
.copy-btn i { font-size: 0.75rem; }
pre:hover .copy-btn { opacity: 1; }

/* ==================== QR CODE ==================== */
.qr-code { display: flex; align-items: center; justify-content: center; }
.qr-code img { display: block; width: 100% !important; height: 100% !important; }
.qr-code canvas { display: block; width: 100% !important; height: 100% !important; }
