/* ══════════════════════════════════════════════════════════════════════════════
   TOME Knowledge Base
   Industrial Terminal Design System
   JetBrains Mono + Brand Colors
   ══════════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────────
   Typography
   ───────────────────────────────────────────────────────────────────────────── */
@font-face {
    font-family: 'JetBrains Mono';
    src: url('fonts/jetbrains-mono-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'JetBrains Mono';
    src: url('fonts/jetbrains-mono-bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* IBM Plex Sans - Corporate theme */
@font-face { font-family: 'IBM Plex Sans'; src: url('https://i.sub-net.at/fonts/ibm-plex-sans-300.woff2') format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url('https://i.sub-net.at/fonts/ibm-plex-sans-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url('https://i.sub-net.at/fonts/ibm-plex-sans-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url('https://i.sub-net.at/fonts/ibm-plex-sans-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url('https://i.sub-net.at/fonts/ibm-plex-sans-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url('https://i.sub-net.at/fonts/ibm-plex-sans-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

/* IBM Plex Mono - Corporate theme */
@font-face { font-family: 'IBM Plex Mono'; src: url('https://i.sub-net.at/fonts/ibm-plex-mono-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('https://i.sub-net.at/fonts/ibm-plex-mono-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('https://i.sub-net.at/fonts/ibm-plex-mono-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }

/* Orbitron - Synthwave theme */
@font-face { font-family: 'Orbitron'; src: url('https://i.sub-net.at/fonts/orbitron-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Orbitron'; src: url('https://i.sub-net.at/fonts/orbitron-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Orbitron'; src: url('https://i.sub-net.at/fonts/orbitron-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Orbitron'; src: url('https://i.sub-net.at/fonts/orbitron-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Orbitron'; src: url('https://i.sub-net.at/fonts/orbitron-800.woff2') format('woff2'); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Orbitron'; src: url('https://i.sub-net.at/fonts/orbitron-900.woff2') format('woff2'); font-weight: 900; font-style: normal; font-display: swap; }

/* Rajdhani - Synthwave theme */
@font-face { font-family: 'Rajdhani'; src: url('https://i.sub-net.at/fonts/rajdhani-300.woff2') format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Rajdhani'; src: url('https://i.sub-net.at/fonts/rajdhani-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Rajdhani'; src: url('https://i.sub-net.at/fonts/rajdhani-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Rajdhani'; src: url('https://i.sub-net.at/fonts/rajdhani-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Rajdhani'; src: url('https://i.sub-net.at/fonts/rajdhani-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

/* Fira Code - Synthwave theme */
@font-face { font-family: 'Fira Code'; src: url('https://i.sub-net.at/fonts/fira-code-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fira Code'; src: url('https://i.sub-net.at/fonts/fira-code-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fira Code'; src: url('https://i.sub-net.at/fonts/fira-code-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }

/* ─────────────────────────────────────────────────────────────────────────────
   Design Tokens
   ───────────────────────────────────────────────────────────────────────────── */
/* ─────────────────────────────────────────────────────────────────────────────
   Shared Tokens (all themes)
   ───────────────────────────────────────────────────────────────────────────── */
:root {
    /* Brand Colors */
    --brand-dark: #736b5e;
    --brand-accent: #27AE60;
    --brand-accent-bright: #2ECC71;
    --brand-accent-dim: rgba(39, 174, 96, 0.15);
    --brand-accent-glow: rgba(39, 174, 96, 0.4);

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Transitions */
    --transition-fast: 0.1s;
    --transition-base: 0.15s;
    --transition-slow: 0.3s;
}

/* ─────────────────────────────────────────────────────────────────────────────
   THEME: Terminal (default)
   JetBrains Mono · Dark industrial · Green accent
   ───────────────────────────────────────────────────────────────────────────── */
.terminal-theme {
    /* Backgrounds */
    --bg-deep: #080c0f;
    --bg-base: #0d1216;
    --bg-surface: #131a21;
    --bg-elevated: #18212b;
    --bg-hover: #1d2734;

    /* Borders */
    --border-subtle: #1e2832;
    --border-default: #2a3744;
    --border-strong: #3d4f5f;

    /* Text */
    --text-primary: #e8eef4;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --text-disabled: #4b5563;

    /* Accent */
    --accent: var(--brand-accent);
    --accent-bright: var(--brand-accent-bright);
    --accent-dim: var(--brand-accent-dim);
    --accent-glow: var(--brand-accent-glow);

    /* Status */
    --status-error: #ef4444;
    --status-warning: #f59e0b;
    --status-info: #3b82f6;

    /* Typography */
    --font-body: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    --font-heading: 'JetBrains Mono', 'SF Mono', monospace;
    --font-nav: 'JetBrains Mono', 'SF Mono', monospace;

    /* Radii */
    --radius-sm: 3px;
    --radius-md: 6px;
    --radius-lg: 8px;

    /* Effects */
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* ─────────────────────────────────────────────────────────────────────────────
   THEME: Corporate
   IBM Plex Sans + IBM Plex Mono · Navy sidebar, white content · Blue accent
   ───────────────────────────────────────────────────────────────────────────── */
.theme-corporate {
    /* Palette */
    --navy: #0F1B2D;
    --navy-mid: #162338;
    --navy-light: #1C2D45;

    /* Backgrounds */
    --bg-deep: #F8FAFC;
    --bg-base: #FFFFFF;
    --bg-surface: #FFFFFF;
    --bg-elevated: #F1F5F9;
    --bg-hover: #E2E8F0;

    /* Sidebar (dark navy — overridden in selectors below) */
    --sidebar-bg: var(--navy);
    --sidebar-text: #CBD5E1;
    --sidebar-text-dim: #94A3B8;
    --sidebar-border: rgba(255, 255, 255, 0.06);
    --sidebar-hover: rgba(255, 255, 255, 0.05);

    /* Borders */
    --border-subtle: #E2E8F0;
    --border-default: #CBD5E1;
    --border-strong: #94A3B8;

    /* Text */
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --text-disabled: #CBD5E1;

    /* Accent */
    --accent: #3B82F6;
    --accent-bright: #2563EB;
    --accent-dim: rgba(59, 130, 246, 0.1);
    --accent-glow: rgba(59, 130, 246, 0.2);

    /* Status */
    --status-error: #EF4444;
    --status-warning: #F59E0B;
    --status-info: #3B82F6;

    /* Typography */
    --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'IBM Plex Mono', 'Consolas', 'Monaco', monospace;
    --font-heading: 'IBM Plex Sans', -apple-system, sans-serif;
    --font-nav: 'IBM Plex Sans', -apple-system, sans-serif;

    /* Radii */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 10px;

    /* Effects */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* ─────────────────────────────────────────────────────────────────────────────
   THEME: Synthwave
   Orbitron + Rajdhani + Fira Code · Neon on deep purple · Retro-futuristic
   ───────────────────────────────────────────────────────────────────────────── */
.theme-synthwave {
    /* Palette */
    --neon-pink: #FF2D95;
    --neon-cyan: #00F0FF;
    --neon-purple: #A855F7;
    --neon-yellow: #FFE14D;

    /* Backgrounds */
    --bg-deep: #0D0221;
    --bg-base: #110428;
    --bg-surface: #150535;
    --bg-elevated: #1A0940;
    --bg-hover: #1F0D4D;

    /* Sidebar */
    --sidebar-bg: rgba(13, 2, 33, 0.95);
    --sidebar-text: #E8E0F0;
    --sidebar-text-dim: #9B94A8;
    --sidebar-border: rgba(168, 85, 247, 0.15);
    --sidebar-hover: rgba(168, 85, 247, 0.08);

    /* Borders */
    --border-subtle: rgba(168, 85, 247, 0.1);
    --border-default: rgba(168, 85, 247, 0.2);
    --border-strong: rgba(168, 85, 247, 0.35);

    /* Text */
    --text-primary: #E8E0F0;
    --text-secondary: #B0A8C0;
    --text-muted: #7A7490;
    --text-disabled: #5A5470;

    /* Accent */
    --accent: #00F0FF;
    --accent-bright: #33F5FF;
    --accent-dim: rgba(0, 240, 255, 0.1);
    --accent-glow: rgba(0, 240, 255, 0.3);

    /* Status */
    --status-error: #FF4D6A;
    --status-warning: var(--neon-yellow);
    --status-info: var(--neon-cyan);

    /* Typography */
    --font-body: 'Rajdhani', 'Segoe UI', sans-serif;
    --font-mono: 'Fira Code', 'Consolas', monospace;
    --font-heading: 'Orbitron', 'Rajdhani', sans-serif;
    --font-nav: 'Rajdhani', sans-serif;

    /* Radii */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;

    /* Effects */
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Synthwave Font Size Overrides
   Rajdhani (proportional) needs larger sizes than JetBrains Mono (monospace 13px)
   Orbitron (display) headings need scaling too
   ───────────────────────────────────────────────────────────────────────────── */
.theme-synthwave {
    font-size: 15px;
}

.theme-synthwave .sidebar .nav-item,
.theme-synthwave .sidebar .nav-group-header {
    font-size: 14px;
}

.theme-synthwave .page-meta {
    font-size: 13px;
}

.theme-synthwave .page-content h1 {
    font-size: 34px;
}

.theme-synthwave .markdown-body {
    font-size: 15px;
}

.theme-synthwave .markdown-body h1 { font-size: 28px; }
.theme-synthwave .markdown-body h2 { font-size: 23px; }
.theme-synthwave .markdown-body h3 { font-size: 18px; }
.theme-synthwave .markdown-body h4 { font-size: 16px; }

.theme-synthwave .markdown-body code {
    font-size: 14px;
}

.theme-synthwave .markdown-body pre {
    font-size: 14px;
}

.theme-synthwave .markdown-body table {
    font-size: 14px;
}

.theme-synthwave .tag {
    font-size: 10px;
}

.theme-synthwave .search-box input {
    font-size: 14px;
}

.theme-synthwave .breadcrumb {
    font-size: 12px;
}

.theme-synthwave .btn {
    font-size: 13px;
}

.theme-synthwave .btn-small {
    font-size: 10px;
}

.theme-synthwave .welcome h1 {
    font-size: 36px;
}

.theme-synthwave .modal-title {
    font-size: 16px;
}

.theme-synthwave .toast {
    font-size: 14px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Reset & Base
   ───────────────────────────────────────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Terminal theme: disable all transitions for snappy UI */
.terminal-theme *,
.terminal-theme *::before,
.terminal-theme *::after {
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
}

::selection {
    background: var(--accent-dim);
    color: var(--accent-bright);
}

html, body {
    height: 100%;
    font-family: var(--font-body);
    font-size: 13px;
    line-height: 1.6;
    font-feature-settings: 'liga' 1, 'calt' 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.terminal-theme,
.theme-corporate,
.theme-synthwave {
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-strong);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-default) transparent;
}

/* ─────────────────────────────────────────────────────────────────────────────
   App Layout
   ───────────────────────────────────────────────────────────────────────────── */
.app {
    display: flex;
    height: 100vh;
    background: var(--bg-deep);
    position: relative;
}

.terminal-theme .app {
    background:
        linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-base) 100%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(39, 174, 96, 0.02) 2px,
            rgba(39, 174, 96, 0.02) 4px
        );
}

.theme-synthwave .app {
    background: linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-base) 100%);
}

/* Synthwave grid overlay */
.theme-synthwave .app::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        linear-gradient(rgba(168, 85, 247, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(168, 85, 247, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    z-index: 0;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Sidebar
   ───────────────────────────────────────────────────────────────────────────── */
.sidebar {
    width: 300px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.theme-corporate .sidebar {
    background: var(--sidebar-bg);
    border-right-color: var(--sidebar-border);
}

.theme-corporate .sidebar .search-box input {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--sidebar-text);
}

.theme-corporate .sidebar .search-box input::placeholder {
    color: var(--sidebar-text-dim);
}

.theme-corporate .sidebar .search-box input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.theme-corporate .sidebar-header {
    border-bottom-color: var(--sidebar-border);
}

.theme-corporate .sidebar-footer {
    background: rgba(15, 27, 45, 0.8);
    border-top-color: var(--sidebar-border);
}

.theme-corporate .nav-tree .loading {
    color: var(--sidebar-text-dim);
}

.theme-corporate .nav-group-header {
    color: var(--sidebar-text-dim);
}

.theme-corporate .nav-group-header:hover {
    color: var(--sidebar-text);
    background: var(--sidebar-hover);
}

.theme-corporate .nav-group.expanded > .nav-group-header {
    color: #60A5FA;
}

.theme-corporate .nav-item {
    color: var(--sidebar-text);
}

.theme-corporate .nav-item:hover {
    color: var(--sidebar-text);
    background: var(--sidebar-hover);
}

.theme-corporate .nav-item.active {
    color: #60A5FA;
    background: rgba(59, 130, 246, 0.15);
}

.theme-corporate .nav-children {
    border-left-color: rgba(255, 255, 255, 0.08);
}

.theme-corporate .user-name {
    color: var(--sidebar-text-dim);
}

.theme-corporate .settings-btn {
    color: var(--sidebar-text-dim);
}

.theme-corporate .settings-btn:hover {
    color: var(--sidebar-text);
    background: var(--sidebar-hover);
    border-color: var(--sidebar-border);
}

.theme-synthwave .sidebar {
    background: var(--sidebar-bg);
    border-right-color: var(--sidebar-border);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.theme-synthwave .sidebar-header {
    border-bottom-color: var(--sidebar-border);
}

.theme-synthwave .sidebar-footer {
    background: rgba(17, 4, 40, 0.8);
    border-top-color: var(--sidebar-border);
}

.theme-synthwave .nav-group-header {
    font-family: 'Orbitron', sans-serif;
    font-size: 9px;
    letter-spacing: 0.12em;
    font-weight: 600;
}

.theme-synthwave .nav-item.active {
    text-shadow: 0 0 8px var(--accent-glow);
    border: 1px solid rgba(0, 240, 255, 0.15);
}

/* Glow line on sidebar edge */
.terminal-theme .sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(
        180deg,
        var(--accent) 0%,
        transparent 30%,
        transparent 70%,
        var(--accent) 100%
    );
    opacity: 0.3;
}

.theme-synthwave .sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, #00F0FF 0%, #A855F7 50%, #FF2D95 100%);
    opacity: 0.4;
}

.sidebar-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.sidebar-header .btn {
    width: 100%;
}

.sidebar-actions {
    display: flex;
    gap: var(--space-sm);
}

.sidebar-actions .btn {
    width: auto;
    flex: 1;
}

/* Logo */
.logo {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.3px;
}

.logo-icon {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.logo-text {
    color: var(--text-primary);
}

.theme-corporate .logo-icon {
    color: #94A3B8;
}

.theme-corporate .logo-text {
    color: #FFFFFF;
}

.theme-synthwave .logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.theme-synthwave .logo-text {
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 16px rgba(0, 240, 255, 0.25));
}

/* Search */
.search-box {
    padding: var(--space-md) var(--space-lg);
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 10px 36px 10px 14px;
    background: var(--bg-base);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-nav);
    font-size: 13px;
    outline: none;
    transition: all var(--transition-base);
}

.theme-synthwave .search-box input:focus {
    box-shadow: 0 0 0 3px var(--accent-dim), 0 0 20px var(--accent-dim);
}

.search-box input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim), 0 0 20px var(--accent-dim);
}

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

.search-clear {
    position: absolute;
    right: calc(var(--space-lg) + 10px);
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background: transparent;
    border: 1px solid var(--status-error);
    border-radius: var(--radius-sm);
    color: var(--status-error);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.search-box:has(input:not(:placeholder-shown)) .search-clear {
    opacity: 1;
    visibility: visible;
}

.search-clear:hover {
    background: var(--status-error);
    color: white;
}

/* Navigation Tree */
.nav-tree {
    flex: 1;
    overflow-y: auto;
    padding: 0 var(--space-sm);
}

.nav-tree .loading {
    padding: var(--space-lg);
    color: var(--text-muted);
    text-align: center;
    font-size: 12px;
}

.nav-tree .loading::after {
    content: '';
    animation: loading-dots 1.4s infinite;
}

@keyframes loading-dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* Navigation Groups */
.nav-group {
    margin-bottom: 2px;
    opacity: 0;
    transform: translateX(-8px);
    animation: slide-in 0.3s ease-out forwards;
}

.nav-group[data-depth="1"] { margin-left: 12px; }
.nav-group[data-depth="2"] { margin-left: 24px; }
.nav-group[data-depth="3"] { margin-left: 36px; }
.nav-group[data-depth="4"] { margin-left: 48px; }

.nav-group-header {
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
    user-select: none;
    border-left: 2px solid transparent;
    margin-top: var(--space-sm);
}

.nav-group-header:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    border-left-color: var(--accent);
}

.nav-group.expanded > .nav-group-header {
    color: var(--accent);
    border-left-color: var(--accent);
}

.nav-toggle {
    font-size: 10px;
    width: 14px;
    text-align: center;
    color: var(--text-secondary);
    transition: all var(--transition-base);
}

.nav-group.expanded > .nav-group-header .nav-toggle {
    color: var(--accent);
}

.nav-toggle-spacer {
    width: 12px;
}

.nav-children {
    display: none;
    padding-left: 8px;
    border-left: 1px solid var(--border-default);
    margin-left: 6px;
    margin-top: 2px;
}

.nav-group.expanded > .nav-children {
    display: block;
}

.nav-item {
    display: block;
    padding: 8px 12px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    font-size: 13px;
    opacity: 0.85;
}

.nav-item.root-item {
    margin-bottom: 2px;
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    opacity: 1;
}

.nav-item.active {
    color: var(--accent-bright);
    background: var(--accent-dim);
}

.nav-item.active::before {
    content: '>';
    position: absolute;
    left: 4px;
    color: var(--accent);
    font-weight: 700;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; text-shadow: 0 0 4px var(--accent-glow); }
    50% { opacity: 0.7; text-shadow: 0 0 8px var(--accent-glow); }
}

/* Sidebar Footer */
.sidebar-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-base);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex: 1;
    min-width: 0;
}

.user-name {
    flex: 1;
    font-weight: 500;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Settings */
.settings-wrapper {
    position: relative;
}

.settings-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

.settings-btn:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
    border-color: var(--border-subtle);
}

.settings-btn.active {
    color: var(--accent);
    background: var(--bg-hover);
    border-color: var(--accent-dim);
}

.settings-btn svg {
    transition: transform 0.25s ease;
}

.settings-btn:hover svg,
.settings-btn.active svg {
    transform: rotate(30deg);
}

.settings-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    min-width: 170px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    padding: 4px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    z-index: 1000;
}

.settings-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.settings-menu-section {
    padding: 6px 12px 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.settings-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: var(--font-nav);
    font-size: 12px;
    color: var(--text-secondary);
    text-align: left;
    transition: background 0.15s, color 0.15s;
}

.settings-menu-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.settings-menu-item.active {
    color: var(--accent);
}

.theme-preview {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid var(--border-default);
    flex-shrink: 0;
}

.theme-preview--terminal {
    background: linear-gradient(135deg, #0d1216 50%, #27AE60 50%);
    border-color: #2a3744;
}

.theme-preview--corporate {
    background: linear-gradient(135deg, #0F1B2D 50%, #F8FAFC 50%);
    border-color: #334155;
}

.theme-preview--synthwave {
    background: linear-gradient(135deg, #0D0221 50%, #00F0FF 25%, #FF2D95 75%);
    border-color: #4A1D6A;
}

.theme-label {
    flex: 1;
}

.theme-check {
    font-size: 11px;
    opacity: 0;
    color: var(--accent);
    transition: opacity 0.15s;
}

.settings-menu-item.active .theme-check {
    opacity: 1;
}

.theme-synthwave .settings-btn.active {
    box-shadow: 0 0 8px var(--accent-glow);
}

.theme-synthwave .settings-menu {
    border-color: rgba(0, 240, 255, 0.15);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(0, 240, 255, 0.06);
}

.theme-corporate .settings-btn.active {
    color: var(--accent);
    background: var(--sidebar-hover);
    border-color: rgba(59, 130, 246, 0.3);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Main Content
   ───────────────────────────────────────────────────────────────────────────── */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-base);
}

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-xl);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    position: relative;
}

.theme-corporate .content-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Synthwave glow line under topbar */
.theme-synthwave .content-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--neon-cyan) 20%,
        var(--neon-purple) 50%,
        var(--neon-pink) 80%,
        transparent 100%
    );
    opacity: 0.4;
}

/* Corporate: no terminal cursor on active nav item */
.theme-corporate .nav-item.active::before {
    content: '';
}

.content-header.animate {
    animation: fade-in 0.4s ease-out;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 12px;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-base);
}

.breadcrumb a:hover {
    color: var(--accent);
}

.breadcrumb .home-indicator {
    color: var(--accent);
}

.breadcrumb .separator {
    color: var(--border-strong);
}

.theme-synthwave .breadcrumb {
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    letter-spacing: 0.06em;
}

.actions {
    display: flex;
    gap: var(--space-sm);
}

.action-flag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 12px;
    user-select: none;
    cursor: pointer;
}

.action-flag:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.action-flag input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* Page Content */
.page-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-xl);
}

.page-content.graph-mode {
    padding: 0;
    overflow: hidden;
}

.graph-canvas-wrap {
    position: relative;
    width: 100%;
    height: 100%;
}

#graph-canvas {
    position: absolute;
    inset: 0;
}

.graph-search {
    width: 260px;
    max-width: 40vw;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 12px;
}

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

.graph-search:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.graph-hint {
    position: absolute;
    left: var(--space-md);
    bottom: var(--space-md);
    padding: 6px 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: color-mix(in srgb, var(--bg-deep) 60%, transparent);
    color: var(--text-secondary);
    font-size: 12px;
    pointer-events: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Welcome Screen */
.welcome {
    max-width: 600px;
    margin: 80px auto;
    text-align: center;
    opacity: 0;
    transform: translateY(10px);
    animation: fade-up 0.4s ease-out 0.1s forwards;
}

.welcome h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.theme-synthwave .welcome h1 {
    font-size: 32px;
    font-family: var(--font-heading);
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple), var(--neon-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.theme-corporate .welcome h1 {
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
}

.welcome p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: var(--space-lg);
}

.welcome .btn {
    margin-top: var(--space-md);
}

.welcome-terminal {
    font-size: 14px;
    margin-bottom: var(--space-lg);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-deep);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    display: inline-flex;
    gap: var(--space-sm);
}

.theme-corporate .welcome-terminal {
    background: #0F1B2D;
    border-color: rgba(255, 255, 255, 0.1);
}

.theme-corporate .welcome-terminal .command {
    color: #E2E8F0;
}

.welcome-terminal .prompt {
    color: var(--accent);
}

.welcome-terminal .command {
    color: var(--text-primary);
}

.welcome-hint {
    margin-top: var(--space-xl);
    font-size: 12px;
    color: var(--text-muted);
}

.welcome-hint kbd {
    display: inline-block;
    padding: 3px 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: var(--text-secondary);
    box-shadow: 0 2px 0 var(--border-subtle);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Article & Markdown
   ───────────────────────────────────────────────────────────────────────────── */
.page-content article {
    max-width: 100%;
}

.page-content h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.theme-corporate .page-content h1,
.theme-synthwave .page-content h1 {
    font-family: var(--font-heading);
}

.theme-synthwave .page-content h1 {
    font-size: 34px;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 12px;
}

.page-tags {
    display: flex;
    gap: 6px;
}

.tag {
    padding: 3px 10px;
    background: var(--accent-dim);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: var(--accent-bright);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.theme-synthwave .tag {
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    letter-spacing: 0.1em;
}

/* Markdown Content */
.markdown-body {
    color: var(--text-primary);
    line-height: 1.7;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
    margin-top: var(--space-xl);
    margin-bottom: var(--space-md);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    font-family: var(--font-heading);
}

.theme-synthwave .markdown-body h2 {
    color: var(--neon-cyan);
    text-shadow: 0 0 12px rgba(0, 240, 255, 0.15);
    border-bottom-color: rgba(0, 240, 255, 0.15);
}

.theme-synthwave .markdown-body h3 {
    color: var(--neon-purple);
}

.markdown-body h1 { font-size: 24px; }
.markdown-body h2 {
    font-size: 20px;
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-subtle);
}
.markdown-body h3 { font-size: 16px; }
.markdown-body h4 { font-size: 14px; color: var(--text-secondary); }

.markdown-body p {
    margin-bottom: var(--space-md);
}

.markdown-body a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all var(--transition-base);
}

.markdown-body a:hover {
    color: var(--accent-bright);
    border-bottom-color: var(--accent);
}

.theme-synthwave .markdown-body a:hover {
    text-shadow: 0 0 8px var(--accent-glow);
}

/* Wiki-style internal links [[page]] */
.markdown-body a.wiki-link {
    color: var(--accent);
    background: var(--accent-dim);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--accent);
    font-weight: 500;
}

.theme-synthwave .markdown-body a.wiki-link:hover {
    color: var(--bg-deep);
}

.markdown-body a.wiki-link:hover {
    background: var(--accent);
    color: var(--bg-deep);
    border-color: var(--accent-bright);
}

.markdown-body code {
    padding: 2px 6px;
    background: var(--bg-deep);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    font-size: 0.9em;
    color: var(--accent-bright);
    font-family: var(--font-mono);
}

.theme-corporate .markdown-body code {
    background: #F1F5F9;
    color: #B45309;
    border-color: #E2E8F0;
}

/* Color swatch for hex codes */
.color-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 6px;
    border-radius: 2px;
    border: 1px solid var(--border-default);
    vertical-align: middle;
}

.markdown-body pre {
    padding: var(--space-md);
    background: var(--bg-deep);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-bottom: var(--space-md);
    position: relative;
    max-width: 100%;
    width: fit-content;
}

.theme-corporate .markdown-body pre {
    background: #0F1B2D;
    border-color: #1C2D45;
}

.theme-corporate .markdown-body pre code {
    background: transparent;
    color: #CBD5E1;
}

.markdown-body pre::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent) 0%, transparent 100%);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.markdown-body pre code {
    padding: 0;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.5;
}

