/* ==========================================================================
   NSFW Check Web - Modern Glassmorphism & High Performance Dark Theme
   ========================================================================== */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  /* Color Palette */
  --bg-primary: #090d16;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.72);
  --bg-card-hover: rgba(31, 41, 55, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);

  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-cyan: #06b6d4;

  /* Classification Severity Colors */
  --color-l1: #10b981; /* Emerald: Normal */
  --color-l1-glow: rgba(16, 185, 129, 0.25);
  --color-l2: #f59e0b; /* Amber: Suggestive */
  --color-l2-glow: rgba(245, 158, 11, 0.25);
  --color-l3: #f97316; /* Orange: Sensual */
  --color-l3-glow: rgba(249, 115, 22, 0.25);
  --color-l4: #f43f5e; /* Rose: Explicit */
  --color-l4-glow: rgba(244, 63, 94, 0.25);

  /* Radius & Shadows */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.3);

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

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100%;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Ambient Background Glows */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
}

.glow-1 {
  width: 500px;
  height: 500px;
  top: -100px;
  left: -100px;
  background: radial-gradient(circle, var(--accent-primary), transparent 70%);
}

.glow-2 {
  width: 600px;
  height: 600px;
  bottom: -150px;
  right: -100px;
  background: radial-gradient(circle, var(--accent-secondary), transparent 70%);
}

.glow-3 {
  width: 400px;
  height: 400px;
  top: 40%;
  left: 60%;
  background: radial-gradient(circle, var(--accent-cyan), transparent 70%);
  opacity: 0.2;
}

/* App Container */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  gap: 24px;
}

/* ==========================================================================
   Header & Status Bar
   ========================================================================== */

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 0;
}

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

.logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
  transition: transform var(--transition-normal);
}

.logo-icon:hover {
  transform: scale(1.05) rotate(3deg);
}

.brand-text h1 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-text h1 span {
  background: linear-gradient(135deg, #a5b4fc, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.version-tag {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(17, 24, 39, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  backdrop-filter: blur(12px);
  transition: all var(--transition-normal);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-pill.loading .status-dot {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
  animation: pulse-dot 1.5s infinite;
}

.status-pill.ready {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.1);
}

.status-pill.ready .status-dot {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.status-pill.error {
  border-color: rgba(244, 63, 94, 0.4);
  background: rgba(244, 63, 94, 0.1);
}

.status-pill.error .status-dot {
  background: #f43f5e;
  box-shadow: 0 0 8px #f43f5e;
}

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

.icon-btn {
  background: rgba(17, 24, 39, 0.8);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

/* ==========================================================================
   Navigation Tabs
   ========================================================================== */

.app-nav {
  display: flex;
  gap: 8px;
  background: rgba(17, 24, 39, 0.6);
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  overflow-x: auto;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-normal);
}

.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.nav-tab.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(139, 92, 246, 0.25));
  border: 1px solid rgba(99, 102, 241, 0.4);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.2);
}

/* ==========================================================================
   Cards & Layout
   ========================================================================== */

.app-main {
  flex: 1;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

.grid-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

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

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.card-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
}

/* Protocol Warning Banner */
.protocol-warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 0.82rem;
  color: #fde68a;
  line-height: 1.5;
}

.protocol-warning.hidden {
  display: none;
}

.warning-icon {
  font-size: 1.2rem;
}

.warning-text strong {
  color: #fbbf24;
}

.warning-action {
  margin-top: 6px;
  font-size: 0.8rem;
}

.warning-link {
  color: #38bdf8;
  text-decoration: underline;
  cursor: pointer;
  font-weight: 600;
}

.warning-link:hover {
  color: #7dd3fc;
}

/* ==========================================================================
   Drop Zone & Single Upload
   ========================================================================== */

.drop-zone {
  border: 2px dashed rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.03);
  border-radius: var(--radius-md);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.08);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.drop-btn-wrap {
  margin-top: 14px;
}

.drop-action-btn {
  margin: 0 auto;
}

.file-input-hidden {
  display: none;
}

.drop-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: rgba(99, 102, 241, 0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
}

.drop-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.drop-title .highlight {
  color: #818cf8;
  text-decoration: underline;
}

.drop-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

