/**
 * Design System - Matching React Webapp
 * This file contains color tokens, typography, and visual effects.
 * It mirrors the design system from webapp/src/index.css
 */

/* ==========================================================================
   CSS Custom Properties (Design Tokens)
   ========================================================================== */

:root {
  /* Deep Dark Theme "Neo-Glass" */
  --background: #050506;
  --foreground: #ededed;

  --card: rgba(20, 20, 22, 0.6);
  --card-foreground: #ededed;

  --popover: #0a0a0b;
  --popover-foreground: #ededed;

  --primary: #7eb831;
  --primary-foreground: #ffffff;

  --secondary: #1e1e24;
  --secondary-foreground: #ededed;

  --muted: #1e1e24;
  --muted-foreground: #a1a1aa;

  --accent: #27272a;
  --accent-foreground: #ededed;

  --destructive: #7f1d1d;
  --destructive-hover: #f87171;
  --destructive-foreground: #fef2f2;

  --border: #27272a;
  --input: #27272a;
  --ring: #7eb831;

  /* Derived tokens for utility colors */
  --primary-hover: #6aa828;
  --arena-surface: rgba(255, 255, 255, 0.05);
  --arena-accent: #7eb831;

  /* RGB variants for alpha utilities */
  --background-rgb: 5, 5, 6;
  --foreground-rgb: 237, 237, 237;
  --card-rgb: 20, 20, 22;
  --secondary-rgb: 30, 30, 36;
  --muted-rgb: 30, 30, 36;
  --border-rgb: 39, 39, 42;
  --input-rgb: 39, 39, 42;
  --accent-rgb: 39, 39, 42;
  --primary-rgb: 126, 184, 49;
  --primary-foreground-rgb: 255, 255, 255;
  --muted-foreground-rgb: 161, 161, 170;
  --destructive-rgb: 127, 29, 29;
  --arena-accent-rgb: 126, 184, 49;

  --radius: 0.75rem;

  /* Chart colors */
  --chart-1: #7eb831;
  --chart-2: #db2777;
  --chart-3: #ea580c;
  --chart-4: #ca8a04;
  --chart-5: #16a34a;

  /* Mesh inspection issue highlights (used by Three.js via getComputedStyle) */
  --mesh-issue-dim: #ff2626;
  --mesh-issue-dim-opacity: 0.9;
  --mesh-issue-dim-vertex: #ff2626;
  --mesh-issue-focus: #ffd363;
  --mesh-issue-focus-opacity: 1;
  --mesh-issue-focus-vertex: #fbbf24;

  /* Connected component highlight */
  --mesh-component-focus: #fbbf24;
  --mesh-component-dim: #3f3f46;

  /* Wireframe-only mode color */
  --mesh-wireframe-only-color: #606060;

  /* Sidebar widths */
  --sidebar-width: 16rem;
  --sidebar-collapsed-width: 4rem;

  /* =========================================================================
       Sizing Tokens (Tailwind-like)
       ========================================================================= */

  /* Heights - for inputs, buttons, controls */
  --h-8: 32px;
  --h-9: 36px;
  --h-10: 40px;
  --h-12: 48px;

  /* Border Radii (numerical: 1=4px, 2=6px, 3=10px, 4=12px, 5=16px) */
  --radius-1: 4px;
  --radius-2: 6px;
  --radius-3: 10px;
  --radius-4: 12px;
  --radius-5: 16px;
  --radius-full: 9999px;

  /* Spacing (padding/margin) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-2xl: 24px;

  /* Font Sizes */
  --text-xs: 11px;
  --text-sm: 13px;
  --text-md: 14px;
  --text-lg: 16px;
  --text-xl: 18px;
  --text-2xl: 20px;
  --text-3xl: 24px;

  /* Font Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* Icon Sizes */
  --icon-3: 0.75rem;
  --icon-4: 1rem;
  --icon-5: 1.25rem;
  --icon-6: 1.5rem;

  /* Component-specific Sizes */
  --nav-item-py: 0.625rem;
  --toggle-height: 1.375rem;
  --toggle-knob-offset: 2px;
  --toggle-knob-translate: 1.125rem;
  --progress-height: 3px;
  --floating-min-width: 200px;
  --floating-min-height: 150px;
  --content-max-width: 80rem;

  /* Breakpoints (for reference - used in @media queries) */
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;

  /* Z-Index Layers */
  --z-base: 0;
  --z-content: 1;
  --z-sticky: 10;
  --z-floating: 200;
  --z-overlay: 300;
  --z-toast: 400;
  --z-system: 1000;

  /* Transition Durations */
  --duration-fast: 150ms;
  --duration-normal: 200ms;
  --duration-slow: 300ms;
  --duration-slower: 500ms;

  /* =========================================================================
       Overlay & Transparency Tokens
       ========================================================================= */

  --overlay-light: rgba(255, 255, 255, 0.03);
  --overlay-subtle: rgba(255, 255, 255, 0.05);
  --overlay-hover: rgba(255, 255, 255, 0.1);
  --overlay-active: rgba(255, 255, 255, 0.15);
  --overlay-dark: rgba(0, 0, 0, 0.1);
  --overlay-darker: rgba(0, 0, 0, 0.2);
  --overlay-darkest: rgba(0, 0, 0, 0.3);
  --overlay-backdrop: rgba(0, 0, 0, 0.6);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-light: rgba(255, 255, 255, 0.1);

  /* Scrollbar Colors */
  --scrollbar-thumb: #72a62e;
  --scrollbar-track: rgba(39, 39, 42, 0.3);

  /* Derived Colors (shades of primary) */
  --primary-dark: #6fa028;
  --primary-light: #a3e635;
  --accent-pink: #ec4899;
  --accent-purple: rgba(109, 40, 217, 0.15);
  --accent-pink-subtle: rgba(219, 39, 119, 0.05);

  /* Blue accent color (for highlights, info states) */
  --blue-500: #3b82f6;
  --blue-500-rgb: 59, 130, 246;

  /* Image/Content Backgrounds */
  --bg-image: #0a0a0a;
  --bg-shimmer: #2a2a34;

  /* =========================================================================
       Glass Panel Tokens
       Used for floating windows, modals, and overlay panels
       ========================================================================= */

  --glass-bg: rgba(10, 10, 11, 0.85);
  --glass-bg-lighter: rgba(10, 10, 11, 0.6);
  --glass-blur: 16px;
  --glass-blur-light: 12px;
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-light: rgba(255, 255, 255, 0.06);
  --glass-highlight: rgba(255, 255, 255, 0.03);
  --glass-highlight-hover: rgba(255, 255, 255, 0.1);
  --glass-highlight-active: rgba(255, 255, 255, 0.15);
  --glass-input-bg: rgba(0, 0, 0, 0.3);
  --glass-input-bg-focus: rgba(0, 0, 0, 0.4);
  --glass-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);

  /* Focus ring and glow effects (derived from --primary) */
  --ring-glow: rgba(126, 184, 49, 0.2);
  --ring-glow-strong: rgba(126, 184, 49, 0.25);
  --primary-glow: rgba(126, 184, 49, 0.3);
  --primary-glow-strong: rgba(126, 184, 49, 0.4);
  --primary-glow-intense: rgba(126, 184, 49, 0.5);
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  border-color: var(--border);
}

html {
  /* Prevent content shift when scrollbar appears/disappears */
  scrollbar-gutter: stable;
}

body {
  font-family:
    'Inter',
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image:
    radial-gradient(circle at 50% 0%, var(--accent-purple) 0%, transparent 50%),
    radial-gradient(circle at 0% 50%, var(--accent-pink-subtle) 0%, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
  margin: 0;
}

button {
  background: transparent;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
}

/* ==========================================================================
   Typography
   ========================================================================== */

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

.font-mono {
  font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
}

/* ==========================================================================
   Glass Morphism Effects
   ========================================================================== */

.glass-panel {
  background: var(--glass-bg-lighter);
  backdrop-filter: blur(var(--glass-blur-light));
  -webkit-backdrop-filter: blur(var(--glass-blur-light));
  border: 1px solid var(--glass-border);
}

.glass-card {
  background: linear-gradient(145deg, var(--overlay-light) 0%, rgba(255, 255, 255, 0.01) 100%);
  backdrop-filter: blur(var(--glass-blur-light));
  -webkit-backdrop-filter: blur(var(--glass-blur-light));
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 30px var(--overlay-dark);
}

.glow-text {
  text-shadow: 0 0 20px var(--primary);
}

/* ==========================================================================
   Custom Scrollbar
   ========================================================================== */

::-webkit-scrollbar {
  width: var(--space-sm);
  height: var(--space-sm);
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: var(--radius-1);
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: var(--radius-1);
  border: 1px solid var(--scrollbar-track);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.wordmark {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  padding-right: var(--space-sm); /* Match nav-item text spacing */
  background: linear-gradient(to right, var(--primary), var(--accent-pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */

.main-content {
  position: relative; /* Containing block for dialogs */
  flex: 1;
  height: 100vh;
  min-width: 0; /* Prevent flex item from growing beyond container */
  overflow: hidden; /* Never scrolls — #page-content scrolls instead */
}

.content-container {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-2xl);
}

/* Full-width content container - no max-width or padding constraints */
.content-container-full {
  width: 100%;
  height: 100%;
  min-height: calc(100vh - var(--space-2xl));
}

/* Page content is the scroll container (dialogs sit above via position:absolute on .main-content) */
#page-content {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ==========================================================================
   Global Backdrop (for dialogs, modals - scoped to main content area)
   ========================================================================== */

/* Lock page scroll when any dialog is open */
.main-content:has(dialog[open]) > #page-content {
  overflow: hidden;
}

/* ==========================================================================
   Card Styles
   ========================================================================== */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--card-foreground);
  box-shadow: 0 1px 3px var(--overlay-dark);
}

.card-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-2xl);
}

.card-title {
  font-size: var(--text-3xl);
  font-weight: var(--font-semibold);
  line-height: 1;
  letter-spacing: -0.025em;
}

.card-description {
  font-size: var(--text-md);
  color: var(--muted-foreground);
}

.card-content {
  padding: var(--space-2xl);
  padding-top: 0;
}

.card-footer {
  display: flex;
  align-items: center;
  padding: var(--space-2xl);
  padding-top: 0;
}

/* ==========================================================================
   Button Styles
   ========================================================================== */

.btn,
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: var(--radius-2);
  font-size: var(--text-md);
  font-weight: var(--font-medium);
  transition: all var(--duration-fast) ease;
  cursor: pointer;
  border: none;
  outline: none;
  text-decoration: none;
}

.btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.btn:disabled {
  pointer-events: none;
  opacity: 0.5;
}

/* Button variants */
.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.btn-secondary:hover {
  background: rgba(30, 30, 36, 0.8);
}

.btn-destructive {
  background: var(--destructive);
  color: var(--destructive-foreground);
}

.btn-destructive:hover {
  background: var(--destructive-hover);
}

/* ==========================================================================
   Dialog Styles
   ========================================================================== */

.dialog {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%; /* Override UA fit-content — fill containing block */
  height: 100%;
  max-width: none; /* Override UA max-width */
  max-height: none; /* Override UA max-height */
  margin: 0;
  padding: 0;
  border: none;
  outline: none; /* Remove browser focus outline on dialog */
  color: var(--foreground); /* Override UA light-theme text color */
  /* Dialog element IS the backdrop — dark overlay + blur */
  background: var(--overlay-backdrop);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: var(--z-overlay);
}
/* Hide native ::backdrop (we use the dialog element itself) */
.dialog::backdrop {
  display: none;
}

.dialog[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: dialog-backdrop-in var(--duration-normal) ease;
}
/* Animate the content panel (zoom in), not the backdrop */
.dialog[open] > .dialog-content {
  animation: dialog-open var(--duration-normal) ease;
}

.dialog-content {
  /* Layout only - use .glass-panel or .glass-card for background styling */
  border-radius: var(--radius-5);
  padding: var(--space-2xl);
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
}

/* Dialog width sizes - consistent 1.5x progression */
.dialog-content-sm {
  width: 320px;
}
.dialog-content-md {
  width: 480px;
}
.dialog-content-lg {
  width: 640px;
}
.dialog-content-xl {
  width: 960px;
}
.dialog-content-full {
  width: 95vw;
  max-width: 1600px;
}

/* Dialog with header/body layout (removes padding, adds flex column) */
.dialog-content-panel {
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* Explicit height for tall dialogs */
.dialog-content-tall {
  height: 90vh;
}

/* Panel layout: fixed header + scrollable body (use with .dialog-content-panel) */
.dialog-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.dialog-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
}

