/*
 * Brand Color System
 * 
 * To change the main brand color, simply update:
 * - --brand-primary: The main brand color (currently neon yellow #c4ff00)
 * - --brand-secondary: The secondary accent color (currently orange #ff4500)
 * 
 * All accent-related colors (--accent, --accent-strong, --accent-border, etc.)
 * will automatically derive from these two base colors using CSS color-mix().
 * 
 * Note: color-mix() requires modern browsers (Chrome 111+, Firefox 113+, Safari 16.2+)
 * For older browser support, you may need to manually set the derived colors.
 * 
 * IMPORTANT: The logotype SVG animation (assets/animations/data.json) has embedded colors.
 * To change the logotype color, you'll need to either:
 * 1. Update the fill colors in the Lottie JSON file directly, OR
 * 2. Use CSS filters on .drop-logo and .demo-logotype (see below)
 */

:root {
  color-scheme: dark;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont,
    'Segoe UI', sans-serif;
  --danger: #ff7b7b;
}

/* Text selection color - inverted brand primary at 0.5 opacity */
/* Dynamically calculated from brand-primary */
::selection {
  background-color: color-mix(in srgb, var(--brand-primary-inverted) 50%, transparent);
  color: var(--text);
}

::-moz-selection {
  background-color: color-mix(in srgb, var(--brand-primary-inverted) 50%, transparent);
  color: var(--text);
}

:root,
body[data-theme='violet'] {
  /* Brand Colors - Change these to swap the main brand color */
  --brand-primary: #c4ff00;
  --brand-secondary: #ff4500;
  
  /* Inverted brand primary for text selection (1:1 color inversion) */
  /* Calculated: RGB(196, 255, 0) -> RGB(59, 0, 255) = #3b00ff */
  --brand-primary-inverted: #3b00ff;
  
  /* Base Colors */
  --bg: #050112;
  --panel: #0d081f;
  --panel-alt: #160c2f;
  --shelf-bg: rgba(7, 2, 20, 0.50);
  --stroke: rgba(255, 255, 255, 0.15);
  --text: #f5f1ff;
  --text-dim: rgba(245, 241, 255, 0.6);
  
  /* Accent Colors - Derived from brand-primary */
  --accent: var(--brand-primary);
  --accent-strong: var(--brand-secondary);
  --accent-border: color-mix(in srgb, var(--brand-primary) 50%, transparent);
  --accent-shadow: color-mix(in srgb, var(--brand-primary) 35%, transparent);
  --accent-muted: color-mix(in srgb, var(--brand-primary) 18%, transparent);
  --accent-glow: color-mix(in srgb, var(--brand-secondary) 45%, transparent);
  /* Brighter hover color for links / interactive text */
  --accent-hover: color-mix(in srgb, var(--brand-primary) 40%, white 60%);
  --brand-glow: color-mix(in srgb, var(--brand-primary) 65%, transparent);
  
  /* Brand Text Color - Auto-detects if brand is bright (needs dark text) */
  /* For bright colors like yellow, set to #000 or dark color */
  /* For dark colors like purple, set to #fff or light color */
  --brand-text: #02030a; /* Default to dark text, adjust if brand is dark */
  
  /* Drop Zone Colors - Now derived from brand colors */
  --drop-gradient-start: color-mix(in srgb, var(--brand-primary) 20%, var(--bg) 80%);
  --drop-gradient-end: color-mix(in srgb, var(--bg) 96%, transparent);
  --drop-outline: color-mix(in srgb, var(--brand-primary) 55%, transparent);
  --drop-outline-active: color-mix(in srgb, var(--brand-secondary) 85%, transparent);
  --drop-fill: color-mix(in srgb, var(--brand-primary) 12%, transparent);
  --drop-fill-active: color-mix(in srgb, var(--brand-secondary) 20%, transparent);
}

body[data-theme='aqua'] {
  /* Brand Colors - Change these to swap the main brand color */
  --brand-primary: #c4ff00;
  --brand-secondary: #ff4500;
  
  /* Inverted brand primary for text selection (1:1 color inversion) */
  --brand-primary-inverted: #3b00ff;
  
  /* Base Colors */
  --bg: #04060c;
  --panel: #0d111c;
  --panel-alt: #121726;
  --shelf-bg: rgba(0, 0, 0, 0.6);
  --stroke: rgba(255, 255, 255, 0.15);
  --text: #f1f4ff;
  --text-dim: rgba(241, 244, 255, 0.6);
  
  /* Accent Colors - Derived from brand-primary */
  --accent: var(--brand-primary);
  --accent-strong: var(--brand-secondary);
  --accent-border: color-mix(in srgb, var(--brand-primary) 50%, transparent);
  --accent-shadow: color-mix(in srgb, var(--brand-primary) 35%, transparent);
  --accent-muted: color-mix(in srgb, var(--brand-primary) 18%, transparent);
  --accent-glow: color-mix(in srgb, var(--brand-secondary) 35%, transparent);
  --brand-glow: color-mix(in srgb, var(--brand-primary) 55%, transparent);
  
  /* Brand Text Color - Auto-detects if brand is bright (needs dark text) */
  --brand-text: #02030a; /* Default to dark text, adjust if brand is dark */
  
  /* Drop Zone Colors - Now derived from brand colors */
  --drop-gradient-start: color-mix(in srgb, var(--brand-primary) 15%, var(--bg) 85%);
  --drop-gradient-end: color-mix(in srgb, var(--bg) 92%, transparent);
  --drop-outline: color-mix(in srgb, var(--brand-primary) 40%, transparent);
  --drop-outline-active: color-mix(in srgb, var(--brand-primary) 80%, transparent);
  --drop-fill: color-mix(in srgb, var(--brand-primary) 8%, transparent);
  --drop-fill-active: color-mix(in srgb, var(--brand-secondary) 15%, transparent);
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow: hidden;
}

