@import 'tailwindcss';

:root {
  color-scheme: dark;
  --bg-primary: #000000;
  --bg-secondary: #050505;
  --bg-tertiary: #0a0a0a;
  --panel-surface: rgba(8, 11, 16, 0.92);
  --panel-surface-soft: rgba(12, 16, 22, 0.84);
  --panel-outline: rgba(255, 255, 255, 0.09);
  --panel-outline-strong: rgba(255, 255, 255, 0.16);
  --panel-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);

  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.045);
  --glass-highlight-strong: rgba(255, 255, 255, 0.14);

  --text-primary: rgba(255, 255, 255, 0.95);
  --text-secondary: rgba(255, 255, 255, 0.62);
  --text-tertiary: rgba(255, 255, 255, 0.42);
  --text-muted: rgba(255, 255, 255, 0.3);
  --danger: #f87171;
  --warning: #ffbf00;
  --success: #22c55e;

  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --accent-glow: rgba(56, 189, 248, 0.3);
  --accent-rgb: 56, 189, 248;
  --toolbar-bg: rgba(0, 0, 0, 0.74);
  --settings-bg-top: rgba(8, 10, 14, 0.94);
  --settings-bg-bottom: rgba(4, 6, 9, 0.98);
  --bottom-bar-bg: rgba(2, 4, 7, 0.98);
  --menu-bg: rgba(8, 11, 16, 0.96);
  --menu-border: rgba(255, 255, 255, 0.1);
  --control-bg: rgba(255, 255, 255, 0.03);
  --control-bg-hover: rgba(255, 255, 255, 0.06);
  --control-bg-active: rgba(var(--accent-rgb), 0.12);
  --control-border: rgba(255, 255, 255, 0.08);
  --control-border-active: rgba(var(--accent-rgb), 0.28);
  --control-text: rgba(255, 255, 255, 0.92);
  --input-bg: rgba(10, 14, 20, 0.96);
  --input-bg-focus: rgba(12, 17, 24, 0.98);
  --input-border: rgba(255, 255, 255, 0.09);
  --input-border-focus: rgba(var(--accent-rgb), 0.26);
  --option-bg: rgba(8, 11, 16, 0.96);
  --option-text: rgba(245, 247, 250, 1);
  --slider-track: rgba(255, 255, 255, 0.08);
  --slider-fill: rgba(56, 189, 248, 0.82);
  --slider-thumb: rgba(125, 211, 252, 1);
  --divider: rgba(255, 255, 255, 0.08);
  --scope-bg: #000000;
  --scope-guides: rgba(255, 255, 255, 0.1);
  --scope-overlay-bg: rgba(8, 12, 18, 0.88);
  --scope-overlay-text: rgba(255, 255, 255, 0.76);
  --scope-overlay-border: rgba(255, 255, 255, 0.12);
  --scope-resize-handle: rgba(255, 255, 255, 0.12);
}

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

html,
body,
#root {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Window background customization: in blurred/clear modes the OS desktop shows
   through wherever the app paints with alpha. --window-bg-alpha (0..1) controls
   how opaque the themed background stays; visualizer content remains crisp.
   The tint lives on stable DOM layers (scope strips, panels) — never on the
   constantly-repainting canvases — so it cannot shimmer against the backdrop. */
html[data-window-bg='blurred'],
html[data-window-bg='clear'],
html[data-window-bg='blurred'] body,
html[data-window-bg='clear'] body,
html[data-window-bg='blurred'] #root,
html[data-window-bg='clear'] #root {
  background: transparent;
}

html[data-window-bg='blurred'] .scope-strip,
html[data-window-bg='clear'] .scope-strip,
html[data-window-bg='blurred'] .scope-popout,
html[data-window-bg='clear'] .scope-popout {
  background-color: color-mix(
    in srgb,
    var(--scope-bg) calc(var(--window-bg-alpha, 1) * 100%),
    transparent
  );
}

html[data-window-bg='blurred'] .prism-settings-region,
html[data-window-bg='clear'] .prism-settings-region {
  background: color-mix(
    in srgb,
    var(--bg-primary) calc(var(--window-bg-alpha, 1) * 100%),
    transparent
  );
}

button,
input,
select {
  font: inherit;
}

button,
select {
  appearance: none;
  -webkit-appearance: none;
}

.prism-app {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.window-resize-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}

.window-resize-overlay__handle {
  position: absolute;
  pointer-events: auto;
  -webkit-app-region: no-drag;
}

.window-resize-overlay__handle--n,
.window-resize-overlay__handle--s {
  left: 12px;
  right: 12px;
  height: 4px;
}

.window-resize-overlay__handle--e,
.window-resize-overlay__handle--w {
  top: 12px;
  bottom: 12px;
  width: 4px;
}

.window-resize-overlay__handle--n {
  top: 0;
  cursor: ns-resize;
}

.window-resize-overlay__handle--s {
  bottom: 0;
  cursor: ns-resize;
}

.window-resize-overlay__handle--e {
  right: 0;
  cursor: ew-resize;
}

.window-resize-overlay__handle--w {
  left: 0;
  cursor: ew-resize;
}

.window-resize-overlay__handle--ne,
.window-resize-overlay__handle--nw,
.window-resize-overlay__handle--se,
.window-resize-overlay__handle--sw {
  width: 12px;
  height: 12px;
}

.window-resize-overlay__handle--ne {
  top: 0;
  right: 0;
  cursor: nesw-resize;
}

.window-resize-overlay__handle--nw {
  top: 0;
  left: 0;
  cursor: nwse-resize;
}