/* Alert layout: centered icon, title, text, actions */
.dialog-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-md);
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
}

.dialog-icon > svg {
  width: 24px;
  height: 24px;
}

.dialog-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--foreground);
  margin-bottom: var(--space-sm);
}

.dialog-text {
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  line-height: 1.5;
}

.dialog-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

@keyframes dialog-backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes dialog-open {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ==========================================================================
   Disclosure / Collapsible
   Native <details>/<summary> styling for expandable content sections.
   ========================================================================== */

/* Base disclosure container */
.disclosure {
  border: 1px solid var(--border);
  overflow: hidden;
  transition:
    border-color var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease;
}

.disclosure[open]:not(.is-closing) {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(var(--primary-rgb), 0.35);
}

/* Summary/title bar - no border, just background */
.disclosure > summary {
  list-style: none;
  cursor: pointer;
  background: var(--secondary);
}

.disclosure > summary::-webkit-details-marker {
  display: none;
}

/* Disclosure trigger (structure + behavior only, use utilities for sizing/colors) */
.disclosure-trigger {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

/* Icon sizing inside trigger */
.disclosure-trigger svg {
  width: var(--icon-4);
  height: var(--icon-4);
}

/* Variant: primary accent border */
.disclosure-primary {
  border-color: rgba(var(--primary-rgb), 0.2);
}

.disclosure-primary .disclosure-trigger {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
  border-color: rgba(var(--primary-rgb), 0.3);
}

.disclosure-primary .disclosure-trigger:hover {
  border-color: var(--primary);
}

/* Reusable chevron icon (down arrow) */
.icon-chevron {
  display: inline-block;
  width: var(--icon-4);
  height: var(--icon-4);
  background-color: currentColor;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

/* Chevron rotation for disclosure triggers */
.disclosure-chevron {
  transition: transform var(--duration-normal) ease;
}

.disclosure[open]:not(.is-closing) .disclosure-chevron {
  transform: rotate(180deg);
}

/* Animated content container — used inside <details class="disclosure">
   JS in launcher.js drives height/opacity transitions for smooth open/close.
   This class provides the CSS-only enter animation fallback. */
.disclosure-content {
  overflow: hidden;
}

/* CSS-only enter animation for pages without JS disclosure handler */
@keyframes disclosure-enter {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.disclosure[open] > .disclosure-content:not([style]) {
  animation: disclosure-enter 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.btn-outline {
  border: 1px solid var(--input);
  background: transparent;
  color: var(--foreground);
}

.btn-outline:hover {
  background: var(--accent);
  color: var(--accent-foreground);
}

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

.btn-ghost:hover {
  background: var(--overlay-subtle);
  color: var(--foreground);
}

/* Icon-only buttons (use height tokens) */
.btn-icon {
  padding: 0;
  flex-shrink: 0;
}

/* Utility for icon-only or icon+span button alignment */
.btn-icon-center {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.btn-icon-center > span,
.btn-icon-center > svg {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

/* Icon sizing utilities moved to icon-library.css */

/* ==========================================================================
   Input Styles
   ========================================================================== */

.input {
  display: flex;
  width: 100%;
  border-radius: var(--radius-2);
  border: 1px solid var(--input);
  background: var(--overlay-darker);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--text-md);
  color: var(--foreground);
  transition:
    border-color var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease;
}

.input::placeholder {
  color: var(--muted-foreground);
}

.input:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 2px var(--ring-glow-strong);
}

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

/* Input Dark Variant - darker background for forms on dark surfaces */
.input-dark {
  background: var(--background);
  border-color: var(--border);
}

.input-dark:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(126, 184, 49, 0.1);
}

/* Input Group - horizontal layout for input + button combinations */
.input-group {
  display: flex;
  gap: var(--space-sm);
  align-items: stretch;
  width: 100%;
  flex-wrap: nowrap;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.input-group > .input {
  flex: 1 1 0;
  min-width: 0;
}

.input-group > .input-fixed {
  flex: 0 0 auto;
}

/* Ghost button variant for input groups */
.btn-input-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 0 var(--space-md);
  height: var(--h-10);
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-2);
  color: var(--muted-foreground);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-input-group:hover {
  background: var(--accent);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-input-group:active {
  transform: translateY(0);
}

.btn-input-group svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Destructive variant for input group buttons (e.g., remove) */
.btn-input-group.btn-destructive {
  background: var(--destructive);
  color: var(--destructive-foreground);
  border-color: var(--destructive);
}

.btn-input-group.btn-destructive:hover {
  background: var(--destructive-hover);
  border-color: var(--destructive-hover);
  color: var(--destructive-foreground);
}

/* Responsive: stack input groups on small screens */
@media (max-width: 768px) {
  .input-group {
    flex-wrap: wrap;
  }
  .input-group > .input {
    min-width: 100%;
    margin-bottom: var(--space-sm);
  }
  .input-group > .input-fixed {
    flex: 1 1 auto;
    min-width: 100px;
    max-width: 150px;
  }
  .input-group > .btn-input-group {
    flex: 1 1 auto;
    min-width: 100px;
  }
}

/* ==========================================================================
   Textarea Styles
   ========================================================================== */

.textarea {
  width: 100%;
  min-height: 80px;
  padding: var(--space-sm) var(--space-md);
  font-size: var(--text-md);
  font-family: inherit;
  line-height: 1.5;
  color: var(--foreground);
  background: var(--overlay-darker);
  border: 1px solid var(--input);
  border-radius: var(--radius-2);
  resize: vertical;
  transition:
    border-color var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease;
}

.textarea::placeholder {
  color: var(--muted-foreground);
}

.textarea:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 2px var(--ring-glow-strong);
}

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

/* ==========================================================================
   Select Styles
   ========================================================================== */

.select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius-2);
  border: 1px solid var(--input);
  background: var(--secondary);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--text-md);
  color: var(--foreground);
  cursor: pointer;
  transition: border-color var(--duration-fast) ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.select:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 2px var(--ring-glow-strong);
}

/* Style select options for dark theme */
.select option {
  background: var(--secondary);
  color: var(--foreground);
  padding: var(--space-sm);
}

/* Additional styling for select elements */
select.select {
  background-color: var(--secondary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ededed' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-md) center;
  padding-right: var(--h-10);
}

select.select:focus {
  background-color: var(--secondary);
}

select.select option {
  background-color: var(--secondary);
  color: var(--foreground);
}

/* Global dark theme for ALL native select dropdowns (including non-.select selects) */
select {
  color-scheme: dark;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border-radius: var(--radius-2, 6px);
  border: 1px solid var(--input, #2e2e36);
  background-color: var(--secondary, #1e1e24);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ededed' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding: 0.375rem 2.25rem 0.375rem 0.75rem;
  font-size: var(--text-md, 0.875rem);
  color: var(--foreground, #ededed);
  cursor: pointer;
  transition: border-color 150ms ease;
  line-height: 1.5;
}

select:focus {
  outline: none;
  border-color: var(--ring, #7eb831);
  box-shadow: 0 0 0 2px rgba(126, 184, 49, 0.15);
}

select:hover:not(:focus):not(:disabled) {
  border-color: rgba(255, 255, 255, 0.15);
}

select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

select option {
  background-color: #1e1e24;
  color: #ededed;
  padding: 0.375rem;
}

select option:checked {
  background-color: rgba(126, 184, 49, 0.25);
  color: #7eb831;
}

select option:hover {
  background-color: rgba(126, 184, 49, 0.1);
}

/* ==========================================================================
   Badge Styles
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-full);
  padding: var(--toggle-knob-offset) var(--nav-item-py);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  transition: all var(--duration-fast) ease;
}

.badge-default {
  background: var(--primary);
  color: var(--primary-foreground);
}

.badge-secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.badge-outline {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--foreground);
}

.badge-destructive {
  background: var(--destructive);
  color: var(--destructive-foreground);
}

/* ==========================================================================
   Animation Utilities
   ========================================================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInFromBottom {
  from {
    opacity: 0;
    transform: translateY(var(--space-lg));
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

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

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-fade-in {
  animation: fadeIn var(--duration-fast) ease-out;
}

.animate-slide-in {
  animation: fadeIn var(--duration-fast) ease-out;
}

/* Spinner variants - different speeds for animate-spin */
.animate-spin-slow {
  animation: spin 1.5s linear infinite;
}

.animate-spin-fast {
  animation: spin 0.6s linear infinite;
}

/* ==========================================================================
   Chart.js Canvas Sizing
   Prevent intermittent canvas stretch / blur when layout changes (HTMX/Alpine)
   ========================================================================== */

.chart-container {
  position: relative;
  height: 300px;
}

.chart-container > canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.animate-shimmer {
  background: linear-gradient(90deg, var(--muted) 25%, var(--bg-shimmer) 50%, var(--muted) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ==========================================================================
   HTMX Loading States
   ========================================================================== */

.htmx-request {
  opacity: 0.7;
  transition: opacity var(--duration-normal) ease-out;
}

.htmx-request .htmx-indicator {
  display: inline-block;
}

.htmx-indicator {
  display: none;
}

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

.toast {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-3);
  padding: var(--space-md) var(--space-lg);
  font-size: var(--text-md);
  font-weight: var(--font-normal);
  color: var(--foreground);
  box-shadow: var(--glass-shadow);
  pointer-events: auto;
  animation: toast-slide-in var(--duration-normal) ease-out;
}

.toast-success {
  border-color: rgba(var(--primary-rgb), 0.4);
}

.toast-error {
  border-color: rgba(var(--destructive-rgb), 0.4);
}

.toast-info {
  border-color: rgba(var(--blue-500-rgb), 0.4);
}

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

/* ==========================================================================
   Gallery Grid Layouts
   ========================================================================== */

.grid-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-medium {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-large {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (min-width: 640px) {
  .grid-compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .grid-compact {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .grid-medium {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .grid-compact {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .grid-medium {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .grid-large {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

/* Animated reveal - use with JS toggle or parent state
   Set --reveal-height via inline style for custom max-height */
.animate-reveal {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height var(--duration-normal) cubic-bezier(0.4, 0, 0.2, 1),
    opacity var(--duration-normal) ease;
}

.animate-reveal.is-open,
[open] > .animate-reveal,
.active > .animate-reveal {
  max-height: var(--reveal-height, 500px);
  opacity: 1;
}

.border-white-10 {
  border-color: var(--border-light);
}

.border-white-5 {
  border-color: var(--border-subtle);
}

.bg-white-5 {
  background-color: var(--overlay-subtle);
}

.selection-primary ::selection {
  background: var(--primary-glow);
}

/* ==========================================================================
   HTMX Loading Progress Bar
   ========================================================================== */

.htmx-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--progress-height);
  z-index: var(--z-toast);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--duration-normal) ease;
}

.htmx-progress-bar.htmx-request {
  opacity: 1;
}

.htmx-progress-bar.htmx-settling {
  opacity: 0;
  transition: opacity var(--duration-slow) ease;
}

.htmx-progress-bar-inner {
  height: 100%;
  width: 0%;
  background: linear-gradient(
    90deg,
    var(--primary) 0%,
    var(--primary-light) 50%,
    var(--primary) 100%
  );
  background-size: 200% 100%;
  box-shadow:
    0 0 10px var(--primary),
    0 0 5px var(--primary);
  border-radius: 0 2px 2px 0;
  transition: width 0.1s ease;
}

.htmx-progress-bar.htmx-request .htmx-progress-bar-inner {
  animation:
    htmx-progress 2s ease-in-out infinite,
    htmx-shimmer 1.5s ease-in-out infinite;
}

@keyframes htmx-progress {
  0% {
    width: 0%;
  }
  10% {
    width: 20%;
  }
  30% {
    width: 40%;
  }
  50% {
    width: 60%;
  }
  70% {
    width: 75%;
  }
  90% {
    width: 85%;
  }
  100% {
    width: 90%;
  }
}

@keyframes htmx-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Complete animation when request finishes */
.htmx-progress-bar.htmx-settling .htmx-progress-bar-inner {
  width: 100%;
  animation: none;
  transition: width var(--duration-normal) ease;
}

/* ==========================================================================
   Floating Window Component
   Used for draggable/resizable panels (lightbox, color picker, etc.)
   Extends .glass-panel for consistent appearance.
   Requires: data-floating-window, data-floating-header, data-floating-close,
             data-floating-resize attributes (JS behavior in base.html)
   ========================================================================== */

.floating-window {
  display: none;
  position: fixed;
  min-width: var(--floating-min-width);
  min-height: var(--floating-min-height);
  /* Glass panel styling */
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-3);
  box-shadow: var(--glass-shadow);
  z-index: var(--z-floating);
  overflow: hidden;
  flex-direction: column;
}

.floating-window.show {
  display: flex;
}

/* Positioned variant (for panels that should stay within a container) */
.floating-window.floating-window--positioned {
  position: absolute;
}

/* Color panel (color_panel.html) default placement. Drag/resize overrides
   top/left via element.style once the user moves the panel. */
.floating-window--color-panel {
  top: 20px;
  right: 20px;
  left: auto;
  width: 280px;
  max-height: calc(100% - 40px);
}

.floating-window-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  background: var(--glass-highlight);
  border-bottom: 1px solid var(--glass-border-light);
  cursor: move;
  user-select: none;
  flex-shrink: 0;
}

.floating-window-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--foreground);
}

.floating-window-title svg {
  width: var(--icon-4);
  height: var(--icon-4);
  color: var(--muted-foreground);
}

.floating-window-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--icon-6);
  height: var(--icon-6);
  border: none;
  background: var(--glass-highlight);
  color: var(--muted-foreground);
  border-radius: var(--radius-1);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.floating-window-close:hover {
  background: var(--glass-highlight-active);
  color: var(--foreground);
}

.floating-window-content {
  flex: 1;
  padding: var(--space-md);
  overflow: auto;
}

/* Image content variant (dark bg, centered) */
.floating-window-content--image {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm);
  background: var(--bg-image);
  overflow: hidden;
  /* Default cursor signals "scroll wheel to zoom in". JS swaps this to
     grab/grabbing via [data-zoom-state] once the user has zoomed past 1x. */
  cursor: zoom-in;
}

.floating-window-content--image[data-zoom-state='zoomed'] {
  cursor: grab;
}

.floating-window-content--image[data-zoom-state='panning'] {
  cursor: grabbing;
}

.floating-window-content--image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-1);
  /* Wheel-zoom / drag-pan: the JS handler sets transform directly.
     transform-origin top-left keeps the (cx - tx) / scale math simple. */
  transform-origin: 0 0;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
}

.floating-window-resize {
  position: absolute;
  bottom: 0;
  right: 0;
  width: var(--space-lg);
  height: var(--space-lg);
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, var(--glass-highlight-hover) 50%);
  border-radius: 0 0 var(--radius-3) 0;
}

.floating-window-resize:hover {
  background: linear-gradient(135deg, transparent 50%, var(--primary) 50%);
  opacity: 0.5;
}

/* ==========================================================================
   Floating Window Form Controls
   Consistent styling for controls inside floating windows
   ========================================================================== */

.floating-control {
  margin-bottom: var(--space-md);
}

.floating-control:last-child {
  margin-bottom: 0;
}

/* Section header control opening a new control group (e.g. the color
   panel's Lighting / Post Processing groups). */
.floating-control-section {
  border-top: 1px solid var(--border-secondary);
  padding-top: var(--space-sm);
  margin-top: var(--space-sm);
}

/* (0,2,1) so the section-header weight beats `.floating-control label`'s
   500 regardless of source order. */
.floating-control-section label {
  font-weight: 600;
}

.floating-control label {
  display: block;
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  margin-bottom: var(--space-xs);
  font-weight: 500;
}

.floating-control input[type='color'] {
  width: 100%;
  height: var(--h-10);
  border: 1px solid var(--glass-highlight-hover);
  border-radius: var(--radius-2);
  cursor: pointer;
  background: var(--glass-input-bg);
}

.floating-control input[type='color']:hover {
  border-color: var(--glass-highlight-active);
}

.floating-control input[type='text'],
.floating-control input[type='number'] {
  width: 100%;
  margin-top: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--glass-highlight-hover);
  border-radius: var(--radius-2);
  background: var(--glass-input-bg);
  color: var(--foreground);
  font-size: var(--text-sm);
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

.floating-control input[type='text']:focus,
.floating-control input[type='number']:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 2px var(--ring-glow);
  background: var(--glass-input-bg-focus);
}

.floating-control input[type='range'] {
  width: 100%;
  accent-color: var(--primary);
}

.floating-control-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.floating-control-value {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  min-width: var(--h-10);
  text-align: right;
}

/* ==========================================================================
   3D Viewer Controls (Toggle Switches, Channel Buttons)
   ========================================================================== */

/* Layout utilities */
.flex-centered {
  display: flex;
  align-items: center;
  justify-content: center;
}

.inline-flex-centered {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Positioning/stacking utilities */
.right-sm {
  right: var(--space-sm);
}

/* Named z-index layers */
.layer-base {
  z-index: var(--z-base);
}
.layer-content {
  z-index: var(--z-content);
}
.layer-sticky {
  z-index: var(--z-sticky);
}
.layer-overlay {
  z-index: var(--z-overlay);
}
.layer-floating {
  z-index: var(--z-floating);
}
.layer-toast {
  z-index: var(--z-toast);
}
.layer-system {
  z-index: var(--z-system);
}

/* Compatibility aliases (map to consolidated layers) */
.layer-backdrop {
  z-index: var(--z-overlay);
}
.layer-sidebar {
  z-index: var(--z-sticky);
}

/* Color/state utilities */
.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
}

/* Extra background utilities */
.bg-black\/40 {
  background-color: rgba(0, 0, 0, 0.4);
}

.hover\:bg-black\/70:hover {
  background-color: rgba(0, 0, 0, 0.7);
}

/* Generic toggle button (icon or icon+label) */
.toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-2);
  color: var(--muted-foreground);
  cursor: pointer;
  transition:
    background var(--duration-normal) ease,
    border-color var(--duration-normal) ease,
    color var(--duration-normal) ease;
}