.theme-synthwave .markdown-body pre {
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.04);
}

.markdown-body ul,
.markdown-body ol {
    padding-left: var(--space-lg);
    margin-bottom: var(--space-md);
}

.markdown-body li {
    margin-bottom: var(--space-sm);
}

.markdown-body li::marker {
    color: var(--accent);
}

.theme-synthwave .markdown-body li::marker {
    color: var(--neon-pink);
}

.markdown-body blockquote {
    padding: var(--space-md) var(--space-lg);
    margin: 0 0 var(--space-md);
    border-left: 3px solid var(--accent);
    background: var(--accent-dim);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--text-secondary);
}

.markdown-body table {
    width: auto;
    max-width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--space-md);
    font-size: 13px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.markdown-body th,
.markdown-body td {
    padding: 10px 14px;
    border: 1px solid var(--border-subtle);
    text-align: left;
    color: var(--text-primary);
    max-width: 400px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.markdown-body thead tr {
    background: var(--bg-elevated);
    border-left: 3px solid var(--accent);
}

.markdown-body th {
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-default);
}

.theme-synthwave .markdown-body thead tr {
    border-bottom: 2px solid rgba(168, 85, 247, 0.3);
    border-left: none;
}

.theme-synthwave .markdown-body th {
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    letter-spacing: 0.08em;
    color: var(--neon-purple);
}