.window-resize-overlay__handle--se {
  right: 0;
  bottom: 0;
  cursor: nwse-resize;
}

.window-resize-overlay__handle--sw {
  left: 0;
  bottom: 0;
  cursor: nesw-resize;
}

.prism-toolbar-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}

.prism-toolbar-layer.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.prism-strip-region {
  flex: 1;
  min-height: 0;
}

.prism-settings-region {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    linear-gradient(180deg, var(--settings-bg-top), var(--settings-bg-bottom)),
    var(--panel-surface-soft);
  border-top: 1px solid var(--divider);
  box-shadow: 0 -16px 34px rgba(0, 0, 0, 0.34);
}

.prism-settings-region.is-hidden {
  visibility: hidden;
  pointer-events: none;
  border-top-color: transparent;
  box-shadow: none;
}

.app-banner-layer {
  position: absolute;
  top: 10px;
  left: 12px;
  right: 12px;
  z-index: 18;
  pointer-events: none;
  display: flex;
  justify-content: center;
}

.app-banner {
  width: min(520px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--control-border);
  background: linear-gradient(180deg, var(--panel-surface), var(--panel-surface-soft));
  box-shadow: var(--panel-shadow);
  pointer-events: auto;
}

.app-banner--error {
  border-color: color-mix(in srgb, var(--danger) 32%, transparent);
}

.app-banner--info {
  border-color: var(--control-border-active);
}

.app-banner__message {
  flex: 1;
  min-width: 0;
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.45;
}

.app-banner__actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.app-banner__action,
.app-banner__dismiss {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--control-border);
  background: var(--control-bg);
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.app-banner__action:hover,
.app-banner__dismiss:hover,
.app-banner__action:focus-visible,
.app-banner__dismiss:focus-visible {
  outline: none;
  background: var(--control-bg-hover);
  border-color: var(--control-border-active);
  color: var(--text-primary);
}

.toolbar {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 38px;
  padding: 4px 10px 0;
  gap: 10px;
  background: var(--toolbar-bg);
  backdrop-filter: blur(16px) saturate(1.05);
  -webkit-backdrop-filter: blur(16px) saturate(1.05);
}

.toolbar.is-native-drag {
  -webkit-app-region: drag;
  user-select: none;
}

.toolbar__grab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: grab;
  flex-shrink: 0;
  -webkit-app-region: no-drag;
}

.toolbar__grab.is-native-drag {
  -webkit-app-region: drag;
}

.toolbar__grab:active {
  cursor: grabbing;
}

.toolbar__grab svg {
  width: 14px;
  height: 14px;
}

.toolbar__brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 28px;
  padding: 2px;
  margin: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  line-height: 0;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
  -webkit-app-region: no-drag;
}

.toolbar__brand:hover {
  background: var(--glass-bg);
  color: var(--text-primary);
}

.toolbar__brand-logo {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 21px;
  flex-shrink: 0;
  transition: opacity 0.15s ease, transform 0.2s ease;
}

.toolbar__brand-logo > svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.prism-logo__path {
  transition: fill 0.15s ease, filter 0.15s ease;
}

.prism-logo__path--lower {
  fill: var(--accent);
  filter: drop-shadow(0 0 5px var(--accent-glow));
}

.prism-logo__path--upper {
  fill: var(--accent);
  filter: drop-shadow(0 0 4px var(--accent-glow));
}

.toolbar__brand-heart {
  width: 2px;
  height: 2px;
  margin-top: -4px;
  margin-left: -5px;
  background: #fb7185;
  box-shadow:
    2px 0 0 #fb7185,
    6px 0 0 #fb7185,
    8px 0 0 #fb7185,
    0 2px 0 #fb7185,
    2px 2px 0 #fb7185,
    4px 2px 0 #fb7185,
    6px 2px 0 #fb7185,
    8px 2px 0 #fb7185,
    2px 4px 0 #fb7185,
    4px 4px 0 #fb7185,
    6px 4px 0 #fb7185,
    4px 6px 0 #fb7185;
  opacity: 0;
  transform: translate3d(0, 2px, 0);
  transform-origin: center;
  transition: opacity 0.15s ease, transform 0.15s ease;
  filter: drop-shadow(0 0 4px rgba(248, 113, 113, 0.45));
  pointer-events: none;
  position: absolute;
  top: 50%;
  left: 50%;
}