.toggle-btn:hover {
  border-color: rgba(var(--primary-rgb), 0.4);
  color: var(--foreground);
}

.toggle-btn:disabled,
.toggle-btn.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.toggle-btn.active,
.toggle-press.active {
  background: rgba(var(--primary-rgb), 0.6);
  border-color: var(--primary);
  color: var(--primary-foreground);
  box-shadow: 0 0 0 1px rgba(var(--primary-rgb), 0.35);
}

/* Toggle icon swap (use .active on the button) */
.toggle-icon-swap .toggle-icon-on {
  display: none;
}

.toggle-icon-swap .toggle-icon-off {
  display: inline-flex;
}

.toggle-icon-swap.active .toggle-icon-on {
  display: inline-flex;
}

.toggle-icon-swap.active .toggle-icon-off {
  display: none;
}

/* Segmented Switch Component */
.segmented-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--space-sm);
  transition: all var(--duration-fast) ease;
  cursor: pointer;
  user-select: none;
}

.segmented-switch:hover {
  background: var(--overlay-subtle);
}

.segmented-switch input[type='checkbox'] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.segmented-switch-track {
  position: relative;
  width: var(--h-10);
  height: var(--toggle-height);
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  transition: all var(--duration-normal) ease;
  flex-shrink: 0;
}

.segmented-switch-track::after {
  content: '';
  position: absolute;
  top: var(--toggle-knob-offset);
  left: var(--toggle-knob-offset);
  width: var(--icon-4);
  height: var(--icon-4);
  background: var(--muted-foreground);
  border-radius: 50%;
  transition: all var(--duration-normal) ease;
  box-shadow: 0 1px 3px var(--overlay-darkest);
}

.segmented-switch input:checked + .segmented-switch-track {
  background: rgba(var(--primary-rgb), 0.35);
  border-color: rgba(var(--primary-rgb), 0.6);
}

.segmented-switch input:checked + .segmented-switch-track::after {
  transform: translateX(var(--toggle-knob-translate));
  background: white;
}

.segmented-switch-icon {
  width: var(--icon-4);
  height: var(--icon-4);
  color: var(--muted-foreground);
  transition: color var(--duration-fast) ease;
  flex-shrink: 0;
}

.segmented-switch input:checked ~ .segmented-switch-icon {
  color: var(--primary);
}

.segmented-switch-label {
  font-size: var(--text-md);
  font-weight: var(--font-medium);
  color: var(--foreground);
  transition: color var(--duration-fast) ease;
}

.segmented-switch input:checked ~ .segmented-switch-label {
  color: var(--foreground);
}

/* Channel Selector Button Styles */
.channel-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--h-8);
  height: var(--h-8);
  padding: var(--space-xs);
  border-radius: var(--radius-2);
  background: var(--secondary);
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.channel-btn:hover {
  background: var(--overlay-hover);
  color: var(--foreground);
  border-color: var(--foreground);
}

.channel-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 0 8px var(--primary-glow-strong);
}

.channel-btn svg {
  width: var(--icon-4);
  height: var(--icon-4);
}

.channel-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ==========================================================================
   Sizing Utility Classes (Tailwind-like)
   ========================================================================== */

/* Height utilities */
.h-8 {
  height: var(--h-8);
}
.h-9 {
  height: var(--h-9);
}
.h-10 {
  height: var(--h-10);
}
.h-12 {
  height: var(--h-12);
}

/* Border radius utilities (numerical: 1=4px, 2=6px, 3=10px, 4=12px, 5=16px) */
.rounded {
  border-radius: var(--radius-2);
}
.rounded-1 {
  border-radius: var(--radius-1);
}
.rounded-2 {
  border-radius: var(--radius-2);
}
.rounded-3 {
  border-radius: var(--radius-3);
}
.rounded-4 {
  border-radius: var(--radius-4);
}
.rounded-5 {
  border-radius: var(--radius-5);
}
.rounded-full {
  border-radius: var(--radius-full);
}

/* Font size utilities */
.text-xs {
  font-size: var(--text-xs);
}
.text-sm {
  font-size: var(--text-sm);
}
.text-md {
  font-size: var(--text-md);
}
.text-lg {
  font-size: var(--text-lg);
}
.text-xl {
  font-size: var(--text-xl);
}

