/* ==========================================================================
   Design System & Theme Presets (User Global Rules Compliant)
   Slightly Glitchy Subtle Aesthetics (Clean Mode Preserved)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700;800&family=VT323&family=Share+Tech+Mono&display=swap');

:root, [data-theme="dracula"] {
    --bg-body: #050b07;
    --bg-surface: #0a140d;
    --bg-elevated: #0f1f14;
    --bg-input: #050b07;
    --bg-hover: rgba(80, 250, 123, 0.12);
    --bg-selected: rgba(80, 250, 123, 0.22);

    --border-color: #10b981;
    --border-highlight: rgba(80, 250, 123, 0.4);
    --border-shadow: rgba(0, 0, 0, 0.7);

    --text-primary: #50fa7b;
    --text-secondary: #8be9fd;
    --text-muted: #10b981;

    --purple: #bd93f9;
    --cyan: #8be9fd;
    --green: #50fa7b;
    --pink: #ff79c6;
    --orange: #ffb86c;
    --red: #ff5555;
    --yellow: #f1fa8c;

    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;

    --shadow-depth: 0 10px 30px -5px rgba(0, 0, 0, 0.8), 0 0 15px rgba(80, 250, 123, 0.2);
    --shadow-glow: 0 0 25px rgba(80, 250, 123, 0.35);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="gruvbox"] {
    --bg-body: #1d2021;
    --bg-surface: #282828;
    --bg-elevated: #3c3836;
    --bg-input: #1d2021;
    --bg-hover: rgba(250, 189, 47, 0.1);
    --bg-selected: rgba(250, 189, 47, 0.2);

    --border-color: #504945;
    --border-highlight: rgba(255, 255, 255, 0.08);
    --border-shadow: rgba(0, 0, 0, 0.5);

    --text-primary: #fbf1c7;
    --text-secondary: #d5c4a1;
    --text-muted: #928374;

    --purple: #d3869b;
    --cyan: #83a598;
    --green: #b8bb26;
    --pink: #d3869b;
    --orange: #fe8019;
    --red: #fb4934;
    --yellow: #fabd2f;
}

[data-theme="tokyo-night"] {
    --bg-body: #16161e;
    --bg-surface: #1a1b26;
    --bg-elevated: #24283b;
    --bg-input: #13141c;
    --bg-hover: rgba(187, 154, 247, 0.12);
    --bg-selected: rgba(187, 154, 247, 0.22);

    --border-color: #292e42;
    --border-highlight: rgba(255, 255, 255, 0.08);
    --border-shadow: rgba(0, 0, 0, 0.45);

    --text-primary: #a9b1d6;
    --text-secondary: #787c99;
    --text-muted: #565f89;

    --purple: #bb9af7;
    --cyan: #7dcfff;
    --green: #9ece6a;
    --pink: #f7768e;
    --orange: #ff9e64;
    --red: #f7768e;
    --yellow: #e0af68;
}

[data-theme="catppuccin"] {
    --bg-body: #11111b;
    --bg-surface: #181825;
    --bg-elevated: #1e1e2e;
    --bg-input: #11111b;
    --bg-hover: rgba(203, 166, 247, 0.1);
    --bg-selected: rgba(203, 166, 247, 0.2);

    --border-color: #313244;
    --border-highlight: rgba(255, 255, 255, 0.08);
    --border-shadow: rgba(0, 0, 0, 0.5);

    --text-primary: #cdd6f4;
    --text-secondary: #a6adc8;
    --text-muted: #6c7086;

    --purple: #cba6f7;
    --cyan: #89dceb;
    --green: #a6e3a1;
    --pink: #f5c2e7;
    --orange: #fab387;
    --red: #f38ba8;
    --yellow: #f9e2af;
}

[data-theme="solarized-light"] {
    --bg-body: #fdf6e3;
    --bg-surface: #eee8d5;
    --bg-elevated: #e0d7c3;
    --bg-input: #fdf6e3;
    --bg-hover: rgba(38, 139, 210, 0.12);
    --bg-selected: rgba(38, 139, 210, 0.22);

    --border-color: #cb4b16;
    --border-highlight: rgba(255, 255, 255, 0.4);
    --border-shadow: rgba(7, 54, 66, 0.25);

    --text-primary: #073642;
    --text-secondary: #586e75;
    --text-muted: #839496;

    --purple: #d33682;
    --cyan: #2aa198;
    --green: #859900;
    --pink: #d33682;
    --orange: #cb4b16;
    --red: #dc322f;
    --yellow: #b58900;
}

/* 100% Monospaced Global Font Rule */
*, input, select, button, textarea {
    font-family: 'JetBrains Mono', 'VT323', 'Share Tech Mono', monospace !important;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
    position: relative;
}