.toolbar__brand:hover .toolbar__brand-heart {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  animation: titlebarLogoHeartPop 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.toolbar__brand:hover .toolbar__brand-logo {
  opacity: 0;
  transform: scale(0.82);
}

@keyframes titlebarLogoHeartPop {
  0% {
    opacity: 0;
    transform: translate3d(0, 3px, 0);
  }
  62% {
    opacity: 1;
    transform: translate3d(0, -1px, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.toolbar__chip,
.toolbar__icon-button,
.settings-section-title,
.settings-scope-section__title,
.settings-scope-section__summary,
.settings-control__label,
.settings-chip,
.settings-status-pill,
.settings-panel__close {
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.toolbar__version {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  max-width: 210px;
  border: 0;
  background: transparent;
  color: var(--text-tertiary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  white-space: nowrap;
  overflow: hidden;
  flex-shrink: 0;
}

button.toolbar__version {
  padding: 0 2px;
  cursor: pointer;
  outline: none;
  transition: color 120ms ease, transform 120ms ease;
  -webkit-app-region: no-drag;
}

button.toolbar__version:hover,
button.toolbar__version:focus-visible {
  color: var(--text-primary);
}

button.toolbar__version:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

button.toolbar__version:hover {
  transform: translateY(-1px);
}

.toolbar__version.is-update-available {
  color: var(--text-secondary);
}

.toolbar__version-update-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 9px var(--accent-glow);
  flex-shrink: 0;
}

.toolbar__version-number,
.toolbar__version-commit {
  overflow: hidden;
  text-overflow: ellipsis;
}

.toolbar__version-separator {
  color: var(--text-muted);
}

.toolbar__profile {
  position: relative;
  display: flex;
  align-items: center;
}

.toolbar__profile-button {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--control-border);
  background: var(--control-bg);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  outline: none;
  transition: color 120ms ease, border-color 120ms ease;
  -webkit-app-region: no-drag;
}

.toolbar__profile-button:hover,
.toolbar__profile-button.is-active {
  color: var(--control-text);
  border-color: var(--control-border-active);
  background: var(--control-bg-active);
}

.toolbar__profile-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbar__profile-dirty-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--warning);
  box-shadow: 0 0 8px var(--warning);
  flex-shrink: 0;
}

.toolbar__spacer {
  flex: 1;
  min-width: 0;
  height: 100%;
}

.toolbar__reposition-wrap {
  position: relative;
  -webkit-app-region: no-drag;
}

.toolbar__reposition-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  background: var(--menu-bg);
  border: 1px solid var(--menu-border);
  border-radius: 8px;
  overflow: hidden;
  z-index: 20;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
  -webkit-app-region: no-drag;
}

.toolbar__reposition-option {
  padding: 6px 16px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: color 120ms ease, background-color 120ms ease;
  -webkit-app-region: no-drag;
}

.toolbar__reposition-option:hover {
  color: var(--text-primary);
  background: var(--control-bg-hover);
}

.toolbar__reposition-option:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.toolbar__chip {
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--control-border);
  background: var(--control-bg);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  color: var(--text-tertiary);
  font-size: 9px;
  cursor: pointer;
  transition:
    color 120ms ease,
    border-color 120ms ease,
    background-color 120ms ease,
    transform 120ms ease;
}

.toolbar__chip:hover {
  color: var(--control-text);
  border-color: var(--control-border-active);
  background: var(--control-bg-hover);
}

.toolbar__chip.is-active {
  color: var(--accent);
  border-color: var(--control-border-active);
  background: var(--control-bg-active);
  box-shadow: inset 0 0 0 1px var(--glass-highlight);
}

.toolbar__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  -webkit-app-region: no-drag;
}

.toolbar__icon-button {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--control-border);
  background: var(--control-bg);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    color 120ms ease,
    border-color 120ms ease,
    background-color 120ms ease,
    transform 120ms ease;
  -webkit-app-region: no-drag;
}

.toolbar__icon-button svg {
  width: 14px;
  height: 14px;
}

.toolbar__icon-button:hover:not(:disabled) {
  color: var(--control-text);
  border-color: var(--control-border-active);
  background: var(--control-bg-hover);
  transform: translateY(-1px);
}

.toolbar__icon-button.is-active {
  color: var(--accent);
  border-color: var(--control-border-active);
  background: var(--control-bg-active);
}

.toolbar__icon-button--danger:hover:not(:disabled) {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--control-bg-hover);
}

.toolbar__icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
  transform: none;
}

@media (max-width: 640px) {
  .toolbar__version-commit,
  .toolbar__version-separator {
    display: none;
  }
}

@media (max-width: 520px) {
  .toolbar__version {
    display: none;
  }
}

.scope-strip {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: var(--scope-bg);
}

.scope-strip__grid {
  display: grid;
  width: 100%;
  height: 100%;
}