/* Tailwind Compatibility Utilities */
.-translate-x-1\/2 {
  --tw-translate-x: -50%;
  transform: translate(var(--tw-translate-x, 0), var(--tw-translate-y, 0))
    scale(var(--tw-scale-x, 1), var(--tw-scale-y, 1)) rotate(var(--tw-rotate, 0deg));
}
.-translate-y-1\/2 {
  --tw-translate-y: -50%;
  transform: translate(var(--tw-translate-x, 0), var(--tw-translate-y, 0))
    scale(var(--tw-scale-x, 1), var(--tw-scale-y, 1)) rotate(var(--tw-rotate, 0deg));
}
.absolute {
  position: absolute;
}
.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.animate-spin {
  animation: spin 1s linear infinite;
}
.antialiased {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.aspect-square {
  aspect-ratio: 1 / 1;
}
.backdrop-blur-sm {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.bg-accent {
  background-color: var(--accent);
}
.bg-amber-500\/10 {
  background-color: rgba(245, 158, 11, 0.1);
}
.bg-amber-500\/20 {
  background-color: rgba(245, 158, 11, 0.2);
}
.bg-amber-600\/20 {
  background-color: rgba(217, 119, 6, 0.2);
}
.bg-arena-card {
  background-color: var(--card);
}
.bg-background {
  background-color: var(--background);
}
.bg-background\/80 {
  background-color: rgba(var(--background-rgb), 0.8);
}
.bg-background\/90 {
  background-color: rgba(var(--background-rgb), 0.9);
}
.bg-transparent {
  background-color: transparent;
}
.bg-black {
  background-color: #000000;
}
.bg-black\/10 {
  background-color: rgba(0, 0, 0, 0.1);
}
.bg-black\/20 {
  background-color: rgba(0, 0, 0, 0.2);
}
.bg-black\/50 {
  background-color: rgba(0, 0, 0, 0.5);
}
.bg-black\/60 {
  background-color: rgba(0, 0, 0, 0.6);
}
.bg-black\/70 {
  background-color: rgba(0, 0, 0, 0.7);
}
.bg-black\/80 {
  background-color: rgba(0, 0, 0, 0.8);
}
.bg-black\/85 {
  background-color: rgba(0, 0, 0, 0.85);
}
.bg-blue-500\/10 {
  background-color: rgba(59, 130, 246, 0.1);
}
.bg-blue-500\/20 {
  background-color: rgba(59, 130, 246, 0.2);
}
.bg-blue-500\/30 {
  background-color: rgba(59, 130, 246, 0.3);
}
.bg-border {
  background-color: var(--border);
}
.bg-card {
  background-color: var(--card);
}
.bg-card\/50 {
  background-color: rgba(var(--card-rgb), 0.5);
}
.bg-card\/80 {
  background-color: rgba(var(--card-rgb), 0.8);
}
.bg-card\/95 {
  background-color: rgba(var(--card-rgb), 0.95);
}
.bg-clip-text {
  -webkit-background-clip: text;
  background-clip: text;
}
.bg-destructive\/10 {
  background-color: rgba(var(--destructive-rgb), 0.1);
}
.bg-destructive\/20 {
  background-color: rgba(var(--destructive-rgb), 0.2);
}
.bg-emerald-500 {
  background-color: #10b981;
}
.bg-emerald-500\/20 {
  background-color: rgba(16, 185, 129, 0.2);
}
.bg-emerald-500\/80 {
  background-color: rgba(16, 185, 129, 0.8);
}
.bg-emerald-600 {
  background-color: #059669;
}
.bg-gradient-to-br {
  background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
}
.bg-gradient-to-r {
  background-image: linear-gradient(to right, var(--tw-gradient-stops));
}
.bg-gradient-to-t {
  background-image: linear-gradient(to top, var(--tw-gradient-stops));
}
.bg-gray-500\/20 {
  background-color: rgba(107, 114, 128, 0.2);
}
.bg-green-500 {
  background-color: #22c55e;
}
.bg-green-500\/20 {
  background-color: rgba(34, 197, 94, 0.2);
}
.bg-green-500\/30 {
  background-color: rgba(34, 197, 94, 0.3);
}
.bg-green-600 {
  background-color: #16a34a;
}
.bg-input {
  background-color: var(--input);
}
.bg-input\/50 {
  background-color: rgba(var(--input-rgb), 0.5);
}
.bg-muted {
  background-color: var(--muted);
}
.bg-muted\/10 {
  background-color: rgba(var(--muted-rgb), 0.1);
}
.bg-muted\/30 {
  background-color: rgba(var(--muted-rgb), 0.3);
}
.bg-muted\/50 {
  background-color: rgba(var(--muted-rgb), 0.5);
}
.bg-pink-500 {
  background-color: #ec4899;
}
.bg-pink-500\/20 {
  background-color: rgba(236, 72, 153, 0.2);
}
.bg-pink-600 {
  background-color: #db2777;
}
.bg-primary {
  background-color: var(--primary);
}
.bg-primary\/10 {
  background-color: rgba(var(--primary-rgb), 0.1);
}
.bg-primary\/20 {
  background-color: rgba(var(--primary-rgb), 0.2);
}
.bg-primary\/5 {
  background-color: rgba(var(--primary-rgb), 0.05);
}
.bg-primary\/80 {
  background-color: rgba(var(--primary-rgb), 0.8);
}
.bg-purple-500\/10 {
  background-color: rgba(168, 85, 247, 0.1);
}
.bg-purple-500\/20 {
  background-color: rgba(168, 85, 247, 0.2);
}
.bg-purple-500\/30 {
  background-color: rgba(168, 85, 247, 0.3);
}
.bg-red-500 {
  background-color: #ef4444;
}
.bg-red-500\/20 {
  background-color: rgba(239, 68, 68, 0.2);
}
.bg-red-600 {
  background-color: #dc2626;
}
.bg-rose-500 {
  background-color: #f43f5e;
}
.bg-secondary {
  background-color: var(--secondary);
}
.bg-secondary\/30 {
  background-color: rgba(var(--secondary-rgb), 0.3);
}
.bg-secondary\/50 {
  background-color: rgba(var(--secondary-rgb), 0.5);
}
.bg-white\/20 {
  background-color: rgba(255, 255, 255, 0.2);
}
.bg-yellow-500 {
  background-color: #eab308;
}
.bg-yellow-500\/10 {
  background-color: rgba(234, 179, 8, 0.1);
}
.bg-yellow-500\/20 {
  background-color: rgba(234, 179, 8, 0.2);
}
.block {
  display: block;
}
.border {
  border-width: 1px;
  border-style: solid;
  border-color: var(--border);
}
.border-2 {
  border-width: 2px;
  border-style: solid;
  border-color: var(--border);
}
.border-3 {
  border-width: 3px;
  border-style: solid;
  border-color: var(--border);
}
.border-4 {
  border-width: 4px;
  border-style: solid;
  border-color: var(--border);
}
.border-amber-500\/30 {
  border-color: rgba(245, 158, 11, 0.3);
}
.border-arena-border {
  border-color: var(--border);
}
.border-b {
  border-bottom: 1px solid var(--border);
}
.border-blue-400 {
  border-color: #60a5fa;
}
.border-blue-500\/30 {
  border-color: rgba(59, 130, 246, 0.3);
}
.border-blue-500\/40 {
  border-color: rgba(59, 130, 246, 0.4);
}
.border-blue-500\/50 {
  border-color: rgba(59, 130, 246, 0.5);
}
.border-zinc-800 {
  border-color: var(--border);
}
.border-zinc-800\/50 {
  border-color: rgba(var(--border-rgb), 0.5);
}
.border-b-subtle {
  border-bottom: 1px solid var(--border-subtle);
}
.border-dashed {
  border-style: dashed;
}
.border-destructive {
  border-color: var(--destructive);
}
.border-destructive\/20 {
  border-color: rgba(var(--destructive-rgb), 0.2);
}
.border-destructive\/30 {
  border-color: rgba(var(--destructive-rgb), 0.3);
}
.border-emerald-500\/30 {
  border-color: rgba(16, 185, 129, 0.3);
}
.border-l {
  border-left: 1px solid var(--border);
}
.border-l-4 {
  border-left: 4px solid var(--border);
}
.border-muted-foreground {
  border-color: var(--muted-foreground);
}
.border-none {
  border: none;
}
.border-primary {
  border-color: var(--primary);
}
.border-primary\/30 {
  border-color: rgba(var(--primary-rgb), 0.3);
}
.border-purple-400 {
  border-color: #c084fc;
}
.border-purple-500\/30 {
  border-color: rgba(168, 85, 247, 0.3);
}
.border-purple-500\/40 {
  border-color: rgba(168, 85, 247, 0.4);
}
.border-purple-500\/50 {
  border-color: rgba(168, 85, 247, 0.5);
}
.border-r {
  border-right: 1px solid var(--border);
}
.border-red-500\/30 {
  border-color: rgba(239, 68, 68, 0.3);
}
.border-t {
  border-top: 1px solid var(--border);
}
.border-t-transparent {
  border-top-color: transparent;
}
.border-yellow-500 {
  border-color: #eab308;
}
.bottom-0 {
  bottom: 0;
}
.bottom-4 {
  bottom: 16px;
}
.break-all {
  word-break: break-all;
}
.col-span-full {
  grid-column: 1 / -1;
}
.container {
  width: 100%;
  max-width: var(--content-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}
.cursor-not-allowed {
  cursor: not-allowed;
}
.cursor-pointer {
  cursor: pointer;
}
.cursor-zoom-in {
  cursor: zoom-in;
}
.disabled\:opacity-50:disabled {
  opacity: 0.5;
}
.divide-border > * + * {
  border-top-color: var(--border);
}
.divide-y > * + * {
  border-top-width: 1px;
  border-style: solid;
  border-color: var(--border);
}
.duration-150 {
  transition-duration: 150ms;
}
.duration-200 {
  transition-duration: 200ms;
}
.duration-300 {
  transition-duration: 300ms;
}
.duration-500 {
  transition-duration: 500ms;
}
.ease-out {
  transition-timing-function: ease-out;
}
.fixed {
  position: fixed;
}
.flex {
  display: flex;
}
.flex-1 {
  flex: 1 1 0%;
}
.flex-col {
  flex-direction: column;
}
.flex-grow {
  flex-grow: 1;
}
.flex-shrink-0 {
  flex-shrink: 0;
}
.flex-wrap {
  flex-wrap: wrap;
}
.focus\:border-primary:focus {
  border-color: var(--primary);
}
.focus\:outline-none:focus {
  outline: none;
}
.focus\:ring-0:focus {
  box-shadow: none;
}
.focus\:ring-2:focus {
  box-shadow:
    0 0 0 var(--tw-ring-offset-width, 0) var(--tw-ring-offset-color, transparent),
    0 0 0 calc(2px + var(--tw-ring-offset-width, 0)) var(--tw-ring-color, var(--ring));
}
.focus\:ring-primary:focus {
  --tw-ring-color: var(--primary);
}
.focus\:ring-primary\/50:focus {
  --tw-ring-color: rgba(var(--primary-rgb), 0.5);
}
.font-bold {
  font-weight: 700;
}
.font-medium {
  font-weight: 500;
}
.font-normal {
  font-weight: 400;
}
.font-semibold {
  font-weight: 600;
}
.from-background {
  --tw-gradient-from: var(--background);
  --tw-gradient-to: rgba(0, 0, 0, 0);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
.from-black\/80 {
  --tw-gradient-from: rgba(0, 0, 0, 0.8);
  --tw-gradient-to: rgba(0, 0, 0, 0);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
.from-black\/90 {
  --tw-gradient-from: rgba(0, 0, 0, 0.9);
  --tw-gradient-to: rgba(0, 0, 0, 0);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
.from-blue-500\/20 {
  --tw-gradient-from: rgba(59, 130, 246, 0.2);
  --tw-gradient-to: rgba(0, 0, 0, 0);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
.from-emerald-500\/20 {
  --tw-gradient-from: rgba(16, 185, 129, 0.2);
  --tw-gradient-to: rgba(0, 0, 0, 0);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
.from-gray-400 {
  --tw-gradient-from: #9ca3af;
  --tw-gradient-to: rgba(0, 0, 0, 0);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
.from-gray-500 {
  --tw-gradient-from: #6b7280;
  --tw-gradient-to: rgba(0, 0, 0, 0);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
.from-green-500 {
  --tw-gradient-from: #22c55e;
  --tw-gradient-to: rgba(0, 0, 0, 0);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
.from-pink-500 {
  --tw-gradient-from: #ec4899;
  --tw-gradient-to: rgba(0, 0, 0, 0);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
.from-primary {
  --tw-gradient-from: var(--primary);
  --tw-gradient-to: rgba(0, 0, 0, 0);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
.from-primary\/10 {
  --tw-gradient-from: rgba(var(--primary-rgb), 0.1);
  --tw-gradient-to: rgba(0, 0, 0, 0);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
.from-purple-500\/20 {
  --tw-gradient-from: rgba(168, 85, 247, 0.2);
  --tw-gradient-to: rgba(0, 0, 0, 0);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
.from-red-500 {
  --tw-gradient-from: #ef4444;
  --tw-gradient-to: rgba(0, 0, 0, 0);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
.from-secondary {
  --tw-gradient-from: var(--secondary);
  --tw-gradient-to: rgba(0, 0, 0, 0);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
.from-yellow-400 {
  --tw-gradient-from: #facc15;
  --tw-gradient-to: rgba(0, 0, 0, 0);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
.gap-0 {
  gap: 0;
}
.gap-1 {
  gap: 4px;
}
.gap-1\.5 {
  gap: 6px;
}
.gap-2 {
  gap: 8px;
}
.gap-3 {
  gap: 12px;
}
.gap-4 {
  gap: 16px;
}
.gap-5 {
  gap: 20px;
}
.gap-6 {
  gap: 24px;
}
.gap-x-3 {
  column-gap: 12px;
}
.grid {
  display: grid;
}
.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}
.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.group:hover .group-hover\:bg-primary\/30 {
  background-color: rgba(var(--primary-rgb), 0.3);
}
.group:hover .group-hover\:opacity-100 {
  opacity: 1;
}
.group:hover .group-hover\:scale-105 {
  --tw-scale-x: 1.05;
  --tw-scale-y: 1.05;
  transform: translate(var(--tw-translate-x, 0), var(--tw-translate-y, 0))
    scale(var(--tw-scale-x, 1), var(--tw-scale-y, 1)) rotate(var(--tw-rotate, 0deg));
}
.group:hover .group-hover\:scale-110 {
  --tw-scale-x: 1.1;
  --tw-scale-y: 1.1;
  transform: translate(var(--tw-translate-x, 0), var(--tw-translate-y, 0))
    scale(var(--tw-scale-x, 1), var(--tw-scale-y, 1)) rotate(var(--tw-rotate, 0deg));
}
.group:hover .group-hover\:text-blue-400 {
  color: #60a5fa;
}
.group:hover .group-hover\:text-primary {
  color: var(--primary);
}
.group:hover .group-hover\:text-purple-400 {
  color: #c084fc;
}
.group[open] .group-open\:rotate-90 {
  --tw-rotate: 90deg;
  transform: translate(var(--tw-translate-x, 0), var(--tw-translate-y, 0))
    scale(var(--tw-scale-x, 1), var(--tw-scale-y, 1)) rotate(var(--tw-rotate, 0deg));
}
.group.open .group-open\:rotate-90 {
  --tw-rotate: 90deg;
  transform: translate(var(--tw-translate-x, 0), var(--tw-translate-y, 0))
    scale(var(--tw-scale-x, 1), var(--tw-scale-y, 1)) rotate(var(--tw-rotate, 0deg));
}
.h-1 {
  height: 4px;
}
.h-1\.5 {
  height: 6px;
}
.h-14 {
  height: 56px;
}
.h-16 {
  height: 64px;
}
.h-2 {
  height: 8px;
}
.h-20 {
  height: 80px;
}
.h-24 {
  height: 96px;
}
.h-3 {
  height: 12px;
}
.h-32 {
  height: 128px;
}
.h-4 {
  height: 16px;
}
.h-5 {
  height: 20px;
}
.h-6 {
  height: 24px;
}
.h-7 {
  height: 28px;
}
.h-full {
  height: 100%;
}
.h-px {
  height: 1px;
}
.hidden {
  display: none;
}
.hover\:bg-arena-surface:hover {
  background-color: var(--arena-surface);
}
.hover\:bg-blue-500\/10:hover {
  background-color: rgba(59, 130, 246, 0.1);
}
.hover\:bg-blue-500\/20:hover {
  background-color: rgba(59, 130, 246, 0.2);
}
.hover\:bg-border:hover {
  background-color: var(--border);
}
.hover\:bg-emerald-500:hover {
  background-color: #10b981;
}
.hover\:bg-muted:hover {
  background-color: var(--muted);
}
.hover\:bg-muted\/20:hover {
  background-color: rgba(var(--muted-rgb), 0.2);
}
.hover\:bg-primary-hover:hover {
  background-color: var(--primary-hover);
}
.hover\:bg-primary\/90:hover {
  background-color: rgba(var(--primary-rgb), 0.9);
}
.hover\:bg-destructive\/20:hover {
  background-color: rgba(var(--destructive-rgb), 0.2);
}
.hover\:bg-purple-500\/10:hover {
  background-color: rgba(168, 85, 247, 0.1);
}
.hover\:bg-purple-500\/20:hover {
  background-color: rgba(168, 85, 247, 0.2);
}
.hover\:bg-secondary:hover {
  background-color: var(--secondary);
}
.hover\:bg-secondary\/20:hover {
  background-color: rgba(var(--secondary-rgb), 0.2);
}
.hover\:bg-secondary\/50:hover {
  background-color: rgba(var(--secondary-rgb), 0.5);
}
.hover\:bg-secondary\/80:hover {
  background-color: rgba(var(--secondary-rgb), 0.8);
}
.hover\:bg-white\/5:hover {
  background-color: rgba(255, 255, 255, 0.05);
}
.hover\:border-arena-accent\/50:hover {
  border-color: rgba(var(--arena-accent-rgb), 0.5);
}
.hover\:border-blue-400:hover {
  border-color: #60a5fa;
}
.hover\:border-blue-400\/50:hover {
  border-color: rgba(96, 165, 250, 0.5);
}
.hover\:border-primary:hover {
  border-color: var(--primary);
}
.hover\:border-primary\/30:hover {
  border-color: rgba(var(--primary-rgb), 0.3);
}
.hover\:border-primary\/50:hover {
  border-color: rgba(var(--primary-rgb), 0.5);
}
.hover\:border-purple-400:hover {
  border-color: #c084fc;
}
.hover\:border-purple-400\/50:hover {
  border-color: rgba(192, 132, 252, 0.5);
}
.hover\:opacity-100:hover {
  opacity: 1;
}
.hover\:opacity-80:hover {
  opacity: 0.8;
}
.hover\:shadow-lg:hover {
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.3);
}
.hover\:shadow-primary\/20:hover {
  box-shadow: 0 10px 20px rgba(var(--primary-rgb), 0.2);
}
.hover\:text-blue-400:hover {
  color: #60a5fa;
}
.hover\:text-foreground:hover {
  color: var(--foreground);
}
.hover\:text-primary-hover:hover {
  color: var(--primary-hover);
}
.hover\:text-primary\/80:hover {
  color: rgba(var(--primary-rgb), 0.8);
}
.hover\:text-purple-400:hover {
  color: #c084fc;
}
.hover\:text-red-300:hover {
  color: #fca5a5;
}
.hover\:text-destructive-hover:hover {
  color: var(--destructive-hover);
}
.hover\:text-white:hover {
  color: #ffffff;
}
.hover\:underline:hover {
  text-decoration: underline;
}
.inline {
  display: inline;
}
.inline-block {
  display: inline-block;
}
.inline-flex {
  display: inline-flex;
}
.inset-0 {
  inset: 0;
}
.inset-x-0 {
  left: 0;
  right: 0;
}
.italic {
  font-style: italic;
}
.items-center {
  align-items: center;
}
.items-end {
  align-items: flex-end;
}
.items-start {
  align-items: flex-start;
}
.justify-between {
  justify-content: space-between;
}
.justify-center {
  justify-content: center;
}
.justify-end {
  justify-content: flex-end;
}
.justify-start {
  justify-content: flex-start;
}
.last\:border-b-0:last-child {
  border-bottom: 0;
}
.leading-relaxed {
  line-height: 1.625;
}
.leading-tight {
  line-height: 1.25;
}
.left-0 {
  left: 0;
}
.left-1\/2 {
  left: 50%;
}
.left-2 {
  left: 8px;
}
.left-3 {
  left: 12px;
}
.left-4 {
  left: 16px;
}
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.max-h-\[200px\] {
  max-height: 200px;
}
.max-h-\[90vh\] {
  max-height: 90vh;
}
.max-w-2xl {
  max-width: 42rem;
}
.max-w-6xl {
  max-width: 72rem;
}
.max-w-7xl {
  max-width: 80rem;
}
.max-w-\[200px\] {
  max-width: 200px;
}
.max-w-\[250px\] {
  max-width: 250px;
}
.max-w-\[300px\] {
  max-width: 300px;
}
.max-w-\[320px\] {
  max-width: 320px;
}
.max-w-\[400px\] {
  max-width: 400px;
}
.max-w-full {
  max-width: 100%;
}
.max-w-lg {
  max-width: 32rem;
}
.max-w-md {
  max-width: 28rem;
}
.max-w-sm {
  max-width: 24rem;
}
.max-w-xs {
  max-width: 20rem;
}
.mb-1 {
  margin-bottom: 4px;
}
.mb-12 {
  margin-bottom: 48px;
}
.mb-2 {
  margin-bottom: 8px;
}
.mb-3 {
  margin-bottom: 12px;
}
.mb-4 {
  margin-bottom: 16px;
}
.mb-6 {
  margin-bottom: 24px;
}
.mb-8 {
  margin-bottom: 32px;
}
.min-h-\[150px\] {
  min-height: 150px;
}
.min-h-\[280px\] {
  min-height: 280px;
}
.min-h-\[45px\] {
  min-height: 45px;
}
.min-h-screen {
  min-height: 100vh;
}
.min-w-0 {
  min-width: 0;
}
.min-w-\[120px\] {
  min-width: 120px;
}
.min-w-\[200px\] {
  min-width: 200px;
}
.min-w-\[250px\] {
  min-width: 250px;
}
.min-w-\[40px\] {
  min-width: 40px;
}
.min-w-\[90px\] {
  min-width: 90px;
}
.ml-1 {
  margin-left: 4px;
}
.ml-2 {
  margin-left: 8px;
}
.ml-auto {
  margin-left: auto;
}
.mr-1 {
  margin-right: 4px;
}
.mr-1\.5 {
  margin-right: 6px;
}
.mr-2 {
  margin-right: 8px;
}
.mt-0\.5 {
  margin-top: 2px;
}
.mt-1 {
  margin-top: 4px;
}
.mt-16 {
  margin-top: 64px;
}
.mt-2 {
  margin-top: 8px;
}
.mt-3 {
  margin-top: 12px;
}
.mt-4 {
  margin-top: 16px;
}
.mt-6 {
  margin-top: 24px;
}
.mt-8 {
  margin-top: 32px;
}
.mx-0\.5 {
  margin-left: 2px;
  margin-right: 2px;
}
.mx-1 {
  margin-left: 4px;
  margin-right: 4px;
}
.mx-2 {
  margin-left: 8px;
  margin-right: 8px;
}
.mx-3 {
  margin-left: 12px;
  margin-right: 12px;
}
.mx-4 {
  margin-left: 16px;
  margin-right: 16px;
}
.mx-6 {
  margin-left: 24px;
  margin-right: 24px;
}
.mx-auto {
  margin-left: auto;
  margin-right: auto;
}
.my-0\.5 {
  margin-top: 2px;
  margin-bottom: 2px;
}
.my-1 {
  margin-top: 4px;
  margin-bottom: 4px;
}
.my-2 {
  margin-top: 8px;
  margin-bottom: 8px;
}
.my-3 {
  margin-top: 12px;
  margin-bottom: 12px;
}
.my-4 {
  margin-top: 16px;
  margin-bottom: 16px;
}
.my-6 {
  margin-top: 24px;
  margin-bottom: 24px;
}
.my-8 {
  margin-top: 32px;
  margin-bottom: 32px;
}
.object-contain {
  object-fit: contain;
}
.object-cover {
  object-fit: cover;
}
.opacity-0 {
  opacity: 0;
}
.opacity-25 {
  opacity: 0.25;
}
.opacity-30 {
  opacity: 0.3;
}
.opacity-50 {
  opacity: 0.5;
}
.opacity-60 {
  opacity: 0.6;
}
.opacity-75 {
  opacity: 0.75;
}
.outline {
  outline-style: solid;
  outline-width: 1px;
}
.outline-2 {
  outline-width: 2px;
}
.outline-primary\/50 {
  outline-color: rgba(var(--primary-rgb), 0.5);
}
.overflow-auto {
  overflow: auto;
}
.overflow-hidden {
  overflow: hidden;
}
.overflow-x-auto {
  overflow-x: auto;
}
.overflow-y-auto {
  overflow-y: auto;
}
.p-0 {
  padding: 0;
}
.p-1 {
  padding: 4px;
}
.p-1\.5 {
  padding: 6px;
}
.p-12 {
  padding: 48px;
}
.p-2 {
  padding: 8px;
}
.p-3 {
  padding: 12px;
}
.p-4 {
  padding: 16px;
}
.p-5 {
  padding: 20px;
}
.p-6 {
  padding: 24px;
}
.p-8 {
  padding: 32px;
}
.pb-0 {
  padding-bottom: 0;
}
.pb-1 {
  padding-bottom: 4px;
}
.pb-2 {
  padding-bottom: 8px;
}
.pb-3 {
  padding-bottom: 12px;
}
.pb-4 {
  padding-bottom: 16px;
}
.pb-6 {
  padding-bottom: 24px;
}
.pl-0 {
  padding-left: 0;
}
.pl-10 {
  padding-left: 40px;
}
.pl-4 {
  padding-left: 16px;
}
.pl-9 {
  padding-left: 36px;
}
.placeholder-gray-500::placeholder {
  color: #6b7280;
}
.pointer-events-none {
  pointer-events: none;
}
.pr-0 {
  padding-right: 0;
}
.pr-20 {
  padding-right: 80px;
}
.pr-3 {
  padding-right: 12px;
}
.pr-4 {
  padding-right: 16px;
}
.pt-0 {
  padding-top: 0;
}
.pt-1 {
  padding-top: 4px;
}
.pt-2 {
  padding-top: 8px;
}
.pt-3 {
  padding-top: 12px;
}
.pt-4 {
  padding-top: 16px;
}
.pt-6 {
  padding-top: 24px;
}
.pt-8 {
  padding-top: 32px;
}
.px-0 {
  padding-left: 0;
  padding-right: 0;
}
.px-1 {
  padding-left: 4px;
  padding-right: 4px;
}
.px-1\.5 {
  padding-left: 6px;
  padding-right: 6px;
}
.px-2 {
  padding-left: 8px;
  padding-right: 8px;
}
.px-2\.5 {
  padding-left: 10px;
  padding-right: 10px;
}
.px-3 {
  padding-left: 12px;
  padding-right: 12px;
}
.px-4 {
  padding-left: 16px;
  padding-right: 16px;
}
.px-5 {
  padding-left: 20px;
  padding-right: 20px;
}
.px-6 {
  padding-left: 24px;
  padding-right: 24px;
}
.py-0\.5 {
  padding-top: 2px;
  padding-bottom: 2px;
}
.py-0 {
  padding-top: 0;
  padding-bottom: 0;
}
.py-1 {
  padding-top: 4px;
  padding-bottom: 4px;
}
.py-1\.5 {
  padding-top: 6px;
  padding-bottom: 6px;
}
.py-12 {
  padding-top: 48px;
  padding-bottom: 48px;
}
.py-16 {
  padding-top: 64px;
  padding-bottom: 64px;
}
.py-2 {
  padding-top: 8px;
  padding-bottom: 8px;
}
.py-2\.5 {
  padding-top: 10px;
  padding-bottom: 10px;
}
.py-20 {
  padding-top: 80px;
  padding-bottom: 80px;
}
.py-3 {
  padding-top: 12px;
  padding-bottom: 12px;
}
.py-4 {
  padding-top: 16px;
  padding-bottom: 16px;
}
.py-6 {
  padding-top: 24px;
  padding-bottom: 24px;
}
.py-8 {
  padding-top: 32px;
  padding-bottom: 32px;
}
.relative {
  position: relative;
}
.resize-y {
  resize: vertical;
}
.resize-none {
  resize: none;
}
.right-0 {
  right: 0;
}
.right-2 {
  right: 8px;
}
.right-3 {
  right: 12px;
}
.right-4 {
  right: 16px;
}
.ring-2 {
  box-shadow:
    0 0 0 var(--tw-ring-offset-width, 0) var(--tw-ring-offset-color, transparent),
    0 0 0 calc(2px + var(--tw-ring-offset-width, 0)) var(--tw-ring-color, var(--ring));
}
.ring-offset-2 {
  --tw-ring-offset-width: 2px;
}
.ring-offset-background {
  --tw-ring-offset-color: var(--background);
}
.ring-primary {
  --tw-ring-color: var(--primary);
}
/* Directional border radius utilities */
.rounded-l-3 {
  border-top-left-radius: var(--radius-3);
  border-bottom-left-radius: var(--radius-3);
}
.rounded-r-3 {
  border-top-right-radius: var(--radius-3);
  border-bottom-right-radius: var(--radius-3);
}
.rounded-tl-3 {
  border-top-left-radius: var(--radius-3);
}
.select-none {
  user-select: none;
}
.selection\:bg-primary\/30::selection {
  background-color: rgba(var(--primary-rgb), 0.3);
}
.shadow-2xl {
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.45);
}
.shadow-lg {
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.3);
}
.shadow-md {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}
.shadow-primary\/20 {
  box-shadow: 0 10px 20px rgba(var(--primary-rgb), 0.2);
}
.shadow-xl {
  box-shadow: 0 20px 25px rgba(0, 0, 0, 0.35);
}
.shrink-0 {
  flex-shrink: 0;
}
.space-y-1 > * + * {
  --tw-space-y-reverse: 0;
  margin-top: 4px;
}
.space-y-2 > * + * {
  --tw-space-y-reverse: 0;
  margin-top: 8px;
}
.space-y-3 > * + * {
  --tw-space-y-reverse: 0;
  margin-top: 12px;
}
.space-y-4 > * + * {
  --tw-space-y-reverse: 0;
  margin-top: 16px;
}
.space-y-6 > * + * {
  --tw-space-y-reverse: 0;
  margin-top: 24px;
}
.space-y-8 > * + * {
  --tw-space-y-reverse: 0;
  margin-top: 32px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.sticky {
  position: sticky;
}
.text-2xl {
  font-size: 20px;
}
.text-3xl {
  font-size: 24px;
}
.text-4xl {
  font-size: 36px;
}
.text-\[10px\] {
  font-size: 10px;
}
.text-\[9px\] {
  font-size: 9px;
}
.text-amber-400 {
  color: #fbbf24;
}
.text-amber-500 {
  color: #f59e0b;
}
.text-amber-600 {
  color: #d97706;
}
.text-blue-300 {
  color: #93c5fd;
}
.text-blue-400 {
  color: #60a5fa;
}
.text-blue-500 {
  color: var(--blue-500);
}
.text-center {
  text-align: center;
}
.text-destructive {
  color: var(--destructive);
}
.text-destructive-hover {
  color: var(--destructive-hover);
}
.text-emerald-400 {
  color: #34d399;
}
.text-foreground\/80 {
  color: rgba(var(--foreground-rgb), 0.8);
}
.text-gray-300 {
  color: #d1d5db;
}
.text-gray-400 {
  color: #9ca3af;
}
.text-gray-500 {
  color: #6b7280;
}
.text-gray-600 {
  color: #4b5563;
}
.text-green-300 {
  color: #86efac;
}
.text-green-400 {
  color: #4ade80;
}
.text-green-500 {
  color: #22c55e;
}
.text-left {
  text-align: left;
}
.text-muted-foreground {
  color: var(--muted-foreground);
}
.text-muted-foreground\/60 {
  color: rgba(var(--muted-foreground-rgb), 0.6);
}
.text-pink-500 {
  color: #ec4899;
}
.text-primary-foreground {
  color: var(--primary-foreground);
}
.text-purple-300 {
  color: #d8b4fe;
}
.text-purple-400 {
  color: #c084fc;
}
.text-red-300 {
  color: #fca5a5;
}
.text-red-400 {
  color: #f87171;
}
.text-right {
  text-align: right;
}
.text-transparent {
  color: transparent;
}
.text-white {
  color: #ffffff;
}
.text-white\/60 {
  color: rgba(255, 255, 255, 0.6);
}
.text-white\/70 {
  color: rgba(255, 255, 255, 0.7);
}
.text-white\/80 {
  color: rgba(255, 255, 255, 0.8);
}
.text-white\/90 {
  color: rgba(255, 255, 255, 0.9);
}
.text-yellow-300 {
  color: #fde047;
}
.text-yellow-400 {
  color: #facc15;
}
.text-yellow-500 {
  color: #eab308;
}
.to-amber-500 {
  --tw-gradient-to: #f59e0b;
}
.to-background {
  --tw-gradient-to: var(--background);
}
.to-blue-600\/10 {
  --tw-gradient-to: rgba(37, 99, 235, 0.1);
}
.to-emerald-400 {
  --tw-gradient-to: #34d399;
}
.to-emerald-600\/10 {
  --tw-gradient-to: rgba(5, 150, 105, 0.1);
}
.to-gray-400 {
  --tw-gradient-to: #9ca3af;
}
.to-gray-500 {
  --tw-gradient-to: #6b7280;
}
.to-green-400 {
  --tw-gradient-to: #4ade80;
}
.to-purple-500\/10 {
  --tw-gradient-to: rgba(168, 85, 247, 0.1);
}
.to-purple-600\/10 {
  --tw-gradient-to: rgba(147, 51, 234, 0.1);
}
.to-secondary {
  --tw-gradient-to: var(--secondary);
}
.top-0 {
  top: 0;
}
.top-1\/2 {
  top: 50%;
}
.top-2 {
  top: 8px;
}
.top-4 {
  top: 16px;
}
.tracking-tight {
  letter-spacing: -0.025em;
}
.tracking-wide {
  letter-spacing: 0.025em;
}
.tracking-wider {
  letter-spacing: 0.05em;
}
.transform {
  transform: translate(var(--tw-translate-x, 0), var(--tw-translate-y, 0))
    scale(var(--tw-scale-x, 1), var(--tw-scale-y, 1)) rotate(var(--tw-rotate, 0deg));
}
.transition-\[width\] {
  transition-property: width;
  transition-duration: var(--duration-fast);
  transition-timing-function: ease;
}
.transition-all {
  transition-property: all;
  transition-duration: var(--duration-fast);
  transition-timing-function: ease;
}
.transition-colors {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
  transition-duration: var(--duration-fast);
  transition-timing-function: ease;
}
.transition-opacity {
  transition-property: opacity;
  transition-duration: var(--duration-fast);
  transition-timing-function: ease;
}
.transition-transform {
  transition-property: transform;
  transition-duration: var(--duration-fast);
  transition-timing-function: ease;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.uppercase {
  text-transform: uppercase;
}
.via-background\/95 {
  --tw-gradient-stops:
    var(--tw-gradient-from), rgba(var(--background-rgb), 0.95), var(--tw-gradient-to);
}
.via-black\/20 {
  --tw-gradient-stops: var(--tw-gradient-from), rgba(0, 0, 0, 0.2), var(--tw-gradient-to);
}
.via-black\/70 {
  --tw-gradient-stops: var(--tw-gradient-from), rgba(0, 0, 0, 0.7), var(--tw-gradient-to);
}
.w-0\.5 {
  width: 2px;
}
.w-10 {
  width: 40px;
}
.w-12 {
  width: 48px;
}
.w-14 {
  width: 56px;
}
.w-16 {
  width: 64px;
}
.w-2 {
  width: 8px;
}
.w-20 {
  width: 80px;
}
.w-24 {
  width: 96px;
}
.w-3 {
  width: 12px;
}
.w-32 {
  width: 128px;
}
.w-4 {
  width: 16px;
}
.w-40 {
  width: 160px;
}
.w-48 {
  width: 192px;
}
.w-5 {
  width: 20px;
}
.w-6 {
  width: 24px;
}
.w-7 {
  width: 28px;
}
.w-8 {
  width: 32px;
}
.w-\[460px\] {
  width: 460px;
}
.w-full {
  width: 100%;
}
.whitespace-nowrap {
  white-space: nowrap;
}
.whitespace-pre-wrap {
  white-space: pre-wrap;
}
.z-10 {
  z-index: 10;
}
.z-20 {
  z-index: 20;
}
.z-40 {
  z-index: 40;
}
.z-50 {
  z-index: 50;
}
@media (min-width: 640px) {
  .sm\:block {
    display: block;
  }
  .sm\:flex-row {
    flex-direction: row;
  }
  .sm\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sm\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .sm\:inline {
    display: inline;
  }
  .sm\:items-center {
    align-items: center;
  }
  .sm\:p-12 {
    padding: 48px;
  }
  .sm\:w-\[480px\] {
    width: 480px;
  }
}
@media (min-width: 768px) {
  .md\:flex-row {
    flex-direction: row;
  }
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .md\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .md\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .md\:grid-cols-8 {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
  .md\:items-center {
    align-items: center;
  }
  .md\:items-end {
    align-items: flex-end;
  }
  .md\:justify-between {
    justify-content: space-between;
  }
}
@media (min-width: 1024px) {
  .lg\:aspect-auto {
    aspect-ratio: auto;
  }
  .lg\:flex {
    display: flex;
  }
  .lg\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .lg\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .lg\:grid-cols-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .lg\:hidden {
    display: none;
  }
  .lg\:min-h-\[400px\] {
    min-height: 400px;
  }
  .lg\:p-8 {
    padding: 32px;
  }
}
@media (min-width: 1280px) {
  .xl\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .xl\:text-5xl {
    font-size: 48px;
  }
}
/* End Tailwind Compatibility Utilities */

/* ==========================================================================
   Alpine.js
   ========================================================================== */

/* Hide [x-cloak] elements until Alpine initializes */
[x-cloak] {
  display: none !important;
}

/* ==========================================================================
   Swapped-fragment styles
   Relocated from inline <style> in htmx fragments, whose CSP nonce can never
   match the loaded document. Behavior for these classes lives in
   static/js/core-fragments.js.
   ========================================================================== */

/* Data Explorer table view (components/query_results.html) */
.query-results-table {
  min-width: 100%;
}
.query-results-th {
  width: 1%;
  white-space: nowrap;
}
.query-results-td {
  white-space: nowrap;
}
/* Selected-row highlight, applied imperatively (tableNav.syncSelectedRow). */
.query-results-row.query-row-selected {
  background-color: rgba(126, 184, 49, 0.1);
  outline: 2px solid rgba(126, 184, 49, 0.5);
  outline-offset: -1px;
}

/* Data Explorer gallery view (components/query_gallery.html). The selected-ring
   class is toggled imperatively (syncSelectedCard); the cursor depends on
   whether the row carries a model. */
.gallery-card-animated {
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  cursor: default;
}
.gallery-card-animated[data-model-path] {
  cursor: pointer;
}
.gallery-card-animated:not(.selected):hover {
  border-color: rgba(126, 184, 49, 0.5);
  box-shadow:
    0 10px 15px -3px rgba(126, 184, 49, 0.1),
    0 4px 6px -4px rgba(126, 184, 49, 0.1);
}
.gallery-card-animated.selected {
  border-color: var(--primary);
  box-shadow:
    0 0 0 2px var(--primary),
    0 0 0 4px var(--background),
    0 10px 15px -3px rgba(126, 184, 49, 0.2);
}
/* Active page-number button (marked via syncPageButtons). */
.page-num-active {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

/* Rubric launcher (page_content/rubric_launcher.html) */
.project-card {
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.project-card:hover {
  transform: translateY(-2px);
}
.progress-ring {
  transform: rotate(-90deg);
}
.progress-ring-circle {
  transition: stroke-dashoffset 0.3s ease;
}

/* ============================================================================
   Swapped-fragment styles (relocated from inline <style> in fragment templates;
   a fragment's inline <style> can never match the document CSP nonce).
   ============================================================================ */

/* page_content/rubric_scoring.html */
model-viewer {
  width: 100%;
  height: 100%;
  background-color: #1a1a2e;
  --poster-color: transparent;
}
.segmented-control {
  display: flex;
  gap: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  background: var(--secondary);
}
.segmented-control input[type='radio'] {
  display: none;
}
.segmented-control label {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--muted-foreground);
  border-right: 1px solid color-mix(in srgb, var(--border) 40%, transparent);
  user-select: none;
  position: relative;
}
.segmented-control label:last-of-type {
  border-right: none;
}
.segmented-control label:hover {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--foreground);
}
.segmented-control input[type='radio']:checked + label {
  background: var(--primary);
  color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.scored-badge {
  background: linear-gradient(135deg, var(--primary) 0%, #059669 100%);
}

/* page_content/stats.html — refresh button busy state */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
.refresh-btn.htmx-request .refresh-icon {
  animation: spin 1s linear infinite;
}
.refresh-btn.htmx-request .refresh-text::after {
  content: '...';
}
.refresh-btn.htmx-request {
  pointer-events: none;
  opacity: 0.7;
}

/* components/stats_radar.html */
.radar-chart-container {
  height: 450px;
}

/* components/stats_radar.html + page_content/art_results.html — dimension tabs.
   art_results uses the green (#4ade80) accent; the radar uses the primary
   (#7eb831) accent. Keep both; the radar selector wins via .stats-dimension-tab. */
.dimension-tab {
  padding: 8px 16px;
  background: rgba(15, 23, 42, 0.8);
  border: 2px solid rgba(148, 163, 184, 0.2);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
  font-size: 13px;
  color: #94a3b8;
}
.dimension-tab:hover {
  border-color: rgba(74, 222, 128, 0.5);
  background: rgba(15, 23, 42, 0.9);
}
.dimension-tab.active {
  background: rgba(74, 222, 128, 0.2);
  border-color: #4ade80;
  color: #4ade80;
}

/* components/stats_scatter.html */
.scatter-chart-container {
  height: 350px;
}
.scatter-legend-gradient {
  background: linear-gradient(to right, #ef4444, #eab36b, #3b82f6);
}
.scatter-tooltip-hidden {
  display: none;
}
.scatter-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 8px;
  padding: 8px;
  z-index: 100;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  max-width: 280px;
  transition: opacity 0.15s ease;
}
.scatter-tooltip-thumb {
  width: 80px;
  height: 80px;
  border-radius: 4px;
  background-size: cover;
  background-position: center;
  background-color: rgba(30, 30, 36, 0.8);
  flex-shrink: 0;
}
.scatter-tooltip-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.scatter-tooltip-title {
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
}
.scatter-tooltip-body {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.4;
}
.scatter-failed {
  color: #ef4444;
}

/* page_content/art_results.html + art_results_content.html */
.stat-card {
  background: linear-gradient(135deg, rgba(30, 30, 36, 0.8), rgba(20, 20, 24, 0.6));
  border: 1px solid rgba(126, 184, 49, 0.15);
}
.stat-card:hover {
  border-color: rgba(126, 184, 49, 0.4);
  transform: translateY(-2px);
}
.win-bar {
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(39, 39, 42, 0.8);
}
.win-bar-gen {
  background: linear-gradient(90deg, #ec4899, #f472b6);
}
.win-bar-ref {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}
.win-bar-tie {
  background: linear-gradient(90deg, #6b7280, #9ca3af);
}
.accuracy-ring {
  stroke-dasharray: 100;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease-out;
}
.art-chart-container {
  position: relative;
  height: 300px;
}
.heatmap-cell {
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.heatmap-cell:hover {
  z-index: 10;
}
#meshHeatmap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20px, 1fr));
  gap: 4px;
  padding: 4px;
}
.stat-mode-btn {
  padding: 6px 12px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 12px;
  color: #94a3b8;
}
.stat-mode-btn:hover {
  border-color: rgba(74, 222, 128, 0.5);
  background: rgba(15, 23, 42, 0.9);
}
.stat-mode-btn.active {
  background: rgba(74, 222, 128, 0.2);
  border-color: #4ade80;
  color: #4ade80;
}
.art-custom-select-wrapper {
  position: relative;
  width: 100%;
  user-select: none;
  z-index: 1;
}
.art-custom-select-trigger {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--foreground);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.art-custom-select-trigger:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--muted-foreground);
}
.art-custom-select-trigger.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(126, 184, 49, 0.15);
}
.art-custom-select-options {
  position: fixed;
  width: auto;
  min-width: 200px;
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #1a1a1a !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 10px;
  z-index: 10000 !important;
  display: none;
  box-shadow:
    0 10px 25px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(10px);
  opacity: 1 !important;
}
.art-custom-select-options.open {
  display: block;
}
.art-custom-select-options::-webkit-scrollbar {
  width: 8px;
}
.art-custom-select-options::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}
.art-custom-select-options::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}
.art-custom-select-options::-webkit-scrollbar-thumb:hover {
  background: rgba(126, 184, 49, 0.8);
}
.art-custom-option {
  padding: 10px 14px;
  font-size: 14px;
  color: var(--foreground);
  cursor: pointer;
  transition: background 0.15s ease;
}
.art-custom-option:hover {
  background: rgba(255, 255, 255, 0.1);
}
.art-custom-option.selected {
  color: var(--primary);
  background: rgba(126, 184, 49, 0.1);
}
.art-custom-arrow {
  transition: transform 0.2s ease;
}
.art-custom-select-trigger.active .art-custom-arrow {
  transform: rotate(180deg);
}
.art-note-cell {
  max-width: 200px;
  position: relative;
}
.art-note-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  color: var(--muted-foreground);
  line-height: 1.4;
  cursor: pointer;
  text-decoration: underline dotted rgba(255, 255, 255, 0.55);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition:
    color 0.12s ease,
    text-decoration-color 0.12s ease,
    background-color 0.12s ease;
  border-radius: 3px;
  padding: 2px 4px;
  margin: -2px -4px;
  position: relative;
  z-index: 2;
}
.art-note-text:hover,
.art-note-text:focus-visible {
  color: var(--foreground);
  text-decoration-color: rgba(255, 255, 255, 0.95);
  background-color: rgba(255, 255, 255, 0.08);
  outline: none;
}
/* Native popover renders in browser top-layer, so position:fixed top/left
   anchor to the viewport instead of any backdrop-filter ancestor. */
#art-note-popover {
  inset: auto;
  margin: 0;
  max-width: 420px;
  min-width: 200px;
  padding: 12px 14px;
  background: var(--popover, #1f1f23);
  color: var(--foreground, #e5e5e5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  pointer-events: none;
}
#art-note-popover.pinned {
  pointer-events: auto;
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(99, 102, 241, 0.3);
}
.art-note-pin-hint {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted-foreground);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 6px;
}
.art-dimension-chart-container {
  height: 420px;
}
.art-reset-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}
.art-eval-row-excluded {
  opacity: 0.4;
  text-decoration: line-through;
}
.art-win-bar-segment {
  height: 100%;
}
.art-legend-swatch-generated-correct {
  background-color: #22c55e;
}
.art-legend-swatch-generated-incorrect {
  background-color: #ef4444;
}
.art-legend-swatch-generated-tie {
  background-color: #fbbf24;
}
.art-legend-swatch-reference-correct {
  background-color: #10b981;
}
.art-legend-swatch-reference-incorrect {
  background-color: #dc2626;
}
.art-legend-swatch-reference-tie {
  background-color: #f59e0b;
}

/* components/preset_picker_dialog.html (reusable include) */
.pk-preset-manager-shell {
  width: 580px;
  max-width: min(580px, calc(100% - 48px));
  max-height: 80vh;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  flex-direction: column;
}
.pk-preset-manager-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}
.pk-preset-manager-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
  margin: 0;
}
.pk-preset-manager-close {
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.pk-preset-manager-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--foreground);
}
.pk-preset-manager-content {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}
.pk-preset-manager-search {
  margin-bottom: 12px;
}
.pk-preset-manager-search .input {
  width: 100%;
  max-width: 100%;
  display: block;
  box-sizing: border-box;
}
.pk-preset-status-filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--muted-foreground) transparent;
  -webkit-overflow-scrolling: touch;
}
.pk-preset-status-filters::-webkit-scrollbar {
  height: 4px;
}
.pk-preset-status-filters::-webkit-scrollbar-track {
  background: transparent;
}
.pk-preset-status-filters::-webkit-scrollbar-thumb {
  background: var(--muted-foreground);
  border-radius: 2px;
}
.pk-status-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.pk-status-filter-btn:hover {
  background: var(--accent);
  color: var(--foreground);
}
.pk-status-filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.pk-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pk-status-dot--in-progress {
  background: rgb(34, 197, 94);
}
.pk-status-dot--completed {
  background: rgb(59, 130, 246);
}
.pk-status-dot--test {
  background: rgb(168, 85, 247);
}
.pk-status-dot--archived {
  background: rgb(148, 163, 184);
}
.pk-preset-manager-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pk-preset-manager-close-icon {
  width: 20px;
  height: 20px;
}
.pk-preset-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
}
.pk-preset-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: all 0.15s ease;
  cursor: pointer;
}
.pk-preset-item:hover,
.pk-preset-item.focused {
  background: var(--accent);
  border-color: rgba(255, 255, 255, 0.15);
}
.pk-preset-item.focused {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
.pk-preset-item.current {
  border-color: var(--primary);
  background: rgba(126, 184, 49, 0.1);
}
.pk-preset-item-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.pk-preset-item-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pk-preset-current-badge {
  font-size: 10px;
  color: #4ade80;
  margin-left: 8px;
  border: 1px solid #4ade80;
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}
.pk-preset-empty {
  text-align: center;
  color: var(--muted-foreground);
  padding: 40px 20px;
  font-size: 14px;
}
.pk-preset-item-status {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.pk-preset-status-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 12px;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: box-shadow 0.15s ease;
  position: relative;
}
.pk-preset-status-badge[data-status='In Progress'] {
  background: rgba(34, 197, 94, 0.15);
  color: rgb(34, 197, 94);
}
.pk-preset-status-badge[data-status='Completed'] {
  background: rgba(59, 130, 246, 0.15);
  color: rgb(59, 130, 246);
}
.pk-preset-status-badge[data-status='Test Projects'] {
  background: rgba(168, 85, 247, 0.15);
  color: rgb(168, 85, 247);
}
.pk-preset-status-badge[data-status='Archived'] {
  background: rgba(148, 163, 184, 0.15);
  color: rgb(148, 163, 184);
}
.pk-preset-status-badge::after {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  opacity: 0;
  transition: opacity 0.15s ease;
  flex-shrink: 0;
}
.pk-preset-item-status:hover .pk-preset-status-badge,
.pk-preset-item-status:focus-within .pk-preset-status-badge {
  box-shadow: 0 0 0 1.5px currentColor;
}
.pk-preset-item-status:hover .pk-preset-status-badge::after,
.pk-preset-item-status:focus-within .pk-preset-status-badge::after {
  opacity: 0.7;
}
.pk-preset-status-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
}
.pk-preset-item-name .fuzzy-match {
  color: var(--primary);
  font-weight: 600;
}
.pk-preset-edit-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.pk-preset-edit-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--foreground);
}
.pk-preset-edit-toggle.active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(126, 184, 49, 0.1);
}
.pk-preset-delete-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.15);
  border: 1.5px solid rgba(239, 68, 68, 0.5);
  color: rgb(239, 68, 68);
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background 0.15s ease,
    transform 0.1s ease;
  padding: 0;
}
.pk-preset-delete-btn:hover {
  background: rgba(239, 68, 68, 0.3);
  transform: scale(1.1);
}
.pk-preset-list.pk-edit-mode .pk-preset-delete-btn {
  display: flex;
}
.pk-preset-list.pk-edit-mode .pk-preset-item-status {
  display: none;
}
.pk-preset-list.pk-edit-mode .pk-preset-rename-trigger {
  cursor: text;
  text-decoration: underline dotted rgba(255, 255, 255, 0.3);
}
.pk-preset-invalid-icon {
  display: inline-flex;
  align-items: center;
  color: rgb(239, 68, 68);
  flex-shrink: 0;
  margin-left: 4px;
  cursor: default;
}
.pk-custom-status-dropdown {
  min-width: 140px;
  padding: 4px;
  border-radius: 8px;
  background: var(--secondary);
  border: 1px solid var(--border);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pk-status-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--foreground);
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
  border: none;
  text-align: left;
  transition: background 0.1s ease;
}
.pk-status-option:hover {
  background: rgba(255, 255, 255, 0.1);
}
.pk-status-option.current {
  color: var(--primary);
  background: rgba(126, 184, 49, 0.1);
  font-weight: 500;
}
.pk-status-option-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* page_content/images_detail.html + images_detail_content.html */
.model-canvas-block {
  display: block;
}
.viewer-controls-divider-line {
  width: 1px;
  height: 1.5rem;
  background: var(--border);
  opacity: 0.5;
}

