:root,
[data-theme="slate"] {
  --bg:               #121316;
  --surface:          #1A1C20;
  --surface-elevated: #23262D;
  --surface-dark:     #0E1013;
  --border:           rgba(255, 255, 255, 0.09);
  --border-inset:     rgba(0, 0, 0, 0.52);
  --specular:         rgba(255, 255, 255, 0.11);
  --accent:           #0071E3;
  --accent-bright:    #38BDF8;
  --accent-amber:     #F59E0B;
  --accent-subtle:    rgba(56, 189, 248, 0.14);
  --led-cyan:         #00E5FF;
  --led-emerald:      #22C55E;
  --text:             #F3F4F6;
  --text-muted:       #9CA3AF;
  --text-dim:         #6B7280;
  --neu-shadow-dark:  rgba(6, 7, 9, 0.82);
  --neu-shadow-light: rgba(38, 42, 50, 0.65);
  --font-sans:        "Albert Sans", "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono:        "JetBrains Mono", "SF Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius-sm:        8px;
  --radius-md:        14px;
  --radius-lg:        20px;
  --radius-xl:        28px;
  --ease-out-expo:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:      cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="emerald"] {
  --bg:               #0B1410;
  --surface:          #12211B;
  --surface-elevated: #192D25;
  --surface-dark:     #070E0B;
  --border:           rgba(52, 211, 153, 0.16);
  --accent:           #059669;
  --accent-bright:    #34D399;
  --accent-subtle:    rgba(52, 211, 153, 0.14);
  --led-cyan:         #34D399;
}

[data-theme="crimson"] {
  --bg:               #160D10;
  --surface:          #221418;
  --surface-elevated: #2D1B20;
  --surface-dark:     #0E080A;
  --border:           rgba(251, 113, 133, 0.16);
  --accent:           #E11D48;
  --accent-bright:    #FB7185;
  --accent-subtle:    rgba(251, 113, 133, 0.14);
  --led-cyan:         #FB7185;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 50% 0%, var(--accent-subtle), transparent 55%),
    radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 100% 100%, 24px 24px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 0.28s var(--ease-out-expo), color 0.28s var(--ease-out-expo);
}

:focus-visible {
  outline: 2px solid var(--accent-bright) !important;
  outline-offset: 3px;
  box-shadow: 0 0 0 4px var(--accent-subtle) !important;
}

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

.psx-outset {
  background: linear-gradient(145deg, var(--surface-elevated), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow:
    inset 0 1px 0 0 var(--specular),
    8px 8px 18px var(--neu-shadow-dark),
    -6px -6px 14px var(--neu-shadow-light);
}

.psx-inset {
  background-color: var(--surface-dark);
  border: 1px solid var(--border-inset);
  border-radius: var(--radius-md);
  box-shadow:
    inset 4px 4px 8px var(--neu-shadow-dark),
    inset -3px -3px 7px var(--neu-shadow-light);
}

main {
  max-width: 65rem;
  margin: 0 auto;
  padding: 0 1.5rem 6rem;
}

.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin-bottom: 0.625rem;
}

.section-title {
  text-align: center;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 0.75rem;
  text-wrap: balance;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 54ch;
  margin: 0 auto;
  text-wrap: pretty;
}

.site-nav {
  position: sticky;
  top: 1rem;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.625rem 1.25rem;
  margin: 1rem 0 2.5rem;
  background: rgba(22, 24, 29, 0.78); backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.12),
    0 12px 24px -4px rgba(0, 0, 0, 0.45);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 0.5rem;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--led-emerald);
  box-shadow: 0 0 8px var(--led-emerald);
}

.hero-logo-accent {
  color: var(--accent-bright);
}

.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.5rem 0.9375rem;
  border-radius: 999px;
  transition:
    color 0.18s var(--ease-out-expo),
    background-color 0.18s var(--ease-out-expo),
    transform 0.18s var(--ease-out-expo);
}

.nav-link:hover {
  color: var(--text);
  background-color: rgba(255, 255, 255, 0.08);
}

.nav-link:active {
  transform: scale(0.97);
}

.hero {
  text-align: center;
  padding: 2.5rem 0 3.5rem;
}

.hero-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.375rem 0.875rem;
  margin-bottom: 1.25rem;
  border-radius: 999px;
  background-color: var(--surface-dark);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.hero-logo {
  font-size: clamp(2.75rem, 7vw, 4.75rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--text);
  line-height: 1.04;
  margin-bottom: 1.25rem;
  text-wrap: balance;
}

