/* --- THEME VARIABLES --- */
:root {
    /* Default to PROD theme (green) */
    --primary-color: #10b981;
    --primary-color-rgb: 16, 185, 129;
    --primary-text-color: #10b981;
    --primary-glow-color: rgba(16, 185, 129, 0.12);
    --primary-hover-bg: rgba(16, 185, 129, 0.05);
    --primary-active-bg: rgba(16, 185, 129, 0.1);
    --primary-btn-bg: rgba(16, 185, 129, 0.15);
    --primary-btn-border: rgba(16, 185, 129, 0.3);
    --primary-btn-hover-bg: rgba(16, 185, 129, 0.3);
    --primary-deploy-btn-bg: #10b981;
    --primary-deploy-btn-text: #000;

    /* Base Colors (Dark Mode Default) */
    --bg-color: #0e0e12;
    --surface-color: #141720;
    --text-color: #e4e4e7;
    --text-muted: #a1a1aa;
    --card-bg: rgba(255, 255, 255, 0.03);
    --border-color: rgba(255, 255, 255, 0.05);
    --input-bg: rgba(255, 255, 255, 0.03);
    --modal-bg: #18181b;
    --heading-color: #fff;
}

:root.light {
    /* Light Mode Overrides */
    --bg-color: #f3f4f6;
    --surface-color: #ffffff;
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --input-bg: #ffffff;
    --modal-bg: #ffffff;
    --heading-color: #111827;
    --primary-text-color: #059669;
    
    /* Light mode specific adjustments for glowing elements */
    --primary-glow-color: transparent; /* Disable glow in light mode or make it subtle */
}

body.dev {
    /* DEV theme override (purple) */
    --primary-color: #818cf8;
    --primary-color-rgb: 99, 102, 241;
    --primary-text-color: #c7d2fe;
    --primary-glow-color: rgba(99, 102, 241, 0.12);
    --primary-hover-bg: rgba(99, 102, 241, 0.1);
    --primary-active-bg: rgba(99, 102, 241, 0.05);
    --primary-btn-bg: rgba(129, 140, 248, 0.15);
    --primary-btn-border: rgba(129, 140, 248, 0.3);
    --primary-btn-hover-bg: rgba(129, 140, 248, 0.3);
    --primary-deploy-btn-bg: rgba(129, 140, 248, 0.8);
    --primary-deploy-btn-text: #fff;
}

:root.light body.dev {
    --primary-color: #4f46e5;
    --primary-color-rgb: 79, 70, 229;
    --primary-text-color: #4338ca;

    --primary-hover-bg: rgba(79, 70, 229, 0.05);
    --primary-active-bg: rgba(79, 70, 229, 0.1);
    --primary-btn-bg: rgba(79, 70, 229, 0.1);
    --primary-btn-border: rgba(79, 70, 229, 0.2);
}