/* Initially-hidden controls that JS reveals later. A markup-level
   style="display:none" is refused by host pages with a nonce-based style-src
   CSP, so elements carry data-pk-initial-hidden instead. This rule hides them
   from first paint; a script applier (MeshyViewer.connectControls here,
   pk-fragments.js in muse-webapp) then sets data-pk-hidden-applied and moves
   the hiding into element.style, because the existing show-paths reveal by
   clearing element.style.display to '' — which defeats an inline style but
   never a class/attribute rule. */
[data-pk-initial-hidden]:not([data-pk-hidden-applied]) {
  display: none;
}

/* ==========================================================================
   Viewer Controls fragment (controls.html)
   ==========================================================================
   Styles for templates/controls.html. They live here, not in a <style>
   block inside the fragment, because host pages with a nonce-based
   style-src CSP — muse-webapp's pk pages, which include the fragment —
   refuse inline style blocks. This copy is SYNCED
   from museview's design-system.css (the canonical home, in the museview
   repo) — edit there and re-sync, don't edit here. */

/* Ensure hidden icons stay hidden (override .icon display) */
.icon.hidden {
  display: none !important;
}

.viewer-controls-divider {
  width: 1px;
  height: var(--h-8, 2rem);
  background: rgba(255, 255, 255, 0.1);
  align-self: center;
  /* Local addition, NOT in museview's copy of this rule: upstream layers this
     via a second generic .viewer-controls-divider rule, which the duplicate-
     selector lint forbids here, so the two rules are merged. On re-sync, land
     the same merge upstream or this opacity is silently dropped. */
  opacity: 0.5;
  /* Offset to align with button row, not button+kbd-hint wrapper */
  margin-bottom: 13px;
}

