﻿/* dev-console.css - Dev console, views, AI analysis */

/* ==================== DEV CONSOLE ==================== */

.dev-console-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #fff;
    color: #198754;
    border: 2px solid #dee2e6;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    z-index: 9990;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.dev-console-fab:hover {
    border-color: #198754;
    background: #f0fff4;
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(25,135,84,0.2);
}

.dev-console-fab-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #198754;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    font-family: 'Jost', sans-serif;
    border: 2px solid #fff;
}

.dev-console-panel {
    position: fixed;
    bottom: 16px;
    right: 16px;
    width: 75vw;
    height: 90vh;
    min-height: 400px;
    min-width: 600px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    max-width: calc(100vw - 32px);
    background: #fff;
    border-radius: 16px;
    border: 1px solid #dee2e6;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
    z-index: 9991;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Jost', sans-serif;
    animation: devConsoleSlideUp 0.3s ease-out;
}

/* Backdrop overlay */
.dev-console-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 9990;
    animation: devConsoleFadeIn 0.2s ease-out;
}

.dev-console-backdrop.closing { animation: devConsoleFadeOut 0.2s ease-in forwards; }

@keyframes devConsoleFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes devConsoleFadeOut { from { opacity: 1; } to { opacity: 0; } }

@keyframes devConsoleSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.dev-console-panel.closing {
    animation: devConsoleScaleOut 0.25s ease-in forwards;
}

@keyframes devConsoleScaleOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(20px) scale(0.97); }
}

/* Header */
.dev-console-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
}

.dev-console-title {
    display: flex;
    align-items: center;
    color: #212529;
    font-weight: 600;
    font-size: 15px;
    gap: 10px;
}

