/* ==========================================================================
   Zoth Tool Nexus & Catalog Explorer — Master Stylesheet
   Full 4-Theme High-Contrast System (Dark, Light, Matrix, Gold)
   100% Vector Icon Integration & High-Density UI Architecture
   ========================================================================== */

/* -------------------------------------------------------------------------- */
/* 1. Theme Tokens & Semantic Color Palette                                  */
/* -------------------------------------------------------------------------- */

:root {
  --nexus-bg: #030408;
  --nexus-surface: rgba(11, 15, 26, 0.88);
  --nexus-surface-card: rgba(14, 20, 34, 0.92);
  --nexus-surface-hover: rgba(22, 30, 50, 0.95);
  --nexus-surface-subtle: rgba(255, 255, 255, 0.03);
  --nexus-border: rgba(0, 240, 255, 0.18);
  --nexus-border-subtle: rgba(255, 255, 255, 0.08);
  --nexus-border-hover: rgba(0, 240, 255, 0.45);
  --nexus-text: #f8fafc;
  --nexus-text-muted: #94a3b8;
  --nexus-text-dim: #64748b;
  --nexus-cyan: #00f0ff;
  --nexus-cyan-glow: rgba(0, 240, 255, 0.25);
  --nexus-gold: #fbbf24;
  --nexus-gold-glow: rgba(251, 191, 36, 0.25);
  --nexus-emerald: #10b981;
  --nexus-emerald-glow: rgba(16, 185, 129, 0.2);
  --nexus-purple: #a855f7;
  --nexus-magenta: #ec4899;
  --nexus-blue: #3b82f6;
  --nexus-amber: #f59e0b;
  --nexus-font-sans: 'Figtree', system-ui, -apple-system, sans-serif;
  --nexus-font-display: 'Syne', sans-serif;
  --nexus-font-mono: 'IBM Plex Mono', monospace;
  --nexus-card-pad: 24px;
  --nexus-radius: 14px;
  --nexus-radius-sm: 8px;
  --nexus-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

/* Solar Light Theme */
html[data-theme="light"] {
  --nexus-bg: #f4f6f9;
  --nexus-surface: #ffffff;
  --nexus-surface-card: #ffffff;
  --nexus-surface-hover: #f8fafc;
  --nexus-surface-subtle: #f1f5f9;
  --nexus-border: #cbd5e1;
  --nexus-border-subtle: #e2e8f0;
  --nexus-border-hover: #0284c7;
  --nexus-text: #0f172a;
  --nexus-text-muted: #475569;
  --nexus-text-dim: #64748b;
  --nexus-cyan: #0284c7;
  --nexus-cyan-glow: rgba(2, 132, 199, 0.15);
  --nexus-gold: #b45309;
  --nexus-gold-glow: rgba(180, 83, 9, 0.15);
  --nexus-emerald: #059669;
  --nexus-emerald-glow: rgba(5, 150, 105, 0.15);
  --nexus-purple: #7c3aed;
  --nexus-magenta: #db2777;
  --nexus-blue: #2563eb;
  --nexus-amber: #d97706;
  --nexus-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

/* Matrix CRT Phosphor Theme */
html[data-theme="matrix"] {
  --nexus-bg: #000803;
  --nexus-surface: rgba(0, 18, 8, 0.94);
  --nexus-surface-card: rgba(0, 24, 10, 0.95);
  --nexus-surface-hover: rgba(0, 36, 16, 0.98);
  --nexus-surface-subtle: rgba(0, 255, 102, 0.05);
  --nexus-border: rgba(0, 255, 102, 0.28);
  --nexus-border-subtle: rgba(0, 255, 102, 0.14);
  --nexus-border-hover: rgba(0, 255, 102, 0.65);
  --nexus-text: #00ff66;
  --nexus-text-muted: #4ade80;
  --nexus-text-dim: #22c55e;
  --nexus-cyan: #00ff66;
  --nexus-cyan-glow: rgba(0, 255, 102, 0.35);
  --nexus-gold: #86efac;
  --nexus-gold-glow: rgba(134, 239, 172, 0.25);
  --nexus-emerald: #00ff66;
  --nexus-emerald-glow: rgba(0, 255, 102, 0.35);
  --nexus-purple: #86efac;
  --nexus-magenta: #4ade80;
  --nexus-blue: #22c55e;
  --nexus-amber: #86efac;
  --nexus-shadow: 0 0 24px rgba(0, 255, 102, 0.12);
}

/* Hermetic Gold Theme */
html[data-theme="gold"] {
  --nexus-bg: #080602;
  --nexus-surface: rgba(22, 17, 7, 0.94);
  --nexus-surface-card: rgba(28, 22, 9, 0.95);
  --nexus-surface-hover: rgba(38, 30, 13, 0.98);
  --nexus-surface-subtle: rgba(251, 191, 36, 0.05);
  --nexus-border: rgba(251, 191, 36, 0.3);
  --nexus-border-subtle: rgba(251, 191, 36, 0.12);
  --nexus-border-hover: rgba(251, 191, 36, 0.65);
  --nexus-text: #fef08a;
  --nexus-text-muted: #fde047;
  --nexus-text-dim: #ca8a04;
  --nexus-cyan: #fef08a;
  --nexus-cyan-glow: rgba(254, 240, 138, 0.3);
  --nexus-gold: #fbbf24;
  --nexus-gold-glow: rgba(251, 191, 36, 0.35);
  --nexus-emerald: #fde047;
  --nexus-emerald-glow: rgba(253, 224, 71, 0.25);
  --nexus-purple: #fbbf24;
  --nexus-magenta: #fef08a;
  --nexus-blue: #fde047;
  --nexus-amber: #f59e0b;
  --nexus-shadow: 0 8px 32px rgba(251, 191, 36, 0.1);
}

/* -------------------------------------------------------------------------- */
/* 2. Global Reset & Container Hygiene                                       */
/* -------------------------------------------------------------------------- */

body.studio-hub {
  background: var(--nexus-bg) !important;
  color: var(--nexus-text) !important;
  font-family: var(--nexus-font-sans);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

/* -------------------------------------------------------------------------- */
/* 3. Hero & Poster Section                                                   */
/* -------------------------------------------------------------------------- */

.tool-nexus-header {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.tool-nexus-title {
  font-family: var(--nexus-font-display);
  font-weight: 800;
  font-size: clamp(2rem, 3.5vw, 3.2rem);
  color: var(--nexus-text);
  margin: 0;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.tool-nexus-badge {
  font-family: var(--nexus-font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--nexus-surface-subtle);
  color: var(--nexus-cyan);
  border: 1px solid var(--nexus-border);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tool-nexus-meta {
  font-size: 1rem;
  color: var(--nexus-text-muted);
  line-height: 1.6;
  margin-top: 12px;
  max-width: 680px;
}

/* -------------------------------------------------------------------------- */
/* 4. Filter, Search & Telemetry Controls                                    */
/* -------------------------------------------------------------------------- */

.studio-filter-section {
  position: sticky;
  top: 54px;
  z-index: 40;
  background: var(--nexus-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--nexus-border);
  padding: 14px clamp(16px, 4vw, 48px);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.studio-filter-wrap {
  max-width: 1560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.filter-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.filter-chip {
  background: var(--nexus-surface-card);
  border: 1px solid var(--nexus-border-subtle);
  color: var(--nexus-text-muted);
  padding: 7px 13px;
  border-radius: 999px;
  font-family: var(--nexus-font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.filter-chip svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.filter-chip .chip-count {
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--nexus-surface-subtle);
  border: 1px solid var(--nexus-border-subtle);
  color: var(--nexus-text-dim);
}

.filter-chip:hover {
  border-color: var(--nexus-border-hover);
  color: var(--nexus-text);
  transform: translateY(-1px);
}

.filter-chip.active {
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--nexus-cyan);
  color: var(--nexus-cyan);
  box-shadow: 0 0 12px var(--nexus-cyan-glow);
}

html[data-theme="light"] .filter-chip.active {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0369a1;
}

html[data-theme="matrix"] .filter-chip.active {
  background: rgba(0, 255, 102, 0.15);
  border-color: #00ff66;
  color: #00ff66;
}

html[data-theme="gold"] .filter-chip.active {
  background: rgba(251, 191, 36, 0.15);
  border-color: #fbbf24;
  color: #fbbf24;
}

.filter-chip.active .chip-count {
  background: var(--nexus-cyan);
  color: #030408;
  border-color: transparent;
  font-weight: 700;
}

html[data-theme="light"] .filter-chip.active .chip-count {
  background: #0284c7;
  color: #ffffff;
}

html[data-theme="matrix"] .filter-chip.active .chip-count {
  background: #00ff66;
  color: #000803;
}

html[data-theme="gold"] .filter-chip.active .chip-count {
  background: #fbbf24;
  color: #080602;
}

/* Secondary runtime / verification filter chips */
.filter-row-secondary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 4px;
}

.runtime-filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.runtime-label {
  font-family: var(--nexus-font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--nexus-text-dim);
  margin-right: 4px;
}

.runtime-chip {
  background: transparent;
  border: 1px solid var(--nexus-border-subtle);
  color: var(--nexus-text-muted);
  padding: 4px 10px;
  border-radius: 6px;
  font-family: var(--nexus-font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.runtime-chip:hover {
  border-color: var(--nexus-border);
  color: var(--nexus-text);
}

.runtime-chip.active {
  background: var(--nexus-surface-card);
  border-color: var(--nexus-cyan);
  color: var(--nexus-cyan);
  font-weight: 700;
}

/* Search Box Container */
.search-box-wrap {
  position: relative;
  min-width: 280px;
  flex: 1 1 320px;
  max-width: 460px;
}

.search-box-wrap input {
  width: 100%;
  background: var(--nexus-surface-card);
  border: 1px solid var(--nexus-border-subtle);
  border-radius: 999px;
  padding: 9px 38px 9px 40px;
  min-height: 42px;
  color: var(--nexus-text);
  font-family: var(--nexus-font-mono);
  font-size: 0.84rem;
  outline: none;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.search-box-wrap input:focus {
  border-color: var(--nexus-cyan);
  box-shadow: 0 0 16px var(--nexus-cyan-glow);
}

.search-icon-svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--nexus-text-muted);
  pointer-events: none;
}

.search-clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--nexus-text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 999px;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.search-clear-btn:hover {
  color: var(--nexus-text);
}

.search-clear-btn svg {
  width: 14px;
  height: 14px;
}

/* View & Action Controls */
.view-mode-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.view-btn {
  background: var(--nexus-surface-card);
  border: 1px solid var(--nexus-border-subtle);
  color: var(--nexus-text-muted);
  padding: 6px 12px;
  border-radius: 8px;
  font-family: var(--nexus-font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.view-btn:hover {
  border-color: var(--nexus-border);
  color: var(--nexus-text);
}

.view-btn.active {
  background: var(--nexus-surface-hover);
  border-color: var(--nexus-cyan);
  color: var(--nexus-cyan);
}

/* -------------------------------------------------------------------------- */
/* 5. Studio Main & High-Density Catalog Grid                                */
/* -------------------------------------------------------------------------- */

.studio-main {
  max-width: 1560px;
  margin: 0 auto;
  padding: 30px clamp(16px, 4vw, 48px) 80px;
}

.section-heading {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.section-heading h2 {
  font-family: var(--nexus-font-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--nexus-text);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.section-heading-meta {
  font-family: var(--nexus-font-mono);
  font-size: 0.82rem;
  color: var(--nexus-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.stamp-quick-link {
  color: var(--nexus-gold);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--nexus-surface-subtle);
  border: 1px solid var(--nexus-border-subtle);
  transition: all 0.15s ease;
}

.stamp-quick-link:hover {
  border-color: var(--nexus-gold);
  background: rgba(251, 191, 36, 0.1);
  transform: translateY(-1px);
}

/* Quick Jump Bar */
.quick-jump-bar {
  background: var(--nexus-surface);
  border: 1px solid var(--nexus-border-subtle);
  border-radius: var(--nexus-radius);
  padding: 16px 20px;
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--nexus-shadow);
}

.quick-jump-info {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.quick-jump-title {
  font-family: var(--nexus-font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--nexus-cyan);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.quick-jump-sub {
  font-size: 0.78rem;
  color: var(--nexus-text-dim);
}

.quick-jump-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-jump-pill {
  background: var(--nexus-surface-card);
  border: 1px solid var(--nexus-border-subtle);
  color: var(--nexus-text-muted);
  padding: 6px 12px;
  border-radius: 999px;
  font-family: var(--nexus-font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.quick-jump-pill:hover {
  border-color: var(--nexus-border-hover);
  color: var(--nexus-text);
  transform: translateY(-1px);
}

.quick-jump-pill svg {
  width: 13px;
  height: 13px;
  color: var(--nexus-cyan);
}

/* Category Accordion / Group Structure */
.ws-group {
  margin-bottom: 36px;
  background: var(--nexus-surface);
  border: 1px solid var(--nexus-border-subtle);
  border-radius: var(--nexus-radius);
  overflow: hidden;
  box-shadow: var(--nexus-shadow);
  transition: border-color 0.2s ease;
}

.ws-group:hover {
  border-color: var(--nexus-border);
}

.ws-group-header {
  padding: 16px 24px;
  background: var(--nexus-surface-card);
  border-bottom: 1px solid var(--nexus-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.ws-group-header:hover {
  background: var(--nexus-surface-hover);
}

.ws-group-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ws-group-icon-box {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--nexus-surface-subtle);
  border: 1px solid var(--nexus-border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--nexus-cyan);
  flex-shrink: 0;
}

.ws-group-icon-box svg {
  width: 18px;
  height: 18px;
}

.ws-group-title {
  font-family: var(--nexus-font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--nexus-text);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.ws-group-count {
  font-family: var(--nexus-font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--nexus-surface-subtle);
  border: 1px solid var(--nexus-border-subtle);
  color: var(--nexus-text-muted);
}

.ws-group-toggle-icon {
  width: 18px;
  height: 18px;
  color: var(--nexus-text-dim);
  transition: transform 0.2s ease;
}

.ws-group.collapsed .ws-group-toggle-icon {
  transform: rotate(-90deg);
}

.ws-group.collapsed .ws-cards-container {
  display: none;
}

.ws-cards-container {
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 18px;
}

/* -------------------------------------------------------------------------- */
/* 6. Tool Workstation Card — Elevated High-Density Layout                   */
/* -------------------------------------------------------------------------- */

.ws-card {
  background: var(--nexus-surface-card);
  border: 1px solid var(--nexus-border-subtle);
  border-radius: var(--nexus-radius);
  padding: var(--nexus-card-pad);
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.2s ease,
              box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
}

html[data-theme="light"] .ws-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);
}

.ws-card:hover {
  transform: translateY(-2px);
  border-color: var(--nexus-border-hover);
  box-shadow: 0 10px 30px var(--nexus-cyan-glow);
}

html[data-theme="light"] .ws-card:hover {
  border-color: #0284c7;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.12);
}

/* Card Top Strip: Category Badge + Verification + Star */
.ws-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ws-badge-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--nexus-font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--nexus-surface-subtle);
  border: 1px solid var(--nexus-border-subtle);
  color: var(--nexus-cyan);
}

.ws-badge-cat svg {
  width: 12px;
  height: 12px;
}

.ws-card-head-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ws-contract-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--nexus-font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--nexus-emerald);
}

.ws-contract-badge svg {
  width: 11px;
  height: 11px;
}

.ws-star-btn {
  background: transparent;
  border: none;
  color: var(--nexus-text-dim);
  cursor: pointer;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, transform 0.15s ease;
}

.ws-star-btn:hover {
  color: var(--nexus-gold);
  transform: scale(1.15);
}

.ws-star-btn.starred {
  color: var(--nexus-gold);
}

.ws-star-btn svg {
  width: 16px;
  height: 16px;
}

/* Tool Title & Description */
.ws-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ws-title {
  font-family: var(--nexus-font-display);
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--nexus-text);
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.ws-desc {
  font-size: 0.85rem;
  color: var(--nexus-text-muted);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* CLI Command Box */
.ws-cli-box {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--nexus-border-subtle);
  border-radius: var(--nexus-radius-sm);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--nexus-font-mono);
  font-size: 0.74rem;
  color: var(--nexus-cyan);
}

html[data-theme="light"] .ws-cli-box {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #0f172a;
}

html[data-theme="matrix"] .ws-cli-box {
  background: #000c05;
  border: 1px solid rgba(0, 255, 102, 0.2);
  color: #00ff66;
}

html[data-theme="gold"] .ws-cli-box {
  background: #140f05;
  border: 1px solid rgba(251, 191, 36, 0.2);
  color: #fef08a;
}

.ws-cli-code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: all;
}

.ws-cli-copy-btn {
  background: transparent;
  border: none;
  color: var(--nexus-text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.ws-cli-copy-btn:hover {
  color: var(--nexus-text);
  background: var(--nexus-surface-subtle);
}

.ws-cli-copy-btn svg {
  width: 13px;
  height: 13px;
}

/* Runtime Execution Badges */
.ws-runtime-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.rt-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--nexus-font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--nexus-surface-subtle);
  border: 1px solid var(--nexus-border-subtle);
  color: var(--nexus-text-muted);
}

.rt-badge svg {
  width: 10px;
  height: 10px;
}

.rt-badge.rt-node { color: #a78bfa; border-color: rgba(167, 139, 250, 0.3); background: rgba(167, 139, 250, 0.08); }
.rt-badge.rt-python { color: #fde047; border-color: rgba(253, 224, 71, 0.3); background: rgba(253, 224, 71, 0.08); }
.rt-badge.rt-rust { color: #f97316; border-color: rgba(249, 115, 22, 0.3); background: rgba(249, 115, 22, 0.08); }
.rt-badge.rt-shell { color: #94a3b8; border-color: rgba(148, 163, 184, 0.3); background: rgba(148, 163, 184, 0.08); }
.rt-badge.rt-vite { color: #f43f5e; border-color: rgba(244, 63, 94, 0.3); background: rgba(244, 63, 94, 0.08); }
.rt-badge.rt-astro { color: #fb923c; border-color: rgba(251, 146, 60, 0.3); background: rgba(251, 146, 60, 0.08); }
.rt-badge.rt-go { color: #38bdf8; border-color: rgba(56, 189, 248, 0.3); background: rgba(56, 189, 248, 0.08); }
.rt-badge.rt-frontend { color: #34d399; border-color: rgba(52, 211, 153, 0.3); background: rgba(52, 211, 153, 0.08); }
.rt-badge.rt-wasm { color: #818cf8; border-color: rgba(129, 140, 248, 0.3); background: rgba(129, 140, 248, 0.08); }

/* Card Actions Footer */
.ws-card-footer {
  border-top: 1px solid var(--nexus-border-subtle);
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

.ws-action-btn {
  background: var(--nexus-surface-subtle);
  border: 1px solid var(--nexus-border-subtle);
  color: var(--nexus-text-muted);
  padding: 6px 12px;
  border-radius: 6px;
  font-family: var(--nexus-font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  text-decoration: none;
}

.ws-action-btn:hover {
  border-color: var(--nexus-border);
  color: var(--nexus-text);
  background: var(--nexus-surface-hover);
}

.ws-action-btn.btn-primary {
  color: var(--nexus-cyan);
  border-color: var(--nexus-border);
}

.ws-action-btn.btn-primary:hover {
  background: rgba(0, 240, 255, 0.12);
  box-shadow: 0 0 10px var(--nexus-cyan-glow);
}

.ws-action-btn svg {
  width: 12px;
  height: 12px;
}

/* -------------------------------------------------------------------------- */
/* 7. Modal Inspector & Execution Simulator                                  */
/* -------------------------------------------------------------------------- */

.zoth-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(3, 4, 8, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.zoth-modal-backdrop[hidden] {
  display: none !important;
}

.zoth-modal-dialog {
  background: var(--nexus-surface);
  border: 1px solid var(--nexus-border);
  border-radius: var(--nexus-radius);
  width: 100%;
  max-width: 840px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.75);
  overflow: hidden;
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.zoth-modal-header {
  padding: 18px 24px;
  background: var(--nexus-surface-card);
  border-bottom: 1px solid var(--nexus-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.zoth-modal-header h2 {
  font-family: var(--nexus-font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--nexus-text);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.modal-header-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--nexus-surface-subtle);
  border: 1px solid var(--nexus-border-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--nexus-cyan);
}

.modal-header-icon svg {
  width: 16px;
  height: 16px;
}

.zoth-modal-close {
  background: transparent;
  border: none;
  color: var(--nexus-text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.zoth-modal-close:hover {
  color: var(--nexus-text);
  background: var(--nexus-surface-subtle);
}

/* Modal Navigation Tabs */
.modal-nav-tabs {
  display: flex;
  border-bottom: 1px solid var(--nexus-border-subtle);
  background: var(--nexus-surface-card);
  padding: 0 24px;
  gap: 4px;
}

.modal-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 11px 14px;
  font-family: var(--nexus-font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--nexus-text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.modal-tab-btn:hover {
  color: var(--nexus-text);
}

.modal-tab-btn.active {
  color: var(--nexus-cyan);
  border-bottom-color: var(--nexus-cyan);
}

.zoth-modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
}

.modal-tab-pane {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.modal-tab-pane.active {
  display: flex;
}

.modal-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-field-label {
  font-family: var(--nexus-font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--nexus-cyan);
}

.modal-field-value {
  font-size: 0.92rem;
  color: var(--nexus-text);
  line-height: 1.5;
  word-break: break-word;
}

.modal-field-value.mono {
  font-family: var(--nexus-font-mono);
  font-size: 0.82rem;
  color: var(--nexus-text-muted);
}

/* Modal Schema JSON Box */
.modal-code-viewer {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--nexus-border-subtle);
  border-radius: var(--nexus-radius-sm);
  padding: 14px;
  font-family: var(--nexus-font-mono);
  font-size: 0.78rem;
  color: #a78bfa;
  overflow-x: auto;
  line-height: 1.5;
  max-height: 240px;
}

html[data-theme="light"] .modal-code-viewer {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #475569;
}

/* Interactive Simulator Terminal Console */
.sim-console-wrap {
  background: #000803;
  border: 1px solid var(--nexus-border);
  border-radius: var(--nexus-radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sim-console-bar {
  background: rgba(0, 24, 10, 0.9);
  padding: 8px 14px;
  border-bottom: 1px solid var(--nexus-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sim-console-title {
  font-family: var(--nexus-font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--nexus-emerald);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sim-run-btn {
  background: var(--nexus-emerald);
  color: #030408;
  border: none;
  padding: 5px 12px;
  border-radius: 4px;
  font-family: var(--nexus-font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.sim-run-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.sim-console-output {
  padding: 14px;
  font-family: var(--nexus-font-mono);
  font-size: 0.78rem;
  line-height: 1.55;
  color: #00ff66;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.zoth-modal-footer {
  padding: 14px 24px;
  background: var(--nexus-surface-card);
  border-top: 1px solid var(--nexus-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--nexus-font-mono);
  font-size: 0.72rem;
  color: var(--nexus-text-dim);
}

/* -------------------------------------------------------------------------- */
/* 8. Dense Table View Mode                                                  */
/* -------------------------------------------------------------------------- */

.ws-dense-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.ws-dense-table th {
  font-family: var(--nexus-font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--nexus-cyan);
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--nexus-border);
  background: var(--nexus-surface-card);
}

.ws-dense-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--nexus-border-subtle);
  color: var(--nexus-text);
  vertical-align: middle;
}

.ws-dense-table tr:hover td {
  background: var(--nexus-surface-hover);
}

/* -------------------------------------------------------------------------- */
/* 9. Responsive Adjustments                                                 */
/* -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .modal-grid-2col {
    grid-template-columns: 1fr;
  }
  .ws-cards-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .studio-filter-section {
    padding: 10px 14px;
  }
  .ws-card {
    padding: 18px;
  }
  .search-box-wrap {
    min-width: 100%;
  }
}