.hero-tagline {
  font-size: clamp(1.0625rem, 2.2vw, 1.3125rem);
  font-weight: 400;
  color: var(--text-muted);
  max-width: 56ch;
  margin: 0 auto 2rem;
  line-height: 1.55;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.shortcuts-bar {
  margin: 1.5rem auto 0;
  max-width: 44rem;
  background-color: var(--surface-dark);
  border: 1px solid var(--border-inset);
  border-radius: var(--radius-lg);
  box-shadow:
    inset 4px 4px 8px var(--neu-shadow-dark),
    inset -4px -4px 8px var(--neu-shadow-light);
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.125rem;
}

.shortcut-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
}

.key-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 0.25rem 0.5rem;
  background: linear-gradient(145deg, var(--surface-elevated), var(--surface-dark));
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow:
    inset 0 1px 0 0 var(--specular),
    2px 2px 5px var(--neu-shadow-dark),
    -2px -2px 5px var(--neu-shadow-light);
}

.deck-showcase {
  padding: 1.5rem 0 4rem;
  perspective: 1100px;
}

.deck-chassis {
  max-width: 52rem;
  margin: 0 auto;
  padding: 1.5rem;
  border-radius: var(--radius-xl);
  background: linear-gradient(145deg, var(--surface-elevated), var(--surface));
  border: 1px solid var(--border);
  box-shadow:
    inset 0 1px 0 0 var(--specular),
    0 24px 48px -12px rgba(0, 0, 0, 0.7),
    10px 10px 24px var(--neu-shadow-dark),
    -8px -8px 20px var(--neu-shadow-light);
  transform-style: preserve-3d;
}

.deck-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.deck-telemetry {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.875rem;
}

.telemetry-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.led-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--led-cyan);
  box-shadow: 0 0 8px var(--led-cyan);
}

.theme-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem;
  background-color: var(--surface-dark);
  border: 1px solid var(--border-inset);
  border-radius: 999px;
}

.theme-pill {
  min-height: 44px;
  padding: 0.375rem 0.875rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition:
    color 0.16s var(--ease-out-expo),
    background-color 0.16s var(--ease-out-expo),
    border-color 0.16s var(--ease-out-expo),
    transform 0.16s var(--ease-out-expo);
}

.theme-pill:hover {
  color: var(--text);
}

.theme-pill:active {
  transform: scale(0.97);
}

.theme-pill[aria-pressed="true"] {
  background: linear-gradient(145deg, var(--surface-elevated), var(--surface));
  color: var(--accent-bright);
  border-color: var(--border);
  box-shadow:
    inset 0 1px 0 0 var(--specular),
    2px 2px 6px var(--neu-shadow-dark);
}

.deck-well {
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  background-color: var(--surface-dark);
  border: 1px solid var(--border-inset);
  box-shadow:
    inset 5px 5px 10px var(--neu-shadow-dark),
    inset -4px -4px 9px var(--neu-shadow-light);
}

.deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.deck-pad {
  min-height: 98px;
  padding: 0.875rem;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, var(--surface-elevated), var(--surface));
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-sans);
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.5rem;
  box-shadow:
    inset 0 1px 0 0 var(--specular),
    5px 5px 12px var(--neu-shadow-dark),
    -4px -4px 10px var(--neu-shadow-light);
  transition:
    transform 0.16s var(--ease-spring),
    border-color 0.16s var(--ease-out-expo),
    box-shadow 0.16s var(--ease-out-expo);
}

.deck-pad:hover {
  transform: translateY(-2px);
  border-color: var(--accent-bright);
}

.deck-pad:active,
.deck-pad[aria-pressed="true"] {
  transform: scale(0.97);
  border-color: var(--accent-bright);
  box-shadow:
    inset 3px 3px 7px var(--neu-shadow-dark),
    inset -3px -3px 7px var(--neu-shadow-light),
    0 0 12px var(--accent-subtle);
}

.pad-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.pad-icon {
  width: 20px;
  height: 20px;
  color: var(--accent-bright);
  flex-shrink: 0;
}

.pad-code {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.pad-label {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.deck-mixer-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.mixer-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.mixer-slider {
  flex: 1;
  min-width: 160px;
  height: 44px;
  background: transparent;
  cursor: pointer;
  accent-color: var(--accent-bright);
}

.mixer-readout {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--led-cyan);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg);
  border: 1px solid var(--border);
}

