/* ==========================================================================
   CVLAB PRO — 7-in-1 Interactive Computer Vision Pipeline Suite
   Design System: Deep Cyber-Industrial Dark UI / Precision HUD / Glassmorphism
   Includes "Predict & Watch What Happens" Hypothesis Challenge Engine Styling
   ========================================================================== */

:root {
  --bg-deep: #050811;
  --bg-main: #080d1a;
  --bg-panel: #0d1527;
  --bg-card: #131c33;
  --bg-card-hover: #172340;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(56, 189, 248, 0.28);
  --border-amber: rgba(245, 158, 11, 0.35);
  --border-cyan: #38bdf8;
  
  --accent-cyan: #38bdf8;
  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-purple: #a855f7;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-red: #ef4444;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Outfit', var(--font-sans);
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-pill: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.2);

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset & Typography */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-deep);
  background-image: 
    radial-gradient(ellipse at 15% 0%, rgba(56, 189, 248, 0.09) 0%, transparent 60%),
    radial-gradient(ellipse at 85% 100%, rgba(99, 102, 241, 0.07) 0%, transparent 60%);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  user-select: none;
}

/* ==========================================================================
   TOP NAVIGATION BAR (7 APPLICATIONS)
   ========================================================================== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: rgba(8, 13, 26, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-glow);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  gap: 16px;
  flex-wrap: wrap;
}

/* ==========================================================================
   NOTESKART PORTAL & FORWARD/BACKWARD NAVIGATION
   ========================================================================== */
.nk-nav-portal {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-nk-portal {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22) 0%, rgba(56, 189, 248, 0.15) 100%);
  border: 1px solid rgba(99, 102, 241, 0.45);
  color: #e0e7ff;
  padding: 6px 12px;
  border-radius: 8px;
  font-family: var(--font-sans, 'Inter', sans-serif);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-decoration: none;
  transition: all 0.22s ease;
  white-space: nowrap;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.15);
}

.btn-nk-portal:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35) 0%, rgba(56, 189, 248, 0.28) 100%);
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateX(-2px);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.35);
}

.nk-portal-arrow {
  font-size: 0.95rem;
  transition: transform 0.2s ease;
}

.btn-nk-portal:hover .nk-portal-arrow {
  transform: translateX(-3px);
}

.nk-portal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
}

.nk-history-btns {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(15, 23, 42, 0.6);
  padding: 2px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-nk-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: transparent;
  border: none;
  border-radius: 5px;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.btn-nk-step:hover {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  transform: scale(1.08);
}

.btn-nk-step:active {
  transform: scale(0.95);
}

.btn-nk-sublink {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 6px 10px;
  border-radius: 8px;
  font-family: var(--font-sans, 'Inter', sans-serif);
  font-size: 0.76rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-nk-sublink:hover {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.4);
  color: #ffffff;
}

.nk-portal-sep {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 4px;
}

/* Noteskart Hub Dropdown Menu */
.nk-dropdown-wrap {
  position: relative;
  display: inline-block;
}

.btn-nk-hub {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #bae6fd;
  padding: 6px 12px;
  border-radius: 8px;
  font-family: var(--font-sans, 'Inter', sans-serif);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-nk-hub:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.hub-caret {
  transition: transform 0.2s ease;
}

.nk-dropdown-wrap.open .hub-caret {
  transform: rotate(180deg);
}

.nk-hub-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: rgba(10, 15, 30, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 12px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6), 0 0 25px rgba(56, 189, 248, 0.15);
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 1000;
  animation: hubMenuFadeIn 0.18s ease-out forwards;
}

.nk-dropdown-wrap.open .nk-hub-menu {
  display: flex;
}

@keyframes hubMenuFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.nk-hub-header {
  padding: 8px 12px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 4px;
}

.nk-hub-header strong {
  display: block;
  color: #ffffff;
  font-size: 0.82rem;
  letter-spacing: 0.4px;
}

.nk-hub-header small {
  color: #94a3b8;
  font-size: 0.7rem;
}

.nk-hub-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #e2e8f0;
  text-decoration: none;
  transition: all 0.15s ease;
}