.scope-strip__cell {
  min-width: 0;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.scope-module {
  position: relative;
  width: 100%;
  height: 100%;
}

.scope-measurement-surface {
  cursor: crosshair;
  touch-action: none;
}

.scope-measurement-surface.is-measuring {
  user-select: none;
}

.scope-measurement {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.scope-measurement__line {
  position: absolute;
  display: block;
  background: var(--scope-overlay-text);
  opacity: 0.58;
  box-shadow: 0 0 0.5px rgba(0, 0, 0, 0.5);
}

.scope-measurement__line--vertical {
  top: 0;
  bottom: 0;
  width: 1px;
  transform: translateX(-0.5px);
}

.scope-measurement__line--horizontal {
  left: 0;
  right: 0;
  height: 1px;
  transform: translateY(-0.5px);
}

.scope-measurement__readout {
  position: absolute;
  max-width: calc(100% - 16px);
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  padding: 6px 10px;
  border: 1px solid var(--scope-overlay-border);
  border-radius: 5px;
  background: var(--scope-overlay-bg);
  color: var(--scope-overlay-text);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}

.scope-measurement__item {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  white-space: nowrap;
}

.scope-measurement__value,
.scope-measurement__separator {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  line-height: 1;
}

.scope-measurement__value {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.scope-measurement__separator {
  opacity: 0.4;
}

.scope-module__peak-info {
  position: absolute;
  z-index: 3;
  min-width: 0;
  max-width: calc(100% - 20px);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid var(--scope-overlay-border);
  border-radius: 6px;
  background: var(--scope-overlay-bg);
  color: var(--scope-overlay-text);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  white-space: nowrap;
}

.scope-module__peak-info.is-corner {
  top: 10px;
  left: 10px;
}

.scope-module__peak-info-value,
.scope-module__peak-info-separator {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  line-height: 1;
}

.scope-module__peak-info-value {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.scope-module__peak-info-separator {
  opacity: 0.38;
  font-weight: 500;
}

.scope-strip__reorder-controls {
  position: absolute;
  bottom: 8px;
  left: 8px;
  z-index: 3;
  display: flex;
  gap: 4px;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 120ms ease, transform 120ms ease;
  pointer-events: none;
}

.scope-strip__reorder-button,
.scope-strip__popout-button {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--scope-overlay-border);
  background: var(--scope-overlay-bg);
  color: var(--scope-overlay-text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  cursor: pointer;
  transition: opacity 120ms ease, transform 120ms ease, border-color 120ms ease, color 120ms ease;
  backdrop-filter: blur(14px) saturate(1.04);
  -webkit-backdrop-filter: blur(14px) saturate(1.04);
}

.scope-strip__reorder-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.scope-strip__popout-button {
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 3;
  opacity: 0;
  transform: translateY(-2px);
  pointer-events: none;
}

.scope-strip__cell:hover .scope-strip__reorder-controls,
.scope-strip__cell:focus-within .scope-strip__reorder-controls,
.scope-strip__cell:hover .scope-strip__popout-button,
.scope-strip__cell:focus-within .scope-strip__popout-button,
.scope-strip__popout-button:focus-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.scope-strip__reorder-button:hover:not(:disabled),
.scope-strip__reorder-button:focus-visible,
.scope-strip__popout-button:hover,
.scope-strip__popout-button:focus-visible {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.28);
}

.scope-strip__reorder-button:focus-visible,
.scope-strip__popout-button:focus-visible {
  outline: none;
}

.scope-strip__reorder-button:disabled {
  color: var(--text-muted);
  border-color: transparent;
  cursor: default;
}

.scope-strip__reorder-icon,
.scope-strip__popout-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.scope-strip__resize-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 12px;
  transform: translateX(-50%);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: col-resize;
  display: flex;
  align-items: stretch;
  justify-content: center;
  z-index: 2;
}

.scope-strip__resize-handle-grip {
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent, var(--scope-resize-handle), transparent);
}

.astra-scope {
  --astra-cover-size: clamp(52px, min(30cqi, 68cqb), 180px);
  --astra-card-gap: clamp(7px, min(2.4cqi, 2.4cqb), 12px);
  --astra-card-padding: clamp(8px, min(2.6cqi, 2.8cqb), 12px);
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--astra-bg);
  color: var(--astra-text);
  container-type: size;
  scrollbar-width: none;
}

.astra-scope::-webkit-scrollbar {
  display: none;
}

.astra-scope--empty {
  align-items: center;
  justify-content: center;
  padding: var(--astra-card-padding);
}

.astra-scope__card {
  flex: 1;
  display: grid;
  grid-template-columns: var(--astra-cover-size) minmax(0, 1fr);
  align-items: center;
  gap: var(--astra-card-gap);
  width: 100%;
  height: 100%;
  padding: var(--astra-card-padding);
}

.astra-scope__card--no-cover {
  grid-template-columns: minmax(0, 1fr);
}

.astra-scope__card--cover-only {
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
}

.astra-scope__cover-shell {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  align-self: center;
  justify-self: start;
  width: var(--astra-cover-size);
  min-width: 0;
}

.astra-scope__card--cover-only .astra-scope__cover-shell {
  justify-self: center;
  width: min(
    calc(100cqi - (var(--astra-card-padding) + var(--astra-card-padding))),
    calc(100cqb - (var(--astra-card-padding) + var(--astra-card-padding)))
  );
  max-width: 420px;
}

.astra-scope__cover {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid var(--astra-border);
  object-fit: cover;
  background: var(--astra-surface);
}

.astra-scope__cover--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--astra-accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 24px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--astra-surface);
}

.astra-scope__body {
  width: 100%;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(6px, min(2cqi, 2cqb), 9px);
}

.astra-scope__meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.astra-scope__title {
  min-width: 0;
  color: var(--astra-text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.astra-scope__artist {
  min-width: 0;
  color: var(--astra-subtext);
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.astra-scope__transport {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.astra-scope__progress {
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--astra-progress-track);
}

.astra-scope__progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--astra-progress-fill);
}

.astra-scope__time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--astra-subtext);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
  line-height: 1;
}

.astra-scope__controls {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: nowrap;
}

.astra-scope__control {
  flex: 0 0 auto;
  min-width: 36px;
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--astra-button-border);
  background: var(--astra-button-bg);
  color: var(--astra-button-text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.astra-scope__control--primary {
  flex: 1 1 72px;
  min-width: 72px;
}

.astra-scope__control--transport {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  font-size: 13px;
  letter-spacing: 0;
}

.astra-scope__control--transport-primary {
  flex-basis: 38px;
  width: 38px;
  min-width: 38px;
  color: var(--astra-accent);
}

.astra-scope__control-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.astra-scope__control:hover:not(:disabled),
.astra-scope__control:focus-visible {
  background: var(--astra-button-bg-hover);
  border-color: var(--astra-accent);
  color: var(--astra-button-text);
  outline: none;
}

.astra-scope__control:active:not(:disabled) {
  background: var(--astra-button-bg-active);
}

.astra-scope__control:disabled {
  opacity: 0.45;
  cursor: default;
}

.astra-scope__status,
.astra-scope__placeholder {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--astra-border);
  color: var(--astra-subtext);
  background: var(--astra-surface);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.astra-scope__placeholder {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  max-width: min(100%, 360px);
  padding: 12px;
  white-space: normal;
  text-transform: none;
  letter-spacing: 0;
  font-family: 'Inter', sans-serif;
  line-height: 1.45;
}

.astra-scope__empty-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--astra-text);
}

