/* ============================================
   LAURENCE WATCHERS - Dark Glassmorphism Theme
   ============================================ */

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-glass: rgba(30, 41, 59, 0.5);
    --bg-hover: rgba(51, 65, 85, 0.4);
    --border: rgba(99, 102, 241, 0.15);
    --border-active: rgba(99, 102, 241, 0.5);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-indigo: #6366f1;
    --accent-cyan: #22d3ee;
    --accent-emerald: #34d399;
    --accent-amber: #fbbf24;
    --accent-rose: #fb7185;
    --accent-violet: #a78bfa;
    --glow-indigo: rgba(99, 102, 241, 0.3);
    --glow-cyan: rgba(34, 211, 238, 0.2);
    --radius: 12px;
    --radius-lg: 16px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background effects */
.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: 0;
    pointer-events: none;
}

.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
}

.bg-glow-1 {
    width: 500px;
    height: 500px;
    background: var(--glow-indigo);
    top: -200px;
    left: -100px;
    animation: float1 20s ease-in-out infinite;
}

.bg-glow-2 {
    width: 400px;
    height: 400px;
    background: var(--glow-cyan);
    bottom: -150px;
    right: -100px;
    animation: float2 25s ease-in-out infinite;
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(80px, 60px); }
}

@keyframes float2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-60px, -80px); }
}

/* ===== TOPBAR ===== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 1.5rem;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.version-badge {
    font-size: 0.65rem;
    font-family: var(--font-mono);
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--bg-glass);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.topbar-center {
    display: flex;
    align-items: center;
}

.orchestrator-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: var(--bg-glass);
    border-radius: 20px;
    border: 1px solid var(--border);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-emerald);
    box-shadow: 0 0 8px var(--accent-emerald);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

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

.orchestrator-state {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-emerald);
}

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

.stat-pill {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    background: var(--bg-glass);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.stat-pill-alert {
    border-color: rgba(251, 113, 133, 0.3);
    background: rgba(251, 113, 133, 0.1);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-cyan);
}

.stat-pill-alert .stat-value {
    color: var(--accent-rose);
}

.btn-trigger {
    padding: 0.4rem 1rem;
    border: 1px solid var(--accent-indigo);
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-indigo);
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-trigger:hover {
    background: rgba(99, 102, 241, 0.3);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

/* Edit Mode Toggle */
.edit-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}
.edit-toggle input { display: none; }
.edit-toggle-slider {
    width: 36px;
    height: 20px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: 10px;
    position: relative;
    transition: all 0.3s;
}
.edit-toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all 0.3s;
}
.edit-toggle input:checked + .edit-toggle-slider {
    background: rgba(99, 102, 241, 0.3);
    border-color: var(--accent-indigo);
}
.edit-toggle input:checked + .edit-toggle-slider::after {
    transform: translateX(16px);
    background: var(--accent-indigo);
    box-shadow: 0 0 8px var(--accent-indigo);
}
.edit-toggle-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.edit-toggle input:checked ~ .edit-toggle-label {
    color: var(--accent-indigo);
}

/* Edit mode container */
.mermaid-container.edit-mode {
    border: 1px dashed var(--accent-indigo);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.1);
}
.mermaid-container.edit-mode .node {
    cursor: grab;
}
.mermaid-container.edit-mode .node.dragging {
    cursor: grabbing;
}

/* JSON Toast */
.json-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    z-index: 300;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-active);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    max-width: 600px;
    width: 90%;
    max-height: 350px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 30px var(--glow-indigo);
    opacity: 0;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.json-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.json-toast-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.json-toast-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-indigo);
}
.json-toast-actions {
    display: flex;
    gap: 0.5rem;
}
.json-toast-actions button {
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.2s;
}
.btn-copy {
    border: 1px solid var(--accent-emerald);
    background: rgba(52, 211, 153, 0.15);
    color: var(--accent-emerald);
}
.btn-copy:hover { background: rgba(52, 211, 153, 0.3); }
.btn-toast-close {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
}
.btn-toast-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.json-toast pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    overflow: auto;
    max-height: 200px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-cyan);
    line-height: 1.5;
    margin: 0;
}

/* ===== COMMAND BAR ===== */
.command-bar {
    position: relative;
    z-index: 50;
    padding: 0.75rem 1.5rem;
    background: rgba(15, 23, 42, 0.6);
    border-bottom: 1px solid var(--border);
}

.command-bar-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

.command-avatar {
    font-size: 2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    border-radius: 12px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.command-content {
    flex: 1;
}

.command-quote {
    font-size: 1rem;
    color: var(--text-secondary);
    font-style: italic;
    transition: color 0.3s;
}

.command-quote.active {
    color: var(--accent-amber);
    font-style: normal;
    font-weight: 500;
}

.command-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.command-separator {
    color: var(--text-muted);
    opacity: 0.3;
}

.command-actions {
    flex-shrink: 0;
}

.btn-command {
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--accent-amber);
    background: rgba(251, 191, 36, 0.1);
    color: var(--accent-amber);
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-command:hover {
    background: rgba(251, 191, 36, 0.2);
    box-shadow: 0 0 25px rgba(251, 191, 36, 0.15);
}

.btn-command.triggered {
    animation: commandFlash 0.6s ease;
}

@keyframes commandFlash {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); background: rgba(251, 191, 36, 0.4); }
    100% { transform: scale(1); }
}