body.dropzone-visible #webgl {
  opacity: 0;
  pointer-events: none;
}


.top-bar {
  display: none;
}

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

.brand img {
  filter: drop-shadow(0 0 16px var(--brand-glow));
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-name {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-tagline {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.top-bar__cluster {
  display: flex;
  gap: 0.6rem;
}

.top-bar__status {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.1;
}

.status-title {
  font-weight: 500;
}

.status-detail {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Secondary buttons - transparent style */
.ghost-btn {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.15);
  color: var(--text);
  padding: 0.75rem 1.25rem;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border 0.2s;
  width: 100%;
}

.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.ghost-btn.small {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  width: auto;
}

.ghost-btn.active {
  background: var(--accent-muted);
  border-color: var(--accent);
  color: var(--accent);
}

/* Primary button - gradient style (for play/pause) */
.primary-btn {
  border-radius: 12px;
  border: none;
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: var(--brand-text);
  padding: 0.4rem 0.9rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.2s;
  box-shadow: 0 8px 16px var(--accent-shadow);
}

.primary-btn:hover {
  filter: brightness(1.08);
}

.primary-btn.icon-btn {
  width: 3rem;
  height: 3rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  gap: 0.25rem;
}

.primary-btn.icon-btn i {
  font-size: 1.1rem;
  color: var(--brand-text);
}

.animation-play-btn {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: border 0.2s, background 0.2s, color 0.2s, opacity 0.2s;
}

.animation-play-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255, 255, 255, 0.12);
}

.animation-play-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Load Settings Modal */
.load-settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(8px);
  padding: 2rem;
  margin: 0;
  box-sizing: border-box;
}

.load-settings-content {
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 6px;
  padding: 1.2rem;
  width: 100%;
  max-width: 650px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow-y: auto;
}

.load-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}

.load-settings-header h3 {
  font-family: 'Cal Sans', system-ui, -apple-system, sans-serif;
  margin: 0;
  font-size: 2rem;
  letter-spacing: -0.01em;
  font-weight: 400;
  color: var(--accent);
  text-transform: none;
}

.load-settings-description {
  margin: 0 0 0.5rem 0;
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 0.4rem;
  width: 26px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text);
}

.close-btn i {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.load-settings-content textarea {
  width: 100%;
  min-height: 300px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  color: var(--text);
  font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.load-settings-content textarea:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.2);
}

.load-settings-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 0.25rem;
}

.load-settings-actions .ghost-btn {
  min-width: 100px;
  width: auto;
  margin-top: 0;
}

.primary-btn {
  border-color: transparent;
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: var(--brand-text);
  font-weight: 700;
  box-shadow: 0 8px 16px var(--accent-shadow);
}

.primary-btn:hover {
  filter: brightness(1.08);
}

/* Unified Accent Action Buttons (Export, Scene controls) - Slim, compact style */
.accent-action-btn {
  width: 100%;
  padding: 0.5rem 1rem;
  border-radius: 999px; /* Fully rounded */
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.15);
  color: var(--text);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s, opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  box-shadow: none;
  box-sizing: border-box;
  min-height: 2.5rem; /* Explicit height to match toggle buttons */
  opacity: 0.6;
}

.accent-action-btn:hover {
  background: var(--accent);
  color: var(--brand-text);
  border-color: var(--accent);
  box-shadow: 0 4px 12px var(--accent-shadow);
  opacity: 1;
}

.accent-action-btn:active {
  filter: brightness(0.95);
}

/* Accent action button icons - smaller size (12px) */
.accent-action-btn i {
  font-size: 12px !important;
  width: 12px !important;
  height: 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.scene-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Export button specific spacing */
#exportPng {
  margin-top: 0.5rem;
}

.dropzone-btn {
  padding: clamp(0.4rem, 0.8vw, 0.5rem) clamp(1rem, 2vw, 1.5rem);
  border-radius: 999px; /* Fully rounded like accent-action-btn */
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.15);
  color: var(--text);
  font-family: inherit;
  /* Responsive font size: scales down on smaller screens */
  font-size: clamp(0.7rem, 1.2vw, 0.8rem);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s, opacity 0.2s;
  opacity: 0;
  transform: translateY(-15px);
  animation: dropRevealButton 1s cubic-bezier(0.16, 1, 0.3, 1) 1.05s forwards;
  /* Responsive min-height: scales down on smaller screens */
  min-height: clamp(2rem, 4vw, 2.5rem);
  box-shadow: none;
  position: relative;
  z-index: 2; /* Ensure button is above dropzone background */
}

@keyframes dropReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes logotypeReveal {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes demoLogotypeFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes demoLogotypeFadeOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

@keyframes dropRevealButton {
  to {
    opacity: 0.6;
    transform: translateY(0);
  }
}

.dropzone-btn:hover {
  background: var(--accent) !important;
  color: var(--brand-text) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 4px 12px var(--accent-shadow) !important;
  opacity: 1 !important;
}

.drop-link {
  color: #7E6BFF;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s, opacity 0.2s;
  opacity: 0.9;
}

.drop-link:hover {
  color: #9D8AFF;
  opacity: 1;
  text-decoration: underline;
}

.dropzone-btn:active {
  filter: brightness(0.95);
}

.workspace {
  flex: 1;
  display: flex;
  min-height: 0;
  min-width: 0;
  height: 100vh;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.viewport {
  position: relative;
  flex: 1;
  background: #000;
  min-height: 0;
  min-width: 0;
}

#webgl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: var(--bg);
  outline: none;
}

#webgl:focus,
#webgl:focus-visible {
  outline: none;
}

.dropzone {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: radial-gradient(
    circle at top,
    var(--drop-gradient-start),
    var(--drop-gradient-end)
  );
  border: 0;
  text-align: center;
  pointer-events: auto;
  opacity: 0;
  animation: dropzoneReveal 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  /* Add padding to push content away from border - matches border inset */
  padding: var(--dropzone-padding);
  box-sizing: border-box;
}