/* Subtle Micro-Glitch Text & Border Accent Effects */
.subtle-glitch-text {
    text-shadow: -1px 0 rgba(255, 85, 85, 0.7), 1px 0 rgba(139, 233, 253, 0.7);
    transition: text-shadow 0.2s ease;
}

.subtle-glitch-text:hover {
    text-shadow: -2px 0 rgba(255, 85, 85, 0.9), 2px 0 rgba(139, 233, 253, 0.9);
}

/* Year Zero Warning Banner */
.year-zero-banner {
    background: #2b0404;
    border: 2px solid var(--red);
    color: var(--red);
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: space-between;
    letter-spacing: 0.1em;
    box-shadow: 0 0 15px rgba(255, 85, 85, 0.3);
}

.air-flag {
    background: var(--red);
    color: #000;
    padding: 0.1rem 0.5rem;
    border-radius: 3px;
    font-weight: 900;
}

/* Quantum Dots Canvas & Background Overlay */
#quantum-dots-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
    opacity: 0.35;
}

/* Nine Inch Nails Industrial Audio Rack Panel */
.nin-rack-panel {
    background: #0a0406;
    border: 2px solid var(--red);
    box-shadow: 0 0 15px rgba(255, 85, 85, 0.25), inset 0 0 10px rgba(0, 0, 0, 0.8);
    border-radius: var(--radius);
    padding: 0.85rem 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.knob-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.rotary-knob {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: radial-gradient(circle, #2d1017 30%, #15060a 90%);
    border: 2px solid var(--red);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6), inset 0 0 6px rgba(255, 85, 85, 0.3);
    position: relative;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.rotary-knob::after {
    content: " ";
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 12px;
    background-color: var(--red);
    box-shadow: 0 0 4px var(--red);
    border-radius: 2px;
}

.knob-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--red);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Hostile AI Assistant Floating Sidecar Widget */
#hostile-ai-widget {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 99999;
    width: 300px;
    background-color: #0d0407;
    border: 1px solid var(--red);
    box-shadow: 0 0 15px rgba(255, 85, 85, 0.3);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}

.ai-widget-header {
    background-color: #1a080c;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--red);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    color: var(--red);
    font-size: 0.8rem;
}

.ai-eye-scanner {
    width: 10px;
    height: 10px;
    background-color: var(--red);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--red);
    animation: eye-pulse 1.5s ease-in-out infinite alternate;
}

@keyframes eye-pulse {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

.ai-widget-body {
    padding: 0.75rem;
    color: #ffb86c;
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Matrix Loading Progress Bar */
.matrix-loader-box {
    background-color: #030804;
    border: 2px solid var(--green);
    box-shadow: 0 0 25px rgba(80, 250, 123, 0.3);
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
    max-width: 480px;
    width: 90%;
}

.matrix-progress-bar {
    width: 100%;
    height: 20px;
    background-color: #0b1c0e;
    border: 1px solid var(--green);
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.matrix-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #10b981, #50fa7b);
    box-shadow: 0 0 10px var(--green);
    transition: width 0.1s ease;
}

/* Colored ASCII Spinners */
.ascii-spinner {
    display: inline-block;
    font-weight: 800;
    font-size: 0.9rem;
    animation: ascii-color-cycle 2s linear infinite;
}

.ascii-spinner-pink { color: var(--pink); }
.ascii-spinner-cyan { color: var(--cyan); }
.ascii-spinner-green { color: var(--green); }
.ascii-spinner-yellow { color: var(--yellow); }

@keyframes ascii-color-cycle {
    0% { color: var(--cyan); }
    25% { color: var(--pink); }
    50% { color: var(--green); }
    75% { color: var(--yellow); }
    100% { color: var(--cyan); }
}

/* Subtle Rainbow Flow & CRT Scanlines */
.rainbow-text {
    background: linear-gradient(90deg, #ff0055, #ff9900, #ffff00, #33ff00, #00ffff, #0099ff, #9900ff, #ff0055);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbow-flow 6s linear infinite;
}

.rainbow-bar {
    height: 3px;
    width: 100%;
    background: linear-gradient(90deg, #ff0055, #ff9900, #ffff00, #33ff00, #00ffff, #0099ff, #9900ff, #ff0055);
    background-size: 400% 400%;
    animation: rainbow-flow 5s linear infinite;
}

@keyframes rainbow-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body::after {
    content: " ";
    display: block;
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
    z-index: 999;
    background-size: 100% 3px;
    pointer-events: none;
    opacity: 0.6;
}

.scrolling-ticker-bar {
    background-color: #030804;
    border-bottom: 1px solid var(--green);
    color: var(--green);
    overflow: hidden;
    white-space: nowrap;
    font-size: 0.8rem;
    padding: 0.25rem 0;
}

.ticker-content {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 30s linear infinite;
    font-weight: 700;
}

@keyframes marquee {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-100%, 0); }
}

.glitch-title {
    position: relative;
    display: inline-block;
    letter-spacing: 0.08em;
    text-shadow: -1px 0 var(--pink), 1px 0 var(--cyan);
}

.retro-terminal-box {
    background-color: #030804;
    border: 1px solid var(--green);
    color: var(--green);
    font-size: 0.9rem;
    padding: 0.85rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 0 10px rgba(80, 250, 123, 0.2);
    overflow-y: auto;
    max-height: 200px;
    line-height: 1.4;
}

/* ==========================================================================
   Beveled Card & Panel Base Component (Global Rule Compliance)
   ========================================================================== */
.card-beveled, .panel-beveled {
    background-color: var(--bg-elevated);
    border-top: 1px solid var(--border-highlight);
    border-bottom: 1px solid var(--border-shadow);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-depth);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* ==========================================================================
   Header & Top Bar Navigation
   ========================================================================== */
.app-header {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-shadow);
    padding: 0.85rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--purple), var(--cyan));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #12141d;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.brand-title {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