.nk-hub-item:hover {
  background: rgba(56, 189, 248, 0.14);
  color: #ffffff;
  transform: translateX(3px);
}

.hub-item-icon {
  font-size: 1rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.hub-item-text {
  display: flex;
  flex-direction: column;
}

.hub-item-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #f1f5f9;
}

.hub-item-text small {
  font-size: 0.68rem;
  color: #94a3b8;
}

@media (max-width: 640px) {
  .nk-portal-title { display: none; }
  .btn-nk-sublink span { display: none; }
  .btn-nk-hub span { display: none; }
  .nk-hub-menu { right: -40px; width: 260px; }
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  position: relative;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  box-shadow: 0 0 14px var(--accent-cyan);
}

.brand-rings {
  position: absolute;
  inset: 0;
  border: 1.5px dashed rgba(56, 189, 248, 0.5);
  border-radius: 50%;
  animation: spinRing 12s linear infinite;
}

@keyframes spinRing {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.brand-text strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-text strong span { color: var(--accent-cyan); }

.version-tag {
  font-size: 0.65rem;
  font-weight: 800;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
}

.brand-text small {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* 7 Application Tab Buttons */
.app-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 4px;
  scrollbar-width: none;
}
.app-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.tab-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-dim);
}

.tab-btn:hover {
  background: rgba(56, 189, 248, 0.1);
  color: var(--text-main);
  border-color: rgba(56, 189, 248, 0.3);
}

.tab-btn:hover .tab-num {
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.18);
}

.tab-btn.active {
  background: linear-gradient(135deg, #0284c7 0%, #1d4ed8 100%);
  color: #ffffff;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.35);
}

.tab-btn.active .tab-num {
  background: rgba(0, 0, 0, 0.28);
  color: #e0f2fe;
}

/* Global Utilities & Score Pill */
.top-utils {
  display: flex;
  align-items: center;
  gap: 10px;
}

.score-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}

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

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.score-label {
  color: #a7f3d0;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.score-pill strong {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: #34d399;
}

.btn-util {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-util:hover {
  background: rgba(56, 189, 248, 0.15);
  color: var(--text-main);
  border-color: var(--accent-cyan);
}

.util-svg {
  width: 17px;
  height: 17px;
}

.btn-speed {
  width: auto;
  padding: 0 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
}

/* ==========================================================================
   PIPELINE STAGE STEPPER BAR
   ========================================================================== */
.stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  background: #090e1b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  gap: 14px;
  flex-wrap: wrap;
}

.stage-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.stage-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #111827;
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.stage-badge {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
}

.stage-btn:hover {
  background: #172033;
  color: var(--text-main);
  border-color: rgba(56, 189, 248, 0.3);
}

.stage-btn.active {
  background: rgba(56, 189, 248, 0.18);
  color: #e0f2fe;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.28);
}

.stage-btn.active .stage-badge {
  background: var(--accent-cyan);
  color: #050811;
}

.stage-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: #fde047;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  padding: 5px 12px;
  border-radius: var(--radius-md);
  max-width: 650px;
}

.hint-icon { font-size: 0.95rem; }

/* ==========================================================================
   MAIN WORKSPACE LAYOUT
   ========================================================================== */
.workspace {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
  padding: 14px 20px 24px;
  flex: 1;
}

/* Left: Interactive 2D Vision Sandbox */
.vision-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-md);
}

.canvas-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.canvas-title-group h2 {
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.canvas-title-group p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 3px;
}

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

.tech-badge {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-arch {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--accent-cyan);
}

.badge-annot {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--accent-amber);
}

/* Canvas Viewport Wrap */
.canvas-stage-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 820 / 440;
  background: #02050b;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.85);
}

#vision-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
  touch-action: none;
}