.dropzone.hiding {
  animation: dropzoneHide 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  pointer-events: none !important;
}

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

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

.dropzone {
  /* Define padding variable at dropzone level so it's available to all children */
  /* Max padding: 20rem (320px) for even more generous spacing at large sizes */
  /* Base symmetric padding (used for top/bottom by default) */
  --dropzone-padding: clamp(0.25rem, calc((100vw - 600px) / 15), 20rem);
  /* Allow separate horizontal control on very wide screens */
  --dropzone-padding-x: var(--dropzone-padding);
  --dropzone-padding-y: var(--dropzone-padding);
}

.dropzone::before {
  content: '';
  position: absolute;
  /* Responsive padding: large on desktop, shrinks dramatically on smaller screens */
  /* Padding scales from 20rem (320px) at 1440px+ down to 0.25rem (4px) at small sizes */
  /* Using larger default padding for symmetrical look with more generous spacing */
  /* Use separate horizontal/vertical padding so we can keep more side breathing room on ultrawides */
  top: var(--dropzone-padding-y);
  right: var(--dropzone-padding-x);
  bottom: var(--dropzone-padding-y);
  left: var(--dropzone-padding-x);
  /* Remove aspect-ratio constraint to allow true equal padding on all sides */
  /* The border will adapt to viewport while maintaining equal padding */
  border: 2px dashed var(--drop-outline);
  /* Doubled corner roundness: 18px -> 36px max */
  border-radius: clamp(8px, 2.25vw, 36px);
  background: linear-gradient(120deg, var(--drop-fill), transparent);
  pointer-events: none;
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
}

/* On very wide screens, increase horizontal padding only (narrower dropzone, same vertical spacing) */
@media (min-width: 1600px) {
  .dropzone {
    --dropzone-padding-x: clamp(4rem, calc((100vw - 1440px) / 2), 14rem);
    /*
      Vertical padding:
      - On tall fullscreen 16:9 (e.g. 1080p), keep a comfortable cushion from top/bottom
      - As the window height shrinks, padding tapers down
      - Overall more generous so fullscreen doesn’t feel cramped
    */
    --dropzone-padding-y: clamp(3rem, calc((100vh - 720px) / 10 + 3rem), 5rem);
  }
}

.dropzone > * {
  position: relative;
  z-index: 1;
}

/* Scale down dropzone content when window shrinks (maintains aspect ratio) */
/* Scale the entire dropzone container for consistent scaling */
.dropzone {
  /* Scale based on BOTH width and height so content shrinks on short windows */
  /* - Use 1440×900 as the comfortable baseline size */
  /* - As either width or height gets smaller, scale down the whole hero */
  --dropzone-scale: clamp(
    0.6,
    min(100vw / 1440, 100vh / 900),
    1
  );
  transform: scale(var(--dropzone-scale));
  transform-origin: center center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(100%);
  border: 0;
  white-space: nowrap;
}

.dropzone.drag-active {
  box-shadow: inset 0 0 50px var(--accent-muted), 0 0 25px var(--accent-glow);
}

.dropzone.drag-active::before {
  border-color: var(--drop-outline-active);
  background: linear-gradient(120deg, var(--drop-fill-active), transparent);
  box-shadow: 0 0 40px var(--accent-glow), inset 0 0 30px var(--accent-muted);
}