/* ===== DASHBOARD / DIAGRAM VIEW ===== */
.dashboard {
    position: relative;
    z-index: 10;
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard.diagram-view {
    max-width: 100%;
    padding: 0.5rem 1rem;
    padding-bottom: 20px;
}

.mermaid-container {
    width: 100%;
    overflow: auto;
    background: rgba(10, 14, 26, 0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    min-height: calc(100vh - 320px);
}

.mermaid-container svg {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
}

/* Mermaid dark overrides */
.mermaid-container .node rect,
.mermaid-container .node polygon,
.mermaid-container .node circle {
    cursor: pointer;
}

.watcher-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

/* ===== WATCHER TILE ===== */
.watcher-tile {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.watcher-tile:hover {
    border-color: var(--border-active);
    transform: translateY(-2px);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3), 0 0 20px var(--tile-glow, rgba(99, 102, 241, 0.1));
}

.watcher-tile.scanning {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 30px rgba(34, 211, 238, 0.15);
}

.watcher-tile.scanning .tile-preview {
    animation: scanPulse 1.5s ease-in-out infinite;
}

@keyframes scanPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Tile Header */
.tile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

.tile-identity {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.tile-icon {
    font-size: 1.3rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--tile-bg, var(--bg-glass));
}

.tile-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tile-info span {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.tile-status {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tile-status.online {
    background: rgba(52, 211, 153, 0.15);
    color: var(--accent-emerald);
}

.tile-status.scanning {
    background: rgba(34, 211, 238, 0.15);
    color: var(--accent-cyan);
}

.tile-status.alert {
    background: rgba(251, 113, 133, 0.15);
    color: var(--accent-rose);
}

.tile-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* Tile Preview - Live Thumbnail */
.tile-preview {
    height: 160px;
    background: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}

.tile-preview canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.tile-preview-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.preview-label {
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.preview-time {
    font-size: 0.65rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

/* Tile Body */
.tile-body {
    padding: 0.75rem 1rem;
}

.tile-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.metric {
    text-align: center;
    padding: 0.4rem;
    background: var(--bg-glass);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.metric-value {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.metric-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.tile-last-scan {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Tile Footer */
.tile-footer {
    display: flex;
    border-top: 1px solid var(--border);
}

.tile-footer button {
    flex: 1;
    padding: 0.6rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tile-footer button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.tile-footer button:not(:last-child) {
    border-right: 1px solid var(--border);
}

.tile-footer button.btn-rescan {
    color: var(--accent-cyan);
}

.tile-footer button.btn-rescan:hover {
    background: rgba(34, 211, 238, 0.1);
}

/* ===== ACTIVITY PANEL ===== */
.activity-panel {
    position: relative;
    z-index: 80;
    max-height: 200px;
    margin: 0 1rem 1rem;
    background: rgba(10, 14, 26, 0.92);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
}

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

.panel-header h3 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-icon {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

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

.activity-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 1rem;
}

.activity-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 1rem;
    font-style: italic;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.35rem 0;
    font-size: 0.8rem;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.activity-time {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 55px;
}

.activity-icon {
    font-size: 0.9rem;
}

.activity-text {
    color: var(--text-secondary);
    flex: 1;
}

.activity-text strong {
    color: var(--text-primary);
    font-weight: 500;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    width: 90%;
    max-width: 520px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-active);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px var(--glow-indigo);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    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: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.modal-body {
    padding: 1.25rem;
}

.scan-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.scan-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-glass);
    border-radius: 3px;
    overflow: hidden;
}

.scan-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-indigo), var(--accent-cyan));
    border-radius: 3px;
    transition: width 0.3s ease;
}

.scan-percent {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-cyan);
    min-width: 40px;
    text-align: right;
}

.scan-steps {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.scan-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    transition: all 0.3s;
}

.scan-step.active {
    color: var(--accent-cyan);
    background: rgba(34, 211, 238, 0.05);
}

.scan-step.done {
    color: var(--accent-emerald);
}

.scan-step-icon {
    width: 16px;
    text-align: center;
    font-size: 0.75rem;
}

.scan-result {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--bg-glass);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.scan-result h4 {
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
    color: var(--accent-emerald);
}

.scan-result p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
}

.btn-primary, .btn-secondary {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    border: 1px solid var(--accent-indigo);
    background: var(--accent-indigo);
    color: white;
}

.btn-primary:hover {
    background: #4f46e5;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

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

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

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .topbar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .topbar-center {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .watcher-grid {
        grid-template-columns: 1fr;
    }

    .command-bar-inner {
        flex-wrap: wrap;
    }

    .command-actions {
        width: 100%;
    }

    .btn-command {
        width: 100%;
    }
}

/* ===== CONFIGURATION ITEM VIEWER ===== */
.ci-viewer {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    z-index: 250;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.2s ease;
}

.ci-viewer-chrome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-active);
    flex-shrink: 0;
}

.ci-viewer-identity {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ci-viewer-icon {
    font-size: 1.4rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.ci-viewer-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.ci-viewer-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.ci-viewer-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ci-rescan-btn {
    font-size: 0.75rem;
    padding: 0.3rem 0.75rem;
}

.ci-close {
    width: 32px;
    height: 32px;
    font-size: 1rem;
}

.ci-viewer-canvas {
    flex: 1;
    overflow: hidden;
}

.ci-viewer-canvas iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: #fff;
}

/* Watcher nodes are clickable CIs when not in edit mode */
.mermaid-container:not(.edit-mode) .node {
    cursor: pointer;
}