kbd {
  display: inline-block;
  padding: 2px 6px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

/* Sample Images Section */
.sample-section {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

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

.sample-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sample-btn {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sample-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Single Preview Container */
.preview-box {
  margin-top: 20px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
}

.preview-box.hidden {
  display: none;
}

.preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

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

.preview-image-wrapper {
  max-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: repeating-conic-gradient(#1e293b 0% 25%, #0f172a 0% 50%) 50% / 16px 16px;
}

.preview-image-wrapper img {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
}

/* ==========================================================================
   Prediction Hero & Probability Meters
   ========================================================================== */

.result-badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.result-badge.empty {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.result-badge.l1 {
  background: var(--color-l1-glow);
  color: var(--color-l1);
  border: 1px solid var(--color-l1);
  box-shadow: 0 0 15px var(--color-l1-glow);
}

.result-badge.l2 {
  background: var(--color-l2-glow);
  color: var(--color-l2);
  border: 1px solid var(--color-l2);
  box-shadow: 0 0 15px var(--color-l2-glow);
}

.result-badge.l3 {
  background: var(--color-l3-glow);
  color: var(--color-l3);
  border: 1px solid var(--color-l3);
  box-shadow: 0 0 15px var(--color-l3-glow);
}

.result-badge.l4 {
  background: var(--color-l4-glow);
  color: var(--color-l4);
  border: 1px solid var(--color-l4);
  box-shadow: 0 0 15px var(--color-l4-glow);
}

.hero-prediction {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.hero-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.hero-class-name {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.hero-class-sub {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.hero-score-val {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fff;
  text-align: right;
}

/* Probability Bars */
.probability-bars-section h4,
.timing-section h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.prob-row {
  margin-bottom: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all var(--transition-normal);
}

.prob-row:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-subtle);
}

.prob-row.active-winner {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.08);
}

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

.prob-tag {
  font-size: 0.82rem;
  font-weight: 600;
}

.tag-l1 { color: var(--color-l1); }
.tag-l2 { color: var(--color-l2); }
.tag-l3 { color: var(--color-l3); }
.tag-l4 { color: var(--color-l4); }

.prob-num {
  font-size: 0.85rem;
  font-family: var(--font-mono);
  font-weight: 700;
}

.prob-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.prob-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.fill-l1 { background: linear-gradient(90deg, #059669, #10b981); }
.fill-l2 { background: linear-gradient(90deg, #d97706, #f59e0b); }
.fill-l3 { background: linear-gradient(90deg, #ea580c, #f97316); }
.fill-l4 { background: linear-gradient(90deg, #e11d48, #f43f5e); }

.prob-logit {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-top: 4px;
}

/* Timing Breakdown */
.timing-section {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
}

.fps-badge {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 2px 8px;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border-radius: var(--radius-full);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.timing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.timing-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-align: center;
}

.timing-card.highlight-total {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.1);
}

.timing-name {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.timing-value {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #fff;
}

.timing-value small {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-secondary);
}

/* ==========================================================================
   Buttons & Controls
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition-normal);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-text {
  background: transparent;
  color: var(--text-muted);
}

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

.btn-sm {
  padding: 4px 10px;
  font-size: 0.75rem;
}

/* ==========================================================================
   Batch Processing Styles
   ========================================================================== */

.batch-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.batch-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.batch-progress-container {
  background: rgba(0, 0, 0, 0.3);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.batch-progress-container.hidden {
  display: none;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-cyan));
  border-radius: var(--radius-full);
  transition: width 0.2s ease;
}

.table-responsive {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.batch-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}

.batch-table th {
  background: rgba(0, 0, 0, 0.4);
  padding: 12px 14px;
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--border-subtle);
}

.batch-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.batch-table tr:last-child td {
  border-bottom: none;
}

.batch-table tr:hover:not(.empty-row) {
  background: rgba(255, 255, 255, 0.02);
}

.empty-row td {
  text-align: center;
  padding: 48px;
  color: var(--text-muted);
}

.batch-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  background: #1e293b;
  display: block;
}

/* ==========================================================================
   Camera View
   ========================================================================== */

.camera-stream-wrapper {
  position: relative;
  width: 100%;
  min-height: 380px;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#camera-video {
  width: 100%;
  height: auto;
  max-height: 450px;
  object-fit: contain;
}

.camera-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cam-guide-box {
  width: 280px;
  height: 280px;
  border: 2px dashed rgba(99, 102, 241, 0.5);
  border-radius: var(--radius-md);
}

.cam-fps-tag {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(0, 0, 0, 0.7);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: #10b981;
}

/* ==========================================================================
   Inspection / Debug View
   ========================================================================== */

.inspect-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.inspect-box {
  flex: 1;
  min-width: 260px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.inspect-box h4 {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.inspect-canvas-wrap {
  width: 240px;
  height: 240px;
  background: repeating-conic-gradient(#1e293b 0% 25%, #0f172a 0% 50%) 50% / 16px 16px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.inspect-canvas-wrap.highlight-border {
  border: 2px solid rgba(99, 102, 241, 0.6);
}

.inspect-canvas-wrap canvas {
  max-width: 100%;
  max-height: 100%;
}

.inspect-caption {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-top: 10px;
}

.inspect-arrow {
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tensor-box {
  align-items: stretch;
}

.tensor-info-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.78rem;
  font-family: var(--font-mono);
}

.tensor-row {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
}

.tensor-row code {
  color: #a5b4fc;
}

.tensor-sample-header {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tensor-sample-box {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px;
  font-size: 0.7rem;
  color: #34d399;
  word-break: break-all;
  max-height: 90px;
  overflow-y: auto;
}

/* ==========================================================================
   Settings Modal
   ========================================================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  z-index: 101;
  max-width: 480px;
  width: 100%;
  padding: 24px;
}

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

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.form-group {
  margin-bottom: 16px;
}

.form-group.hidden {
  display: none;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.85rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-control:focus {
  border-color: var(--accent-primary);
}

.modal-footer {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 12px 18px;
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 10px;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast.success { border-color: rgba(16, 185, 129, 0.4); }
.toast.error { border-color: rgba(244, 63, 94, 0.4); }
.toast.info { border-color: rgba(99, 102, 241, 0.4); }

/* ==========================================================================
   Footer
   ========================================================================== */

.app-footer {
  margin-top: auto;
  padding-top: 20px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}