/* Mode button (Wireframe, Clay, Flat Shading, Color Adjust) */
.vc-mode-btn {
  width: var(--h-8, 2rem);
  height: var(--h-8, 2rem);
}

/* UV Checker segmented control — the icon toggle (left) and the density
 * cycle chip (right) flush-join into a single visual widget. CSS handles
 * the seam: the chip shares the icon button's right border (``border-left: 0``)
 * and ``:has(...)`` flattens the icon's right corners only when the chip
 * is actually visible, so the icon still reads as a normal pill when
 * UV Checker is off and the chip is hidden. */
.vc-uvchecker-group {
  display: inline-flex;
  align-items: stretch;
  /* No positioning context needed any more — the old popover-anchor
   * version used ``position: relative``, but the slider is inline now. */
}
/* When the density chip slides out, the icon button's right corners ease
 * from rounded → flat over the same duration as the chip's slide so the
 * widget reads as a single expanding pill rather than a corner snap. */
.vc-uvchecker-main {
  transition: border-radius 0.18s ease;
}
.vc-uvchecker-group:has(.vc-density-control:not([hidden])) .vc-uvchecker-main {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

/* Inline density control — joins the icon button into a single segmented
 * pill with a horizontal slider + numeric value label. Slides out from
 * the icon button's right edge when UV Checker turns on, collapses back
 * when it turns off (max-width / padding / border / opacity all animate
 * together so the widget reads as one shrinking pill). The label echoes
 * the slider live as the user drags. */
.vc-density-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  /* 26px like the pill buttons it joins inside .vc-display-bar, so the pill
     container stays at the 32px bar baseline (MES-14407). */
  height: 26px;
  max-width: 10rem; /* enough for ``slider + 3-digit label`` */
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-left: 0; /* share the icon button's right border */
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-top-right-radius: var(--radius, 4px);
  border-bottom-right-radius: var(--radius, 4px);
  overflow: hidden;
  white-space: nowrap;
  transition:
    max-width 0.18s ease,
    padding 0.18s ease,
    opacity 0.15s ease,
    border-width 0.18s ease,
    background 0.1s ease;
}
.vc-density-control:hover {
  background: rgba(255, 255, 255, 0.06);
}
.vc-density-slider {
  width: 90px;
  margin: 0;
  accent-color: var(--primary, #6cd43a);
  cursor: pointer;
  height: 4px; /* match the surrounding pill — chunkier sliders look out of place */
}
.vc-density-value {
  min-width: 26px;
  text-align: right;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--primary, #6cd43a);
}

/* Hidden state — collapse to zero width but keep ``display: inline-flex``
 * so the slide animation runs (UA's ``[hidden]{display:none}`` would snap
 * it shut instantly). Higher specificity beats the UA rule. */
.vc-density-control[hidden] {
  display: inline-flex;
  max-width: 0;
  padding: 0;
  border-width: 0;
  opacity: 0;
  pointer-events: none;
}

/* Wireframe overlay mode: outline only (no fill), border green */
.vc-mode-btn.active[data-vc-toggle='wireframe']:not(.wireframe-only) {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: none;
}

/* Wireframe-only mode: full green fill (strongest emphasis) */
.vc-mode-btn.wireframe-only.active {
  background: rgba(var(--primary-rgb), 0.6);
  border-color: var(--primary);
  color: var(--primary-foreground);
  box-shadow: 0 0 0 1px rgba(var(--primary-rgb), 0.35);
}

/* Mode button wrapper with keyboard hint below */
.vc-mode-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

/* Keyboard shortcut hint text */
.vc-kbd {
  font-size: 9px;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  opacity: 0.6;
}

/* Channel selector wrapper with keyboard hints below */
.vc-channel-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

/* Channel bar - grouped container matching toggle-btn border style */
.vc-channel-bar {
  display: flex;
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-2, 6px);
  padding: 3px;
  gap: 2px;
}