.canvas-overlay-tip {
  position: absolute;
  bottom: 8px;
  right: 12px;
  background: rgba(8, 13, 26, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 11px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.tip-glow {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
}

/* Floating Live Reveal Banner */
.canvas-reveal-banner {
  position: absolute;
  top: 10px;
  left: 12px;
  right: 12px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(10px);
  border: 1px solid #fbbf24;
  color: #fef08a;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  display: none;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6), 0 0 15px rgba(245, 158, 11, 0.3);
  animation: slideBanner 0.25s ease;
}

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

.reveal-badge {
  background: #f59e0b;
  color: #1c1917;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
}

.annot-mode-banner {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(245, 158, 11, 0.92);
  color: #1c1917;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.4);
  pointer-events: none;
}

.alert-flash-overlay {
  position: absolute;
  inset: 0;
  background: rgba(239, 68, 68, 0.25);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.alert-flash-overlay.active {
  opacity: 1;
  animation: pulseFlash 0.5s alternate infinite;
}

@keyframes pulseFlash {
  from { opacity: 0.15; }
  to { opacity: 0.45; }
}

/* ==========================================================================
   PREDICT WHAT WILL HAPPEN CHALLENGE DOCK
   ========================================================================== */
.predict-dock {
  background: linear-gradient(180deg, rgba(21, 30, 52, 0.95), rgba(13, 20, 36, 0.95));
  border: 1px solid var(--border-amber);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.predict-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.predict-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.predict-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 8px #fbbf24;
}

.predict-tag {
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fbbf24;
  text-transform: uppercase;
}

.btn-reset-sim {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-reset-sim:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--text-main);
  border-color: var(--accent-cyan);
}

.predict-question {
  font-size: 0.88rem;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.4;
}

.predict-choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.choice-btn {
  background: rgba(26, 36, 56, 0.95);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.3);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
  line-height: 1.35;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.choice-btn strong {
  color: var(--accent-cyan);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.choice-btn:hover {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.15);
  transform: translateY(-1px);
}

.choice-btn.correct {
  background: rgba(16, 185, 129, 0.22);
  border-color: var(--accent-emerald);
  color: #a7f3d0;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.choice-btn.correct strong {
  color: #34d399;
}

.choice-btn.wrong {
  background: rgba(239, 68, 68, 0.22);
  border-color: var(--accent-red);
  color: #fecaca;
}

.choice-btn.wrong strong {
  color: #f87171;
}

.predict-feedback {
  display: none;
  font-size: 0.81rem;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  line-height: 1.45;
}

.predict-feedback.show {
  display: block;
  background: rgba(16, 185, 129, 0.1);
  border-left: 3px solid var(--accent-emerald);
  color: #e2e8f0;
}

/* Controls & Hyperparameter Dock */
.controls-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  background: var(--bg-card);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  align-items: center;
}

.control-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.control-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.control-label-row strong {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  font-size: 0.86rem;
}

/* Styled Sliders */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: #1f293d;
  border-radius: var(--radius-pill);
  outline: none;
  cursor: pointer;
  transition: background 0.15s;
}

input[type="range"]:hover { background: #2b3854; }

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border: 2px solid #ffffff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
  cursor: grab;
}

.slider-scale {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  padding: 0 2px;
}

/* Tool Action Buttons */
.tool-actions {
  display: flex;
  gap: 8px;
}

.btn-tool {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-tool:hover {
  background: rgba(56, 189, 248, 0.15);
  color: var(--text-main);
  border-color: var(--accent-cyan);
}

.btn-tool.active {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-amber);
  border-color: var(--accent-amber);
}

