/**
 * str8dope.collab — Create surface design system
 * FL Studio–inspired visual language (not a clone).
 * Tokens: charcoal panels, FL orange / neon cyan / lime accents.
 * Import after /css/style.css on create.html (overrides studio warm tokens for this surface).
 */

@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500;600&family=Space+Grotesk:wght@500;600;700&display=swap");

:root {
  /* ——— FL Studio Visual Language tokens ——— */
  --fl-bg: #1a1a1a;
  --fl-panel-0: #242424;
  --fl-panel-1: #2c2c2c;
  --fl-border: #3a3a3a;
  --fl-orange: #ff8a00;
  --fl-cyan: #00e5ff;
  --fl-lime: #a6ff00;
  --fl-text: #e0e0e0;
  --fl-muted: #9a9a9a;
  --fl-deep: #121212;
  --fl-bevel-hi: rgba(255, 255, 255, 0.08);
  --fl-bevel-lo: rgba(0, 0, 0, 0.45);
  --fl-glow-orange: rgba(255, 138, 0, 0.45);
  --fl-glow-cyan: rgba(0, 229, 255, 0.4);
  --fl-glow-lime: rgba(166, 255, 0, 0.35);
  --fl-panel-grad: linear-gradient(180deg, var(--fl-panel-1) 0%, var(--fl-panel-0) 100%);
  --fl-panel-grad-inset: linear-gradient(180deg, var(--fl-panel-0) 0%, #1e1e1e 100%);

  /* Mapped aliases (create + shared components) */
  --bg0: var(--fl-bg);
  --bg1: var(--fl-panel-0);
  --bg2: var(--fl-panel-1);
  --bg-deep: var(--fl-deep);
  --ink: var(--fl-text);
  --muted: var(--fl-muted);
  --line: var(--fl-border);
  --line-strong: #4a4a4a;
  --accent: var(--fl-orange);
  --accent-2: var(--fl-cyan);
  --accent-3: var(--fl-lime);
  --good: var(--fl-lime);
  --warn: var(--fl-orange);
  --bad: #ff3b4a;
  --latency-ok: var(--fl-lime);
  --latency-mid: var(--fl-orange);
  --latency-high: var(--bad);
  --presence-ring: var(--fl-glow-cyan);
  --sheet-scrim: rgba(0, 0, 0, 0.62);
  --shadow: 0 12px 36px rgba(0, 0, 0, 0.55);

  /* Spacing scale (4px base) */
  --space-0: 0;
  --space-1: 0.25rem; /* 4 */
  --space-2: 0.5rem; /* 8 */
  --space-3: 0.75rem; /* 12 */
  --space-4: 1rem; /* 16 */
  --space-5: 1.5rem; /* 24 */
  --space-6: 2rem; /* 32 */
  --space-7: 3rem; /* 48 */
  --space-8: 4rem; /* 64 */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --touch: 44px;

  /* Type — compact geometric sans (no Inter) */
  --font-display: "Space Grotesk", "DM Sans", system-ui, sans-serif;
  --font-body: "DM Sans", "Space Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --text-xs: 0.75rem; /* 12 labels */
  --text-sm: 0.875rem; /* 14 */
  --text-md: 1rem; /* 16 */
  --text-lg: 1.25rem; /* 20 header */
  --text-xl: 1.25rem;
  --text-hero: clamp(1.75rem, 4vw, 2.25rem);
  --leading-tight: 1.15;
  --leading-body: 1.4;
  --tracking-display: -0.02em;

  /* Motion — 120ms ease + glow pulses */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-playhead: cubic-bezier(0.33, 1, 0.68, 1);
  --dur-fast: 120ms;
  --dur-mid: 220ms;
  --dur-slow: 420ms;

  /* ——— Complete UI/UX Architecture aliases ——— */
  --primary: #8b9cb3; /* neutral gray-blue */
  --create-primary: var(--primary);
  --create-accent: var(--fl-cyan); /* electric cyan — architecture accent */
  --create-success: var(--good);
  --create-warning: var(--warn);
  --create-error: var(--bad);
  --create-bg: var(--fl-deep);
  --cs-accent: var(--fl-cyan);
  --cs-accent-2: var(--fl-orange);
  --cs-success: var(--good);
  --cs-warning: var(--warn);
  --cs-error: var(--bad);
  --cs-ink: var(--ink);
  --cs-muted: var(--muted);
  --cs-line: var(--line);
  --cs-bg: var(--bg1);
  --cs-bg-deep: var(--bg-deep);
  --cs-font-body: var(--font-body);
  --cs-font-mono: var(--font-mono);
  --space-xs: 4px;
  --space-s: 8px;
  --space-m: 16px;
  --space-l: 24px;
  --space-xl: 32px;
  --type-display: 1.25rem;
  --type-display-sm: 1.125rem;
  --type-body: 1rem;
  --type-body-sm: 0.875rem;
  --type-mono: 0.8125rem;
  --weight-medium: 500;
  --motion-ui: var(--dur-fast) ease-out;
  --radius: var(--radius-md);
  --shadow-soft: var(--shadow);
}

/* ——— Create shell: one composition ——— */

.create-body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--ink);
  background:
    radial-gradient(900px 520px at 6% -8%, rgba(255, 138, 0, 0.12), transparent 55%),
    radial-gradient(700px 420px at 96% 0%, rgba(0, 229, 255, 0.08), transparent 50%),
    radial-gradient(600px 360px at 70% 100%, rgba(166, 255, 0, 0.05), transparent 45%),
    linear-gradient(180deg, #1f1f1f 0%, var(--fl-bg) 40%, var(--fl-deep) 100%);
  background-attachment: fixed;
}

