/* ==========================================================================
   🎙️ ELEVENLABS & xAI HYBRID DESIGN SYSTEM
   Supports Light Mode (ElevenLabs Off-White Editorial) & Dark Mode (xAI Frontier Dark)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Geist+Mono:wght@400;500;600&family=Inter:wght@300;400;500;600&family=Noto+Sans+KR:wght@300;400;500;600&family=Waldenburg:wght@300;400;500&display=swap');

:root {
    /* 🎨 Default Light Mode (ElevenLabs Editorial Canvas) */
    --color-primary: #292524;
    --color-on-primary: #ffffff;
    --color-ink: #0c0a09;
    --color-body: #4e4e4e;
    --color-body-mid: #777169;
    --color-mute: #777169;
    --color-hairline: #e7e5e4;
    
    --color-canvas: #f5f5f5;
    --color-canvas-soft: #fafafa;
    --color-canvas-card: #ffffff;
    --color-canvas-mid: #f0efed;

    /* Atmospheric Gradient Orbs (ElevenLabs Signature) */
    --gradient-mint: #a7e5d3;
    --gradient-peach: #f4c5a8;
    --gradient-lavender: #c8b8e0;
    --gradient-sky: #a8c8e8;
    --gradient-rose: #e8b8c4;

    /* 📐 Functional Tokens - Light */
    --bg-base: #f5f5f5;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f0efed;
    --bg-input: #ffffff;

    --border-hairline: #e7e5e4;
    --border-pill: #d6d3d1;
    --border-pill-hover: #292524;

    --text-primary: #0c0a09;
    --text-body: #4e4e4e;
    --text-secondary: #777169;
    --text-tertiary: #a8a29e;
    --text-inverse: #ffffff;

    /* ⭕ Shapes & Radii (ElevenLabs Pill + Rounded Card) */
    --radius-none: 0px;
    --radius-sm: 8px;
    --radius-card: 16px;
    --radius-pill: 9999px;
    --radius-full: 9999px;

    /* ⚡ Typography */
    --font-display: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
    --font-serif: 'Waldenburg', 'Times New Roman', serif;
    --transition-smooth: all 0.2s ease-in-out;
}

/* 🌙 Dark Mode (xAI Frontier Canvas) */
body.theme-dark, :root.theme-dark {
    --color-primary: #ffffff;
    --color-on-primary: #0a0a0a;
    --color-ink: #ffffff;
    --color-body: #dadbdf;
    --color-body-mid: #7d8187;
    --color-mute: #7d8187;
    --color-hairline: #212327;
    
    --color-canvas: #0a0a0a;
    --color-canvas-soft: #1a1c20;
    --color-canvas-card: #191919;
    --color-canvas-mid: #363a3f;

    --bg-base: #0a0a0a;
    --bg-surface: #191919;
    --bg-surface-hover: #1a1c20;
    --bg-input: #1a1c20;

    --border-hairline: #212327;
    --border-pill: rgba(255, 255, 255, 0.25);
    --border-pill-hover: rgba(255, 255, 255, 0.75);

    --text-primary: #ffffff;
    --text-body: #dadbdf;
    --text-secondary: #7d8187;
    --text-tertiary: #7d8187;
    --text-inverse: #0a0a0a;
}

/* Base Resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-display);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Subtle particle canvas */
#bg-particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.15;
}

/* App Container Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
    z-index: 1;
    background-color: var(--bg-base);
}

/* ==========================================================================
   🏛️ SIDEBAR COMPONENT (xAI Strict Dark)
   ========================================================================== */

.sidebar {
    width: 380px;
    min-width: 340px;
    background: var(--color-canvas);
    border-right: 1px solid var(--border-hairline);
    display: flex;
    flex-direction: column;
    height: 100%;
    z-index: 10;
    padding: 24px;
    gap: 20px;
}