.markdown-body th.sortable-with-btn {
    padding: 0;
}

.markdown-body th.sortable-with-btn .table-sort-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    background: transparent;
    border: 0;
    color: inherit;
    font: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    cursor: pointer;
    user-select: none;
}

.markdown-body th.sortable-with-btn:hover .table-sort-btn {
    background: var(--bg-hover);
}

.markdown-body th.sortable-with-btn .table-sort-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.markdown-body th.sortable .table-sort-indicator {
    flex: 0 0 auto;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    opacity: 0.65;
}

.markdown-body th.sortable-direct {
    cursor: pointer;
    position: relative;
    padding-right: 32px;
}

.markdown-body th.sortable-direct:hover {
    background: var(--bg-hover);
}

.markdown-body th.sortable-direct:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.markdown-body th.sortable-direct > .table-sort-indicator {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.markdown-body th.sortable[data-sort-dir="asc"] .table-sort-indicator {
    border-bottom: 6px solid var(--text-secondary);
}

.markdown-body th.sortable[data-sort-dir="desc"] .table-sort-indicator {
    border-top: 6px solid var(--text-secondary);
}

.markdown-body tbody tr:nth-child(odd) {
    background: var(--bg-surface);
}

.markdown-body tbody tr:nth-child(even) {
    background: var(--bg-base);
}

.markdown-body tbody tr:hover {
    background: var(--bg-hover);
}

.markdown-body img {
    max-width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
}

.markdown-body .kroki-diagram {
    margin: var(--space-lg) 0;
}

.markdown-body figure.kroki-diagram {
    margin: var(--space-lg) 0;
}

.markdown-body .kroki-diagram img {
    /* Some Kroki renderers (notably d2) can emit very tall SVG viewboxes.
       Cap height to keep pages readable while preserving aspect ratio. */
    max-height: 65vh;
    max-width: 100%;
    width: auto;
    height: auto;
    display: block;
    /* Left-align by default to match typical Markdown image layout. */
    margin: 0;
    object-fit: contain;
}

.markdown-body .kroki-diagram.align-left img,
.markdown-body figure.kroki-diagram.align-left img {
    margin-left: 0;
    margin-right: auto;
}

.markdown-body .kroki-diagram.align-center img,
.markdown-body figure.kroki-diagram.align-center img {
    margin-left: auto;
    margin-right: auto;
}

.markdown-body .kroki-diagram.align-right img,
.markdown-body figure.kroki-diagram.align-right img {
    margin-left: auto;
    margin-right: 0;
}

.markdown-body figure.kroki-diagram figcaption {
    margin-top: var(--space-sm);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
}

.trash-banner {
    margin: var(--space-md) 0 var(--space-lg) 0;
    padding: 10px 12px;
    border: 1px dashed var(--border-default);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 12px;
}

.trash-view h1 {
    margin-top: 0;
}

.trash-hint {
    color: var(--text-muted);
}

.trash-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: var(--space-lg);
}