.deck-log-bar {
  margin-top: 1rem;
  padding: 0.625rem 1rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--accent-bright);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.downloads {
  padding: 2.5rem 0 4rem;
}

.download-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 47.5rem;
  margin: 0 auto;
}

.download-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem 1.5rem;
  background: linear-gradient(145deg, var(--surface-elevated), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 0 var(--specular),
    8px 8px 16px var(--neu-shadow-dark),
    -8px -8px 16px var(--neu-shadow-light);
  transition:
    transform 0.2s var(--ease-out-expo),
    border-color 0.2s var(--ease-out-expo),
    box-shadow 0.2s var(--ease-out-expo);
}

.download-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent-bright);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.16),
    10px 10px 20px var(--neu-shadow-dark),
    -10px -10px 20px var(--neu-shadow-light);
}

.download-btn:active {
  transform: scale(0.97);
  border-color: var(--border-inset);
  box-shadow:
    inset 4px 4px 8px var(--neu-shadow-dark),
    inset -4px -4px 8px var(--neu-shadow-light);
}

.btn-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background-color: var(--surface-dark);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-bright);
  box-shadow:
    inset 2px 2px 5px var(--neu-shadow-dark),
    inset -2px -2px 5px var(--neu-shadow-light);
}

.btn-svg {
  width: 26px;
  height: 26px;
}

.btn-title {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
}

.btn-sub {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.how-it-works {
  padding: 3rem 0 4rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.step {
  background: linear-gradient(145deg, var(--surface-elevated), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow:
    inset 0 1px 0 0 var(--specular),
    8px 8px 16px var(--neu-shadow-dark),
    -8px -8px 16px var(--neu-shadow-light);
  padding: 2rem 1.5rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.step-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--led-cyan);
  letter-spacing: 0.06em;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  background-color: var(--surface-dark);
  border: 1px solid var(--border);
}

.step-icon {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
}

.step-title {
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text);
}

.step-text {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.75rem;
  font-size: 0.8125rem;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.5rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.16s var(--ease-out-expo);
}

.footer-link:hover {
  color: var(--accent-bright);
  text-decoration: underline;
}

.skip-link {
  position: absolute;
  top: -120px;
  left: 20px;
  z-index: 60;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0.625rem 1.125rem;
  background-color: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--accent-bright);
  border-radius: var(--radius-sm);
  transition: top 0.18s var(--ease-out-expo);
}

.skip-link:focus,
.skip-link:focus-visible {
  top: 20px;
}

.legal-page {
  max-width: 53.75rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 5rem;
}

.legal-header {
  margin-bottom: 2.25rem;
  text-align: left;
}

.legal-title {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 0.75rem;
  text-wrap: balance;
}

.legal-badge {
  display: inline-block;
  padding: 0.3125rem 0.75rem;
  background-color: var(--accent-subtle);
  color: var(--accent-bright);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-bottom: 0.875rem;
}

.legal-meta {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.legal-card {
  color: var(--text);
  padding: 2.5rem 2.25rem;
  margin-bottom: 2.25rem;
  line-height: 1.65;
}

.legal-toc {
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

.legal-toc h2 {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.legal-toc ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.5rem;
}

.legal-toc a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--accent-bright);
  text-decoration: none;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.legal-toc a:hover {
  text-decoration: underline;
}

.legal-section {
  margin-bottom: 2.25rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}

.legal-section:last-child {
  border-bottom: none;
}

.legal-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
  margin-top: 1rem;
  margin-bottom: 0.75rem;
}

.legal-section h3 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.legal-section p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 0.875rem;
  text-wrap: pretty;
}

.legal-section ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.legal-section li {
  margin-bottom: 0.375rem;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.875rem;
}

.legal-table th,
.legal-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border: 1px solid var(--border);
}

.legal-table th {
  background-color: var(--surface-dark);
  font-weight: 600;
  color: var(--text);
}

.legal-table td {
  color: var(--text-muted);
}

.back-btn-row {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 1.5rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 0.5rem;
  padding: 0.625rem 1.125rem;
  border-radius: var(--radius-md);
  color: var(--text);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 600;
  transition:
    transform 0.16s var(--ease-out-expo),
    border-color 0.16s var(--ease-out-expo),
    box-shadow 0.16s var(--ease-out-expo);
}