.dev-console-title > i { color: #198754; }

.dev-console-connection {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 500;
    color: #6c757d;
    background: #fff;
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

.dev-console-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #dc3545;
    flex-shrink: 0;
}

.dev-console-connection.connected .dev-console-dot {
    background: #198754;
    box-shadow: 0 0 6px rgba(25,135,84,0.4);
}

.dev-console-connection.connected { color: #198754; border-color: #d1e7dd; background: #f0fff4; }

.dev-console-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dev-console-icon-btn {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
}

.dev-console-icon-btn:hover { background: #f0f0f0; color: #212529; }

/* Stats */
.dev-console-stats {
    display: flex;
    padding: 10px 20px;
    gap: 8px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
    background: #fff;
}

.dev-console-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    padding: 6px 0;
    border-radius: 8px;
    background: #f8f9fa;
}

.dev-console-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #212529;
    line-height: 1.2;
}

.dc-val-api { color: #0d6efd; }
.dc-val-net { color: #b08245; }
.dc-val-auth { color: #e85d04; }
.dc-val-info { color: #0dcaf0; }
.dc-val-warn { color: #ffc107; }
.dc-val-error { color: #dc3545; }

.dev-console-stat-label {
    font-size: 9px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Toolbar â€” search + filters */
.dev-console-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
    background: #fff;
}

.dev-console-search {
    position: relative;
    flex: 0 0 220px;
}

.dev-console-search i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    font-size: 12px;
}

.dev-console-search input {
    width: 100%;
    padding: 6px 10px 6px 30px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Jost', sans-serif;
    color: #212529;
    background: #f8f9fa;
    outline: none;
    transition: border-color 0.2s;
}

.dev-console-search input:focus {
    border-color: #198754;
    background: #fff;
}

.dev-console-search input::placeholder { color: #adb5bd; }

.dev-console-filters {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    flex: 1;
}

.dc-filter-btn {
    padding: 4px 12px;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    background: #fff;
    color: #6c757d;
    font-size: 12px;
    font-family: 'Jost', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    position: relative;
}

/* Per-category filter colors */
.dc-filter-all:hover { border-color: #198754; color: #198754; background: #f0fff4; }
.dc-filter-all.active { background: #198754; color: #fff; border-color: #198754; }
.dc-filter-none:hover { border-color: #6c757d; color: #6c757d; background: #f8f9fa; }
.dc-filter-none.active { background: #6c757d; color: #fff; border-color: #6c757d; }
.dc-filter-api:hover { border-color: #0d6efd; color: #0d6efd; background: #e7f1ff; }
.dc-filter-api.active { background: #0d6efd; color: #fff; border-color: #0d6efd; }
.dc-filter-net:hover { border-color: #b08245; color: #b08245; background: #fdf3e2; }
.dc-filter-net.active { background: #b08245; color: #fff; border-color: #b08245; }
.dc-filter-auth:hover { border-color: #e85d04; color: #e85d04; background: #fff0e0; }
.dc-filter-auth.active { background: #e85d04; color: #fff; border-color: #e85d04; }
.dc-filter-merge:hover { border-color: #7c3aed; color: #7c3aed; background: #ede9fe; }
.dc-filter-merge.active { background: #7c3aed; color: #fff; border-color: #7c3aed; }
.dc-filter-supabase:hover { border-color: #3ECF8E; color: #2da36e; background: #e6faf0; }
.dc-filter-supabase.active { background: #3ECF8E; color: #fff; border-color: #3ECF8E; }
.dc-filter-info:hover { border-color: #0aa2c0; color: #0aa2c0; background: #e8f9fd; }
.dc-filter-info.active { background: #0aa2c0; color: #fff; border-color: #0aa2c0; }
.dc-filter-warn:hover { border-color: #cc9a06; color: #cc9a06; background: #fff8e1; }
.dc-filter-warn.active { background: #cc9a06; color: #fff; border-color: #cc9a06; }
.dc-filter-error:hover { border-color: #dc3545; color: #dc3545; background: #fce4e4; }
.dc-filter-error.active { background: #dc3545; color: #fff; border-color: #dc3545; }
.dc-filter-core:hover { border-color: #198754; color: #198754; background: #d1e7dd; }
.dc-filter-core.active { background: #198754; color: #fff; border-color: #198754; }

/* Count badge on filter buttons */
.dc-filter-count {
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    margin-left: 5px;
    background: rgba(0,0,0,0.15);
    color: inherit;
    line-height: 1;
}
.dc-filter-btn.active .dc-filter-count { background: rgba(255,255,255,0.3); }

/* AI Dropdown menu */
.dc-ai-dropdown { position: relative; display: inline-block; }
.dc-ai-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 1100;
    min-width: 200px;
    overflow: hidden;
}
.dc-ai-menu.show { display: block; }
.dc-ai-menu button {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    font-size: 13px;
    font-family: 'Jost', sans-serif;
    color: #212529;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}
.dc-ai-menu button:hover { background: #f0fff4; }
.dc-ai-menu button:first-child { border-radius: 10px 10px 0 0; }
.dc-ai-menu button:last-child { border-radius: 0 0 10px 10px; }
.dc-ai-menu button i { width: 18px; text-align: center; }

/* Per-entry AI analyze button */
.dc-entry-ai-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #fff;
    color: #6c757d;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 6px;
    opacity: 0;
    flex-shrink: 0;
}
.dev-console-entry:hover .dc-entry-ai-btn { opacity: 1; }
.dc-entry-ai-btn:hover { background: #198754; color: #fff; border-color: #198754; }

/* Log entries */
.dev-console-logs {
    flex: 1;
    overflow-y: auto;
    padding: 10px 16px;
    scroll-behavior: smooth;
}

.dev-console-logs::-webkit-scrollbar { width: 6px; }
.dev-console-logs::-webkit-scrollbar-track { background: transparent; }
.dev-console-logs::-webkit-scrollbar-thumb { background: #dee2e6; border-radius: 3px; }
.dev-console-logs::-webkit-scrollbar-thumb:hover { background: #adb5bd; }

.dev-console-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #adb5bd;
    text-align: center;
    padding: 2rem;
}

.dev-console-empty i { font-size: 42px; margin-bottom: 14px; opacity: 0.4; color: #198754; }
.dev-console-empty p { margin: 0; font-size: 15px; font-weight: 500; color: #6c757d; }
.dev-console-empty span { font-size: 13px; color: #adb5bd; margin-top: 4px; }

.dev-console-entry {
    background: #fff;
    border-radius: 10px;
    margin-bottom: 6px;
    border: 1px solid #eee;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dev-console-entry:hover { border-color: #dee2e6; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }

/* Category border colors */
.dev-console-entry.cat-api { border-left: 3px solid #0d6efd; }
.dev-console-entry.cat-net { border-left: 3px solid #b08245; }
.dev-console-entry.cat-auth { border-left: 3px solid #e85d04; }
.dev-console-entry.cat-info { border-left: 3px solid #0dcaf0; }
.dev-console-entry.cat-warn { border-left: 3px solid #ffc107; }
.dev-console-entry.cat-error { border-left: 3px solid #dc3545; }
.dev-console-entry.cat-core { border-left: 3px solid #198754; }

.dev-console-entry-header {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    gap: 10px;
    user-select: none;
}

/* Category badge */
.dc-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
    font-family: 'Jost', sans-serif;
}

.dc-badge-api { background: #e7f1ff; color: #0d6efd; }
.dc-badge-net { background: #fdf3e2; color: #b08245; }
.dc-badge-auth { background: #fff0e0; color: #e85d04; }
.dc-badge-info { background: #e8f9fd; color: #0aa2c0; }
.dc-badge-warn { background: #fff8e1; color: #cc9a06; }
.dc-badge-error { background: #fce4e4; color: #dc3545; }
.dc-badge-core { background: #d1e7dd; color: #146c43; }

.dev-console-entry-msg {
    flex: 1;
    font-size: 12.5px;
    color: #495057;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.dev-console-entry-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    font-size: 11px;
    color: #adb5bd;
}

.dev-console-entry-time { font-variant-numeric: tabular-nums; }

.dev-console-entry-records {
    padding: 1px 7px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 10px;
}

.cat-api .dev-console-entry-records { background: #e7f1ff; color: #0d6efd; }
.cat-error .dev-console-entry-records { background: #fce4e4; color: #dc3545; }

.dev-console-entry-duration {
    color: #6c757d;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.dev-console-entry-chevron {
    color: #adb5bd;
    font-size: 10px;
    transition: transform 0.2s;
}

.dev-console-entry.expanded .dev-console-entry-chevron { transform: rotate(90deg); }

/* Expanded detail */
.dev-console-entry-detail {
    display: none;
    padding: 0 14px 14px;
    border-top: 1px solid #f0f0f0;
}

.dev-console-entry.expanded .dev-console-entry-detail { display: block; }

.dev-console-detail-section { margin-top: 10px; }

.dev-console-detail-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dev-console-detail-content {
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px 14px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    color: #495057;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.6;
    max-height: 50vh;
    overflow-y: auto;
}

.dev-console-detail-content::-webkit-scrollbar { width: 6px; }
.dev-console-detail-content::-webkit-scrollbar-track { background: transparent; }
.dev-console-detail-content::-webkit-scrollbar-thumb { background: #dee2e6; border-radius: 3px; }

/* Pretty JSON syntax highlighting */
.dc-json-key { color: #0d6efd; font-weight: 500; }
.dc-json-string { color: #198754; }
.dc-json-number { color: #d63384; }
.dc-json-bool { color: #e65100; font-weight: 600; }
.dc-json-null { color: #6c757d; font-style: italic; }

/* Detail toolbar (pretty/raw toggle + copy) */
.dev-console-detail-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dev-console-detail-copy {
    background: #fff;
    border: 1px solid #dee2e6;
    color: #6c757d;
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Jost', sans-serif;
    transition: all 0.2s;
}

.dev-console-detail-copy:hover { background: #f0fff4; border-color: #198754; color: #198754; }

/* Sequence number */
.dc-seq {
    font-size: 10px;
    font-weight: 700;
    color: #adb5bd;
    min-width: 28px;
    text-align: center;
    flex-shrink: 0;
    font-family: 'Consolas', monospace;
    font-variant-numeric: tabular-nums;
}

/* MERGE category */
.dc-badge-merge { background: #ede9fe; color: #7c3aed; }
.dev-console-entry.cat-merge { border-left: 3px solid #7c3aed; }
.cat-merge .dev-console-entry-records { background: #ede9fe; color: #7c3aed; }

/* SUPABASE category */
.dc-badge-supabase { background: #e6faf0; color: #2da36e; }
.dev-console-entry.cat-supabase { border-left: 3px solid #3ECF8E; }
.cat-supabase .dev-console-entry-records { background: #e6faf0; color: #2da36e; }

/* ===== JSON Viewer - Type Badges ===== */
.dc-tbadge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 4px;
    letter-spacing: 0.3px;
    font-family: 'Jost', sans-serif;
    vertical-align: middle;
    margin-left: 4px;
    white-space: nowrap;
}

.dc-t-string  { background: #d1e7dd; color: #146c43; }
.dc-t-number  { background: #cfe2ff; color: #0d6efd; }
.dc-t-boolean { background: #e8d5f5; color: #7c3aed; }
.dc-t-null    { background: #e9ecef; color: #6c757d; }
.dc-t-object  { background: #fce4e4; color: #dc3545; }
.dc-t-array   { background: #fff3cd; color: #cc9a06; }

/* Viewer mode container override */
.dc-viewer-mode {
    font-family: 'Jost', sans-serif !important;
    background: #fff !important;
    padding: 16px !important;
    white-space: normal !important;
}

/* ===== Schema View ===== */
.dc-schema { padding: 4px 0; }

.dc-schema-row {
    padding: 5px 4px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    line-height: 1.6;
    border-bottom: 1px solid #f8f8f8;
}

.dc-schema-row:hover { background: #f8fdf9; }
.dc-schema-row.collapsed > .dc-schema-children { display: none; }

.dc-schema-arrow {
    cursor: pointer;
    font-size: 10px;
    color: #198754;
    width: 16px;
    text-align: center;
    user-select: none;
    flex-shrink: 0;
    transition: color 0.15s;
}
.dc-schema-arrow:hover { color: #0d6efd; }

.dc-schema-key {
    font-weight: 600;
    color: #212529;
}

.dc-schema-info {
    font-size: 11px;
    color: #adb5bd;
    font-style: italic;
}

.dc-schema-val {
    color: #6c757d;
    font-size: 12px;
    margin-left: auto;
    text-align: right;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: 'Consolas', monospace;
}

.dc-schema-children { width: 100%; }

.dc-schema-root {
    font-size: 14px;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 2px solid #198754;
    margin-bottom: 4px;
}

/* ===== Flowchart View ===== */
.dc-flow-scroll { overflow-x: auto !important; white-space: normal !important; }

.dc-flow {
    display: inline-flex;
    align-items: flex-start;
    gap: 0;
    padding: 12px;
    min-width: 100%;
}

.dc-flow-level {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.dc-flow-card {
    background: #fff;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    min-width: 170px;
    max-width: 280px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dc-flow-card:hover {
    border-color: #198754;
    box-shadow: 0 4px 16px rgba(25,135,84,0.12);
}

.dc-flow-card-head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    border-radius: 10px 10px 0 0;
    font-size: 12px;
    font-weight: 600;
}

.dc-flow-card-label { color: #212529; }

.dc-flow-card-body { padding: 4px 0; }

.dc-flow-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 14px;
    font-size: 11px;
    color: #495057;
    gap: 8px;
}

.dc-flow-fname { font-weight: 500; }
.dc-flow-more { color: #adb5bd; font-style: italic; }

.dc-flow-connector {
    padding: 0 6px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.dc-flow-branches {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ===== Cards View ===== */
.dc-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
    padding: 4px;
}

.dc-card {
    background: #fff;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dc-card:hover {
    border-color: #198754;
    box-shadow: 0 4px 16px rgba(25,135,84,0.12);
}

.dc-card-head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    font-size: 13px;
    font-weight: 600;
}

.dc-card-title { color: #212529; }

.dc-card-sub {
    font-size: 10px;
    color: #adb5bd;
    padding: 3px 14px;
    font-family: 'Consolas', monospace;
    background: #fcfcfc;
    border-bottom: 1px solid #f0f0f0;
}

.dc-card-body { padding: 6px 0; }

.dc-card-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 14px;
    font-size: 12px;
    color: #495057;
    gap: 8px;
    border-bottom: 1px solid #fafafa;
}

.dc-card-field:last-child { border-bottom: none; }
.dc-card-fname { font-weight: 500; }

/* ===== Table View ===== */
.dc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.dc-table th {
    text-align: left;
    padding: 10px 14px;
    background: #f8f9fa;
    border-bottom: 2px solid #198754;
    font-size: 10px;
    font-weight: 700;
    color: #198754;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.dc-table td {
    padding: 7px 14px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.dc-table tbody tr:hover { background: #f0fff4; }

.dc-table-depth {
    font-weight: 700;
    color: #6c757d;
    text-align: center;
    width: 55px;
}

.dc-table-name { font-weight: 600; color: #212529; }

.dc-table-path {
    font-family: 'Consolas', monospace;
    font-size: 11px;
    color: #198754;
}

.dc-table-sample {
    color: #6c757d;
    font-size: 11px;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* View toggle expanded for 6 modes */
.dc-view-toggle {
    display: inline-flex;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
    margin-right: 4px;
    flex-wrap: wrap;
}

.dc-view-btn {
    padding: 2px 8px;
    font-size: 10px;
    font-family: 'Jost', sans-serif;
    font-weight: 500;
    border: none;
    border-right: 1px solid #dee2e6;
    background: #fff;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.dc-view-btn:last-child { border-right: none; }
.dc-view-btn:hover { background: #f0f0f0; }
.dc-view-btn.active { background: #198754; color: #fff; }

/* ===== AI Analyze Button ===== */
.dc-ai-btn {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Jost', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(124,58,237,0.25);
    margin-right: 4px;
}

.dc-ai-btn:hover {
    background: linear-gradient(135deg, #6d28d9, #5b21b6);
    box-shadow: 0 4px 16px rgba(124,58,237,0.35);
    transform: translateY(-1px);
}

/* ===== AI Analysis Panel ===== */
.dc-ai-panel {
    flex-shrink: 0;
    max-height: 45%;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    border-top: 2px solid #7c3aed;
    background: #faf8ff;
    overflow: hidden;
}

.dc-ai-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: linear-gradient(135deg, #faf8ff, #f3f0ff);
    border-bottom: 1px solid #e9e0ff;
    flex-shrink: 0;
}

.dc-ai-title {
    font-size: 14px;
    font-weight: 600;
    color: #7c3aed;
}

.dc-ai-header-actions { display: flex; gap: 4px; }

.dc-ai-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.dc-ai-body::-webkit-scrollbar { width: 6px; }
.dc-ai-body::-webkit-scrollbar-track { background: transparent; }
.dc-ai-body::-webkit-scrollbar-thumb { background: #d4c4f0; border-radius: 3px; }

.dc-ai-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
    color: #a78bfa;
}

.dc-ai-placeholder i { font-size: 28px; margin-bottom: 10px; }
.dc-ai-placeholder p { font-size: 13px; color: #7c3aed; font-weight: 500; }

.dc-ai-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
}

.dc-ai-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e9e0ff;
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: dcAiSpin 0.8s linear infinite;
    margin-bottom: 12px;
}

@keyframes dcAiSpin { to { transform: rotate(360deg); } }

.dc-ai-loading p { font-size: 13px; color: #7c3aed; font-weight: 500; }

.dc-ai-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 16px;
    color: #dc3545;
    font-size: 13px;
}

.dc-ai-setup-code {
    background: #1e293b;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 14px;
    font-size: 11px;
    font-family: 'Consolas', monospace;
    white-space: pre-wrap;
    word-break: break-all;
    margin-top: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.dc-ai-response {
    font-size: 13px;
    line-height: 1.7;
    color: #374151;
}

.dc-ai-response p { margin: 0 0 10px; }
.dc-ai-response strong { color: #111827; }

.dc-ai-h {
    color: #7c3aed;
    font-weight: 700;
    margin: 16px 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e9e0ff;
}

h2.dc-ai-h { font-size: 16px; }
h3.dc-ai-h { font-size: 14px; }
h4.dc-ai-h { font-size: 13px; }

.dc-ai-response ul {
    margin: 8px 0;
    padding-left: 20px;
}

.dc-ai-response li {
    margin-bottom: 4px;
    color: #4b5563;
}

.dc-ai-response .dc-ai-section {
    margin: 8px 0;
    padding: 10px 14px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e9e0ff;
}

.dc-ai-code {
    background: #f3f0ff;
    color: #7c3aed;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'Consolas', monospace;
}

.dc-ai-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    margin-top: 12px;
    border-top: 1px solid #e9e0ff;
}

.dc-ai-model {
    font-size: 10px;
    color: #a78bfa;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dc-ai-copy-btn {
    background: #f3f0ff;
    border: 1px solid #e9e0ff;
    color: #7c3aed;
    font-size: 11px;
    padding: 3px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Jost', sans-serif;
    transition: all 0.2s;
}

.dc-ai-copy-btn:hover { background: #7c3aed; color: #fff; }

/* Resize */
.dev-console-resize {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    cursor: ns-resize;
    z-index: 1;
    border-radius: 16px 16px 0 0;
}

.dev-console-resize:hover { background: linear-gradient(180deg, rgba(25,135,84,0.15), transparent); }

@media (max-width: 900px) {
    .dev-console-panel {
        width: calc(100vw - 16px);
        height: calc(100vh - 16px);
        height: calc(100dvh - 16px);
        min-width: auto;
        border-radius: 12px;
    }
    .dev-console-toolbar { flex-direction: column; gap: 8px; }
    .dev-console-search { flex: 1 1 100%; }