/* Eyebrow Code Comment */
.eyebrow-mono {
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Brand Header */
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Collapse/expand controls. Only shown while the knowledge graph is open — that is
   the view that benefits from the extra width; the reader does not. */
.sidebar-collapse-btn,
.sidebar-expand-btn {
    background: transparent;
    border: 1px solid var(--border-hairline);
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

.sidebar-collapse-btn {
    /* Pushed to the far right of the brand row, past the title. */
    margin-left: auto;
}

.sidebar-collapse-btn:hover,
.sidebar-expand-btn:hover {
    border-color: var(--border-pill);
    color: var(--text-primary);
    background: var(--bg-surface-hover);
}

.sidebar-expand-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 6;
    background: var(--bg-base);
}

/* The sidebar keeps its place in the flex row and slides out of it, so the graph
   canvas reflows into the freed width rather than being overlapped. */
.sidebar {
    transition: margin-left 0.28s ease, opacity 0.2s ease;
}

.app-container.sidebar-collapsed .sidebar {
    margin-left: -380px;
    opacity: 0;
    pointer-events: none;
}

.logo-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-pill);
    background: var(--bg-base);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-text h1 {
    font-size: 16px;
    font-weight: 400;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

/* Stats Card */
.stats-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-card);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-around;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 400;
    letter-spacing: -1.2px;
    color: var(--text-primary);
    font-family: var(--font-display);
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-secondary);
}

.stat-divider {
    width: 1px;
    height: 32px;
    background: var(--border-hairline);
}

/* Articles List Container */
.articles-list-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: 16px;
}

.list-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-header h2 {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Search Box */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-sm);
    padding: 9px 14px 9px 36px;
    font-size: 13px;
    color: var(--text-primary);
    font-family: var(--font-display);
    outline: none;
    transition: var(--transition-smooth);
}

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

.search-box input:focus {
    border-color: var(--border-pill);
}

.search-icon {
    position: absolute;
    left: 14px;
    font-size: 13px;
    color: var(--text-secondary);
    pointer-events: none;
}

/* Articles Scrollable List */
.articles-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

.articles-list::-webkit-scrollbar {
    width: 4px;
}

.articles-list::-webkit-scrollbar-track {
    background: transparent;
}

.articles-list::-webkit-scrollbar-thumb {
    background: var(--border-hairline);
    border-radius: var(--radius-pill);
}

/* Article List Item Card */
.article-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-card);
    padding: 14px 16px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* The title is a bare <h3> in the markup (see app.js), so it was rendering at the
   browser's default h3 size (~1.17em) with no rule of its own. Sized down to h5's
   default (~0.83em) here. */
.article-item h3 {
    font-size: 13px;
}

.article-item:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-pill);
}

.article-item.active {
    background: var(--bg-surface);
    border-color: var(--text-primary);
}

.article-item-title {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 1.35;
}

.article-item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
}

.category-badge {
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-hairline);
    background: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

/* Placeholder */
.list-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    gap: 12px;
}

/* ==========================================================================
   📖 MAIN ARTICLE VIEWER AREA
   ========================================================================== */

.viewer-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: var(--bg-base);
}

/* Navigation Tabs Header */
.viewer-tabs {
    padding: 16px 28px;
    border-bottom: 1px solid var(--border-hairline);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-base);
    z-index: 5;
}

.tab-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* xAI White Outline Pill Buttons */
.tab-btn {
    background: transparent;
    border: 1px solid var(--border-pill);
    color: var(--text-primary);
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    font-family: var(--font-display);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

.tab-btn:hover {
    border-color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

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

/* Segmented Theme Switcher */
.theme-switcher {
    display: flex;
    align-items: center;
    background: var(--bg-base);
    border: 1px solid var(--border-hairline);
    padding: 3px;
    border-radius: var(--radius-pill);
    gap: 2px;
}

.theme-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.theme-btn:hover {
    color: var(--text-primary);
}

.theme-btn.active {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-hairline);
}

/* Mobile Sidebar Toggle */
.mobile-sidebar-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border-pill);
    color: var(--text-primary);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-pill);
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
}

/* Welcome View */
.welcome-view {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--bg-base);
}

.welcome-content {
    max-width: 640px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.welcome-illustration {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-pill);
    background: var(--bg-base);
    border: 1px solid var(--border-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-primary);
}

.welcome-content h2 {
    font-size: 48px;
    font-weight: 400;
    letter-spacing: -1.2px;
    line-height: 1.1;
    color: var(--text-primary);
}

.welcome-content p {
    font-size: 16px;
    color: var(--text-body);
    line-height: 1.5;
}

.welcome-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.badge {
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    background: var(--bg-base);
    border: 1px solid var(--border-hairline);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 1.0px;
    text-transform: uppercase;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Article View Container */
.article-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-base);
}

.viewer-header {
    padding: 36px 40px 24px 40px;
    border-bottom: 1px solid var(--border-hairline);
}