.back-link:hover {
  transform: translateY(-1px);
  border-color: var(--accent-bright);
}

.back-link:active {
  transform: scale(0.97);
  box-shadow:
    inset 4px 4px 8px var(--neu-shadow-dark),
    inset -4px -4px 8px var(--neu-shadow-light);
}

.icon-inline {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.layout-creator {
  padding: 2.5rem 0 4rem;
}

.creator-chassis {
  max-width: 58rem;
  margin: 0 auto;
  padding: 1.5rem;
  border-radius: var(--radius-xl);
}

.creator-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.creator-dims-group {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
}

.creator-field-inline {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.creator-field-inline label,
.seed-label,
.slot-field label,
.slot-legend {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.creator-select {
  min-height: 48px;
  min-width: 5.5rem;
  padding: 0.5rem 0.875rem;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  cursor: pointer;
}

.creator-select-full {
  width: 100%;
}

.creator-presets-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.creator-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, var(--surface-elevated), var(--surface));
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 0 var(--specular),
    4px 4px 10px var(--neu-shadow-dark),
    -3px -3px 8px var(--neu-shadow-light);
  transition:
    transform 0.16s var(--ease-spring),
    border-color 0.16s var(--ease-out-expo),
    color 0.16s var(--ease-out-expo);
}

.creator-btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent-bright);
  color: var(--accent-bright);
}

.creator-btn:active {
  transform: scale(0.97);
}

.creator-btn-accent {
  border-color: var(--accent-bright);
  color: var(--accent-bright);
  box-shadow:
    inset 0 1px 0 0 var(--specular),
    0 0 14px var(--accent-subtle),
    4px 4px 10px var(--neu-shadow-dark);
}

.creator-well {
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.25rem;
}

.creator-grid {
  display: grid;
  grid-template-columns: repeat(var(--creator-cols, 3), minmax(110px, 1fr));
  gap: 0.875rem;
  overflow-x: auto;
}

.creator-slot {
  min-height: 104px;
  padding: 0.875rem;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, var(--surface-elevated), var(--surface));
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-sans);
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.5rem;
  box-shadow:
    inset 0 1px 0 0 var(--specular),
    4px 4px 10px var(--neu-shadow-dark),
    -3px -3px 8px var(--neu-shadow-light);
  transition:
    transform 0.16s var(--ease-spring),
    border-color 0.16s var(--ease-out-expo);
}

.creator-slot:hover {
  transform: translateY(-2px);
  border-color: var(--accent-bright);
}

.creator-slot:active {
  transform: scale(0.97);
}

.creator-slot-empty {
  background: var(--surface-dark);
  border: 1px dashed var(--border);
  color: var(--text-muted);
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: none;
}

.slot-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 0.5rem;
}

.slot-type-pill {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background-color: var(--surface-dark);
  border: 1px solid var(--border);
  color: var(--accent-bright);
}

.slot-type-pill-fader {
  color: var(--led-emerald);
}

.slot-coord-code {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.slot-main-label {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  word-break: break-word;
}

.slot-action-code {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.slot-fader-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background-color: var(--surface-dark);
  border: 1px solid var(--border-inset);
  overflow: hidden;
}

.slot-fader-fill {
  height: 100%;
  background-color: var(--accent-bright);
  border-radius: 999px;
}

.creator-seed-panel {
  padding-top: 0.5rem;
}

.seed-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.seed-input-row {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.seed-input {
  flex: 1;
  min-width: 220px;
  min-height: 48px;
  padding: 0.625rem 0.875rem;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.seed-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background-color: rgba(8, 9, 12, 0.82);
}

.creator-dialog[open] {
  margin: auto;
  width: min(92vw, 30rem);
  padding: 1.5rem;
  color: var(--text);
  border-radius: var(--radius-xl);
}

.slot-editor-form {
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.dialog-title {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.slot-fieldset {
  border: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.radio-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 0.375rem;
}

.radio-card {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 48px;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-md);
  background-color: var(--surface-dark);
  border: 1px solid var(--border);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.radio-card input[type="radio"] {
  accent-color: var(--accent-bright);
  width: 18px;
  height: 18px;
}

.slot-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.color-picker-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.color-swatch-input {
  width: 56px;
  min-height: 48px;
  padding: 0.25rem;
  cursor: pointer;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
