:root {
  /* Red/black surface scale. */
  --bg-app: #000000;
  --bg-surface: #0c0505;
  --bg-surface-raised: #1a0e0e;
  --bg-surface-hover: #271414;

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.26);

  --text-primary: #ffffff;
  --text-secondary: #9a9a9a;
  --text-muted: #5c5c5c;

  /* The accent scale is the brand red. */
  --accent: #e3272f;
  --accent-bright: #ff3b3f;
  --accent-glow: rgba(227, 39, 47, 0.22);
  --danger: #f2555a;
  --danger-glow: rgba(242, 85, 90, 0.16);
  --success: #4ade80;
  --success-glow: rgba(74, 222, 128, 0.14);

  /* Semantic status colors — kept distinct from the black/white palette
     above on purpose: "modified" (amber), the R/G/B color-channel
     indicators, and danger/success states all carry meaning, not branding,
     so graying them out would make the editor harder to read, not easier. */
  --value-accent: #f59e0b;
  --channel-r: #ef4444;
  --channel-g: #22c55e;
  --channel-b: #60a5fa;

  /* Rounder, more modern scale than before, plus a new xl step for
     hero/sidebar-scale surfaces. */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 28px;

  /* Consistent spacing scale used throughout the new layout. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  /* Soft, black-based depth — used on cards/panels/sidebar instead of the
     app's old flat borders-only look. */
  --shadow-sm: 0 2px 10px -4px rgba(0, 0, 0, 0.55);
  --shadow-md: 0 10px 28px -10px rgba(0, 0, 0, 0.65);
  --shadow-lg: 0 28px 70px -18px rgba(0, 0, 0, 0.75);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 150ms;
  --dur-base: 200ms;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body {
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: -apple-system, "Segoe UI", "Inter", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

button,
input {
  font-family: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

::selection {
  background: var(--accent-glow);
}

/* Scrollbars — kept thin and monochrome so they never stand out against
   the black/white theme. */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: var(--border-strong);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--text-muted);
}

/* Range sliders — same issue: the unfilled track defaults to a bright
   light-grey/white bar unless explicitly styled. `accent-color` (set
   per-slider elsewhere) still colors the thumb; only the track base needs
   overriding here. */
input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

input[type='range']::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
}

/* Subtle ambient background: faint white glows so the black isn't flat. */
#app-root {
  position: relative;
  width: 100%;
  /* No titlebar here (this build runs embedded in an iframe on the website,
     not as a frameless native window) -- 100% instead of the desktop app's
     `calc(100vh - 36px)` + 36px margin-top it reserved for one. */
  height: 100%;
  background:
    radial-gradient(ellipse 1000px 560px at 50% 0%, rgba(227, 39, 47, 0.12), transparent 60%),
    radial-gradient(ellipse 760px 520px at 100% 100%, rgba(227, 39, 47, 0.08), transparent 55%),
    var(--bg-app);
  overflow: hidden;
}

.view {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

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

@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

@keyframes nav-item-in {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes panel-slide-in {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