.astra-scope__empty-detail {
  font-size: 11px;
  color: var(--astra-subtext);
}

.astra-scope__status.is-ok {
  color: var(--astra-status-ok);
}

.astra-scope__status.is-error {
  color: var(--astra-status-error);
  border-color: var(--astra-status-error);
}

.astra-scope__status-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

@container (max-width: 420px) {
  .astra-scope {
    --astra-cover-size: clamp(44px, min(28cqi, 60cqb), 132px);
    --astra-card-gap: 8px;
  }

  .astra-scope__title {
    font-size: 14px;
  }

  .astra-scope__artist,
  .astra-scope__time,
  .astra-scope__control {
    font-size: 11px;
  }

  .astra-scope__control:not(.astra-scope__control--transport) {
    padding: 0 10px;
  }

  .astra-scope__control--transport {
    flex-basis: 30px;
    width: 30px;
    min-width: 30px;
    height: 30px;
    padding: 0;
  }

  .astra-scope__control--transport-primary {
    flex-basis: 36px;
    width: 36px;
    min-width: 36px;
  }
}

@container (max-width: 260px) {
  .astra-scope {
    --astra-cover-size: 40px;
    --astra-card-gap: 8px;
  }

  .astra-scope__controls {
    flex-wrap: wrap;
  }
}

@container (max-height: 180px) {
  .astra-scope {
    --astra-cover-size: clamp(40px, min(22cqi, 46cqb), 88px);
    --astra-card-gap: 8px;
    --astra-card-padding: 8px;
  }

  .astra-scope__control {
    height: 30px;
  }

  .astra-scope__control--transport {
    height: 28px;
  }
}

.settings-panel {
  background: linear-gradient(180deg, var(--settings-bg-top), var(--settings-bg-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: hidden;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  position: relative;
  padding: 10px 0 0;
  flex-shrink: 1;
}

.settings-panel__utility-row {
  display: flex;
  align-items: flex-start;
  gap: 14px 18px;
  flex-wrap: wrap;
  padding: 0 14px 10px;
}

.settings-utility-section {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  min-width: 0;
}

.settings-utility-section--source {
  flex: 1 1 360px;
}

.settings-utility-section--theme {
  flex: 1 1 300px;
}

.settings-panel__scope-track {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 0;
  padding: 0 0 4px;
  align-items: stretch;
}

.settings-section-title {
  width: 100%;
  color: var(--text-secondary);
  font-size: 10px;
}

.settings-scope-section {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 16px 14px;
  border-left: 1px solid var(--divider);
}

.settings-scope-section:first-child {
  border-left: 0;
}

.settings-scope-section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 12px;
  min-height: 42px;
  border-bottom: 1px solid var(--divider);
}

.settings-scope-section__title {
  color: var(--accent);
  font-size: 10px;
  line-height: 1.3;
}

.settings-scope-section__summary {
  flex: 1;
  color: var(--text-tertiary);
  font-size: 9px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

.settings-scope-section__controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 148px), 1fr));
  gap: 12px 14px;
  align-content: start;
}

.settings-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.settings-control--full,
.settings-control--stack {
  grid-column: 1 / -1;
}

.settings-control--stack {
  gap: 6px;
}

.settings-control.is-disabled {
  opacity: 0.46;
}

.settings-control__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 9px;
}

.settings-control__value {
  color: var(--text-primary);
  letter-spacing: 0.08em;
}

.settings-control__select {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 34px;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--control-border);
  background: var(--control-bg);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  color: var(--control-text);
  font-size: 11px;
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease, color 140ms ease;
}

.settings-control__select:hover,
.settings-control__select:focus-within {
  border-color: var(--control-border-active);
  background: var(--control-bg-hover);
  color: var(--control-text);
}

.themed-select__control {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 0 36px 0 12px;
  border: 0;
  border-radius: inherit;
  box-sizing: border-box;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 11px;
  line-height: 1.2;
  outline: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.themed-select__control option,
.themed-select__control optgroup {
  background: var(--option-bg);
  color: var(--option-text);
}

.themed-select__control optgroup {
  font-weight: 600;
}

.themed-select__chevron {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  pointer-events: none;
  transform: translateY(-50%);
  transition: color 140ms ease;
}

.themed-select__chevron svg {
  width: 14px;
  height: 14px;
}

.settings-control__select:hover .themed-select__chevron,
.settings-control__select:focus-within .themed-select__chevron {
  color: var(--accent);
}

.settings-control__range {
  width: 100%;
  --range-percent: 50%;
  height: 22px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: ew-resize;
}

.settings-control__range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  border: 1px solid var(--control-border);
  background:
    linear-gradient(90deg, var(--slider-fill), var(--slider-fill)) 0 / var(--range-percent) 100% no-repeat,
    linear-gradient(180deg, var(--slider-track), var(--glass-highlight));
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    0 0 0 1px rgba(0, 0, 0, 0.22);
}

.settings-control__range::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 16px;
  margin-top: -6px;
  border-radius: 5px;
  border: 1px solid var(--control-border-active);
  background: var(--slider-thumb);
  box-shadow:
    inset 0 1px 0 var(--glass-highlight-strong),
    0 0 0 2px rgba(var(--accent-rgb), 0.14),
    0 3px 8px rgba(0, 0, 0, 0.35);
}

.settings-control__range::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  border: 1px solid var(--control-border);
  background: linear-gradient(180deg, var(--slider-track), var(--glass-highlight));
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    0 0 0 1px rgba(0, 0, 0, 0.22);
}