/* Scenario Action Buttons */
.scenario-btns {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-act {
  background: rgba(56, 189, 248, 0.12);
  color: #e0f2fe;
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-act:hover {
  background: rgba(56, 189, 248, 0.28);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

.btn-act.danger {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fecaca;
}

/* ==========================================================================
   RIGHT INSPECTOR PANEL (NEURAL ENGINE, 3D FLOW, ANNOTATION CODE, ACTIONS)
   ========================================================================== */
.inspector-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--bg-panel);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.ind-indigo { background: var(--accent-indigo); box-shadow: 0 0 8px var(--accent-indigo); }
.ind-cyan { background: var(--accent-cyan); box-shadow: 0 0 8px var(--accent-cyan); }
.ind-amber { background: var(--accent-amber); box-shadow: 0 0 8px var(--accent-amber); }
.ind-emerald { background: var(--accent-emerald); box-shadow: 0 0 8px var(--accent-emerald); }

.card-head h3 {
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-main);
}

/* CARD 1: Neural Network Engine Diagnostic */
.nn-chip {
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.45);
  color: #c7d2fe;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.nn-diagnostics-body {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
}

.nn-spec-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
}

.nn-spec-label {
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.nn-spec-val {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-main);
  text-align: right;
}

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

.nn-spec-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  text-align: right;
  line-height: 1.3;
}

.nn-alert-box {
  margin-top: 4px;
  background: rgba(56, 189, 248, 0.08);
  border-left: 3px solid var(--accent-cyan);
  padding: 6px 9px;
  border-radius: 4px;
  font-size: 0.74rem;
  color: #e0f2fe;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nn-alert-icon { font-size: 0.85rem; }

/* Interactive Layer Stepper */
.layer-stepper {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.4);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  margin-bottom: 4px;
}

.layer-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 2px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.layer-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.layer-btn.active {
  background: var(--accent-indigo);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

/* Real-Time Layer Feature Activation Row */
.layer-activation-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  margin-bottom: 4px;
}

.activation-canvas-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.act-label {
  font-size: 0.62rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.04em;
}

#nn-layer-canvas {
  width: 58px;
  height: 58px;
  background: #000;
  border: 1.5px solid var(--accent-indigo);
  border-radius: 4px;
  image-rendering: pixelated;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.activation-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
}

.meta-row span {
  color: var(--text-dim);
}

.meta-row strong {
  font-family: var(--font-mono);
  color: var(--text-main);
  font-size: 0.72rem;
}

/* Card 1.5: Target / Defect / Plate Inspector Card */
.card-inspect {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(13, 21, 39, 0.9);
}

.inspect-body {
  padding: 8px 10px;
}

.inspect-crop-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

#inspect-crop-canvas {
  width: 145px;
  height: 80px;
  background: #02050e;
  border: 1.5px solid var(--accent-amber);
  border-radius: 6px;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.25);
  flex-shrink: 0;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.inspect-details {
  flex: 1;
  font-size: 0.73rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.inspect-details strong {
  color: var(--text-main);
  font-family: var(--font-mono);
}

.inspect-hint {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-style: italic;
}


/* 3D Neural Flow Mini-Viewport */
.three-viewport-wrap {
  position: relative;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#three-container {
  width: 100%;
  height: 160px;
  background: #040711;
  display: block;
}

.three-controls-hint {
  position: absolute;
  bottom: 5px;
  left: 7px;
  font-size: 0.65rem;
  color: var(--text-dim);
  background: rgba(4, 7, 17, 0.75);
  padding: 2px 7px;
  border-radius: 4px;
  pointer-events: none;
}

.tensor-spec {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

/* Format Switcher Pills */
.format-pills {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pill-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pill-btn:hover { background: rgba(255, 255, 255, 0.1); color: var(--text-main); }
.pill-btn.active {
  background: rgba(245, 158, 11, 0.18);
  color: var(--accent-amber);
  border-color: var(--accent-amber);
}

.pill-copy {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--accent-cyan);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: 4px;
  transition: all var(--transition-fast);
}

.pill-copy:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: var(--accent-cyan);
}

/* Annotation Code Box */
.code-box {
  background: #050811;
  color: #a7f3d0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.45;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  max-height: 125px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Action Status Pill */
.status-indicator {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.05em;
}

.status-indicator.live {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid var(--accent-emerald);
}

.status-indicator.alert {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid var(--accent-red);
}

/* Action Output Body */
.action-body {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  padding: 12px;
  font-size: 0.81rem;
  min-height: 125px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Metric Display Grid */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  margin-top: 3px;
}

.metric-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.metric-box span {
  font-size: 0.67rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.metric-box strong {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-main);
}

/* e-Challan Ticket & Real-Time Violation Hub */
.challan-ticket {
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.12) 0%, rgba(15, 23, 42, 0.95) 100%);
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 0.76rem;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.15);
  position: relative;
  overflow: hidden;
}