.trash-row {
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.trash-link {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 14px;
    text-decoration: none;
}

.trash-meta {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.markdown-body hr {
    border: none;
    height: 1px;
    background: var(--border-subtle);
    margin: var(--space-xl) 0;
}

.theme-synthwave .markdown-body hr {
    background: linear-gradient(90deg, transparent, var(--neon-purple), transparent);
    opacity: 0.4;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Buttons
   ───────────────────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font-nav);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

.theme-synthwave .btn {
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    letter-spacing: 0.08em;
}

.theme-synthwave .btn-small { font-size: 10px; }

.btn-primary {
    background: var(--accent);
    color: var(--bg-deep);
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-bright);
    border-color: var(--accent-bright);
    box-shadow: 0 0 20px var(--accent-dim), 0 0 40px var(--accent-dim);
}

.theme-corporate .btn-primary {
    color: white;
}

.theme-synthwave .btn-primary {
    color: var(--bg-deep);
}

.theme-synthwave .btn-primary:hover {
    box-shadow: 0 0 24px var(--accent-glow);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-default);
}

.btn-secondary:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
    background: var(--bg-hover);
}

.btn.active {
    color: var(--text-primary);
    border-color: var(--accent);
    background: var(--accent-dim);
}

.btn-danger {
    background: var(--status-error);
    color: white;
    border-color: var(--status-error);
}