.settings-control__range::-moz-range-thumb {
  width: 12px;
  height: 16px;
  border-radius: 5px;
  border: 1px solid var(--control-border-active);
  background: var(--slider-thumb);
  box-shadow:
    inset 0 1px 0 var(--glass-highlight-strong),
    0 0 0 2px rgba(var(--accent-rgb), 0.14),
    0 3px 8px rgba(0, 0, 0, 0.35);
}

.settings-control__range::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  border: 1px solid var(--glass-highlight);
  background: linear-gradient(90deg, var(--slider-fill), var(--slider-fill));
}

.settings-control__range:hover::-webkit-slider-runnable-track,
.settings-control__range:focus-visible::-webkit-slider-runnable-track {
  background:
    linear-gradient(90deg, var(--slider-fill), var(--slider-fill)) 0 / var(--range-percent) 100% no-repeat,
    linear-gradient(180deg, var(--control-bg-hover), var(--slider-track));
}

.settings-control__range:hover::-moz-range-progress,
.settings-control__range:focus-visible::-moz-range-progress {
  background: linear-gradient(90deg, var(--slider-fill), var(--slider-fill));
}

.settings-control__range:hover::-webkit-slider-thumb,
.settings-control__range:focus-visible::-webkit-slider-thumb {
  border-color: rgba(var(--accent-rgb), 0.96);
  box-shadow:
    inset 0 1px 0 var(--glass-highlight-strong),
    0 0 0 3px rgba(var(--accent-rgb), 0.18),
    0 3px 10px rgba(0, 0, 0, 0.4);
}

.settings-control__range:hover::-moz-range-thumb,
.settings-control__range:focus-visible::-moz-range-thumb {
  border-color: rgba(var(--accent-rgb), 0.96);
  box-shadow:
    inset 0 1px 0 var(--glass-highlight-strong),
    0 0 0 3px rgba(var(--accent-rgb), 0.18),
    0 3px 10px rgba(0, 0, 0, 0.4);
}

.settings-control__range:focus-visible {
  outline: none;
}

.settings-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.settings-chip {
  max-width: 100%;
  min-width: 0;
  min-height: 28px;
  box-sizing: border-box;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid var(--control-border);
  background: var(--control-bg);
  color: var(--text-secondary);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition:
    border-color 140ms ease,
    color 140ms ease,
    background-color 140ms ease;
}

.settings-chip:hover:not(:disabled) {
  color: var(--control-text);
  border-color: var(--control-border-active);
  background: var(--control-bg-hover);
}

.settings-chip:disabled {
  color: var(--text-muted);
  cursor: default;
  opacity: 0.72;
}

.settings-chip.is-active {
  color: var(--control-text);
  border-color: var(--control-border-active);
  background: var(--control-bg-active);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}

.settings-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--control-border);
  background: linear-gradient(180deg, var(--panel-surface), var(--panel-surface-soft));
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  color: var(--text-secondary);
  font-size: 10px;
  white-space: nowrap;
}

.settings-status-pill__dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--text-muted);
}

.settings-status-pill.is-connecting .settings-status-pill__dot {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.settings-status-pill.is-connecting {
  border-color: var(--accent);
}

.settings-status-pill.is-capturing .settings-status-pill__dot {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.settings-status-pill.is-capturing {
  border-color: var(--success);
}

.settings-status-pill.is-connected .settings-status-pill__dot {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.settings-status-pill.is-connected {
  border-color: var(--success);
}

.settings-status-pill.is-error .settings-status-pill__dot {
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}

.settings-status-pill.is-error {
  border-color: var(--danger);
}

.settings-error-text {
  margin-top: 8px;
  color: var(--danger);
  font-size: 11px;
  line-height: 1.4;
}

.settings-info-text {
  color: var(--text-tertiary);
  font-size: 11px;
  line-height: 1.4;
}

.settings-inline-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.settings-theme-swatches {
  display: flex;
  align-items: center;
  gap: 6px;
}

.settings-swatch {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid var(--divider);
  background: var(--swatch-color);
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.34);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.settings-swatch:hover {
  border-color: var(--control-border-active);
}

.settings-swatch.is-active {
  border-color: var(--control-border-active);
  box-shadow:
    0 0 0 1px var(--control-border-active),
    0 0 0 4px rgba(var(--accent-rgb), 0.12);
}

.settings-accent-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-accent-input {
  width: 84px;
  height: 28px;
  border-radius: 9px;
  border: 1px solid var(--input-border);
  background: linear-gradient(180deg, var(--input-bg), var(--settings-bg-bottom));
  cursor: pointer;
  padding: 3px 4px;
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}

.settings-panel__close {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--control-bg);
  color: var(--text-secondary);
  font-size: 9px;
  cursor: pointer;
  transition:
    border-color 140ms ease,
    color 140ms ease,
    background-color 140ms ease;
}

.settings-panel__close:hover {
  color: var(--text-primary);
  border-color: var(--control-border-active);
  background: var(--control-bg-hover);
}

.bottom-bar {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: 92px;
  padding: 0;
  background: var(--bottom-bar-bg);
  border-top: 1px solid var(--divider);
  flex-shrink: 0;
}

.bottom-bar__rail {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 0 8px 14px;
  scrollbar-gutter: stable;
}

.bottom-bar__rail-content {
  display: flex;
  align-items: stretch;
  width: max-content;
  min-width: 100%;
}

.bottom-bar__section {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 0 16px 0 0;
  min-width: 0;
  flex: 0 0 auto;
}

.bottom-bar__section--modules {
  min-width: 520px;
}

.bottom-bar__section--theme {
  min-width: 420px;
}

.bottom-bar__section--astra,
.bottom-bar__section--now-playing {
  min-width: 420px;
}

.bottom-bar__section--window {
  min-width: 380px;
}

.bottom-bar__section--source {
  min-width: 360px;
}

.bottom-bar__section--performance {
  min-width: 328px;
}

.bottom-bar__section--trim {
  min-width: 196px;
}

.bottom-bar__section-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.bottom-bar__section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.bottom-bar__section-title {
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-size: 9px;
  white-space: nowrap;
}

.bottom-bar__inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.bottom-bar__inline--chips {
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--control-border);
  background: linear-gradient(180deg, var(--panel-surface), var(--control-bg));
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}

.bottom-bar__inline--theme {
  gap: 6px;
}

.bottom-bar__inline--now-playing {
  gap: 6px;
}

.bottom-bar__theme-metadata {
  min-width: 0;
  margin-left: auto;
  color: var(--text-tertiary);
  font-size: 10px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

.bottom-bar__theme-credit {
  color: inherit;
}

.bottom-bar__theme-description {
  color: var(--text-tertiary);
}

.bottom-bar__theme-separator {
  margin: 0 4px;
}

.bottom-bar__window-note {
  min-width: 0;
  margin-left: auto;
  color: var(--text-tertiary);
  font-size: 10px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

.bottom-bar__theme-credit--link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 140ms ease;
}

.bottom-bar__theme-credit--link:hover {
  color: var(--accent);
}

.bottom-bar__inline--performance {
  gap: 10px;
}

.bottom-bar__inline--memory {
  gap: 6px;
  flex-wrap: wrap;
  white-space: normal;
}

.bottom-bar__divider {
  width: 1px;
  align-self: stretch;
  margin: 0 16px 0 0;
  background: linear-gradient(180deg, transparent, var(--divider) 18%, var(--divider) 82%, transparent);
  flex-shrink: 0;
}

.bottom-bar__trim-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-primary);
  letter-spacing: 0.08em;
  min-width: 56px;
  text-align: right;
  white-space: nowrap;
}