.create-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: var(--space-4) var(--space-4) var(--space-3);
  gap: var(--space-3);
}

.create-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.create-brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-hero);
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-tight);
}

.create-tagline {
  margin: var(--space-1) 0 0;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.create-mental {
  margin: var(--space-2) 0 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  max-width: 28rem;
}

.create-top-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

/* ——— Primitives ——— */

.cs-btn {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #ff9a22 0%, var(--fl-orange) 55%, #e07800 100%);
  color: #1a1208;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-sm);
  min-height: var(--touch);
  padding: 0 var(--space-4);
  border-radius: var(--radius-md);
  box-shadow:
    inset 0 1px 0 var(--fl-bevel-hi),
    inset 0 -1px 0 var(--fl-bevel-lo),
    0 0 0 0 transparent;
  cursor: pointer;
  transition:
    transform var(--dur-fast) var(--ease-out),
    filter var(--dur-fast) ease,
    box-shadow var(--dur-fast) ease;
}

.cs-btn:hover {
  filter: brightness(1.08);
  box-shadow:
    inset 0 1px 0 var(--fl-bevel-hi),
    inset 0 -1px 0 var(--fl-bevel-lo),
    0 0 14px var(--fl-glow-orange);
}

.cs-btn:active {
  transform: scale(0.97);
}

.cs-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.cs-btn--secondary {
  background: var(--fl-panel-grad);
  color: var(--ink);
  border-color: var(--fl-border);
}

.cs-btn--secondary:hover {
  box-shadow:
    inset 0 1px 0 var(--fl-bevel-hi),
    0 0 12px var(--fl-glow-cyan);
}

.cs-btn--ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  box-shadow: none;
}

.cs-btn--danger {
  background: linear-gradient(180deg, #ff5566, #d02838);
  color: #fff8f0;
}

.cs-btn--good {
  background: linear-gradient(180deg, #c4ff44, var(--fl-lime) 55%, #7cbc00);
  color: #12180a;
}

.cs-btn--good:hover {
  box-shadow:
    inset 0 1px 0 var(--fl-bevel-hi),
    0 0 14px var(--fl-glow-lime);
}

.cs-dock {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--fl-border);
  border-radius: var(--radius-md);
  background: var(--fl-panel-grad);
  box-shadow:
    inset 0 1px 0 var(--fl-bevel-hi),
    inset 0 -1px 0 var(--fl-bevel-lo);
}

.cs-dock-item {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  min-width: var(--touch);
  min-height: var(--touch);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition:
    color var(--dur-fast) ease,
    background var(--dur-fast) ease,
    border-color var(--dur-fast) ease,
    box-shadow var(--dur-fast) ease;
}

.cs-dock-item:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.12);
}

.cs-dock-item[aria-pressed="true"],
.cs-dock-item.is-active {
  color: var(--fl-cyan);
  border-color: var(--line-strong);
  background: rgba(0, 229, 255, 0.08);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.18);
}