.challan-ticket::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #ef4444, #f59e0b, #ef4444);
}

.challan-ticket.cleared {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.08) 0%, rgba(15, 23, 42, 0.95) 100%);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.12);
}

.challan-ticket.cleared::before {
  background: linear-gradient(90deg, #10b981, #38bdf8, #10b981);
}

.challan-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  padding-bottom: 6px;
}

.challan-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.challan-id {
  font-family: var(--font-mono);
  color: #fca5a5;
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 0.82rem;
}

.challan-ticket.cleared .challan-id {
  color: #6ee7b7;
}

.challan-amt {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  color: #fbbf24;
  font-weight: 900;
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
}

.challan-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 12px;
  background: rgba(0, 0, 0, 0.35);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.challan-row {
  display: flex;
  flex-direction: column;
}

.challan-lbl {
  font-size: 0.65rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.challan-val {
  font-weight: 700;
  color: #f1f5f9;
  font-size: 0.75rem;
}

.challan-val.alert {
  color: #f87171;
}

.challan-val.success {
  color: #34d399;
}

.challan-action-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.btn-pay-fine {
  flex: 1;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0f172a;
  border: none;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 0.76rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
  transition: all 0.18s ease;
}

.btn-pay-fine:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.5);
  filter: brightness(1.08);
}

.btn-violation-action {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.74rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.18s ease;
}

.btn-violation-action:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-1px);
}

.challan-paid-stamp {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.35));
  border: 1px solid #10b981;
  color: #6ee7b7;
  font-weight: 800;
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  text-align: center;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

/* Recent Violations Log Table */
.violations-log-box {
  background: rgba(10, 15, 28, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.violations-log-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 3px;
}

.violations-log-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.70rem;
  font-family: var(--font-mono);
  padding: 2px 0;
  color: #cbd5e1;
}

.violations-log-item .v-plate {
  color: #f59e0b;
  font-weight: 700;
}

.violations-log-item .v-offense {
  color: #ef4444;
}

.violations-log-item .v-fine {
  color: #fbbf24;
  font-weight: 700;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
  pointer-events: none;
}

.toast {
  background: rgba(13, 21, 39, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--accent-cyan);
  color: var(--text-main);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: slideToast 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideToast {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   TAB 0: 3D CNN LENET-5 EXHIBIT & INTERACTIVE DRAWING KIOSK
   ========================================================================== */
#tab-cnn {
  border-color: rgba(168, 85, 247, 0.4);
  background: rgba(168, 85, 247, 0.08);
}

#tab-cnn:hover {
  border-color: var(--accent-purple);
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.35);
}

#tab-cnn.active {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.28) 0%, rgba(56, 189, 248, 0.22) 100%);
  border-color: var(--accent-purple);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.45);
}

#tab-cnn .tab-num {
  background: rgba(168, 85, 247, 0.25);
  color: #d8b4fe;
}

/* CNN Drawing Kiosk Overlay inside Canvas Stage */
.cnn-kiosk-overlay {
  position: absolute;
  inset: 0;
  z-index: 25;
  background: rgba(6, 10, 22, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: stretch;
  padding: 16px;
  gap: 20px;
}

.cnn-pad-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.pad-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 280px;
}

.pad-badge {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--accent-purple);
  background: rgba(168, 85, 247, 0.15);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.draw-canvas-box {
  position: relative;
  width: 280px;
  height: 280px;
  background: #000000;
  border-radius: var(--radius-md);
  border: 1.5px solid rgba(168, 85, 247, 0.45);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8), 0 0 16px rgba(168, 85, 247, 0.2);
  overflow: hidden;
}