.bottom-bar__trim-slider {
  width: 132px;
  flex: 0 0 auto;
}

.bottom-bar .settings-control__select {
  min-width: 0;
  max-width: none;
}

.bottom-bar__select {
  min-width: 280px;
  max-width: 280px;
}

.bottom-bar__text-input {
  height: 32px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 12px;
  outline: none;
}

.bottom-bar__text-input::placeholder {
  color: var(--text-muted);
}

.bottom-bar__text-input:focus {
  border-color: var(--input-border-focus);
  background: var(--input-bg-focus);
}

.bottom-bar__text-input--url {
  width: 190px;
}

.bottom-bar__text-input--token {
  width: 180px;
}

.bottom-bar__fps-pill {
  min-width: 84px;
  justify-content: center;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.08em;
}

.bottom-bar__error-text {
  margin-top: 0;
  max-width: 360px;
}

.bottom-bar__section-header--now-playing {
  align-items: center;
}

.bottom-bar__now-playing-summary {
  flex: 1;
  min-width: 0;
  color: var(--text-tertiary);
  font-size: 10px;
  line-height: 1.2;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bottom-bar__now-playing-summary.is-error {
  color: var(--danger);
}

.bottom-bar__actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 10px 14px 10px 16px;
  border-left: 1px solid var(--divider);
  background: linear-gradient(90deg, transparent, var(--bottom-bar-bg) 28%, var(--bottom-bar-bg));
}

.bottom-bar__close {
  flex-shrink: 0;
}

.scope-popout {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.scope-popout__viewport {
  position: relative;
  flex: 0 0 auto;
  min-height: 0;
  overflow: hidden;
}

.scope-popout__chrome {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateY(-8px);
  transition: max-height 160ms ease, opacity 120ms ease, transform 160ms ease;
}

.scope-popout__viewport:hover .scope-popout__chrome,
.scope-popout__chrome:hover,
.scope-popout__chrome:focus-within,
.scope-popout__chrome.is-cursor-inside,
.scope-popout__chrome.is-expanded {
  max-height: 58px;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.scope-popout__header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  background: var(--toolbar-bg);
}

.scope-popout__header.is-native-drag {
  -webkit-app-region: drag;
  user-select: none;
}

.scope-popout__drag {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.scope-popout__drag-handle {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: grab;
  -webkit-app-region: no-drag;
}

.scope-popout__drag-handle.is-native-drag {
  -webkit-app-region: drag;
}

.scope-popout__drag-handle:active {
  cursor: grabbing;
}

.scope-popout__drag-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.scope-popout__drag-icon svg {
  width: 14px;
  height: 14px;
}

.scope-popout__title-group {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.scope-popout__title {
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 10px;
  color: var(--accent);
}

.scope-popout__subtitle {
  font-size: 10px;
  color: var(--text-tertiary);
}

.scope-popout__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  -webkit-app-region: no-drag;
}

.scope-popout__button {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--control-bg);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease, background-color 120ms ease, transform 120ms ease;
}

.scope-popout__button svg {
  width: 14px;
  height: 14px;
}

.scope-popout__button:hover:not(:disabled),
.scope-popout__button.is-active {
  color: var(--accent);
  border-color: var(--control-border-active);
  background: var(--control-bg-active);
  transform: translateY(-1px);
}

.scope-popout__button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
  transform: none;
}