.drop-logo {
  width: clamp(264px, 30.5vw, 440px); /* Scales from 440px down to 264px (60% of 440px) */
  height: auto;
  margin-bottom: 0;
  opacity: 0;
  transform: scale(0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  transform-origin: center center;
}

.drop-logo.reveal {
  animation: logotypeReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.drop-primary {
  font-family: 'Cal Sans', system-ui, -apple-system, sans-serif;
  /* Responsive font size: scales from 3rem down to 2rem on smaller screens */
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: 0.05em;
  opacity: 0;
  transform: translateY(-15px);
  animation: dropReveal 1s cubic-bezier(0.16, 1, 0.3, 1) 0.85s forwards;
  /* Allow text to break into 2 lines naturally */
  max-width: 90%;
  line-height: 1.2;
  text-align: center;
}

.brand-highlight {
  color: var(--brand-primary);
}

.drop-secondary {
  color: var(--text-dim);
  /* Responsive font size: scales down on smaller screens */
  font-size: clamp(0.75rem, 1.2vw, 0.9rem);
  letter-spacing: -0.01em;
  opacity: 0;
  transform: translateY(-10px);
  animation: dropReveal 1s cubic-bezier(0.16, 1, 0.3, 1) 1.15s forwards;
  /* Responsive margin: scales down on smaller screens */
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.quick-start-guide {
  display: flex;
  /* Responsive gap: scales down on smaller screens */
  gap: clamp(1rem, 2.5vw, 2rem);
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  color: var(--text-dim);
  /* Responsive font size: scales down on smaller screens */
  font-size: clamp(0.75rem, 1.2vw, 0.9rem);
  opacity: 0;
  transform: translateY(-10px);
  animation: dropReveal 1s cubic-bezier(0.16, 1, 0.3, 1) 1.2s forwards;
}

.quick-start-guide strong {
  color: var(--accent);
  font-weight: 700;
}

.drop-note {
  color: var(--text-dim);
  /* Responsive font size: scales down on smaller screens */
  font-size: clamp(0.8rem, 1.3vw, 0.95rem);
  letter-spacing: -0.01em;
  text-align: center;
  opacity: 0;
  transform: translateY(-10px);
  animation: dropReveal 1s cubic-bezier(0.16, 1, 0.3, 1) 1.25s forwards;
  /* Responsive max-width: scales down on smaller screens */
  max-width: clamp(90%, 85vw, 680px);
  line-height: 1.5;
}

body:not(.dropzone-visible) .quick-start-guide {
  opacity: 0;
  pointer-events: none;
}

.shelf {
  width: clamp(320px, 23vw, 380px);
  background: var(--shelf-bg);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(22px);
  height: calc(100vh - 48px);
  padding: 0.4rem 0.4rem 0.4rem 0.4rem;
  position: absolute;
  top: 24px;
  right: 28px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.shelf.is-shelf-hidden {
  opacity: 0;
  transform: translate3d(36px, 0, 0);
  pointer-events: none;
  visibility: hidden;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: -0.6rem -0.6rem 0 -0.6rem;
  padding: 0;
}

.tab {
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 0.75rem 0;
  font-size: 0.85rem;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-radius 0.2s, opacity 0.2s;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  opacity: 1;
}

.tab:hover:not(.active) {
  background: rgba(255, 255, 255, 0.1);
  opacity: 1;
  transition: color 0s, background 0s, border-radius 0s, opacity 0s;
}

/* Tab icons - larger size (20px) */
.tab i {
  font-size: 20px !important;
  width: 20px !important;
  height: 20px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.tab.active {
  color: var(--brand-text);
  background: var(--accent);
  box-shadow: 0 8px 18px var(--accent-shadow);
  transform: scale(1.01);
  z-index: 1;
  position: relative;
  opacity: 1;
}

.tab.active:first-child {
  border-top-left-radius: 18px;
}

.tab.active:last-child {
  border-top-right-radius: 18px;
}

.tab.active i {
  stroke: var(--brand-text);
}

.shortcuts-grid {
  display: grid;
  gap: 0.5rem;
  margin: 0;
}

.shortcut-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--stroke);
}

.shortcut-row:last-child {
  border-bottom: none;
}

.shortcut-action {
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.4;
}

.shortcut-note {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.1rem;
}

.shortcut-keys {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
  font-size: 0.85rem;
  color: var(--text);
}

.shortcut-keys kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--stroke);
  border-radius: 4px;
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.shortcut-keys kbd:only-child {
  min-width: auto;
}

.info-logotype-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 1rem;
  margin-bottom: 1rem;
}

.info-logotype {
  width: 300px;
  height: auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.info-logotype svg {
  width: 300px;
  height: auto;
}

.info-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
}

.info-list dt {
  font-weight: 600;
  color: var(--text);
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.info-list dd {
  margin: 0 0 0.75rem 0;
  color: var(--text-dim);
  font-size: 0.8rem;
  line-height: 1.4;
}

.info-list dd:last-child {
  margin-bottom: 0;
}

.about-content {
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.6;
}

.about-content a,
.about-content a:visited,
a,
a:visited {
  color: #7E6BFF;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.about-highlight {
  color: #fff;
  font-weight: 700;
}

/* Ensure links with about-highlight class get purple color and hover */
a.about-highlight {
  color: #7E6BFF !important;
}

a.about-highlight:hover {
  color: #9D8AFF !important;
}

.microcopy {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin: 0 0 0.5rem;
}

.about-content p {
  margin: 0 0 1rem 0;
}

.about-content p:last-child {
  margin-bottom: 0;
}

.about-content code {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
  font-family: 'Inter', monospace;
}

.panels {
  flex: 1;
  overflow-y: auto;
  padding: 0.6rem 0.6rem 3rem 0.6rem;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  /* Create space for scrollbar on the right, outside the window */
  margin-right: calc(-1.2rem + 12px);
  padding-right: calc(0.6rem + 1.2rem - 12px);
  border-top: none;
  margin-top: 0;
}

.panels::-webkit-scrollbar {
  width: 4px;
}

.panels::-webkit-scrollbar-track {
  background: transparent;
  margin: 10px 0;
}

.panels::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.5);
  border-radius: 999px;
}

.panels::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.8);
}

.panel {
  display: none;
}

.panel.visible {
  display: block;
}

.panel[data-panel='info'] {
  position: relative;
}

.panel-header-title {
  font-family: 'Cal Sans', system-ui, -apple-system, sans-serif;
  display: none;
  font-size: 2rem;
  letter-spacing: 0;
  font-weight: 400;
  color: var(--accent);
  margin: 0.6rem 0 0.6rem 0;
  padding: 0;
}

.panel-header-title.visible {
  display: block;
}

.panel-header h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.01em;
  font-weight: 400;
}

.panel-header p {
  margin: 0.2rem 0 1rem;
  color: var(--text-dim);
  letter-spacing: -0.01em;
  font-size: 0.65rem;
}

.panel-block {
  border: none;
  border-radius: 6px;
  padding: 1.2rem;
  margin-bottom: 0.5rem;
  background: rgba(0, 0, 0, 0.6);
}

/* Subtle divider line within panel blocks - only spans content width */
.panel-block-divider {
  margin: 1rem 0;
  border-top: 1px solid var(--stroke);
  border-bottom: none;
  max-width: 100%;
}

/* Subsection within merged panel blocks - can be muted individually */
.subsection {
  position: relative;
}

/* Muted UI logic removed - will be reimplemented later */

.block-title {
  font-size: 1.0rem;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 0.75rem;
  font-weight: 400;
}

/* Muted blocks: reduce headline opacity */
.is-muted .block-title {
  opacity: 0.75;
  /* Also desaturate the accent color when muted */
  color: color-mix(in srgb, var(--accent) 25%, var(--text-dim) 75%);
}