#draw-canvas {
  width: 280px;
  height: 280px;
  display: block;
  cursor: crosshair;
  touch-action: none;
}

.canvas-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.85rem;
  font-weight: 500;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.cnn-action-row {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 280px;
}

.btn-primary-glow {
  flex: 1;
  background: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

.btn-primary-glow:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.55);
}

.btn-secondary-glow {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary-glow:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

/* Tensor Preview & Feature Maps */
.cnn-tensor-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.tensor-preview-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.tensor-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.tensor-lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-weight: 600;
}

#preview-28 {
  width: 56px;
  height: 56px;
  background: #000000;
  border: 1.5px solid var(--accent-cyan);
  border-radius: 4px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.quick-digits {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quick-lbl {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.quick-btn-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.btn-digit-preset {
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-digit-preset:hover {
  background: var(--accent-purple);
  color: #ffffff;
  border-color: var(--accent-purple);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.4);
}

.layer-maps-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.maps-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.maps-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.maps-header small {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.conv1-map-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.conv-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.conv-item canvas {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 3px;
  background: #000;
}

.conv-item span {
  font-size: 0.62rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* Softmax Probability Bars in Card 4 */
.prob-bars-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  background: rgba(4, 7, 17, 0.7);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glow);
}

.prob-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.prob-header span {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-main);
}

.cnn-winner-chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.15);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-cyan);
}

.prob-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 18px;
}

.prob-label {
  width: 14px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-align: center;
}

.prob-track {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
}

.prob-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6 0%, #38bdf8 100%);
  border-radius: var(--radius-pill);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease;
}

.prob-fill.winner {
  background: linear-gradient(90deg, #10b981 0%, #38bdf8 100%);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.prob-val {
  width: 42px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  text-align: right;
  font-weight: 600;
}

.hidden { display: none !important; }

/* Responsive */
@media (max-width: 1180px) {
  .workspace { grid-template-columns: 1fr; }
  .predict-choices { grid-template-columns: 1fr; }
  #three-container { height: 200px; }
  .cnn-kiosk-overlay { flex-direction: column; }
  .conv1-map-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ==========================================================================
   TOP RIGHT DYNAMIC ACTION HUB & INTELLIGENT ATC TRAFFIC CONTROLLER
   ========================================================================== */
.card-action {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.05) 0%, rgba(13, 19, 33, 0.95) 100%);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.12);
  position: relative;
}

.card-action::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #10b981, #38bdf8, transparent);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* ATC Dynamic Panel Container */
.atc-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 3-Aspect Traffic Signal Bar */
.atc-signal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.09);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.atc-signal-bar:hover {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.15);
}

.atc-lights-housing {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #0b0f19;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.8);
}

.atc-light-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  opacity: 0.22;
  transition: all 0.25s ease;
  position: relative;
}