.toolbar__brand:focus-visible,
.toolbar__profile-button:focus-visible,
.toolbar__chip:focus-visible,
.toolbar__icon-button:focus-visible,
.scope-strip__reorder-button:focus-visible,
.scope-strip__popout-button:focus-visible,
.settings-chip:focus-visible,
.settings-accent-input:focus-visible,
.settings-panel__close:focus-visible,
.scope-popout__button:focus-visible,
.settings-control__select:focus-within {
  outline: none;
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    0 0 0 1px rgba(var(--accent-rgb), 0.32),
    0 0 0 4px rgba(var(--accent-rgb), 0.12);
}

@media (prefers-reduced-motion: reduce) {
  .toolbar__brand,
  .toolbar__brand-logo,
  .toolbar__brand-heart {
    transition-duration: 0.08s !important;
  }

  .toolbar__brand:hover .toolbar__brand-heart {
    animation: none !important;
  }
}

.scope-popout__settings-panel {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--settings-bg-bottom);
  padding: 12px 0 10px;
}

.scope-popout__settings-panel .settings-scope-section {
  border-left: 0;
  padding: 0 14px 12px;
}

.scope-popout__settings-region {
  flex: 0 0 auto;
  min-height: 0;
  overflow: hidden;
}

.scope-popout__content {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.scope-popout__canvas-region {
  flex: 1;
  min-height: 0;
  position: relative;
}

.now-playing-config {
  width: 100vw;
  height: 100vh;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
}

.now-playing-config__shell {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.now-playing-config__toolbar {
  cursor: grab;
  padding-right: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--divider);
}

.now-playing-config__toolbar:active {
  cursor: grabbing;
}

.now-playing-config__toolbar-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.now-playing-config__toolbar-title {
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 10px;
  color: var(--text-primary);
}

.now-playing-config__toolbar-subtitle {
  font-size: 10px;
  color: var(--text-tertiary);
}

.now-playing-config__content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px 16px;
}

.now-playing-config__stack {
  width: min(820px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.now-playing-config__intro,
.now-playing-config__provider-body-copy,
.now-playing-config__coming-soon {
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.now-playing-config__intro {
  padding: 0 2px;
}

.now-playing-config__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.now-playing-config__provider {
  border-radius: 14px;
  border: 1px solid var(--panel-outline);
  background: linear-gradient(180deg, var(--panel-surface), var(--panel-surface-soft));
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.now-playing-config__provider.is-live {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--panel-outline));
}

.now-playing-config__provider.is-drop-target {
  border-color: var(--control-border-active);
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    inset 0 0 0 1px rgba(var(--accent-rgb), 0.16);
}

.now-playing-config__provider-header {
  display: flex;
  align-items: stretch;
  gap: 6px;
  padding: 6px;
}

.now-playing-config__provider-handle {
  width: 28px;
  flex: 0 0 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  min-height: 28px;
  border-radius: 999px;
  color: var(--text-muted);
  cursor: grab;
  transition: background-color 140ms ease, color 140ms ease, opacity 140ms ease;
}

.now-playing-config__provider-handle:hover {
  background: var(--control-bg-hover);
  color: var(--text-secondary);
}

.now-playing-config__provider-handle:active {
  cursor: grabbing;
}

.now-playing-config__provider-handle.is-dragging {
  opacity: 0.42;
}

.now-playing-config__provider-handle svg {
  width: 14px;
  height: 14px;
}

.now-playing-config__provider-summary {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 140ms ease;
}

.now-playing-config__provider-summary:hover {
  background: rgba(255, 255, 255, 0.025);
}

.now-playing-config__provider-icon-shell {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--provider-brand) 28%, var(--control-border));
  background: color-mix(in srgb, var(--provider-brand) 10%, var(--control-bg));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  color: var(--provider-brand);
}

.now-playing-config__provider-icon-shell svg {
  width: 18px;
  height: 18px;
}

.now-playing-config__provider-icon-shell svg[viewBox="0 0 1024 1024"] {
  width: 20px;
  height: 20px;
}

.now-playing-config__provider-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.now-playing-config__provider-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.now-playing-config__provider-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.now-playing-config__provider-live {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--control-border));
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.now-playing-config__provider-meta {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-playing-config__provider-status {
  flex-shrink: 0;
}

.now-playing-config__provider-chevron {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: transform 140ms ease, color 140ms ease;
}

.now-playing-config__provider-chevron.is-expanded {
  color: var(--text-primary);
  transform: rotate(180deg);
}

.now-playing-config__provider-chevron svg {
  width: 16px;
  height: 16px;
}

.now-playing-config__provider-body {
  padding: 0 16px 14px 50px;
  border-top: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.now-playing-config__provider-body-copy,
.now-playing-config__coming-soon {
  padding-top: 12px;
}

.now-playing-config__form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.now-playing-config__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.now-playing-config__field-label {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.now-playing-config__input {
  width: 100%;
  box-sizing: border-box;
}

.now-playing-config__provider-actions {
  margin-top: 0;
}

.now-playing-config__provider-error {
  margin-top: -2px;
}

@media (max-width: 760px) {
  .now-playing-config__toolbar {
    padding-right: 10px;
  }

  .now-playing-config__content {
    padding: 12px;
  }

  .now-playing-config__toolbar-subtitle {
    display: none;
  }

  .now-playing-config__provider-summary {
    gap: 8px;
    padding-right: 8px;
  }

  .now-playing-config__provider-status {
    display: none;
  }

  .now-playing-config__provider-body {
    padding: 0 12px 12px;
  }

  .now-playing-config__form-grid {
    grid-template-columns: 1fr;
  }
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--scope-guides);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scope-overlay-border);
}