.header-meta {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.article-date-badge {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.viewer-header h1 {
    font-size: 48px;
    font-weight: 400;
    letter-spacing: -1.2px;
    line-height: 1.1;
    color: var(--text-primary);
}

.header-links {
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
}

/* Viewer Content Scrollable Section */
.viewer-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px 40px 80px 40px;
}

.viewer-content::-webkit-scrollbar {
    width: 4px;
}

.viewer-content::-webkit-scrollbar-track {
    background: transparent;
}

.viewer-content::-webkit-scrollbar-thumb {
    background: var(--border-hairline);
    border-radius: var(--radius-pill);
}

/* Editorial Article Formatting (xAI Spec) */
.markdown-body {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-body);
    width: 100%;
    max-width: 100%;
    margin: 0;
}

/* Hide duplicated first h1 title inside body since viewer-header already renders the title */
.markdown-body > h1:first-child {
    display: none;
}

.markdown-body h1 {
    font-size: 48px;
    font-weight: 400;
    letter-spacing: -1.2px;
    line-height: 1.1;
    color: var(--text-primary);
    margin: 40px 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-hairline);
}

.markdown-body h2 {
    font-size: 32px;
    font-weight: 400;
    letter-spacing: -0.6px;
    line-height: 1.15;
    color: var(--text-primary);
    margin: 36px 0 16px 0;
}

.markdown-body h3 {
    font-size: 20px;
    font-weight: 400;
    letter-spacing: normal;
    line-height: 1.35;
    color: var(--text-primary);
    margin: 28px 0 12px 0;
}

.markdown-body p {
    margin-bottom: 20px;
}

.markdown-body a {
    color: var(--text-primary);
    text-decoration: underline;
    transition: var(--transition-smooth);
}

.markdown-body a:hover {
    color: var(--text-secondary);
}

.markdown-body blockquote {
    margin: 24px 0;
    padding: 16px 20px;
    border-left: 2px solid var(--text-primary);
    background: var(--bg-surface);
    border-radius: 0 var(--radius-card) var(--radius-card) 0;
    color: var(--text-primary);
    font-style: normal;
}

.markdown-body code {
    font-family: var(--font-mono);
    font-size: 14px;
    background: var(--bg-surface-hover);
    border: 1px solid var(--border-hairline);
    padding: 3px 6px;
    border-radius: 4px;
    color: var(--text-primary);
}

.markdown-body pre {
    background: var(--bg-surface);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-card);
    padding: 18px 20px;
    overflow-x: auto;
    margin: 24px 0;
}

.markdown-body pre code {
    background: transparent;
    padding: 0;
    border-radius: 0;
    border: none;
}

.markdown-body ul, .markdown-body ol {
    margin: 16px 0 20px 24px;
}

.markdown-body li {
    margin-bottom: 6px;
}

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-card);
    overflow: hidden;
}

.markdown-body th, .markdown-body td {
    padding: 12px 16px;
    border: 1px solid var(--border-hairline);
    text-align: left;
}

.markdown-body th {
    background: var(--bg-surface-hover);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-primary);
}

/* ==========================================================================
   🕸️ KNOWLEDGE GRAPH VIEW (Vis.js Network - xAI Space)
   ========================================================================== */

.graph-view {
    flex: 1;
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--bg-base);
}

#graph-canvas {
    width: 100%;
    height: 100%;
}

/* vis.js injects an inline canvas; the inline baseline gap makes this box a few px
   taller than the canvas, so every re-measure grows it again and the resize wipes
   what was drawn. Block layout removes the gap and keeps the drawing on screen. */
#graph-canvas canvas {
    display: block;
}

.graph-legend {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    /* Sized to its contents so the seven categories stay on one line. No max-width
       cap — capping the pill is what forced the wrap in the first place. */
    max-width: none;
    background: var(--bg-base);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-pill);
    padding: 8px 14px;
    display: flex;
    align-items: center;
    /* Tight enough that all seven still fit the pane beside a 380px sidebar on a
       1100px window, which is where the single row would otherwise spill over. */
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: center;
    z-index: 5;
    cursor: move;
    /* The pill is dragged with pointer events; without this a touch drag scrolls the
       page instead, and a mouse drag selects the category labels as text. */
    touch-action: none;
    user-select: none;
}