.cs-dock-item:active {
  transform: scale(0.96);
}

.cs-dock-item__glyph {
  font-family: var(--font-display);
  font-size: 1.1rem;
  line-height: 1;
  text-transform: none;
  letter-spacing: 0;
}

/* Latency dot */
.cs-latency {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

.cs-latency__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--latency-ok);
  flex-shrink: 0;
  box-shadow: 0 0 8px var(--fl-glow-lime);
}

.cs-latency[data-tier="mid"] .cs-latency__dot {
  background: var(--latency-mid);
  box-shadow: 0 0 8px var(--fl-glow-orange);
}

.cs-latency[data-tier="high"] .cs-latency__dot {
  background: var(--latency-high);
  animation: cs-latency-blink 900ms ease-in-out infinite;
  box-shadow: 0 0 8px rgba(255, 59, 74, 0.55);
}

.cs-latency[data-tier="ok"] .cs-latency__dot {
  background: var(--latency-ok);
}

/* Avatar stack */
.cs-avatars {
  display: inline-flex;
  align-items: center;
  flex-direction: row-reverse;
  padding-left: 0.55rem;
}

.cs-avatar {
  width: 28px;
  height: 28px;
  margin-left: -0.55rem;
  border-radius: 50%;
  border: 2px solid var(--bg1);
  background: var(--bg2);
  color: var(--fl-deep);
  font-size: 0.65rem;
  font-weight: 600;
  display: grid;
  place-items: center;
  position: relative;
  box-shadow: 0 0 0 1px var(--presence-ring);
}

.cs-avatar[data-self="true"] {
  box-shadow: 0 0 0 1px var(--accent), 0 0 10px var(--fl-glow-orange);
}

.cs-avatar__overflow {
  background: rgba(0, 0, 0, 0.45);
  font-size: 0.6rem;
  color: var(--muted);
}

/* Sheet (not modal dialog) */
.cs-sheet-root[hidden] {
  display: none !important;
}

.cs-sheet-root {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  align-items: end;
  pointer-events: none;
}

.cs-sheet-scrim {
  position: absolute;
  inset: 0;
  background: var(--sheet-scrim);
  pointer-events: auto;
  animation: cs-fade-in var(--dur-mid) var(--ease-out);
}

.cs-sheet {
  position: relative;
  width: min(520px, 100%);
  margin: 0 auto;
  max-height: min(78dvh, 640px);
  overflow: auto;
  pointer-events: auto;
  border: 1px solid var(--fl-border);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--fl-panel-grad);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 var(--fl-bevel-hi);
  padding: var(--space-5) var(--space-4) var(--space-6);
  animation: cs-sheet-up var(--dur-mid) var(--ease-out);
}

.cs-sheet__handle {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: var(--line-strong);
  margin: 0 auto var(--space-4);
}

.cs-sheet h2 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
}

.cs-sheet p {
  margin: 0 0 var(--space-4);
  color: var(--muted);
  line-height: var(--leading-body);
  font-size: var(--text-sm);
}

@media (min-width: 860px) {
  .cs-sheet-root {
    align-items: center;
    justify-items: center;
  }

  .cs-sheet {
    border-radius: var(--radius-lg);
    border-bottom: 1px solid var(--fl-border);
    max-height: min(70vh, 560px);
  }

  .cs-sheet__handle {
    display: none;
  }
}

/* Stage / timeline region */
.create-stage {
  position: relative;
  min-height: 280px;
  border: 1px solid var(--fl-border);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 40%),
    var(--fl-deep);
  box-shadow: inset 0 1px 0 var(--fl-bevel-hi), inset 0 -1px 0 var(--fl-bevel-lo);
  overflow: hidden;
  touch-action: none;
}

.create-stage__canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 280px;
}

.create-stage__playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--fl-cyan);
  left: 12%;
  pointer-events: none;
  transform: translateX(-50%);
  transition: left var(--dur-mid) var(--ease-playhead);
  will-change: left;
  box-shadow:
    0 0 8px var(--fl-glow-cyan),
    0 0 18px rgba(0, 229, 255, 0.35);
}

.create-stage__playhead.is-recording {
  background: var(--bad);
  box-shadow:
    0 0 8px rgba(255, 59, 74, 0.65),
    0 0 20px rgba(255, 59, 74, 0.35);
}