.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.btn-small {
    padding: 6px 12px;
    font-size: 11px;
}

/* Focus states */
.btn:focus-visible,
.nav-item:focus-visible,
.search-box input:focus-visible,
.modal-close:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Modal
   ───────────────────────────────────────────────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 18, 0.9);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.theme-corporate .modal {
    background: rgba(15, 23, 42, 0.6);
}

.theme-synthwave .modal {
    background: rgba(13, 2, 33, 0.85);
}

.modal.active {
    display: flex;
}

.modal-content {
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modal-in 0.25s ease-out;
    box-shadow: 0 0 60px var(--accent-dim);
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.modal-header h2 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color var(--transition-base);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.modal-body {
    flex: 1;
    padding: var(--space-lg);
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-base);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Forms
   ───────────────────────────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 500;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group .label-hint {
    font-weight: 400;
    text-transform: none;
    color: var(--text-disabled);
    font-size: 10px;
    letter-spacing: normal;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-base);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13px;
    outline: none;
    transition: all var(--transition-base);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-disabled);
}

.form-group textarea {
    resize: vertical;
    line-height: 1.5;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Search Results
   ───────────────────────────────────────────────────────────────────────────── */
.search-results {
    position: absolute;
    top: 100%;
    left: var(--space-lg);
    right: var(--space-lg);
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

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

.search-result-item {
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-base);
}

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

.search-result-item:hover {
    background: var(--bg-hover);
}

.search-result-title {
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.search-result-path {
    font-size: 11px;
    color: var(--text-muted);
}

.search-result-snippet {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.search-result-snippet mark {
    background: var(--accent-dim);
    color: var(--accent-bright);
    padding: 0 2px;
    border-radius: 2px;
}

/* Search Results List (in nav tree) */
.search-results-list {
    padding: var(--space-sm);
    max-width: 100%;
    overflow: hidden;
}

.search-results-hint {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-sm);
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px 12px;
    margin-bottom: 2px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
    border: 1px solid transparent;
}

.search-result-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-default);
}

.result-number {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.search-result-item:hover .result-number {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-deep);
}

.theme-synthwave .search-result-item:hover .result-number {
    box-shadow: 0 0 8px var(--accent-glow);
}