kbd {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: inset 0 -1px 0 var(--border-shadow);
    color: var(--green);
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    line-height: 1;
}

/* ==========================================================================
   Buttons & Controls
   ========================================================================== */
.btn {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    border-top: 1px solid var(--border-highlight);
    border-bottom: 1px solid var(--border-shadow);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-primary);
    background-color: var(--bg-surface);
}

.btn:hover {
    transform: translateY(-1px);
    border-color: var(--green);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    text-shadow: -1px 0 rgba(255, 85, 85, 0.5), 1px 0 rgba(139, 233, 253, 0.5);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--purple), var(--cyan));
    color: #12141d;
    border-color: rgba(255, 255, 255, 0.1);
    font-weight: 700;
}

.btn-accent {
    background: linear-gradient(135deg, var(--purple), #9855f7);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 14px rgba(189, 147, 249, 0.3);
}

.btn-accent:hover {
    box-shadow: 0 6px 20px rgba(189, 147, 249, 0.45);
}

.btn-danger {
    background: linear-gradient(135deg, var(--red), #d63031);
    color: white;
    border: none;
}

.btn-retro {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #050b07;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    border: 1px solid #10b981;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.btn-retro:hover {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.7);
    border-color: #50fa7b;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.badge-count {
    background-color: rgba(80, 250, 123, 0.15);
    color: var(--green);
    border: 1px solid rgba(80, 250, 123, 0.3);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ==========================================================================
   Hardware & Protocol Launcher Badges
   ========================================================================== */
.hw-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    background-color: rgba(255, 184, 108, 0.12);
    color: var(--orange);
    border: 1px solid rgba(255, 184, 108, 0.25);
    margin-left: 0.35rem;
}

.protocol-link {
    font-size: 0.75rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    background-color: rgba(80, 250, 123, 0.1);
    color: var(--green);
    border: 1px solid rgba(80, 250, 123, 0.25);
    text-decoration: none;
    margin-left: 0.25rem;
    transition: var(--transition);
}

.protocol-link:hover {
    background-color: var(--green);
    color: #12141d;
    font-weight: 700;
}

/* ==========================================================================
   Main App Layout Grid
   ========================================================================== */
.app-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.25rem;
    padding: 1.25rem 1.75rem;
    flex: 1;
    max-width: 1800px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

@media (max-width: 992px) {
    .app-container {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Sidebar: Folders Tree & Smart Tags
   ========================================================================== */
.sidebar-panel {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 150px);
    overflow: hidden;
}

.panel-header {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(0, 0, 0, 0.25);
}

.panel-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tree-container {
    overflow-y: auto;
    padding: 0.75rem;
}

.tree-node {
    margin-bottom: 0.2rem;
    user-select: none;
}

.tree-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.tree-item:hover {
    background-color: var(--bg-hover);
    color: var(--green);
}

.tree-item.active {
    background-color: var(--bg-selected);
    color: var(--cyan);
    font-weight: 600;
    border-left: 3px solid var(--cyan);
}

.tree-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree-expander {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.tree-node.expanded > .tree-item .tree-expander {
    transform: rotate(90deg);
}

.tree-children {
    display: none;
    padding-left: 1.25rem;
    border-left: 1px dashed rgba(80, 250, 123, 0.2);
    margin-left: 0.75rem;
}

.tree-node.expanded > .tree-children {
    display: block;
}

.item-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    background-color: var(--bg-surface);
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
}

/* Smart Tags Sidebar */
.tags-container {
    padding: 0.75rem 1rem;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 0.4rem;
}

.tag-cloud-item {
    font-size: 0.85rem;
    padding: 0.3rem 0.65rem;
    border-radius: 20px;
    background-color: rgba(139, 233, 253, 0.08);
    color: var(--cyan);
    border: 1px solid rgba(139, 233, 253, 0.2);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.tag-cloud-item:hover, .tag-cloud-item.active {
    background-color: var(--cyan);
    color: #12141d;
    font-weight: 600;
}

/* ==========================================================================
   Main Content Area: Search, Controls, & Bookmarks Grid/Table
   ========================================================================== */
.main-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: calc(100vh - 150px);
}

.toolbar-card {
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 240px;
}

.search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-input {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.85rem 0.55rem 2.4rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(80, 250, 123, 0.2);
}

.view-mode-selector {
    display: flex;
    align-items: center;
}

.bookmarks-table-container {
    flex: 1;
    overflow-y: auto;
    position: relative;
}

.bookmarks-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.875rem;
}

.bookmarks-table th {
    background-color: var(--bg-surface);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0.85rem 1rem;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

.bookmarks-table th:hover {
    color: var(--green);
    background-color: rgba(80, 250, 123, 0.05);
}

.sort-icon {
    font-size: 0.7rem;
    margin-left: 0.3rem;
    color: var(--text-muted);
}

.bookmarks-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(80, 250, 123, 0.08);
    color: var(--text-primary);
    vertical-align: middle;
}

.bookmarks-table tbody tr {
    transition: var(--transition);
    cursor: pointer;
}

.bookmarks-table tbody tr:hover {
    background-color: var(--bg-hover);
}

.bookmarks-table tbody tr.selected {
    background-color: var(--bg-selected);
}

.bookmarks-table tr.group-header {
    background-color: rgba(0, 0, 0, 0.4);
    font-weight: 700;
    color: var(--green);
    cursor: default;
    border-bottom: 1px solid var(--border-color);
}

.bookmarks-table tr.group-header td {
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
    letter-spacing: 0.03em;
}

.bm-title {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bm-url {
    color: var(--cyan);
    font-size: 0.8rem;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bm-url a {
    color: inherit;
    text-decoration: none;
}

.bm-url a:hover {
    text-decoration: underline;
}

.bm-path {
    color: var(--purple);
    font-size: 0.8rem;
    font-weight: 500;
}

.tag-pill {
    display: inline-block;
    background-color: rgba(139, 233, 253, 0.12);
    color: var(--cyan);
    border: 1px solid rgba(139, 233, 253, 0.25);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-right: 0.25rem;
}

/* Command Palette Items */
.cmd-item {
    padding: 0.65rem 1rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: var(--transition);
}

.cmd-item:hover, .cmd-item.selected {
    background-color: var(--bg-selected);
    color: var(--green);
}

.cmd-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.cmd-shortcut {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Documentation Modal & Cards */
.doc-item-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-top: 1px solid var(--border-highlight);
    border-bottom: 1px solid var(--border-shadow);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    transition: var(--transition);
}

.doc-item-card:hover {
    border-color: var(--green);
}

.doc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.doc-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.doc-path {
    font-size: 0.75rem;
    color: var(--cyan);
    word-break: break-all;
}

.doc-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Modal Dialog & Theme Cards */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(5, 11, 7, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    width: 90%;
    max-width: 580px;
    background-color: var(--bg-elevated);
    border-top: 1px solid var(--border-highlight);
    border-bottom: 1px solid var(--border-shadow);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-depth), var(--shadow-glow);
    transform: scale(0.95);
    transition: transform 0.25s ease;
    overflow: hidden;
}

.modal-backdrop.open .modal-card {
    transform: scale(1);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(80, 250, 123, 0.2);
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    background-color: var(--bg-surface);
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.theme-card {
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem;
    background-color: var(--bg-surface);
    cursor: pointer;
    transition: var(--transition);
}

.theme-card:hover {
    border-color: var(--green);
    transform: translateY(-2px);
}

.theme-card.active {
    border-color: var(--green);
    background-color: rgba(80, 250, 123, 0.05);
    box-shadow: 0 0 16px rgba(80, 250, 123, 0.2);
}

.prev-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.prev-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.dropzone {
    border: 2px dashed var(--green);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    background-color: rgba(80, 250, 123, 0.03);
    cursor: pointer;
    transition: var(--transition);
}

.dropzone:hover, .dropzone.dragover {
    background-color: rgba(80, 250, 123, 0.1);
    border-color: var(--cyan);
}