/* Channel button — no individual border, green fill on hover */
.vc-channel-btn {
  /* One consistent 32px control height across the viewer control bar so every
     control aligns on a shared baseline, matching .vc-mode-btn / .vc-mode-switch
     / .pk-action-icon-btn (MES-14407). Kept in sync with the museview copy. */
  width: var(--h-8, 2rem);
  height: var(--h-8, 2rem);
  border-radius: var(--radius-1, 4px);
  border-color: transparent;
}
/* Inside the bordered pill container the buttons are 26px, so the pill totals
   --h-8 (26 + 2*2px padding + 2*1px border = 32) exactly like .vc-seg-btn in
   .vc-seg-bar — one pill height across the bar (MES-14407). */
.vc-display-bar .vc-channel-btn {
  width: 26px;
  height: 26px;
}
.vc-channel-btn:hover:not(.active):not(:disabled) {
  background: rgba(var(--primary-rgb), 0.15);
  border-color: transparent;
  color: var(--primary);
}

/* Channel keyboard hints row */
.vc-channel-keys {
  display: flex;
  gap: 2px;
  padding: 0 3px;
}

.vc-channel-key {
  /* Must track the DISPLAY-BAR button width (26px inside the pill, see
     .vc-display-bar .vc-channel-btn): the keys row aligns under the buttons
     purely by matching widths (MES-14407). */
  width: 26px;
  font-size: 9px;
  font-weight: 600;
  color: var(--muted-foreground);
  text-align: center;
  opacity: 0.6;
}