.result-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.result-title {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-path {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-shortcut {
    flex-shrink: 0;
    font-size: 10px;
    color: var(--text-disabled);
    padding: 2px 6px;
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Animations
   ───────────────────────────────────────────────────────────────────────────── */
@keyframes slide-in {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fade-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes detail-in {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Staggered entrance */
.nav-group:nth-child(1) { animation-delay: 0.02s; }
.nav-group:nth-child(2) { animation-delay: 0.04s; }
.nav-group:nth-child(3) { animation-delay: 0.06s; }
.nav-group:nth-child(4) { animation-delay: 0.08s; }
.nav-group:nth-child(5) { animation-delay: 0.1s; }
.nav-group:nth-child(6) { animation-delay: 0.12s; }
.nav-group:nth-child(7) { animation-delay: 0.14s; }
.nav-group:nth-child(8) { animation-delay: 0.16s; }

/* ─────────────────────────────────────────────────────────────────────────────
   Toast Notifications
   ───────────────────────────────────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    z-index: 2000;
}

.toast {
    padding: 12px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    margin-top: var(--space-sm);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: toast-in 0.3s ease;
    font-size: 12px;
}

.toast.success {
    border-color: var(--accent);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--accent-dim);
}

.toast.error {
    border-color: var(--status-error);
}

.toast.info {
    border-color: var(--status-info);
}

.theme-synthwave .toast.success {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 16px var(--accent-dim);
}

@keyframes toast-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Mobile Menu
   ───────────────────────────────────────────────────────────────────────────── */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: var(--space-md);
    left: var(--space-md);
    z-index: 1100;
    width: 44px;
    height: 44px;
    padding: var(--space-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    transition: all var(--transition-base);
}

.mobile-menu-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}

.mobile-menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 1px;
    transition: all 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
    background: var(--accent);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
    background: var(--accent);
}

.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 18, 0.8);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.theme-corporate .mobile-overlay {
    background: rgba(15, 23, 42, 0.6);
}

.theme-synthwave .mobile-overlay {
    background: rgba(13, 2, 33, 0.85);
}

.mobile-overlay.active {
    opacity: 1;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Gitea Embed
   ───────────────────────────────────────────────────────────────────────────── */
.gitea-embed {
    margin: var(--space-lg) 0;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-deep);
    max-width: 100%;
    width: fit-content;
}

.theme-corporate .gitea-embed {
    background: #0F1B2D;
    border-color: #1C2D45;
}

.theme-corporate .gitea-embed-header {
    background: #162338;
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.theme-corporate .gitea-embed code {
    color: #CBD5E1;
}

.gitea-embed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px var(--space-md);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 12px;
}

.gitea-embed-path {
    color: var(--accent);
    font-weight: 500;
    font-family: var(--font-mono);
}

.theme-synthwave .gitea-embed-header {
    background: rgba(168, 85, 247, 0.08);
}

.theme-synthwave .gitea-embed-link:hover {
    color: var(--bg-deep);
}

.gitea-embed-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-default);
    transition: all var(--transition-base);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.gitea-embed-link:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-deep);
}

.gitea-embed pre {
    margin: 0;
    padding: var(--space-md);
    overflow-x: auto;
    background: transparent;
    border: none;
    border-radius: 0;
}

.gitea-embed pre::before {
    display: none;
}

.gitea-embed code {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-primary);
}

.gitea-embed-error {
    border-color: var(--status-error);
}

.gitea-embed-error .gitea-embed-header {
    background: rgba(239, 68, 68, 0.1);
}

.gitea-embed-error .gitea-embed-path {
    color: var(--status-error);
}