.block-title.has-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.block-title.has-reset {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.block-reset-btn {
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: var(--text);
  width: 26px;
  height: 22px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

.block-reset-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.block-reset-btn i {
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  stroke: var(--text-dim);
}

.block-reset-btn:disabled,
.block-reset-btn.is-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Toggle base - always isolated, never affected by muting */
/* Force toggle to render in completely separate layer, bypassing any parent filters */
.effect-toggle {
  --toggle-track-height: calc(0.65rem + 0.5rem);
  --toggle-thumb-size: calc(var(--toggle-track-height) - 0.3rem);
  --toggle-thumb-offset: 0.15rem;
  position: relative;
  display: inline-block;
  width: calc(var(--toggle-track-height) * 2);
  height: var(--toggle-track-height);
  flex-shrink: 0;
  margin-left: auto;
  cursor: pointer;
  justify-self: end;
  /* Toggles are NEVER muted - always full opacity and no filters */
  opacity: 1 !important;
  filter: none !important;
  backdrop-filter: none !important;
  isolation: isolate !important;
  contain: layout style paint !important; /* Completely self-contained */
  transform: translateZ(0) !important; /* Force new compositing layer */
  will-change: transform, opacity, filter !important;
  mix-blend-mode: normal !important;
  z-index: 10 !important; /* High z-index to ensure it's above filtered contexts */
}

.effect-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  cursor: pointer;
  z-index: 2;
}

/* Toggle indicator - always isolated, never affected by muting */
.effect-toggle .effect-indicator {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.25); /* Default unchecked color - checked state will override */
  border-radius: 999px;
  transition: background-color 0.3s ease;
  cursor: pointer;
  /* Always isolated from parent - force separate compositing layer */
  opacity: 1 !important;
  filter: none !important;
  backdrop-filter: none !important;
  isolation: isolate !important;
  contain: layout style paint !important;
  transform: translateZ(0) !important;
  will-change: background-color, transform, opacity, filter !important;
  mix-blend-mode: normal !important;
  z-index: 1;
}

/* Toggle thumb - always isolated */
.effect-toggle .effect-indicator::before {
  position: absolute;
  content: '';
  height: var(--toggle-thumb-size);
  width: var(--toggle-thumb-size);
  left: var(--toggle-thumb-offset);
  bottom: var(--toggle-thumb-offset);
  background-color: var(--brand-text);
  border-radius: 50%;
  transition: transform 0.3s ease, background-color 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  opacity: 1;
  filter: none;
}

/* Toggle checked state - always isolated */
.effect-toggle input:checked + .effect-indicator {
  background-color: var(--brand-primary) !important; /* Always yellow when checked */
  opacity: 1 !important;
  filter: none !important;
  transform: translateZ(0) !important;
}

/* Toggle checked thumb - always isolated */
.effect-toggle input:checked + .effect-indicator::before {
  transform: translateX(calc(var(--toggle-track-height) * 2 - var(--toggle-thumb-size) - var(--toggle-thumb-offset) * 2)) translateZ(0);
  opacity: 1;
}

.effect-toggle:hover .effect-indicator {
  background-color: rgba(255, 255, 255, 0.3);
}

.effect-toggle input:focus-visible + .effect-indicator {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

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

.segmented label {
  border: 1px solid var(--stroke);
  padding: 0.5rem 0.4rem;
  border-radius: 999px;
  text-align: center;
  font-size: 0.75rem;
  cursor: pointer;
  letter-spacing: -0.01em;
  color: var(--text);
  background: rgba(255, 255, 255, 0.15);
  transition: border 0.2s, color 0.2s, background 0.2s, opacity 0.2s;
  opacity: 0.6;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 2.5rem; /* Match other pill buttons */
}

.segmented label:hover:not(:has(input:checked)) {
  transition: border 0s, box-shadow 0s, color 0s, opacity 0s, background 0s;
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.25);
  opacity: 1;
}

.segmented input {
  appearance: none;
  position: absolute;
}

.segmented input:checked + span,
.segmented label:has(input:checked) {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-muted);
  box-shadow: 0 8px 20px var(--accent-shadow);
  opacity: 1;
}

/* Mode Icons - Free floating spherical icons */
.mode-icons {
  display: flex;
  align-items: center;
  padding: 0.75rem 0;
  width: 100%;
  gap: 8px;
}

.mode-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  transition: transform 0.2s ease;
  flex: 1 1 0;
  min-width: 0;
}

.mode-icon {
  transform-origin: center center;
}

.mode-icon::before {
  content: '';
  position: absolute;
  width: clamp(50px, 4.375vw, 70px);
  height: clamp(50px, 4.375vw, 70px);
  border-radius: 50%;
  border: 3px solid transparent;
  transition: border-color 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 1;
  transform-origin: center center;
}

.mode-icon img {
  width: clamp(38px, 3.375vw, 54px);
  height: clamp(38px, 3.375vw, 54px);
  display: block;
  border-radius: 50%;
  transition: transform 0.2s ease;
  position: relative;
  z-index: 0;
  transform-origin: center center;
  /* Free floating - no background or border when unselected */
}

.mode-icon:hover img {
  transform: scale(1.1);
}

.mode-icon input {
  appearance: none;
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Selected state - brand yellow stroked ring around icon */
.mode-icon:has(input:checked)::before {
  border-color: var(--accent);
  transform: scale(1);
}

.mode-icon:has(input:checked):hover img {
  transform: scale(1.1);
}

.slider-line,
.color-line,
.select-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.6rem;
  font-size: 0.85rem;
}

.slider-line {
  grid-template-columns: 90px 1fr auto;
  column-gap: 0.2rem;
}

.slider-line span:first-child {
  grid-column: 1;
  align-self: center;
  text-align: left;
  letter-spacing: -0.01em;
  font-size: 0.9rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.color-line span:first-child,
.select-line span:first-child {
  letter-spacing: -0.01em;
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* Removed - all toggles now use .effect-toggle system */

.slider-line input[type='range'] {
  grid-column: 2;
  align-self: center;
  justify-self: stretch;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  position: relative;
  /* Remove default track styling */
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

/* WebKit slider track with fill effect */
.slider-line input[type='range']::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0.15) var(--slider-fill-start, 0%),
    color-mix(in srgb, var(--accent) 30%, transparent) var(--slider-fill-start, 0%),
    color-mix(in srgb, var(--accent) 30%, transparent) var(--slider-fill-end, 0%),
    rgba(255, 255, 255, 0.15) var(--slider-fill-end, 0%),
    rgba(255, 255, 255, 0.15) 100%
  );
  transition: background 0.15s ease;
}