/* Channel glyph (ƒ for full render) - serif font for icon-like appearance */
.vc-channel-glyph {
  font-family: 'Times New Roman', Times, Georgia, serif;
  font-size: 1rem;
  font-weight: 600;
  font-style: italic;
  letter-spacing: -0.02em;
}

/* Channel letter (R/M/N/E) - clean sans-serif */
.vc-channel-letter {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

/* ===== Animation Controls ===== */
.vc-anim-timeline {
  width: 120px;
  accent-color: var(--primary);
  height: 4px;
  cursor: pointer;
}

/* Timeline readout. Reserves width so the M:SS / M:SS text doesn't jitter
   as digits change. */
.vc-anim-time {
  min-width: 72px;
}

/* Animation selectors — compact variant of global select style */
.vc-anim-clip-select,
.vc-bone-select {
  font-size: 11px;
  padding: 2px 20px 2px 6px;
  max-width: 140px;
  line-height: 1.4;
  height: 26px;
}

/* Responsive: hide dividers on narrow screens */
@media (max-width: 1200px) {
  .vc-hide-narrow {
    display: none;
  }
}

/* ── Advanced / Simple controls mode (museview feature, opt-in) ────────────
   Enabled with the ``show_mode_toggle`` param. In *simple* mode the
   power-user mesh-inspection controls (marked ``.vc-advanced-only``:
   normal-map, segment colors, face orientation, UV checker, UV seam) are
   hidden; the toggle button (``[data-vc-mode-toggle]``) flips
   ``#viewer-controls`` between ``.vc-mode-simple`` / ``.vc-mode-advanced``.
   MeshyViewer.connectControls() wires the click + persists the choice in
   localStorage. Scoped to ``#viewer-controls`` so control bars that don't
   opt in (PK voting/compare, etc.) are completely unaffected. */
#viewer-controls.vc-mode-simple .vc-advanced-only {
  display: none !important;
}
/* Advanced-controls toggle, rendered as a labelled switch (the gear icon it
   used to show was indistinguishable from the colour-settings gear). The JS
   toggles ``.active`` on the button; everything below is driven by that. */
.vc-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2rem;
  padding: 0 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.vc-mode-switch .vc-switch-text {
  font-size: var(--text-xs, 0.75rem);
  color: var(--muted-foreground);
  transition: color 0.15s ease;
}
.vc-mode-switch.active .vc-switch-text {
  color: var(--primary);
}
.vc-switch-track {
  position: relative;
  flex: none;
  width: 2rem;
  height: 1.1rem;
  border-radius: 999px;
  background: var(--muted, #3f3f46);
  transition: background 0.15s ease;
}
.vc-mode-switch.active .vc-switch-track {
  background: var(--primary);
}
.vc-switch-thumb {
  position: absolute;
  top: 50%;
  left: 2px;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: #fff;
  transform: translateY(-50%);
  transition: left 0.15s ease;
}
.vc-mode-switch.active .vc-switch-thumb {
  left: calc(2rem - 0.85rem - 2px);
}
.vc-mode-switch:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-2, 6px);
}

/* View-preset buttons: icon (highlighted-face view cube) + text label, so the
   direction is obvious. Override the icon-only square sizing of .vc-channel-btn. */
.vc-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: auto;
  padding: 0 8px;
}
.vc-view-btn .vc-view-ico {
  width: 15px;
  height: 15px;
  flex: none;
}
.vc-view-label {
  font-size: var(--text-xs, 0.75rem);
  line-height: 1;
}

/* ── Reorganized control groups ───────────────────────────────────────────
   Single-select Display-mode bar + segmented Wireframe / Projection controls.
   These use DISTINCT container classes from ``.vc-channel-bar`` on purpose:
   the legacy channel-lock reflection in updateControlsUI() keys off
   ``.vc-channel-bar`` to grey-out channel buttons in clay/segment/UV mode, and
   we don't want it touching the new bars (display modes are now mutually
   exclusive, not a lockable sub-mode). Visual style mirrors the channel bar. */
.vc-display-bar,
.vc-seg-bar {
  display: flex;
  align-items: center;
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-2, 6px);
  /* Total height = --h-8 (32px): 26px pills + 2*2px padding + 2*1px border,
     so the pill group aligns with the 32px controls around it (MES-14407). */
  padding: 2px;
  gap: 2px;
}
/* Segment button: like .vc-channel-btn but auto-width so it can hold a text
   label (Off / Overlay / Only, Persp / Ortho) as well as an icon. */
.vc-seg-btn {
  width: auto;
  min-width: 28px;
  height: 26px;
  padding: 0 9px;
  border-radius: var(--radius-1, 4px);
  border-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}
.vc-seg-btn .vc-view-ico {
  width: 15px;
  height: 15px;
  flex: none;
}
.vc-seg-btn:hover:not(.active):not(:disabled) {
  background: rgba(var(--primary-rgb), 0.15);
  border-color: transparent;
  color: var(--primary);
}
.vc-seg-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
/* Group label sitting to the left of a bar (mirrors the "View:" prefix). */
.vc-group-label {
  font-size: var(--text-xs, 0.75rem);
  color: var(--muted-foreground);
  margin-right: 0.25rem;
}