/* --- GLOBAL STYLES --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg-color); color: var(--text-color); min-height: 100vh; transition: background 0.3s, color 0.3s; }
.bg-glow { position: fixed; top: -200px; left: 50%; transform: translateX(-50%); width: 600px; height: 600px; background: radial-gradient(circle, var(--primary-glow-color) 0%, transparent 70%); pointer-events: none; }
.container { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; padding: 60px 24px; }
.loading { grid-column: 1/-1; text-align: center; padding: 100px; color: #52525b; font-size: 1.1rem; }

/* --- HEADER --- */
header { margin-bottom: 40px; display: flex; justify-content: space-between; align-items: flex-start; }
header h1 { font-size: 2rem; margin-bottom: 8px; color: var(--heading-color); }
.back-btn { color: #52525b; text-decoration: none; font-size: 0.85rem; font-weight: 500; transition: color 0.2s; margin-top: 6px; }
.back-btn:hover { color: var(--text-color); }
.stats { display: flex; gap: 24px; }
.stat-item { font-size: 0.9rem; color: var(--text-muted); }
.stat-item b { color: var(--primary-color); font-weight: 600; }

/* --- SELECTION PAGE (INDEX) --- */
body.selection-page { height: 100vh; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.selection-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 24px; width: 100%; max-width: 1000px; padding: 24px; position: relative; z-index: 10; }
.selection-container .card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 16px; padding: 48px 32px; text-align: center; text-decoration: none; color: inherit; transition: all 0.3s ease; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 300px; }
.selection-container .card h2 { font-size: 1.8rem; margin: 16px 0 8px 0; color: var(--heading-color); }
.selection-container .card p { color: var(--text-muted); font-size: 0.95rem; }
.selection-container .icon { width: 56px; height: 56px; margin-bottom: 16px; stroke-width: 1.5; }
.selection-container .card.dev:hover { background: rgba(99, 102, 241, 0.05); border-color: rgba(99, 102, 241, 0.3); transform: translateY(-4px); }
.selection-container .card.dev .icon, .selection-container .card.dev h2 { stroke: #818cf8; color: #818cf8; }
.selection-container .card.prod:hover { background: rgba(16, 185, 129, 0.05); border-color: rgba(16, 185, 129, 0.3); transform: translateY(-4px); }
.selection-container .card.prod .icon, .selection-container .card.prod h2 { stroke: #10b981; color: #10b981; }
.selection-container .card.env:hover {background: rgba(245, 158, 11, 0.05); border-color: rgba(245, 158, 11, 0.3); transform: translateY(-4px); }
.selection-container .card.env .icon { stroke: #f59e0b; }
.selection-container .card.env h2 { color: #f59e0b; }
.selection-container .card.db:hover {background: rgba(59, 130, 246, 0.05); border-color: rgba(59, 130, 246, 0.3); transform: translateY(-4px); }
.selection-container .card.db .icon { stroke: #3b82f6; }
.selection-container .card.db h2 { color: #3b82f6; }

/* --- CENTERED REDIRECT CARD (For Logs page) --- */
.center-card {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 48px 56px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    animation: fadeUp 0.4s ease both;
}
.center-card h1 { font-size: 1.4rem; font-weight: 600; color: var(--heading-color); letter-spacing: -0.02em; margin-bottom: 8px; }
.center-card p { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 28px; }
.icon-box {
    display: flex; align-items: center; justify-content: center;
    width: 52px; height: 52px; border-radius: 14px;
    background: rgba(var(--primary-color-rgb), 0.1);
    margin: 0 auto 20px;
}
.icon-box svg {
    width: 24px; height: 24px; stroke: var(--primary-color);
    fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- GRID & CARDS (DEV/PROD) --- */
.grid { display: grid; gap: 16px; margin-top: 20px; }
body:not(.dev) .grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
body.dev .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.app-card, .slot-card { text-decoration: none; color: inherit; border-radius: 12px; padding: 24px; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--border-color); background: var(--card-bg); }
.app-card:hover, .slot-card.used:hover { transform: translateY(-4px); border-color: var(--primary-color); background: var(--primary-hover-bg); }
.app-card, .slot-card.used { cursor: pointer; }
.slot-card.used { background: var(--primary-active-bg); border-color: rgba(var(--primary-color-rgb), 0.2); }
.slot-card.available { opacity: 0.4; border-style: dashed; filter: grayscale(1); }
.slot-card.add-slot-card { border-style: dashed; justify-content: center; align-items: center; cursor: pointer; opacity: 0.6; }
.slot-card.add-slot-card:hover { opacity: 1; border-color: var(--primary-color); background: var(--primary-hover-bg); transform: translateY(-4px); }

/* Card Content */
.card-header, .slot-header { display: flex; justify-content: space-between; align-items: center; }
.app-name, .slot-id { font-weight: 600; font-size: 1.2rem; color: var(--heading-color); }
.slot-card.used .slot-id { color: var(--primary-color); }
.repo-name { font-size: 0.9rem; color: var(--text-muted); line-height: 1.4; min-height: 2.8em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.slot-card.available .repo-name { color: #52525b; font-style: italic; }
.url-text { font-size: 0.85rem; color: #52525b; font-family: monospace; }
.service-list { font-size: 0.8rem; color: var(--text-muted); margin-top: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.service-tag { background: var(--border-color); padding: 2px 6px; border-radius: 4px; }

.status-badge { align-self: flex-start; font-size: 0.65rem; padding: 4px 10px; border-radius: 6px; background: var(--border-color); color: #71717a; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.running .status-badge, .dev .used .status-badge { background: rgba(16, 185, 129, 0.1); color: #10b981; } /* Occupied is green in both themes */

/* --- MODALS --- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: none; align-items: center; justify-content: center; z-index: 100; backdrop-filter: blur(4px); }
.modal-content { background: var(--modal-bg); padding: 32px; border-radius: 12px; width: 100%; max-width: 450px; border: 1px solid var(--border-color); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5); }
.modal-title { font-size: 1.5rem; color: var(--heading-color); margin-bottom: 8px; }
.modal-description, .modal-desc { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 24px; }
.form-group { margin-bottom: 24px; }
.form-group label { display: block; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea { width: 100%; }

/* Generic Input Styles */
input, select, textarea { background: var(--input-bg); border: 1px solid var(--border-color); border-radius: 6px; padding: 10px 12px; color: var(--text-color); font-size: 0.9rem; font-family: 'DM Sans', sans-serif; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--primary-color); background: rgba(255,255,255,0.05); }
select { cursor: pointer; }
select option { background: var(--modal-bg); color: var(--text-color); }
textarea { min-height: 150px; resize: vertical; }

.modal-actions { display: flex; justify-content: flex-end; gap: 12px; }
.btn { padding: 8px 16px; border-radius: 6px; font-size: 0.8rem; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: all 0.2s; }
.btn-secondary { background: var(--border-color); color: var(--text-muted); }
.btn-secondary:hover { opacity: 0.8; }
.btn-primary { background: var(--primary-color); color: var(--primary-deploy-btn-text); }
.btn-primary:hover { opacity: 0.9; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }

/* Dev-specific modal tabs */
.deploy-tabs { display: flex; gap: 12px; margin-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 12px; }
.tab-btn { background: none; border: none; color: #71717a; font-size: 0.9rem; cursor: pointer; padding: 4px 8px; font-weight: 500; border-bottom: 2px solid transparent; transition: all 0.2s; }
.tab-btn:hover { color: #e4e4e7; }
.tab-btn.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }

/* --- ACTION BUTTONS --- */
.deploy-trigger-btn { background: var(--primary-deploy-btn-bg); color: var(--primary-deploy-btn-text); border: none; font-weight: 600; padding: 8px 16px; border-radius: 6px; cursor: pointer; transition: opacity 0.2s; text-decoration: none; margin-top: 6px; display: none; }
.deploy-trigger-btn:hover { opacity: 0.9; }

.card-actions, .deploy-section, .destroy-section { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border-color); }
.card-actions { display: flex; gap: 8px; }
.action-btn, .deploy-btn, .destroy-btn { width: 100%; padding: 8px; border-radius: 6px; font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: all 0.2s; border: 1px solid transparent; background: transparent; }
.action-btn { flex: 1; display: flex; align-items: center; justify-content: center; border-color: var(--border-color); color: var(--text-muted); }
.action-btn:hover { background: var(--border-color); color: var(--text-color); border-color: var(--border-color); }
.action-btn.delete:hover, .destroy-btn:hover { background: rgba(239, 68, 68, 0.3); color: #fecaca; }
.destroy-btn { background: rgba(239, 68, 68, 0.1); color: #fca5a5; border-color: rgba(239, 68, 68, 0.3); }
.deploy-btn { background: var(--primary-btn-bg); color: var(--primary-text-color); border-color: var(--primary-btn-border); }
.deploy-btn:hover { background: var(--primary-btn-hover-bg); }
.action-btn svg { width: 16px; height: 16px; }

/* --- WRITERS SECTION (DEV) --- */
.writers-section { min-width: 0; }
.writers-title { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 8px; font-weight: 600; }
.writers-list { display: flex; flex-wrap: wrap; gap: 6px; }
.writer-badge { font-size: 0.75rem; background: var(--border-color); color: var(--text-muted); padding: 2px 4px 2px 8px; border-radius: 12px; border: 1px solid var(--border-color); display: inline-flex; align-items: center; gap: 4px; }
.writer-badge:hover { background: rgba(var(--primary-color-rgb), 0.1); color: var(--primary-text-color); border-color: rgba(var(--primary-color-rgb), 0.2); }
.writer-badge.admin { background: rgba(var(--primary-color-rgb), 0.2); border-color: rgba(var(--primary-color-rgb), 0.5); color: var(--primary-text-color); font-weight: 500; }
.writer-badge.admin:hover { background: rgba(var(--primary-color-rgb), 0.3); }
.writers-loading { font-size: 0.8rem; color: #52525b; font-style: italic; }
.remove-writer-btn { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; border: none; background: rgba(255,255,255,0.1); color: var(--text-muted); cursor: pointer; font-size: 12px; line-height: 1; padding: 0; transition: all 0.2s; }
.remove-writer-btn:hover { background: #ef4444; color: #fff; transform: scale(1.1); }
.add-writer-form { margin-top: 12px; display: flex; gap: 8px; }
.add-writer-form input { flex-grow: 1; min-width: 0; }
.add-writer-form button { background: var(--primary-deploy-btn-bg); color: var(--primary-deploy-btn-text); border: none; padding: 6px 12px; border-radius: 6px; font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: background 0.2s; flex-shrink: 0; }
.add-writer-form button:hover { opacity: 0.9; }

/* --- SPINNER --- */
.spinner { border: 4px solid rgba(255, 255, 255, 0.1); width: 50px; height: 50px; border-radius: 50%; border-left-color: var(--primary-color); animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* --- SNIPPETS / TOOLS SPECIFIC --- */
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo { width: 32px; height: 32px; }

.controls { display: flex; gap: 12px; margin-bottom: 32px; }
#searchInput { flex-grow: 1; }

.snippet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.snippet-card { animation: fadeUp 0.4s ease both; display: block; }

.snippet-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.icon-wrapper { width: 32px; height: 32px; background: rgba(var(--primary-color-rgb),0.1); display: flex; align-items: center; justify-content: center; border-radius: 8px; }
.snippet-icon { width: 18px; height: 18px; stroke: var(--primary-color); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.snippet-title { font-size: 1.1rem; color: var(--heading-color); display: block; margin-bottom: 4px; font-weight: 600; }
.snippet-desc { color: var(--text-muted); font-size: 0.9rem; line-height: 1.5; }

.lang-tag { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--primary-text-color); background: rgba(var(--primary-color-rgb), 0.1); padding: 4px 8px; border-radius: 6px; }

/* Toast Notification */
#toast { display: none; position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: var(--primary-color); color: white; padding: 12px 24px; border-radius: 30px; font-size: 0.9rem; font-weight: 500; box-shadow: 0 10px 25px rgba(0,0,0,0.3); z-index: 1000; }

/* Boxed Back Button (Specific to Snippets/Tools) */
.back-btn.boxed { display: inline-flex; align-items: center; color: var(--text-muted); text-decoration: none; font-size: 0.9rem; font-weight: 500; padding: 10px 20px; border-radius: 10px; border: 1px solid var(--border-color); background: var(--card-bg); transition: all 0.2s; margin-top: 0; }
.back-btn.boxed:hover { color: var(--text-color); background: var(--border-color); }

/* --- DASHBOARD (Main Index) --- */
body.dashboard header { display: block; text-align: center; margin-bottom: 56px; }
body.dashboard header h1 { margin-bottom: 0; }
body.dashboard header p { margin-top: 10px; font-size: 0.95rem; color: #71717a; }

.badge { display: inline-block; padding: 6px 14px; background: rgba(var(--primary-color-rgb), 0.1); border: 1px solid rgba(var(--primary-color-rgb), 0.2); border-radius: 20px; font-size: 0.75rem; font-weight: 500; color: var(--primary-text-color); letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 20px; }

.tool-card { position: relative; display: flex; align-items: center; gap: 14px; padding: 22px 24px; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 14px; text-decoration: none; color: var(--text-color); font-size: 0.95rem; font-weight: 500; text-transform: capitalize; transition: all 0.25s ease; overflow: hidden; animation: fadeUp 0.4s ease both; }
.tool-card::before { content: ''; position: absolute; inset: 0; border-radius: 14px; background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.08), transparent 60%); opacity: 0; transition: opacity 0.25s ease; }
.tool-card:hover { border-color: rgba(var(--primary-color-rgb), 0.3); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(var(--primary-color-rgb), 0.1); }
.tool-card:hover::before { opacity: 1; }

.tool-card .icon { position: relative; display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; background: rgba(var(--primary-color-rgb), 0.1); flex-shrink: 0; }
.tool-card .icon svg { width: 18px; height: 18px; stroke: var(--primary-color); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.tool-card .arrow { position: relative; margin-left: auto; opacity: 0; transform: translateX(-4px); transition: all 0.25s ease; color: var(--primary-color); font-size: 1.1rem; }
.tool-card:hover .arrow { opacity: 1; transform: translateX(0); }

.empty { text-align: center; color: #52525b; font-size: 0.9rem; padding: 40px 0; }
.empty-denied { text-align: center; color: var(--primary-color); font-size: 2rem; font-weight: 600; padding: 40px 0; letter-spacing: -0.02em; }

.loading { text-align: center; padding: 40px 0; }
.loading .spinner { width: 24px; height: 24px; border: 2px solid rgba(var(--primary-color-rgb), 0.2); border-top-color: var(--primary-color); border-radius: 50%; animation: spin 0.6s linear infinite; margin: 0 auto 12px; }
.loading span { color: #52525b; font-size: 0.85rem; }

/* --- DOCS HUB --- */
body.docs-hub { display: flex; flex-direction: column; overflow: auto; }

.topbar {
    display: flex; align-items: center; gap: 12px; padding: 12px 24px;
    background: var(--surface-color); border-bottom: 1px solid var(--border-color);
    position: sticky; top: 0; z-index: 1000; flex-wrap: wrap;
}

.logo { display: flex; align-items: center; gap: 10px; margin-right: 16px; flex-shrink: 0; }
.logo-icon {
    width: 30px; height: 30px; background: var(--primary-color); border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 15px; color: #fff;
}
.logo-text { font-weight: 600; font-size: 16px; letter-spacing: -0.02em; white-space: nowrap; }
.logo-text span { color: var(--text-muted); font-weight: 400; font-size: 13px; margin-left: 6px; }

.divider { width: 1px; height: 28px; background: var(--border-color); }

.env-toggle {
    display: flex; background: var(--input-bg);
    border-radius: 6px; border: 1px solid var(--border-color); overflow: hidden;
}
.env-toggle button {
    font-family: inherit; font-size: 12px; font-weight: 500; padding: 6px 14px;
    border: none; background: transparent; color: var(--text-muted); cursor: pointer; transition: all 0.15s;
}
.env-toggle button:hover { color: var(--text-color); }
.env-toggle button.active { background: var(--primary-color); color: #000; }
.env-toggle button.active-dev { background: #818cf8; color: #fff; }

.select-wrapper { position: relative; }
.select-wrapper::after {
    content: '▾'; position: absolute; right: 12px; top: 50%;
    transform: translateY(-50%); color: var(--text-muted); pointer-events: none; font-size: 11px;
}
.topbar select {
    appearance: none; font-family: 'JetBrains Mono', monospace; font-size: 13px;
    padding: 8px 32px 8px 12px; background: var(--input-bg);
    border: 1px solid var(--border-color); border-radius: 6px;
    color: var(--text-color); cursor: pointer; min-width: 260px;
}

.status-pill {
    display: flex; align-items: center; gap: 6px;
    font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text-muted);
    padding: 6px 12px; background: var(--input-bg); border-radius: 20px; border: 1px solid var(--border-color);
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #a1a1aa; }
.status-dot.green { background: #10b981; box-shadow: 0 0 6px rgba(16, 185, 129, 0.4); }
.status-dot.red { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.4); }
.status-dot.loading { background: #f59e0b; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

.topbar .btn {
    font-size: 12px; padding: 8px 14px; background: var(--input-bg);
    border: 1px solid var(--border-color); color: var(--text-color); text-decoration: none;
}
.topbar .btn:hover { background: var(--border-color); }

.spacer { flex: 1; }
.url-display { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text-muted); }
.url-display a { color: var(--text-muted); text-decoration: none; }
.url-display a:hover { color: var(--text-color); }

.app-count {
    font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-muted);
    background: var(--input-bg); padding: 3px 8px; border-radius: 10px; border: 1px solid var(--border-color);
}

#swagger-container { flex: 1; background: #fff; }
.swagger-ui .topbar { display: none !important; }

.empty-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 100px 20px; text-align: center; flex: 1;
}
.empty-icon { font-size: 52px; opacity: 0.2; margin-bottom: 16px; font-family: 'JetBrains Mono', monospace; }
.empty-state h2 { font-size: 18px; font-weight: 500; margin-bottom: 6px; color: var(--heading-color); }
.empty-state p { color: var(--text-muted); font-size: 14px; line-height: 1.5; max-width: 380px; }
.empty-state .discover-info {
    margin-top: 16px; font-size: 12px; color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    background: var(--input-bg); padding: 12px 18px; border-radius: 6px;
    border: 1px solid var(--border-color); text-align: left; line-height: 2;
}
.empty-state .discover-info strong { color: var(--text-color); }

.error-state {
    padding: 60px 24px; text-align: center; flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
}
.error-state h2 { color: #ef4444; font-size: 18px; }
.error-state p { color: var(--text-muted); font-size: 14px; max-width: 500px; line-height: 2; word-break: break-word; }
.error-state > code {
    font-family: 'JetBrains Mono', monospace; font-size: 12px;
    background: var(--input-bg); padding: 10px 20px; border-radius: 6px;
    color: var(--text-color); border: 1px solid var(--border-color);
    display: block; max-width: 90vw; word-break: break-all;
}
.error-state p code {
    font-family: 'JetBrains Mono', monospace; font-size: 12px;
    background: var(--input-bg); padding: 2px 7px; border-radius: 4px;
    color: var(--text-color); border: 1px solid var(--border-color); white-space: nowrap;
}

.api-badge {
    font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 4px;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.badge-prod { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.badge-dev { background: rgba(129, 140, 248, 0.15); color: #818cf8; }

/* Theme Toggler */
#theme-toggle {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    transition: all 0.2s;
}
#theme-toggle:hover {
    color: var(--text-color);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

/* --- GITHUB PORTAL SPECIFIC --- */
.repo-card { display: flex; flex-direction: column; gap: 12px; height: 100%; position: relative; }
.repo-header { display: flex; justify-content: space-between; align-items: flex-start; }
.repo-title { font-weight: 600; font-size: 1.1rem; color: var(--heading-color); }
.repo-meta { font-size: 0.85rem; color: var(--text-muted); }

.hud-panel { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border-color); }
.hud-status { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; margin-bottom: 8px; }
.gh-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.gh-status-dot.live { background: #10b981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.4); }

.commit-info { background: rgba(0,0,0,0.2); padding: 8px; border-radius: 6px; font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: var(--text-muted); display: flex; flex-direction: column; gap: 4px; }
.commit-hash { color: var(--primary-color); }

.pr-section { margin-top: 12px; border-top: 1px solid var(--border-color); padding-top: 12px; }
.pr-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.pr-title { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.pr-list { display: flex; flex-direction: column; gap: 6px; }
.pr-item { background: rgba(255,255,255,0.03); padding: 8px; border-radius: 6px; font-size: 0.85rem; display: flex; justify-content: space-between; align-items: center; text-decoration: none; color: inherit; transition: background 0.2s; }
.pr-item:hover { background: rgba(255,255,255,0.06); }
.pr-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.pr-form { display: none; background: rgba(0,0,0,0.2); padding: 12px; border-radius: 8px; margin-top: 8px; border: 1px solid var(--border-color); }
.pr-form input { display: block; width: 100%; margin-bottom: 8px; font-size: 0.85rem; padding: 6px 8px; }
.pr-form-row { display: flex; gap: 8px; }
.branch-select { flex: 1; min-width: 0; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--border-color); background: rgba(0,0,0,0.2); color: var(--text-main); font-size: 0.85rem; outline: none; }

/* Portal Modal Overrides */
.portal-modal { width: 400px; max-width: 90%; }

/* --- PROD SPECIFIC --- */
.branch-status { margin-top: 12px; font-size: 0.8rem; display: flex; align-items: center; }
.branch-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 6px; font-weight: 500; font-size: 0.75rem; border: 1px solid transparent; }
.branch-pill.behind { background: rgba(245, 158, 11, 0.1); color: #fbbf24; border-color: rgba(245, 158, 11, 0.2); }
.branch-pill.up-to-date { background: rgba(16, 185, 129, 0.1); color: #34d399; border-color: rgba(16, 185, 129, 0.2); }