:root {
    --bg-base: #060913;
    --bg-surface: #0b1120;
    --bg-card: rgba(15, 23, 42, 0.75);
    --bg-card-hover: rgba(30, 41, 59, 0.85);
    --bg-elevated: #1e293b;
    --border-subtle: rgba(148, 163, 184, 0.12);
    --border-focus: rgba(6, 182, 212, 0.5);
    --border-glow: 0 0 15px rgba(6, 182, 212, 0.25);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --cyan-primary: #06b6d4;
    --cyan-glow: rgba(6, 182, 212, 0.35);
    --blue-accent: #3b82f6;
    --emerald-safe: #10b981;
    --amber-warning: #f59e0b;
    --rose-danger: #f43f5e;
    --purple-tech: #8b5cf6;
    --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-base);
    background-image:
        radial-gradient(circle at 15% 15%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(139, 92, 246, 0.06) 0%, transparent 45%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

.app-header {
    background: rgba(11, 17, 32, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

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

.brand-icon-wrapper {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(59, 130, 246, 0.15));
    border: 1px solid rgba(6, 182, 212, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-svg { width: 26px; height: 26px; }

.brand-title {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #ffffff;
}

.accent-text { color: var(--cyan-primary); }

.brand-subtitle {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 400;
}

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

.status-pill {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(30, 41, 59, 0.7);
    color: #e2e8f0;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.status-model-btn { cursor: pointer; transition: border-color 0.2s ease, background 0.2s ease; }
.status-model-btn:hover { border-color: var(--cyan-primary); background: rgba(30, 41, 59, 0.95); }

.metric-clickable { cursor: pointer; transition: border-color 0.2s ease, transform 0.2s ease; }
.metric-clickable:hover { border-color: rgba(6, 182, 212, 0.5); transform: translateY(-1px); }

.status-active .dot-indicator {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--emerald-safe);
}

.status-info { color: var(--cyan-primary); border-color: rgba(6, 182, 212, 0.3); }
.status-info .dot-indicator {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--cyan-primary);
}

.status-server { color: var(--purple-tech); border-color: rgba(139, 92, 246, 0.3); }

.main-content {
    flex: 1;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.metric-card {
    background: var(--bg-card);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.9rem 1.15rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.metric-card:hover { border-color: rgba(6, 182, 212, 0.5); transform: translateY(-1px); }

.metric-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.cyan-tint    { background: rgba(6, 182, 212, 0.15); }
.emerald-tint { background: rgba(16, 185, 129, 0.15); }
.amber-tint   { background: rgba(245, 158, 11, 0.15); }
.purple-tint  { background: rgba(139, 92, 246, 0.15); }

.metric-data { display: flex; flex-direction: column; }
.metric-value { font-size: 1rem; font-weight: 700; color: #ffffff; }
.metric-label { font-size: 0.78rem; color: var(--text-secondary); }

.workspace-grid {
    display: grid;
    grid-template-columns: 410px 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .workspace-grid { grid-template-columns: 1fr; }
}

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    transition: var(--transition);
}

.panel-card { margin-bottom: 1.25rem; }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-subtitle { font-size: 0.82rem; color: var(--text-secondary); margin-top: 0.2rem; }

.badge-tag {
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: var(--cyan-primary);
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.25);
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
}

.upload-dropzone {
    border: 2px dashed rgba(6, 182, 212, 0.35);
    border-radius: var(--radius-md);
    padding: 1.75rem 1rem;
    text-align: center;
    background: rgba(6, 182, 212, 0.03);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
    border-color: var(--cyan-primary);
    background: rgba(6, 182, 212, 0.06);
}

.file-input-hidden {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.drop-icon { margin-bottom: 0.65rem; }
.drop-title { font-weight: 600; font-size: 0.95rem; color: #ffffff; margin-bottom: 0.3rem; }
.drop-desc { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 1rem; }

.selected-file-info {
    margin-top: 0.85rem;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.file-meta { display: flex; align-items: center; gap: 0.5rem; overflow: hidden; }

.file-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--cyan-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 210px;
}

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

.form-group { margin-bottom: 1.15rem; }

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-select {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: #ffffff;
    padding: 0.65rem 0.85rem;
    font-family: var(--font-main);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition);
}

.form-select:focus {
    border-color: var(--cyan-primary);
    box-shadow: 0 0 0 2px var(--cyan-glow);
}

.segmented-control {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 4px;
}

.segment-option input { position: absolute; opacity: 0; }

.segment-pill {
    display: block;
    text-align: center;
    padding: 0.5rem 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.segment-pill small { display: block; font-size: 0.68rem; opacity: 0.8; }

.segment-option input:checked + .segment-pill {
    background: var(--cyan-primary);
    color: #04101c;
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.4);
}

.slider-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.35rem; }

.slider-badge {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--cyan-primary);
    background: rgba(6, 182, 212, 0.12);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
}

.form-slider { width: 100%; accent-color: var(--cyan-primary); cursor: pointer; }

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.field-hint { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 0.35rem; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.65rem 1.15rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #06b6d4, #2563eb);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover { box-shadow: 0 6px 20px rgba(6, 182, 212, 0.5); transform: translateY(-1px); }

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

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

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

.btn-outline:hover { color: #ffffff; border-color: var(--text-secondary); }

.btn-block { width: 100%; }
.btn-pulse { position: relative; overflow: hidden; }

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
}

.btn-icon:hover { color: var(--rose-danger); }

.visualizer-card { display: flex; flex-direction: column; margin-bottom: 1.5rem; }

.visualizer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.view-mode-tabs {
    display: flex;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 3px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.45rem 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn.active {
    background: var(--cyan-primary);
    color: #04101c;
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.4);
}

.canvas-display-wrapper {
    position: relative;
    min-height: 420px;
    background: #030712;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-stage {
    padding: 3rem 1.5rem;
    text-align: center;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.scanner-radar {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: 1px solid rgba(148, 163, 184, 0.25);
    margin-bottom: 1.25rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.5);
}

.radar-cross::before, .radar-cross::after {
    content: '';
    position: absolute;
    background: rgba(6, 182, 212, 0.4);
}
.radar-cross::before { width: 28px; height: 1.5px; }
.radar-cross::after  { height: 28px; width: 1.5px; }

.empty-stage h3 { font-size: 1.15rem; color: #ffffff; margin-bottom: 0.5rem; }
.empty-stage p  { font-size: 0.85rem; color: var(--text-secondary); }

.stage-viewports {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    height: 100%;
    gap: 1px;
    background: var(--border-subtle);
}

.stage-viewports.single-view { grid-template-columns: 1fr; }

.frame-container {
    background: #000000;
    position: relative;
    display: flex;
    flex-direction: column;
}

.frame-label {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    padding: 0.5rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle);
    z-index: 5;
}

.toggle-bbox-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: 0.72rem;
    color: var(--cyan-primary);
}

.intensity-legend { display: flex; align-items: center; gap: 0.4rem; font-size: 0.7rem; color: var(--text-muted); }

.legend-bar {
    width: 48px;
    height: 7px;
    border-radius: 4px;
    background: linear-gradient(90deg, #000084, #00ffff, #ffff00, #ff0000);
}

.image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.responsive-endoscopy-img {
    max-width: 100%;
    max-height: 440px;
    object-fit: contain;
    display: block;
    user-select: none;
}

.bbox-overlay-layer { position: absolute; inset: 0; pointer-events: none; }

.bbox-rect {
    position: absolute;
    border: 2px solid #f43f5e;
    background: rgba(244, 63, 94, 0.12);
    border-radius: 4px;
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(6, 9, 19, 0.88);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.loading-spinner-box { text-align: center; max-width: 320px; }

.medical-pulse-spinner {
    width: 58px;
    height: 58px;
    margin: 0 auto 1.25rem;
    border: 3px solid rgba(6, 182, 212, 0.15);
    border-top: 3px solid var(--cyan-primary);
    border-right: 3px solid var(--purple-tech);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text { font-weight: 600; color: #ffffff; font-size: 0.95rem; margin-bottom: 0.35rem; }
.loading-sub  { font-size: 0.78rem; font-family: var(--font-mono); color: var(--cyan-primary); }

.roi-summary-bar {
    background: rgba(15, 23, 42, 0.6);
    border-top: 1px solid var(--border-subtle);
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.roi-summary-title { font-size: 0.82rem; display: flex; align-items: center; gap: 0.5rem; }

.badge-count {
    background: rgba(6, 182, 212, 0.15);
    color: var(--cyan-primary);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
}

.roi-tags-list { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.roi-chip {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.25);
    color: #ff859b;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}

.diagnostic-card { display: flex; flex-direction: column; gap: 1.35rem; }

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

.card-kicker { font-size: 0.72rem; font-family: var(--font-mono); color: var(--cyan-primary); letter-spacing: 0.06em; }

.diag-title { font-size: 1.6rem; font-weight: 800; color: #ffffff; margin: 0.2rem 0 0.5rem; }

.diag-meta-pills { display: flex; gap: 0.5rem; align-items: center; }

.category-pill {
    font-size: 0.78rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.06);
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
}

.urgency-pill { font-size: 0.78rem; font-weight: 700; padding: 0.25rem 0.75rem; border-radius: var(--radius-full); }
.urgency-high   { background: rgba(244, 63, 94, 0.18);  color: var(--rose-danger);    border: 1px solid rgba(244, 63, 94, 0.35); }
.urgency-medium { background: rgba(245, 158, 11, 0.18); color: var(--amber-warning);  border: 1px solid rgba(245, 158, 11, 0.35); }
.urgency-low    { background: rgba(16, 185, 129, 0.18); color: var(--emerald-safe);   border: 1px solid rgba(16, 185, 129, 0.35); }

.confidence-gauge { display: flex; align-items: center; justify-content: center; }

.confidence-circle {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    background: conic-gradient(var(--cyan-primary) calc(var(--percent, 0) * 1%), rgba(255, 255, 255, 0.08) 0);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.25);
}

.confidence-circle::before {
    content: '';
    position: absolute;
    width: 72px;
    height: 72px;
    background: var(--bg-surface);
    border-radius: 50%;
}

.confidence-number {
    position: relative;
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    font-family: var(--font-mono);
}

.confidence-label { position: absolute; bottom: 12px; font-size: 0.65rem; color: var(--text-muted); }

.diag-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 768px) {
    .diag-details-grid { grid-template-columns: 1fr; }
}

.detail-box {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.1rem;
}

.recommendation-box {
    border-color: rgba(16, 185, 129, 0.25);
    background: rgba(16, 185, 129, 0.04);
}

.detail-box-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.45rem;
}

.detail-text { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.55; }

.xai-reasoning-card {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.08), rgba(139, 92, 246, 0.08));
    border: 1px solid rgba(6, 182, 212, 0.25);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.reasoning-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.65rem; }
.reasoning-title-group { display: flex; align-items: center; gap: 0.45rem; }
.reasoning-title-group h4 { font-size: 0.92rem; font-weight: 700; color: #ffffff; }
.sparkle-icon { font-size: 1.1rem; }

.xai-engine-tag {
    font-size: 0.7rem;
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--cyan-primary);
    background: rgba(6, 182, 212, 0.15);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
}

.reasoning-text { font-size: 0.85rem; color: #e2e8f0; line-height: 1.6; margin-bottom: 0.95rem; }

.xai-tech-stats {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 0.75rem;
}

.stat-item { font-size: 0.78rem; display: flex; align-items: center; gap: 0.45rem; }
.stat-lbl  { color: var(--text-secondary); }
.stat-val  { font-family: var(--font-mono); font-weight: 700; color: var(--cyan-primary); }

.distribution-section {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.15rem;
}

.distribution-title { font-size: 0.85rem; font-weight: 700; color: #ffffff; margin-bottom: 0.9rem; }
.bars-container { display: flex; flex-direction: column; gap: 0.65rem; }
.bar-row { display: flex; flex-direction: column; gap: 0.25rem; }
.bar-header { display: flex; justify-content: space-between; font-size: 0.78rem; }
.bar-name { font-weight: 600; color: var(--text-secondary); }
.bar-name.active-pred { color: #ffffff; font-weight: 700; }
.bar-percent { font-family: var(--font-mono); color: #ffffff; font-weight: 600; }
.bar-track { width: 100%; height: 8px; background: rgba(255, 255, 255, 0.06); border-radius: var(--radius-full); overflow: hidden; }
.bar-fill { height: 100%; border-radius: var(--radius-full); transition: width 0.75s cubic-bezier(0.16, 1, 0.3, 1); }

.actions-strip { display: flex; gap: 0.75rem; flex-wrap: wrap; border-top: 1px solid var(--border-subtle); padding-top: 1rem; }

.catalog-section { margin-top: 1.5rem; }
.section-heading { margin-bottom: 1.25rem; }
.section-title { font-size: 1.35rem; font-weight: 800; color: #ffffff; }
.section-subtitle { font-size: 0.85rem; color: var(--text-secondary); margin-top: 0.25rem; }

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

.catalog-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: var(--transition);
}

.catalog-card:hover { border-color: var(--cyan-primary); transform: translateY(-2px); }

.catalog-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.65rem; }
.catalog-card-title { font-size: 0.95rem; font-weight: 700; color: #ffffff; }
.catalog-card-desc { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 0.85rem; line-height: 1.5; }

.catalog-card-rec {
    font-size: 0.78rem;
    background: rgba(255, 255, 255, 0.04);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--emerald-safe);
    border-left: 3px solid var(--emerald-safe);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 7, 15, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

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

.report-brand h3 { font-size: 1.15rem; font-weight: 700; color: #ffffff; }
.report-subtitle { font-size: 0.75rem; color: var(--text-secondary); }

.btn-close { background: transparent; border: none; color: var(--text-muted); font-size: 1.6rem; cursor: pointer; line-height: 1; }
.btn-close:hover { color: #ffffff; }

.modal-body { padding: 1.5rem; overflow-y: auto; font-size: 0.88rem; }

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

.report-view-table { width: 100%; border-collapse: collapse; margin-bottom: 1.25rem; }
.report-view-table td { padding: 0.55rem 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.report-view-table td:first-child { width: 38%; color: var(--text-secondary); font-weight: 500; }
.report-view-table td:last-child { color: #ffffff; font-weight: 600; }

.report-section-block {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1rem;
}

.report-section-block h5 { font-size: 0.85rem; font-weight: 700; color: var(--cyan-primary); margin-bottom: 0.4rem; }

.report-disclaimer {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
    font-style: italic;
    border-left: 2px solid var(--amber-warning);
    padding-left: 0.75rem;
}

.app-footer {
    border-top: 1px solid var(--border-subtle);
    background: rgba(11, 17, 32, 0.7);
    padding: 1.5rem;
    margin-top: 3rem;
}

.footer-container {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

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

.status-eval-btn {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(59, 130, 246, 0.25));
    border: 1px solid rgba(6, 182, 212, 0.5) !important;
    color: #38bdf8 !important;
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition);
}

.status-eval-btn:hover {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.4), rgba(59, 130, 246, 0.4));
    box-shadow: 0 0 16px rgba(6, 182, 212, 0.4);
    transform: translateY(-1px);
}

.eval-report-card { max-width: 920px; max-height: 90vh; overflow-y: auto; }

.eval-dataset-banner {
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.25);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.eval-dataset-banner h4 { color: var(--cyan-primary); font-size: 1.05rem; margin-bottom: 0.35rem; }
.eval-dataset-banner p  { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 0.85rem; }

.split-pills-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.split-pill { font-size: 0.8rem; font-weight: 600; padding: 0.35rem 0.85rem; border-radius: 9999px; }
.split-pill.train { background: rgba(59, 130, 246, 0.2); border: 1px solid rgba(59, 130, 246, 0.4); color: #60a5fa; }
.split-pill.val   { background: rgba(234, 179, 8, 0.2);  border: 1px solid rgba(234, 179, 8, 0.4);  color: #facc15; }
.split-pill.test  { background: rgba(16, 185, 129, 0.2); border: 1px solid rgba(16, 185, 129, 0.4); color: #34d399; }

.eval-section-title { color: var(--text-primary); font-size: 1rem; font-weight: 700; margin: 1.25rem 0 0.75rem; }

.eval-table { width: 100%; border-collapse: collapse; margin-bottom: 1.25rem; font-size: 0.85rem; }
.eval-table th {
    background: rgba(15, 23, 42, 0.8);
    color: var(--text-muted);
    font-weight: 600;
    text-align: left;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--border-subtle);
}
.eval-table td { padding: 0.65rem 0.85rem; border-bottom: 1px solid rgba(255, 255, 255, 0.05); color: var(--text-secondary); }
.best-model-row { background: rgba(6, 182, 212, 0.1); }

.badge-best {
    background: #eab308;
    color: #000;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    margin-left: 6px;
}

.stat-highlight { color: #38bdf8; font-size: 0.95rem; }

.confusion-matrix-section {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.cm-header-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1rem; }

.cm-arch-tabs { display: flex; gap: 0.35rem; background: rgba(0, 0, 0, 0.4); padding: 3px; border-radius: 8px; }

.cm-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.cm-tab-btn.active { background: var(--cyan-primary); color: #030712; }

.cm-table-wrapper { overflow-x: auto; margin-bottom: 1.25rem; }

.cm-matrix-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; text-align: center; }
.cm-matrix-table th { background: rgba(15, 23, 42, 0.9); padding: 0.6rem; border: 1px solid rgba(255, 255, 255, 0.08); color: var(--text-muted); }
.cm-matrix-table td { padding: 0.6rem; border: 1px solid rgba(255, 255, 255, 0.08); font-weight: 600; }

.cm-diagonal { background: rgba(16, 185, 129, 0.25); color: #34d399; font-size: 0.95rem; font-weight: 800; }
.cm-off      { background: rgba(244, 63, 94, 0.15); color: #fb7185; }
.cm-zero     { background: rgba(255, 255, 255, 0.02); color: var(--text-muted); }

.text-emerald { color: #34d399; font-weight: 700; }

.eval-formulas-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-top: 1rem;
}

.eval-formulas-box h5 { color: var(--text-secondary); font-size: 0.82rem; margin-bottom: 0.65rem; }

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

.formula-item code {
    display: block;
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.2);
    color: #38bdf8;
    padding: 0.4rem 0.65rem;
    border-radius: 4px;
    font-size: 0.76rem;
    font-family: var(--font-mono);
}

.status-upload-btn {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.4);
    color: #c084fc;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.status-upload-btn:hover {
    background: rgba(168, 85, 247, 0.3);
    border-color: #c084fc;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.label-with-action { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.35rem; }

.btn-text-action {
    background: transparent;
    border: none;
    color: #a855f7;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    transition: var(--transition);
}

.btn-text-action:hover { color: #c084fc; text-decoration: underline; }

.model-manage-card { max-width: 720px; }

.upload-model-box {
    border: 2px dashed rgba(168, 85, 247, 0.4);
    background: rgba(168, 85, 247, 0.04);
    border-radius: var(--radius-md);
    padding: 2rem 1.5rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    margin-bottom: 1.25rem;
}

.upload-model-box:hover, .upload-model-box.dragover {
    border-color: #a855f7;
    background: rgba(168, 85, 247, 0.08);
    transform: scale(1.01);
}

.upload-icon-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.upload-model-box h4 { font-size: 1.1rem; color: #ffffff; margin-bottom: 0.35rem; }
.upload-model-box p  { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 1rem; }

.upload-model-box code {
    color: #c084fc;
    background: rgba(168, 85, 247, 0.12);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-family: var(--font-mono);
}

.model-selected-info {
    margin-top: 1rem;
    padding: 0.6rem 1rem;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-sm);
    color: #34d399;
    font-size: 0.82rem;
    font-weight: 600;
}

.upload-progress-container { margin-bottom: 1.25rem; }

.progress-bar-wrapper {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 0.45rem;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #a855f7, #06b6d4);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

#model-upload-status-text { font-size: 0.78rem; color: var(--text-secondary); font-family: var(--font-mono); }

.models-server-list h4 { font-size: 0.92rem; color: #ffffff; margin-bottom: 0.75rem; font-weight: 700; }

.models-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
    max-height: 220px;
    overflow-y: auto;
    margin-bottom: 1.25rem;
}

.model-server-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.model-server-item:hover  { border-color: #a855f7; }
.model-server-item.active { border-color: #10b981; background: rgba(16, 185, 129, 0.06); }

.model-item-info { display: flex; flex-direction: column; gap: 0.2rem; }

.model-item-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.model-item-sub { font-size: 0.75rem; color: var(--text-muted); font-family: var(--font-mono); }

.badge-custom-h5 {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
    font-size: 0.68rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-weight: 700;
}

.badge-active-pill {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    font-weight: 700;
}

.btn-select-model {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.btn-select-model:hover { background: var(--bg-elevated); color: #ffffff; border-color: #a855f7; }

.kaggle-guidance-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-subtle);
    border-left: 3px solid #a855f7;
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
}

.guidance-header { font-size: 0.82rem; font-weight: 700; color: #c084fc; margin-bottom: 0.25rem; }
.kaggle-guidance-card p { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.45; }

.kaggle-guidance-card code {
    color: #38bdf8;
    background: rgba(6, 182, 212, 0.1);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-family: var(--font-mono);
}

.empty-stage-small {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
    padding: 1.5rem;
}

@media print {
    body { background: #ffffff !important; color: #000000 !important; }
    .app-header, .metrics-bar, .control-panel, .visualizer-header .view-mode-tabs, .actions-strip, .catalog-section, .app-footer, .modal-footer, .btn-close { display: none !important; }
    .modal-backdrop { position: static !important; background: none !important; padding: 0 !important; }
    .modal-card { border: none !important; box-shadow: none !important; max-width: 100% !important; color: #000000 !important; }
    .report-view-table td { color: #000000 !important; border-bottom: 1px solid #ddd !important; }
    .report-section-block { border: 1px solid #ccc !important; background: #f9f9f9 !important; color: #000000 !important; }
}