.atc-light-dot.red { background: #ef4444; }
.atc-light-dot.yellow { background: #f59e0b; }
.atc-light-dot.green { background: #10b981; }

.atc-light-dot.active.red {
  opacity: 1;
  box-shadow: 0 0 16px #ef4444, inset 0 0 4px #ffffff;
  animation: pulseLight 1.8s infinite alternate;
}

.atc-light-dot.active.yellow {
  opacity: 1;
  box-shadow: 0 0 16px #f59e0b, inset 0 0 4px #ffffff;
  animation: pulseLight 0.8s infinite alternate;
}

.atc-light-dot.active.green {
  opacity: 1;
  box-shadow: 0 0 16px #10b981, inset 0 0 4px #ffffff;
  animation: pulseLight 1.5s infinite alternate;
}

@keyframes pulseLight {
  0% { transform: scale(0.96); filter: brightness(1); }
  100% { transform: scale(1.08); filter: brightness(1.25); }
}

.atc-signal-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 2px;
}

.atc-signal-state-badge {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.atc-signal-state-badge.red { color: #f87171; }
.atc-signal-state-badge.yellow { color: #fbbf24; }
.atc-signal-state-badge.green { color: #34d399; }

.atc-signal-sub {
  font-size: 0.68rem;
  color: var(--text-dim);
}

/* ATC Queue Progress Meter */
.atc-meter-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.atc-meter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.73rem;
}

.atc-meter-title {
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

.atc-meter-ratio {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.92rem;
  color: #38bdf8;
}

.atc-meter-ratio.surge {
  color: #f87171;
  animation: textGlow 1s infinite alternate;
}

.atc-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
}

.atc-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease;
  background: linear-gradient(90deg, #38bdf8 0%, #6366f1 100%);
}

.atc-fill.near {
  background: linear-gradient(90deg, #f59e0b 0%, #ef4444 100%);
}

.atc-fill.triggered {
  background: linear-gradient(90deg, #10b981 0%, #38bdf8 100%);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
}

/* Threshold Setting Stepper & Slider */
.atc-threshold-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  gap: 8px;
}

.atc-threshold-lbl {
  font-size: 0.72rem;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
}

.atc-threshold-lbl strong {
  color: #e2e8f0;
  font-size: 0.76rem;
}

.atc-stepper-ctrls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-stepper {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-stepper:hover {
  background: #334155;
  border-color: #38bdf8;
  color: #38bdf8;
}

.atc-threshold-val {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.95rem;
  color: #38bdf8;
  min-width: 28px;
  text-align: center;
}

/* Quick Action Buttons Grid */
.atc-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.btn-atc-action {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.18s ease;
}

.btn-atc-action:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-atc-action.primary {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(56, 189, 248, 0.25));
  border-color: rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
}

.btn-atc-action.primary:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.45), rgba(56, 189, 248, 0.45));
  color: #ffffff;
}

/* In-Depth Scientific Research Card */
.atc-research-box {
  background: rgba(10, 15, 28, 0.85);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.72rem;
  line-height: 1.45;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.atc-research-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #a5b4fc;
  font-weight: 700;
  font-size: 0.74rem;
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
  padding-bottom: 3px;
}

.atc-research-pill {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  background: rgba(99, 102, 241, 0.2);
  color: #c7d2fe;
  padding: 1px 5px;
  border-radius: 3px;
}

.atc-research-point {
  display: flex;
  align-items: flex-start;
  gap: 5px;
}

.atc-research-point::before {
  content: '▸';
  color: #38bdf8;
  font-weight: bold;
}

/* Iron Man HUD & Factory PPE Dynamic Telemetry */
.hud-status-card {
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  margin: 3px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.hud-status-card.pass {
  background: rgba(6, 78, 59, 0.28);
  border: 1px solid rgba(16, 185, 129, 0.65);
  color: #a7f3d0;
}

.hud-status-card.fail {
  background: rgba(127, 29, 29, 0.32);
  border: 1px solid rgba(239, 68, 68, 0.75);
  color: #fecaca;
  animation: pulseFail 1.2s infinite ease-in-out;
}

@keyframes pulseFail {
  0%, 100% { border-color: rgba(239, 68, 68, 0.6); box-shadow: 0 0 6px rgba(239, 68, 68, 0.2); }
  50% { border-color: rgba(239, 68, 68, 1); box-shadow: 0 0 14px rgba(239, 68, 68, 0.5); }
}

.hud-progress-wrap {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.3);
  margin: 4px 0;
}

.hud-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #00f0ff, #38bdf8, #818cf8);
  box-shadow: 0 0 8px #00f0ff;
  transition: width 0.08s ease;
}

.hud-btn-row {
  display: flex;
  gap: 5px;
  margin-top: 5px;
  flex-wrap: wrap;
}

.btn-hud {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #e0f2fe;
  font-family: var(--font-sans);
  font-size: 0.70rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast);
}

.btn-hud:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: #00f0ff;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-hud.alert {
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

.btn-hud.alert:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: #ef4444;
}