.create-stage__playhead.is-recording::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: var(--bad);
  box-shadow: 0 0 12px rgba(255, 59, 74, 0.8);
  animation: cs-record-pulse 1.1s ease-in-out infinite;
}

/* Empty / error / coach */
.create-empty,
.create-error,
.create-coach {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: var(--space-3);
  padding: var(--space-5);
  text-align: center;
  pointer-events: none;
}

.create-empty[hidden],
.create-error[hidden],
.create-coach[hidden] {
  display: none !important;
}

.create-empty h2,
.create-error h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: var(--tracking-display);
}

.create-empty p,
.create-error p,
.create-coach p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  max-width: 22rem;
  justify-self: center;
}

.create-empty__actions,
.create-error__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
  pointer-events: auto;
}

.create-coach {
  place-content: end start;
  align-content: end;
  justify-items: start;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.72));
  pointer-events: none;
}

.create-coach__mark {
  pointer-events: auto;
  max-width: 18rem;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--fl-border);
  border-radius: var(--radius-md);
  background: rgba(36, 36, 36, 0.96);
  box-shadow: inset 0 1px 0 var(--fl-bevel-hi);
  animation: cs-coach-in var(--dur-slow) var(--ease-out);
}

.create-coach__mark strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  margin-bottom: var(--space-1);
  color: var(--ink);
}

.create-presence-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--muted);
}

.create-clock-chip {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--fl-cyan);
  letter-spacing: 0.02em;
  text-shadow: 0 0 8px var(--fl-glow-cyan);
}

/* Tactile FL controls (CSS-only) */
.cs-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  max-width: 140px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #1a1a1a, #2a2a2a);
  border: 1px solid var(--fl-border);
  outline: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.55);
}

.cs-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3e0, var(--fl-orange) 55%, #c66a00);
  border: 1px solid #ffb14d;
  box-shadow: 0 0 10px var(--fl-glow-orange);
  cursor: pointer;
  transition: box-shadow var(--dur-fast) ease, transform var(--dur-fast) ease;
}

.cs-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3e0, var(--fl-orange) 55%, #c66a00);
  border: 1px solid #ffb14d;
  box-shadow: 0 0 10px var(--fl-glow-orange);
  cursor: pointer;
}

.cs-slider:hover::-webkit-slider-thumb {
  box-shadow: 0 0 16px var(--fl-glow-orange);
  transform: scale(1.06);
}

.cs-knob {
  --knob-angle: 135deg;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--fl-border);
  background:
    conic-gradient(from 210deg, var(--fl-orange) 0 var(--knob-angle), #1e1e1e var(--knob-angle) 1turn),
    radial-gradient(circle at 40% 35%, #3a3a3a, #1a1a1a 70%);
  box-shadow:
    inset 0 1px 0 var(--fl-bevel-hi),
    inset 0 -2px 4px var(--fl-bevel-lo),
    0 0 10px rgba(255, 138, 0, 0.15);
  position: relative;
}

.cs-knob::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 6px;
  width: 2px;
  height: 10px;
  margin-left: -1px;
  border-radius: 1px;
  background: var(--fl-text);
  transform-origin: 50% 12px;
  transform: rotate(calc(var(--knob-angle) - 135deg));
  box-shadow: 0 0 6px var(--fl-glow-cyan);
}

/* ——— Motion keyframes ——— */

@keyframes cs-record-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 10px rgba(255, 59, 74, 0.7);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.85);
    box-shadow: 0 0 18px rgba(255, 59, 74, 0.95);
  }
}

@keyframes cs-latency-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}