.gitea-embed-error pre {
    color: var(--status-error);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Expandable Code Blocks
   ───────────────────────────────────────────────────────────────────────────── */
.code-block-wrapper {
    position: relative;
    margin-bottom: var(--space-md);
    width: fit-content;
    max-width: 100%;
}

.code-block-wrapper.collapsed pre {
    max-height: 300px;
    overflow: hidden;
}

.code-block-wrapper.collapsed::after {
    display: none;
}

.code-expand-btn {
    display: none;
    width: 100%;
    padding: 10px var(--space-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all var(--transition-base);
}

.code-block-wrapper.expandable .code-expand-btn {
    display: block;
}

.code-expand-btn:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.code-block-wrapper.expanded pre {
    max-height: none;
}

.code-block-wrapper.expanded::after {
    display: none;
}

/* Adjust pre in wrapper */
.code-block-wrapper pre {
    margin-bottom: 0;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.code-block-wrapper.expanded pre,
.code-block-wrapper:not(.expandable) pre {
    border-radius: var(--radius-md);
}

/* Gitea embed expandable */
.gitea-embed.expandable.collapsed pre {
    max-height: 300px;
    overflow: hidden;
}

.gitea-embed.expandable.collapsed::after {
    display: none;
}

.gitea-embed.expandable {
    position: relative;
}

.gitea-embed .code-expand-btn {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    border: none;
    border-top: 1px solid var(--border-subtle);
}

.gitea-embed.expanded pre {
    max-height: none;
}

.gitea-embed.expanded::after {
    display: none;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Responsive
   ───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }

    .mobile-overlay {
        display: block;
        pointer-events: none;
    }

    .mobile-overlay.active {
        pointer-events: auto;
    }

    .sidebar {
        width: 300px;
        position: fixed;
        top: 0;
        left: -100%;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
    }

    .sidebar.open {
        left: 0;
    }

    .content {
        margin-left: 0;
    }

    .content-header {
        padding: var(--space-md);
        padding-left: 68px;
    }

    .page-content {
        padding: var(--space-md);
    }

    .welcome {
        margin: var(--space-2xl) auto;
    }

    .welcome h1 {
        font-size: 24px;
    }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Print Styles
   ───────────────────────────────────────────────────────────────────────────── */
@media print {
    .sidebar,
    .mobile-menu-btn,
    .actions,
    .toast-container,
    .settings-wrapper {
        display: none !important;
    }

    .content {
        margin: 0;
    }

    .page-content {
        padding: 0;
    }

    .markdown-body pre {
        white-space: pre-wrap;
        word-wrap: break-word;
    }
}

/* ============================================================
   Syntax Highlighting — CSS class-based (syntect sy- prefix)
   Three theme variants scoped under body theme classes.
   Generated from syntect themes; do not hand-edit colors.
   ============================================================ */

/* --- Terminal theme: Breeze Dark --- */
.terminal-theme .sy-code { color: #cfcfc2; }
.terminal-theme .sy-meta.sy-group, .terminal-theme .sy-meta.sy-method-call.sy-source, .terminal-theme .sy-meta.sy-method.sy-body, .terminal-theme .sy-none, .terminal-theme .sy-source, .terminal-theme .sy-text { color: #cfcfc2; }
.terminal-theme .sy-keyword.sy-operator.sy-accessor, .terminal-theme .sy-meta.sy-brace, .terminal-theme .sy-meta.sy-delimiter, .terminal-theme .sy-meta.sy-separator, .terminal-theme .sy-punctuation { color: #cfcfc2; }
.terminal-theme .sy-comment, .terminal-theme .sy-comment .sy-text, .terminal-theme .sy-punctuation.sy-definition.sy-comment, .terminal-theme .sy-string.sy-comment { color: #7a7c7d; font-style: italic; }
.terminal-theme .sy-comment.sy-block.sy-documentation, .terminal-theme .sy-storage.sy-type.sy-class.sy-jsdoc, .terminal-theme .sy-keyword.sy-other.sy-documentation { color: #3daee9; }
.terminal-theme .sy-keyword, .terminal-theme .sy-keyword.sy-control, .terminal-theme .sy-keyword.sy-other, .terminal-theme .sy-storage.sy-modifier, .terminal-theme .sy-storage.sy-type { color: #fdbc4b; font-weight: bold; }
.terminal-theme .sy-keyword.sy-control.sy-conditional, .terminal-theme .sy-keyword.sy-control.sy-loop, .terminal-theme .sy-keyword.sy-control.sy-flow, .terminal-theme .sy-keyword.sy-control.sy-return, .terminal-theme .sy-keyword.sy-control.sy-break, .terminal-theme .sy-keyword.sy-control.sy-continue { color: #fdbc4b; font-weight: bold; }
.terminal-theme .sy-keyword.sy-operator, .terminal-theme .sy-keyword.sy-operator.sy-arithmetic, .terminal-theme .sy-keyword.sy-operator.sy-assignment, .terminal-theme .sy-keyword.sy-operator.sy-comparison, .terminal-theme .sy-keyword.sy-operator.sy-logical { color: #3f8058; }
.terminal-theme .sy-entity.sy-name.sy-function, .terminal-theme .sy-meta.sy-function-call, .terminal-theme .sy-support.sy-function, .terminal-theme .sy-variable.sy-function { color: #8e44ad; }
.terminal-theme .sy-entity.sy-name.sy-class, .terminal-theme .sy-entity.sy-name.sy-type, .terminal-theme .sy-entity.sy-name.sy-struct, .terminal-theme .sy-entity.sy-name.sy-enum, .terminal-theme .sy-entity.sy-name.sy-trait, .terminal-theme .sy-entity.sy-name.sy-interface, .terminal-theme .sy-support.sy-class, .terminal-theme .sy-support.sy-type { color: #2980b9; }
.terminal-theme .sy-variable, .terminal-theme .sy-variable.sy-other, .terminal-theme .sy-variable.sy-parameter { color: #cfcfc2; }
.terminal-theme .sy-constant, .terminal-theme .sy-constant.sy-other, .terminal-theme .sy-variable.sy-other.sy-constant, .terminal-theme .sy-support.sy-constant { color: #27aeae; }
.terminal-theme .sy-string, .terminal-theme .sy-string.sy-quoted, .terminal-theme .sy-string.sy-template { color: #f44f4f; }
.terminal-theme .sy-constant.sy-character.sy-escape, .terminal-theme .sy-string .sy-variable, .terminal-theme .sy-string.sy-interpolated, .terminal-theme .sy-punctuation.sy-definition.sy-template-expression, .terminal-theme .sy-punctuation.sy-section.sy-embedded { color: #27aeae; }
.terminal-theme .sy-constant.sy-numeric { color: #f67400; }
.terminal-theme .sy-constant.sy-language.sy-boolean { color: #27aeae; }
.terminal-theme .sy-constant.sy-language.sy-null, .terminal-theme .sy-constant.sy-language.sy-undefined, .terminal-theme .sy-constant.sy-language.sy-none { color: #27aeae; }
.terminal-theme .sy-keyword.sy-control.sy-import, .terminal-theme .sy-keyword.sy-control.sy-from, .terminal-theme .sy-keyword.sy-control.sy-export, .terminal-theme .sy-keyword.sy-other.sy-import, .terminal-theme .sy-meta.sy-preprocessor, .terminal-theme .sy-keyword.sy-control.sy-directive { color: #27ae60; }
.terminal-theme .sy-entity.sy-name.sy-module, .terminal-theme .sy-entity.sy-name.sy-namespace, .terminal-theme .sy-support.sy-other.sy-module { color: #27ae60; }
.terminal-theme .sy-entity.sy-name.sy-tag.sy-attribute, .terminal-theme .sy-meta.sy-attribute, .terminal-theme .sy-meta.sy-decorator, .terminal-theme .sy-punctuation.sy-definition.sy-annotation { color: #3daee9; }
.terminal-theme .sy-entity.sy-name.sy-tag, .terminal-theme .sy-punctuation.sy-definition.sy-tag { color: #2980b9; }
.terminal-theme .sy-entity.sy-other.sy-attribute-name { color: #27aeae; }
.terminal-theme .sy-support.sy-type.sy-property-name.sy-css, .terminal-theme .sy-meta.sy-property-name.sy-css { color: #3daee9; }
.terminal-theme .sy-support.sy-constant.sy-property-value.sy-css, .terminal-theme .sy-meta.sy-property-value.sy-css { color: #f67400; }
.terminal-theme .sy-entity.sy-name.sy-tag.sy-css, .terminal-theme .sy-entity.sy-other.sy-attribute-name.sy-class.sy-css, .terminal-theme .sy-entity.sy-other.sy-attribute-name.sy-id.sy-css { color: #27ae60; }
.terminal-theme .sy-meta.sy-structure.sy-dictionary.sy-key .sy-string, .terminal-theme .sy-support.sy-type.sy-property-name.sy-json { color: #3daee9; }
.terminal-theme .sy-entity.sy-name.sy-tag.sy-yaml { color: #3daee9; }
.terminal-theme .sy-markup.sy-heading, .terminal-theme .sy-entity.sy-name.sy-section.sy-markdown, .terminal-theme .sy-punctuation.sy-definition.sy-heading.sy-markdown { color: #2980b9; font-weight: bold; }
.terminal-theme .sy-markup.sy-bold { color: #f67400; font-weight: bold; }
.terminal-theme .sy-markup.sy-italic { color: #fdbc4b; font-style: italic; }
.terminal-theme .sy-markup.sy-underline.sy-link, .terminal-theme .sy-string.sy-other.sy-link { color: #27ae60; }
.terminal-theme .sy-markup.sy-raw, .terminal-theme .sy-markup.sy-inline.sy-raw, .terminal-theme .sy-markup.sy-fenced_code { color: #27aeae; }
.terminal-theme .sy-markup.sy-list, .terminal-theme .sy-punctuation.sy-definition.sy-list { color: #f44f4f; }
.terminal-theme .sy-markup.sy-inserted { color: #27ae60; }
.terminal-theme .sy-markup.sy-deleted { color: #da4453; }
.terminal-theme .sy-markup.sy-changed { color: #f67400; }
.terminal-theme .sy-invalid, .terminal-theme .sy-invalid.sy-illegal { color: #da4453; }
.terminal-theme .sy-invalid.sy-deprecated { color: #da4453; text-decoration: underline; font-style: italic; }
.terminal-theme .sy-support.sy-function.sy-builtin, .terminal-theme .sy-support.sy-variable.sy-magic, .terminal-theme .sy-variable.sy-language { color: #609ca0; }
.terminal-theme .sy-string.sy-regexp { color: #8e44ad; }
.terminal-theme .sy-variable.sy-other.sy-normal.sy-shell, .terminal-theme .sy-variable.sy-other.sy-positional.sy-shell, .terminal-theme .sy-variable.sy-other.sy-bracket.sy-shell { color: #27aeae; }
.terminal-theme .sy-keyword.sy-other.sy-sql, .terminal-theme .sy-keyword.sy-other.sy-DML.sy-sql, .terminal-theme .sy-keyword.sy-other.sy-DDL.sy-sql { color: #fdbc4b; font-weight: bold; }

/* --- Corporate theme: Base16 Ocean Dark --- */
.theme-corporate .sy-code { color: #c0c5ce; }
.theme-corporate .sy-variable.sy-parameter.sy-function { color: #c0c5ce; }
.theme-corporate .sy-comment, .theme-corporate .sy-punctuation.sy-definition.sy-comment { color: #65737e; }
.theme-corporate .sy-keyword.sy-operator { color: #c0c5ce; }
.theme-corporate .sy-keyword { color: #b48ead; }
.theme-corporate .sy-variable, .theme-corporate .sy-variable.sy-other.sy-dollar.sy-only.sy-js { color: #bf616a; }
.theme-corporate .sy-entity.sy-name.sy-function, .theme-corporate .sy-meta.sy-require, .theme-corporate .sy-support.sy-function.sy-any-method, .theme-corporate .sy-variable.sy-function { color: #8fa1b3; }
.theme-corporate .sy-support.sy-class, .theme-corporate .sy-entity.sy-name.sy-class, .theme-corporate .sy-entity.sy-name.sy-type.sy-class { color: #ebcb8b; }
.theme-corporate .sy-meta.sy-class { color: #eff1f5; }
.theme-corporate .sy-keyword.sy-other.sy-special-method { color: #8fa1b3; }
.theme-corporate .sy-storage { color: #b48ead; }
.theme-corporate .sy-support.sy-function { color: #96b5b4; }
.theme-corporate .sy-string, .theme-corporate .sy-constant.sy-other.sy-symbol, .theme-corporate .sy-entity.sy-other.sy-inherited-class { color: #a3be8c; }
.theme-corporate .sy-constant.sy-numeric { color: #d08770; }
.theme-corporate .sy-constant { color: #d08770; }
.theme-corporate .sy-entity.sy-name.sy-tag { color: #bf616a; }
.theme-corporate .sy-entity.sy-other.sy-attribute-name { color: #d08770; }
.theme-corporate .sy-entity.sy-other.sy-attribute-name.sy-id, .theme-corporate .sy-punctuation.sy-definition.sy-entity { color: #8fa1b3; }
.theme-corporate .sy-meta.sy-selector { color: #b48ead; }
.theme-corporate .sy-markup.sy-heading .sy-punctuation.sy-definition.sy-heading, .theme-corporate .sy-entity.sy-name.sy-section { color: #8fa1b3; }
.theme-corporate .sy-keyword.sy-other.sy-unit { color: #d08770; }
.theme-corporate .sy-markup.sy-bold, .theme-corporate .sy-punctuation.sy-definition.sy-bold { color: #ebcb8b; font-weight: bold; }
.theme-corporate .sy-markup.sy-italic, .theme-corporate .sy-punctuation.sy-definition.sy-italic { color: #b48ead; font-style: italic; }
.theme-corporate .sy-markup.sy-raw.sy-inline { color: #a3be8c; }
.theme-corporate .sy-string.sy-other.sy-link { color: #bf616a; }
.theme-corporate .sy-markup.sy-list { color: #bf616a; }
.theme-corporate .sy-markup.sy-inserted { color: #a3be8c; }
.theme-corporate .sy-markup.sy-deleted { color: #bf616a; }
.theme-corporate .sy-markup.sy-changed { color: #b48ead; }
.theme-corporate .sy-constant.sy-other.sy-color { color: #96b5b4; }
.theme-corporate .sy-string.sy-regexp { color: #96b5b4; }
.theme-corporate .sy-constant.sy-character.sy-escape { color: #96b5b4; }
.theme-corporate .sy-punctuation.sy-section.sy-embedded, .theme-corporate .sy-variable.sy-interpolation { color: #ab7967; }
.theme-corporate .sy-invalid.sy-illegal { color: #2b303b; background-color: #bf616a; }

/* --- Synthwave theme: Neon (based on Base16 Eighties Dark, neon-ified) --- */
.theme-synthwave .sy-code { color: #e2e0f0; }
.theme-synthwave .sy-variable.sy-parameter.sy-function { color: #e2e0f0; }
.theme-synthwave .sy-comment, .theme-synthwave .sy-punctuation.sy-definition.sy-comment { color: #6c6783; font-style: italic; }
.theme-synthwave .sy-keyword.sy-operator { color: #e2e0f0; }
.theme-synthwave .sy-keyword { color: #ff79c6; }
.theme-synthwave .sy-variable, .theme-synthwave .sy-variable.sy-other.sy-dollar.sy-only.sy-js { color: #ff6e96; }
.theme-synthwave .sy-entity.sy-name.sy-function, .theme-synthwave .sy-meta.sy-require, .theme-synthwave .sy-support.sy-function.sy-any-method, .theme-synthwave .sy-variable.sy-function { color: #00e5ff; }
.theme-synthwave .sy-support.sy-class, .theme-synthwave .sy-entity.sy-name.sy-class, .theme-synthwave .sy-entity.sy-name.sy-type.sy-class { color: #bd93f9; }
.theme-synthwave .sy-meta.sy-class { color: #f8f0ff; }
.theme-synthwave .sy-keyword.sy-other.sy-special-method { color: #00e5ff; }
.theme-synthwave .sy-storage { color: #ff79c6; }
.theme-synthwave .sy-support.sy-function { color: #50fa7b; }
.theme-synthwave .sy-string, .theme-synthwave .sy-constant.sy-other.sy-symbol, .theme-synthwave .sy-entity.sy-other.sy-inherited-class { color: #f1fa8c; }
.theme-synthwave .sy-constant.sy-numeric { color: #ffb86c; }
.theme-synthwave .sy-constant { color: #ffb86c; }
.theme-synthwave .sy-entity.sy-name.sy-tag { color: #ff6e96; }
.theme-synthwave .sy-entity.sy-other.sy-attribute-name { color: #ffb86c; }
.theme-synthwave .sy-entity.sy-other.sy-attribute-name.sy-id, .theme-synthwave .sy-punctuation.sy-definition.sy-entity { color: #00e5ff; }
.theme-synthwave .sy-meta.sy-selector { color: #ff79c6; }
.theme-synthwave .sy-markup.sy-heading .sy-punctuation.sy-definition.sy-heading, .theme-synthwave .sy-entity.sy-name.sy-section { color: #00e5ff; }
.theme-synthwave .sy-keyword.sy-other.sy-unit { color: #ffb86c; }
.theme-synthwave .sy-markup.sy-bold, .theme-synthwave .sy-punctuation.sy-definition.sy-bold { color: #bd93f9; font-weight: bold; }
.theme-synthwave .sy-markup.sy-italic, .theme-synthwave .sy-punctuation.sy-definition.sy-italic { color: #ff79c6; font-style: italic; }
.theme-synthwave .sy-markup.sy-raw.sy-inline { color: #50fa7b; }
.theme-synthwave .sy-string.sy-other.sy-link { color: #ff6e96; }
.theme-synthwave .sy-markup.sy-list { color: #ff6e96; }
.theme-synthwave .sy-markup.sy-inserted { color: #50fa7b; }
.theme-synthwave .sy-markup.sy-deleted { color: #ff6e96; }
.theme-synthwave .sy-markup.sy-changed { color: #ff79c6; }
.theme-synthwave .sy-constant.sy-other.sy-color { color: #50fa7b; }
.theme-synthwave .sy-string.sy-regexp { color: #50fa7b; }
.theme-synthwave .sy-constant.sy-character.sy-escape { color: #50fa7b; }
.theme-synthwave .sy-punctuation.sy-section.sy-embedded, .theme-synthwave .sy-variable.sy-interpolation { color: #ff6e40; }
.theme-synthwave .sy-invalid.sy-illegal { color: #0a0015; background-color: #ff6e96; }