/* Active/dragging state: 0.5 opacity for visual feedback */
.slider-line input[type='range']:active::-webkit-slider-runnable-track {
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0.15) var(--slider-fill-start, 0%),
    color-mix(in srgb, var(--accent) 60%, transparent) var(--slider-fill-start, 0%),
    color-mix(in srgb, var(--accent) 60%, transparent) var(--slider-fill-end, 0%),
    rgba(255, 255, 255, 0.15) var(--slider-fill-end, 0%),
    rgba(255, 255, 255, 0.15) 100%
  );
}

/* Muted blocks: use gray fill instead of accent color */
.is-muted .slider-line input[type='range']::-webkit-slider-runnable-track {
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0.15) var(--slider-fill-start, 0%),
    color-mix(in srgb, var(--text-dim) 25%, transparent) var(--slider-fill-start, 0%),
    color-mix(in srgb, var(--text-dim) 25%, transparent) var(--slider-fill-end, 0%),
    rgba(255, 255, 255, 0.15) var(--slider-fill-end, 0%),
    rgba(255, 255, 255, 0.15) 100%
  );
}

/* Muted blocks: active state with full opacity gray */
.is-muted .slider-line input[type='range']:active::-webkit-slider-runnable-track {
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0.15) var(--slider-fill-start, 0%),
    var(--text-dim) var(--slider-fill-start, 0%),
    var(--text-dim) var(--slider-fill-end, 0%),
    rgba(255, 255, 255, 0.15) var(--slider-fill-end, 0%),
    rgba(255, 255, 255, 0.15) 100%
  );
}

/* Firefox slider track with fill effect */
.slider-line input[type='range']::-moz-range-track {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0.15) var(--slider-fill-start, 0%),
    color-mix(in srgb, var(--accent) 30%, transparent) var(--slider-fill-start, 0%),
    color-mix(in srgb, var(--accent) 30%, transparent) var(--slider-fill-end, 0%),
    rgba(255, 255, 255, 0.15) var(--slider-fill-end, 0%),
    rgba(255, 255, 255, 0.15) 100%
  );
  border: none;
  transition: background 0.15s ease;
}

/* Active/dragging state: 0.5 opacity for visual feedback */
.slider-line input[type='range']:active::-moz-range-track {
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0.15) var(--slider-fill-start, 0%),
    color-mix(in srgb, var(--accent) 60%, transparent) var(--slider-fill-start, 0%),
    color-mix(in srgb, var(--accent) 60%, transparent) var(--slider-fill-end, 0%),
    rgba(255, 255, 255, 0.15) var(--slider-fill-end, 0%),
    rgba(255, 255, 255, 0.15) 100%
  );
}

/* Muted blocks: use gray fill instead of accent color */
.is-muted .slider-line input[type='range']::-moz-range-track {
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0.15) var(--slider-fill-start, 0%),
    color-mix(in srgb, var(--text-dim) 25%, transparent) var(--slider-fill-start, 0%),
    color-mix(in srgb, var(--text-dim) 25%, transparent) var(--slider-fill-end, 0%),
    rgba(255, 255, 255, 0.15) var(--slider-fill-end, 0%),
    rgba(255, 255, 255, 0.15) 100%
  );
}

/* Muted blocks: active state with full opacity gray */
.is-muted .slider-line input[type='range']:active::-moz-range-track {
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0.15) var(--slider-fill-start, 0%),
    var(--text-dim) var(--slider-fill-start, 0%),
    var(--text-dim) var(--slider-fill-end, 0%),
    rgba(255, 255, 255, 0.15) var(--slider-fill-end, 0%),
    rgba(255, 255, 255, 0.15) 100%
  );
}

/* Temperature and Tint sliders keep their custom gradients */
.slider-line--temperature input[type='range']::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, #1d5bff, #f6f2ff, #ffbb6b);
}

.slider-line--temperature input[type='range']::-moz-range-track {
  background: linear-gradient(90deg, #1d5bff, #f6f2ff, #ffbb6b);
}

.slider-line--tint input[type='range']::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, #36d681, #f6f2ff, #d56bff);
}

.slider-line--tint input[type='range']::-moz-range-track {
  background: linear-gradient(90deg, #36d681, #f6f2ff, #d56bff);
}

/* Disabled sliders */
.slider-line input[type='range']:disabled {
  opacity: 0.6;
}

/* Disabled slider thumbs should be solid gray, closer to label color */
input[type='range']:disabled::-webkit-slider-thumb {
  background: #999 !important;
  box-shadow: none !important;
  cursor: not-allowed;
}

input[type='range']:disabled::-moz-range-thumb {
  background: #999 !important;
  box-shadow: none !important;
  cursor: not-allowed;
}

.slider-line--temperature input[type='range'] {
  background: linear-gradient(90deg, #1d5bff, #f6f2ff, #ffbb6b);
}

.slider-line--tint input[type='range'] {
  background: linear-gradient(90deg, #36d681, #f6f2ff, #d56bff);
}

.slider-line .value {
  grid-column: 3;
  justify-self: end;
  color: var(--text-dim);
  font-size: 0.8rem;
  align-self: center;
  text-align: right;
  min-width: 48px;
}

.slider-line .slider-value-group {
  grid-column: 3;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.slider-line .slider-value-group .value {
  grid-column: auto;
  margin-left: 4px;
}

.info-version-tag {
  display: block;
  margin-top: 1.75rem;
  font-size: 0.69rem;
  letter-spacing: -0.01em;
  text-align: right;
  color: var(--text-dim);
  opacity: 0.6;
  position: static;
  padding-top: 0;
  background: none;
}


/* Fullscreen toggle button (bottom-left of viewport) */
.viewport-fullscreen-btn {
  position: absolute;
  top: 1.2rem;
  left: 1.5rem;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.5);
  color: var(--text-dim);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(14px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  opacity: 0.75;
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s,
    box-shadow 0.2s,
    transform 0.2s,
    opacity 0.2s;
  z-index: 12;
}

.viewport-fullscreen-btn i {
  font-size: 14px;
}

.viewport-fullscreen-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--brand-text);
  box-shadow: 0 8px 22px var(--accent-shadow);
  opacity: 1;
  transform: translateY(1px);
}

.viewport-fullscreen-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7);
}