.legend-item {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 1.0px;
    text-transform: uppercase;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-hairline);
    transition: var(--transition-smooth);
    /* Keep each chip at its natural width on the single row — flex would otherwise
       squeeze them and break the labels across lines. */
    flex-shrink: 0;
    white-space: nowrap;
}

.legend-item:hover {
    border-color: var(--border-pill);
    background: var(--bg-surface-hover);
}

.legend-item.active {
    background: var(--text-primary);
    color: var(--color-on-primary);
    border-color: var(--text-primary);
}

.legend-item.inactive {
    opacity: 0.3;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-pill);
    display: inline-block;
}

/* xAI Accent Node Palette */
.dot.planning-theory { background: #3b82f6; }
.dot.product-planning { background: #10b981; }
.dot.ai-tech { background: #ff7a17; }
.dot.psychology { background: #7c3aed; }
.dot.language { background: #c4b5fd; }
.dot.society { background: #a0c3ec; }
.dot.value { background: #eab308; }

/* ==========================================================================
   🔘 BUTTON SYSTEM (xAI White Outline Pill Standards)
   ========================================================================== */

/* Canonical xAI White Outline Pill Button */
.btn-primary, .btn-pill-outline {
    background: transparent;
    color: var(--text-primary);
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-pill);
    font-size: 14px;
    font-weight: 400;
    font-family: var(--font-display);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

.btn-primary:hover, .btn-pill-outline:hover {
    border-color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Rare White-Filled Pill Button */
.btn-solid, .btn-primary-filled {
    background: var(--text-primary);
    color: var(--color-on-primary);
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--text-primary);
    font-size: 14px;
    font-weight: 400;
    font-family: var(--font-display);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

.btn-solid:hover, .btn-primary-filled:hover {
    opacity: 0.9;
}

/* Secondary Button */
.btn-secondary, .btn-ghost {
    background: transparent;
    color: var(--text-body);
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-hairline);
    font-size: 14px;
    font-weight: 400;
    font-family: var(--font-display);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

.btn-secondary:hover, .btn-ghost:hover {
    border-color: var(--border-pill);
    color: var(--text-primary);
}

/* Floating Action Button (FAB) */
.fab-sync-btn {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-pill);
    background: var(--bg-base);
    color: var(--text-primary);
    border: 1px solid var(--border-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    z-index: 100;
    transition: var(--transition-smooth);
}

.fab-sync-btn:hover {
    border-color: var(--text-primary);
    background: var(--bg-surface-hover);
}

/* Sync Notification Banner */
.sync-banner {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    width: 90%;
    max-width: 640px;
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-pill);
    border-radius: var(--radius-pill);
    padding: 12px 20px;
    transition: var(--transition-smooth);
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.banner-text {
    flex: 1;
}

.btn-banner-sync {
    background: var(--text-primary);
    color: var(--color-on-primary);
    border: none;
    padding: 4px 14px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
}

.btn-banner-close {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 14px;
    opacity: 0.7;
}

.btn-banner-close:hover {
    opacity: 1;
}

/* ==========================================================================
   🔒 MODAL DIALOGS
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-card);
    width: 90%;
    max-width: 480px;
    padding: 28px;
    position: relative;
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
}

.modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    margin-bottom: 20px;
}

.modal-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-pill);
    background: var(--bg-base);
    border: 1px solid var(--border-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-primary);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 400;
    color: var(--text-primary);
}

.modal-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

.password-input-group {
    display: flex;
    gap: 10px;
}

.password-input-group input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
}

.password-input-group input:focus {
    border-color: var(--border-pill);
}

.console-wrapper {
    background: var(--bg-base);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 16px;
    max-height: 240px;
    overflow-y: auto;
}

.console {
    font-family: var(--font-mono);
    font-size: 12px;
    color: #a3e635;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        height: 100vh;
        width: 320px;
        transition: left 0.3s ease-in-out;
    }

    .sidebar.mobile-open {
        left: 0;
    }

    .mobile-sidebar-toggle {
        display: flex;
    }

    .viewer-header {
        padding: 24px 20px 16px 20px;
    }

    .viewer-content {
        padding: 24px 20px 60px 20px;
    }

    .markdown-body h1 {
        font-size: 36px;
        letter-spacing: -0.9px;
    }

    .markdown-body h2 {
        font-size: 28px;
        letter-spacing: -0.6px;
    }
}