@keyframes cs-sheet-up {
  from {
    transform: translateY(12%);
    opacity: 0.6;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes cs-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes cs-coach-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cs-glow-pulse {
  0%,
  100% {
    box-shadow: 0 0 8px var(--fl-glow-orange);
  }
  50% {
    box-shadow: 0 0 18px var(--fl-glow-orange), 0 0 28px rgba(255, 138, 0, 0.25);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cs-btn,
  .cs-dock-item,
  .create-stage__playhead,
  .cs-sheet,
  .cs-sheet-scrim,
  .create-coach__mark,
  .c-btn,
  .c-dock-btn,
  .acu-record {
    animation: none !important;
    transition: none !important;
  }

  .cs-latency[data-tier="high"] .cs-latency__dot,
  .create-stage__playhead.is-recording::after,
  .acu-record[data-state="recording"] {
    animation: none !important;
  }
}

/* ——— c-* component library (createComponents.js / createStudio) ——— */

.c-btn {
  appearance: none;
  border: 1px solid var(--fl-border);
  background: var(--fl-panel-grad);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
  min-height: 2.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: inset 0 1px 0 var(--fl-bevel-hi), inset 0 -1px 0 var(--fl-bevel-lo);
  transition:
    filter var(--dur-fast) ease,
    box-shadow var(--dur-fast) ease,
    transform var(--dur-fast) ease,
    background var(--dur-fast) ease;
}

.c-btn:hover {
  filter: brightness(1.1);
  box-shadow:
    inset 0 1px 0 var(--fl-bevel-hi),
    0 0 12px var(--fl-glow-cyan);
}

.c-btn:active {
  transform: scale(0.97);
}

.c-btn--primary {
  background: linear-gradient(180deg, #c8ff4a, var(--fl-lime) 55%, #7cbc00);
  color: #12180a;
  border-color: #8fd400;
}

.c-btn--primary:hover,
.c-btn--primary.c-btn--active {
  box-shadow:
    inset 0 1px 0 var(--fl-bevel-hi),
    0 0 14px var(--fl-glow-lime);
}

.c-btn--danger {
  background: linear-gradient(180deg, #ff5566, var(--bad));
  color: #fff;
  border-color: #ff6b78;
}

.c-btn--danger.is-recording,
.c-btn--danger.c-btn--active,
.acu-record[data-state="recording"] {
  animation: cs-glow-pulse 1.1s ease-in-out infinite;
  box-shadow: 0 0 16px rgba(255, 59, 74, 0.65);
}

.c-btn--ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--muted);
}

.c-btn--ghost:hover,
.c-btn--ghost.c-btn--active {
  color: var(--fl-cyan);
  border-color: var(--fl-border);
  background: rgba(0, 229, 255, 0.08);
}

.c-btn--active {
  box-shadow:
    inset 0 1px 0 var(--fl-bevel-hi),
    0 0 14px var(--fl-glow-orange);
}

.c-transport {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--fl-border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #2a2a2a, #1e1e1e);
  box-shadow: inset 0 1px 0 var(--fl-bevel-hi), inset 0 -1px 0 var(--fl-bevel-lo);
}

.c-transport__time,
.c-transport__bpm {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  color: var(--fl-cyan);
  letter-spacing: 0.04em;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--fl-border);
  text-shadow: 0 0 8px var(--fl-glow-cyan);
}

.c-transport__bpm {
  color: var(--fl-orange);
  text-shadow: 0 0 8px var(--fl-glow-orange);
}

.c-transport__bpm strong {
  font-weight: 600;
}

.c-latency-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  display: inline-block;
  background: var(--muted);
  box-shadow: 0 0 0 0 transparent;
}

.c-latency-dot[data-level="g"] {
  background: var(--fl-lime);
  box-shadow: 0 0 8px var(--fl-glow-lime);
}

.c-latency-dot[data-level="y"] {
  background: var(--fl-orange);
  box-shadow: 0 0 8px var(--fl-glow-orange);
}

.c-latency-dot[data-level="r"] {
  background: var(--bad);
  box-shadow: 0 0 8px rgba(255, 59, 74, 0.55);
  animation: cs-latency-blink 900ms ease-in-out infinite;
}

.c-dock,
.c-dockbar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.c-dock-btn {
  appearance: none;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--fl-border);
  background: var(--fl-panel-grad);
  color: var(--fl-cyan);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 var(--fl-bevel-hi);
  transition: box-shadow var(--dur-fast) ease, color var(--dur-fast) ease;
}

.c-dock-btn:hover,
.c-dock-btn--active {
  color: var(--fl-orange);
  box-shadow: 0 0 12px var(--fl-glow-orange);
}

.acu-record {
  appearance: none;
  width: 2.45rem;
  height: 2.45rem;
  border-radius: var(--radius-md);
  border: 1px solid #ff6b78;
  background: linear-gradient(180deg, #ff5566, var(--bad));
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: box-shadow var(--dur-fast) ease, filter var(--dur-fast) ease;
}

.acu-record__glyph {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.55);
}