body:not(.dropzone-visible) .viewport-fullscreen-btn {
  opacity: 0.9;
}

/* Demo Logotype - Bottom Left Corner */
.demo-logotype {
  position: absolute;
  bottom: 4.5rem;
  left: 4.5rem;
  width: 440px;
  height: auto;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  display: flex;
  justify-content: flex-start;
  align-items: flex-end;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.2));
  will-change: opacity, transform;
  transform: translateZ(0); /* Force GPU acceleration */
}

.demo-logotype svg {
  width: 440px;
  height: auto;
}

.demo-logotype.visible {
  opacity: 1;
  pointer-events: auto;
  animation: demoLogotypeFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.demo-logotype.hiding {
  animation: demoLogotypeFadeOut 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.rotation-notch {
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: var(--text);
  width: 26px;
  height: 22px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.rotation-notch:hover {
  background: rgba(255, 255, 255, 0.1);
}

.rotation-notch i {
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  stroke: var(--text-dim);
}

.color-line .color-chip {
  justify-self: end;
  min-width: 0;
}

.color-chip {
  width: 88px;
  max-width: 100%;
  height: 14px;
  border-radius: 3px;
  border: none;
  background: transparent;
  appearance: none;
  overflow: hidden;
  cursor: pointer;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.1);
  flex-shrink: 1;
}

.color-chip::-webkit-color-swatch {
  border: none;
  border-radius: 3px;
  padding: 0;
}

.color-chip::-webkit-color-swatch-wrapper {
  padding: 0;
  border-radius: 3px;
}

.color-chip::-moz-color-swatch {
  border: none;
  border-radius: 3px;
}


.control-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.stats-block dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
}

.stats-block dt {
  font-size: 0.7rem;
  letter-spacing: -0.01em;
  color: var(--text-dim);
}

.stats-block dd {
  margin: 0.2rem 0 0;
  font-size: 1rem;
  font-weight: 500;
}

.animation-controls {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.7rem;
}

#animationScrub {
  flex: 1;
}

#animationTime {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  min-width: 2.8ch;
  text-align: right;
}

.select-line select {
  grid-column: span 1;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 0.35rem 1.6rem 0.35rem 0.7rem;
  color: var(--text);
  font-family: inherit;
  appearance: none;
  background-color: rgba(255, 255, 255, 0.15);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2 4L6 8L10 4' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
}

.hdri-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.8rem 1rem;
  margin-bottom: 1.1rem;
  padding: 0.75rem 0;
}

.hdri-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  transition: transform 0.2s ease;
  transform-origin: center center;
}

.hdri-icon::before {
  content: '';
  position: absolute;
  width: clamp(62px, 5.8vw, 92px);
  height: clamp(62px, 5.8vw, 92px);
  border-radius: 50%;
  border: 3px solid transparent;
  transition: border-color 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 1;
  transform-origin: center center;
}

.hdri-icon img {
  width: clamp(52px, 4.8vw, 78px);
  height: clamp(52px, 4.8vw, 78px);
  display: block;
  border-radius: 50%;
  transition: transform 0.2s ease;
  position: relative;
  z-index: 0;
  transform-origin: center center;
  object-fit: cover;
}

.hdri-icon:hover img {
  transform: scale(1.1);
}

.hdri-icon:disabled,
.hdri-icon.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: saturate(0.35);
}

.hdri-icon.active::before {
  border-color: var(--accent);
  transform: scale(1);
}

.hdri-icon.active:hover img {
  transform: scale(1.1);
}

/* Export Controls */
.export-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.export-option-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.export-label {
  font-size: 0.9rem;
  color: var(--text-dim);
  letter-spacing: -0.01em;
}

.export-button-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

/* Export buttons use same styling as HDRI buttons */
.export-option-btn {
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 0.5rem 0.4rem;
  letter-spacing: -0.01em;
  font-size: 0.75rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: border 0.2s, box-shadow 0.2s, color 0.2s, opacity 0.2s, background 0.2s;
  text-align: center;
  opacity: 0.6;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 2.5rem; /* Match accent-action-btn exactly */
}

.export-option-btn:hover:not(:disabled):not(.is-disabled):not(.active) {
  transition: border 0s, box-shadow 0s, color 0s, opacity 0s, background 0s;
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.25);
  opacity: 1;
}

.export-option-btn.active {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-muted);
  box-shadow: 0 8px 20px var(--accent-shadow);
  opacity: 1;
}


.lights .light-color-row {
  grid-template-columns: 160px auto;
}

.lights .slider-line {
  grid-template-columns: 90px 1fr auto;
}

.rotate-slider {
  grid-template-columns: 80px minmax(0, 1fr) auto;
}

.light-chip {
  width: 88px;
  max-width: 100%;
  height: 14px;
  flex-shrink: 1;
  min-width: 0;
}