.acu-record[data-state="armed"] {
  background: linear-gradient(180deg, #ff9a22, var(--fl-orange));
  border-color: #ffb14d;
  box-shadow: 0 0 14px var(--fl-glow-orange);
}

.acu-record[data-state="recording"] .acu-record__glyph {
  border-radius: 2px;
  width: 0.65rem;
  height: 0.65rem;
  animation: cs-record-pulse 1s ease-in-out infinite;
}

.acu-monitor {
  display: inline-flex;
  gap: 0.25rem;
}

.acu-monitor__btn {
  appearance: none;
  border: 1px solid var(--fl-border);
  background: var(--fl-panel-grad-inset);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}

.acu-monitor__btn[aria-pressed="true"] {
  color: var(--fl-lime);
  box-shadow: 0 0 10px var(--fl-glow-lime);
  border-color: #4a4a4a;
}

.c-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  max-height: min(62dvh, 480px);
  padding: var(--space-4);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border: 1px solid var(--fl-border);
  border-bottom: none;
  background: var(--fl-panel-grad);
  box-shadow: var(--shadow), inset 0 1px 0 var(--fl-bevel-hi);
  transform: translateY(105%);
  transition: transform var(--dur-mid) var(--ease-out);
}

.c-sheet.is-open {
  transform: translateY(0);
}

.c-sheet__handle {
  width: 2.4rem;
  height: 0.28rem;
  border-radius: 99px;
  background: var(--line-strong);
  margin: 0 auto var(--space-3);
}

.c-sheet__title {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-lg);
}

.c-avatar {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 0.65rem;
  font-weight: 600;
  color: #121212;
  background: var(--fl-orange);
  border: 2px solid var(--bg1);
}

.c-chat {
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--fl-border);
  background: rgba(0, 0, 0, 0.28);
  margin-bottom: 0.35rem;
}

.c-chat__meta {
  font-size: var(--text-xs);
  color: var(--fl-cyan);
  font-family: var(--font-mono);
}

.c-chat__body {
  font-size: var(--text-sm);
  color: var(--ink);
}

.c-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--ink);
  font-size: var(--text-sm);
}

.c-toggle__track {
  width: 2.4rem;
  height: 1.2rem;
  border-radius: 999px;
  background: #1a1a1a;
  border: 1px solid var(--fl-border);
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.55);
}

.c-toggle__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3e0, var(--fl-orange));
  transition: transform var(--dur-fast) ease;
  box-shadow: 0 0 8px var(--fl-glow-orange);
}

.c-toggle[data-on="true"] .c-toggle__thumb {
  transform: translateX(1.1rem);
}

.c-slider {
  display: grid;
  gap: 0.25rem;
  font-size: var(--text-xs);
  color: var(--muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.c-slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #1a1a1a, #2a2a2a);
  border: 1px solid var(--fl-border);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.55);
}

.c-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3e0, var(--fl-orange) 55%, #c66a00);
  border: 1px solid #ffb14d;
  box-shadow: 0 0 10px var(--fl-glow-orange);
  cursor: pointer;
}

/* Playhead glow overlay (CSS approx of Zig/WebGPU shaders) */
.create-playhead-glow {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  left: 0;
  background: var(--fl-cyan);
  box-shadow: 0 0 10px var(--fl-glow-cyan), 0 0 22px rgba(0, 229, 255, 0.35);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur-fast) ease;
}

.create-playhead-glow[data-on="true"] {
  opacity: 1;
}

.create-onset-ripple {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  border: 2px solid var(--fl-cyan);
  box-shadow: 0 0 12px var(--fl-glow-cyan);
  pointer-events: none;
  opacity: 0;
  transform: scale(0.4);
}

.create-onset-ripple.is-pulse {
  animation: attack-ripple 0.55s ease-out;
}

@keyframes attack-ripple {
  0% {
    opacity: 0.9;
    transform: scale(0.4);
  }
  100% {
    opacity: 0;
    transform: scale(6);
  }
}

.create-stage__empty,
.create-stage__error {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: var(--space-2);
  text-align: center;
  padding: var(--space-5);
  pointer-events: none;
  color: var(--muted);
}

.create-stage__empty h2,
.create-stage__error h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--ink);
}