.color-chip.is-disabled-handle {
  opacity: 0.5;
  pointer-events: none;
  filter: saturate(0.35);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.export-block {
  text-align: center;
}

.export-block p {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.6rem;
  letter-spacing: -0.01em;
}

.help-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.help-card {
  background: rgba(8, 10, 18, 0.8);
  border: 1px solid var(--stroke);
  border-radius: 1rem;
  max-width: 420px;
  padding: 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

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

.help-card h3 {
  font-family: 'Cal Sans', system-ui, -apple-system, sans-serif;
  margin: 0;
  letter-spacing: -0.01em;
  font-weight: 400;
}

.help-card ol {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-dim);
  line-height: 1.6;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.75rem 1.25rem;
  background: rgba(6, 12, 24, 0.8);
  border: 1px solid var(--accent);
  border-radius: 999px;
  letter-spacing: -0.01em;
  font-size: 0.8rem;
  text-transform: none;
  animation: toast 3s ease forwards;
  pointer-events: none;
  z-index: 15;
}

@keyframes toast {
  0% {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  10%,
  90% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
}

/* Tooltip System */
.tooltip {
  position: absolute;
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 6px;
  color: var(--text);
  font-size: 0.75rem;
  letter-spacing: -0.01em;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  max-width: 300px;
  white-space: normal;
  word-wrap: break-word;
}

.tooltip--visible {
  opacity: 1;
  transform: translateY(0);
}

.tooltip[data-position="top"] {
  transform: translateY(4px);
}

.tooltip[data-position="top"].tooltip--visible {
  transform: translateY(0);
}

.tooltip[data-position="bottom"] {
  transform: translateY(-4px);
}

.tooltip[data-position="bottom"].tooltip--visible {
  transform: translateY(0);
}

.tooltip[data-position="left"] {
  transform: translateX(4px);
}

.tooltip[data-position="left"].tooltip--visible {
  transform: translateX(0);
}

.tooltip[data-position="right"] {
  transform: translateX(-4px);
}

.tooltip[data-position="right"].tooltip--visible {
  transform: translateX(0);
}

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

input[type='range'] {
  appearance: none;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
}

input[type='range']::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 10px var(--accent-glow);
  transition: transform 0.15s ease, width 0.15s ease, height 0.15s ease, background 0.2s ease;
  /* Center the thumb vertically on the track: (thumb height - track height) / 2 = (12 - 4) / 2 = 4px */
  margin-top: -4px;
}

input[type='range']:disabled::-webkit-slider-thumb {
  background: #999;
  box-shadow: none;
  cursor: not-allowed;
}

/* Muted blocks: gray thumbs */
.is-muted input[type='range']::-webkit-slider-thumb {
  background: #999 !important;
  box-shadow: none !important;
}

.is-muted input[type='range']::-moz-range-thumb {
  background: #999 !important;
  box-shadow: none !important;
}

input[type='range']::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
  box-shadow: 0 0 10px var(--accent-glow);
  transition: transform 0.15s ease, width 0.15s ease, height 0.15s ease, background 0.2s ease;
}

input[type='range']:disabled::-moz-range-thumb {
  background: #999;
  box-shadow: none;
  cursor: not-allowed;
}

input[type='range']:hover::-webkit-slider-thumb,
input[type='range']:focus-visible::-webkit-slider-thumb {
  transform: scale(1.083); /* 13px / 12px */
}

input[type='range']:active::-webkit-slider-thumb {
  transform: scale(1.333); /* 16px / 12px */
}

input[type='range']:hover::-moz-range-thumb,
input[type='range']:focus-visible::-moz-range-thumb {
  transform: scale(1.083); /* 13px / 12px */
}

input[type='range']:active::-moz-range-thumb {
  transform: scale(1.333); /* 16px / 12px */
}

input[type='range'].is-disabled-handle::-webkit-slider-thumb {
  background: #999 !important;
  box-shadow: none !important;
  cursor: not-allowed;
}

input[type='range'].is-disabled-handle::-moz-range-thumb {
  background: #999 !important;
  box-shadow: none !important;
  cursor: not-allowed;
}

@media (max-width: 1200px) {
  .shelf {
    width: clamp(280px, 30vw, 340px);
  }
  .color-chip {
    width: 70px;
  }
}

@media (max-width: 960px) {
  .workspace {
    flex-direction: column;
  }
  .shelf {
    width: 100%;
    height: 45vh;
  }
  .viewport {
    height: 55vh;
    min-height: 0;
  }
  .color-chip {
    width: 60px;
  }
}

/* Hide UI on mobile and vertical tablet (smallest window sizes) */
/* Hide when width is small OR when screen is very short (mobile portrait) */
@media (max-width: 1024px), (max-height: 500px) {
  .shelf {
    display: none !important;
  }
  .viewport {
    width: 100% !important;
    height: 100vh !important;
  }
}

body.ui-hidden .top-bar,
body.ui-hidden #dropzone {
  pointer-events: none;
  opacity: 0;
}

body.ui-hidden .shelf {
  pointer-events: none;
}

/* Histogram visualization */
.histogram-container {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  position: relative;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.25s ease;
}

.histogram-container--expanded {
  max-height: 120px;
  opacity: 1;
}

.histogram-container--collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  margin-bottom: -0.35rem; /* pull the divider a bit closer when hidden */
}

/* Information tab quick navigation */
.info-quicknav {
  display: block !important;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.info-quicknav a {
  display: block;
  margin-bottom: 0.25rem;
  color: #7E6BFF;
  text-decoration: none;
  transition: color 0.2s ease;
}

.info-quicknav a:hover {
  color: #9D8AFF;
}

/* Global link hover color for inline text links */
a:hover {
  color: #9D8AFF;
  opacity: 1;
}

.histogram-container canvas {
  width: 100%;
  height: 80px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
}

.histogram-warning {
  position: absolute;
  top: 4px;
  right: 8px;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  pointer-events: none;
  z-index: 10;
}

.histogram-warning--overexposed {
  background: rgba(255, 100, 100, 0.9);
}

.histogram-warning--close {
  background: rgba(255, 150, 50, 0.9);
}

/* Mobile Warning */
.mobile-warning {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 1.5rem 2rem;
  max-width: 90%;
  width: 400px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(22px);
}

.mobile-warning p {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.5;
}

