:root {
  --bg: #0f1218;
  --card: #181c26;
  --card-2: #202736;
  --accent: #ffcc4d;
  --accent-2: #6ae0ff;
  --text: #eef1f6;
  --muted: #9aa6bd;
  --danger: #ff6b6b;
  --success: #66f0a4;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --grid-gap: 16px;
  --font: "Space Grotesk", system-ui, sans-serif;
  --tile-count: 8;
  --tile-width: clamp(300px, 28.5vw, 470px);
  --topbar-height: 108px;
  --arrangement-height: 84px;
  --sessions-dock-width: min(420px, 34vw);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(circle at top, #1b2030, #0b0d13 60%);
  min-height: 100vh;
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
}

.topbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  padding: 6px 14px;
  gap: 16px;
  background: rgba(15, 18, 24, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 200;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
}

.topbar > * {
  flex-shrink: 0;
}

.collapsed-title-logo {
  display: none;
  height: 22px;
  width: auto;
}

.brand {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  position: relative;
  z-index: 3;
}

.brand-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-height: 88px;
}

.brand-buttons {
  display: flex;
  align-items: center;
  gap: 14px;
}

.quick-start-line {
  margin-left: 4px;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.3;
  color: rgba(214, 227, 246, 0.85);
  white-space: nowrap;
  font-family: "Space Mono", "Menlo", "Monaco", monospace;
  letter-spacing: 0.01em;
}

.brand-image {
  height: 88px;
  width: auto;
  display: block;
}

.global-controls {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  max-width: 420px;
  margin-left: auto;
  position: relative;
  z-index: 3;
}

.global-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.help-toggle {
  width: auto;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: #111520;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-weight: 700;
  font-size: 12px;
}

.discord-top-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(88, 101, 242, 0.16);
  border-color: rgba(121, 133, 255, 0.28);
  color: #d8def8;
  text-decoration: none;
}

.featured-toggle {
  height: 50px;
  border-radius: 10px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(135deg, #6d7cff, #4a5fde);
  border-color: rgba(157, 177, 255, 0.52);
  color: #f5f8ff;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.center-control {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  gap: 7px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.layout-mode-select {
  height: 50px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #111724;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  padding: 0 10px;
}

.edit-switch {
  width: 150px;
  height: 50px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.edit-side {
  border-radius: 10px;
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  background: transparent;
}

.edit-side.active {
  color: #0b0d13;
}

#present-mode.active {
  background: linear-gradient(135deg, #ffd77d, #f9b94d);
}

#edit-mode.active {
  background: linear-gradient(135deg, #79ecff, #5fc5ff);
}

.play-toggle {
  width: 72px;
  height: 50px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  background: linear-gradient(135deg, #ffe07a, #ffb347);
  color: #0b0d13;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.play-toggle.active {
  background: linear-gradient(135deg, #6ae0ff, #3fa7ff);
}

.loop-toggle {
  width: 72px;
  height: 50px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  background: linear-gradient(135deg, #ff5b5b, #ff8a5b);
  color: #0b0d13;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.loop-toggle.active {
  background: linear-gradient(135deg, #ff2d2d, #ff6b3d);
  color: #0b0d13;
  box-shadow: 0 0 0 1px rgba(255, 107, 61, 0.35), 0 0 10px rgba(255, 85, 51, 0.35);
}

.loop-toggle:hover {
  transform: none;
}

.tap-tempo {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3a4765, #2a3348);
  color: #d9e8ff;
  font-size: 12px;
  line-height: 1.1;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 2px;
}

.tap-tempo.flash {
  animation: tap-flash 180ms ease;
}

.metronome-toggle {
  width: 44px;
  height: 50px;
  border-radius: 10px;
  background: #202736;
  color: #d9e8ff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.metronome-toggle.active {
  background: linear-gradient(135deg, #6ae0ff, #3fa7ff);
  color: #0b0d13;
}

.metronome-volume {
  width: 28px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 7px;
}

.metronome-volume input {
  width: 50px;
  transform: rotate(-90deg);
  transform-origin: center;
}

.metronome-toggle:not(.active) + .metronome-volume {
  display: none;
}

.metronome-toggle.active + .metronome-volume input {
  accent-color: #4fb8ff;
}

.metronome-icon {
  width: 22px;
  height: 22px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

@keyframes tap-flash {
  0% {
    filter: brightness(1);
    transform: scale(1);
  }
  40% {
    filter: brightness(1.35);
    transform: scale(0.98);
  }
  100% {
    filter: brightness(1);
    transform: scale(1);
  }
}

.transport-icon {
  font-size: 20px;
  line-height: 1;
  display: inline-block;
}

.loop-toggle .transport-icon {
  font-size: 20px;
  transform: translateY(1px);
}

.play-icon {
  font-size: 14px;
  width: 18px;
  text-align: center;
  transform: none;
  margin: 0 auto;
}

.stop-icon {
  font-size: 14px;
}

.loop-dot {
  color: #0b0d13;
  font-size: 15px;
}

.loop-toggle.active .loop-dot {
  animation: loop-dot-pulse 1s ease-in-out infinite;
}

@keyframes loop-dot-pulse {
  0% {
    transform: scale(0.9);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(0.9);
  }
}

.transport-label {
  font-size: 11px;
  opacity: 0.92;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.field input {
  width: 80px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--card);
  color: var(--text);
}

.bpm-field {
  width: 60px;
  height: 50px;
  border-radius: 10px;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

.bpm-field span {
  font-size: 11px;
  letter-spacing: 0.08em;
}

.bpm-field input {
  width: 60px;
  height: 28px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  border-radius: 10px;
  background: #111724;
  pointer-events: auto;
}

.field select {
  width: 100px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--card);
  color: var(--text);
}

button {
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  background: var(--card-2);
  color: var(--text);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.topbar-toggle {
  width: 18px;
  height: 18px;
  min-width: 0;
  min-height: 0;
  padding: 0 0 2px;
  border-radius: 0;
  display: grid;
  place-items: center;
  background: transparent;
  color: #cfd8ea;
  border: none;
  box-shadow: none;
  outline: none;
  line-height: 1;
  font-size: 14px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 5px;
  z-index: 220;
  transition: opacity 140ms ease;
}

.topbar-toggle:hover,
.topbar-toggle:focus-visible,
.topbar-toggle:active {
  transform: translateX(-50%);
  box-shadow: none;
}

#topbar-toggle-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

@media (min-width: 1600px) {
  .app:not(.topbar-collapsed) .center-control {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
}

button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

button.primary {
  background: linear-gradient(135deg, #ffd65b, #ffb347);
  color: #111;
}

button.active {
  background: linear-gradient(135deg, #6ae0ff, #4bb7ff);
  color: #0b0d13;
}

.workspace-scroll {
  flex: 1;
  overflow-x: auto;
  overflow-y: auto;
  padding-top: var(--topbar-height);
  padding-bottom: var(--arrangement-height);
}

.app.sessions-open .workspace-scroll,
.app.sessions-open .footer {
  padding-right: var(--sessions-dock-width);
}

.app.sessions-open .topbar {
  right: var(--sessions-dock-width);
}

.workspace-canvas {
  min-width: max(100%, calc(var(--tile-count) * var(--tile-width)));
  width: max-content;
}

.grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--tile-width);
  grid-template-rows: 1fr;
  gap: 0;
  padding: 0;
}

.app.performance .grid {
  align-items: start;
  grid-auto-flow: row;
  grid-auto-columns: initial;
  grid-template-columns: repeat(var(--show-cols, 4), minmax(0, var(--show-fit-width, 1fr)));
  justify-content: center;
  align-content: start;
  width: 100%;
}

.app.performance .workspace-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 8px;
}

.app.performance .workspace-canvas {
  min-width: 100%;
  width: 100%;
}

.app.performance .tile:not(.has-video) {
  display: none;
}

.app.performance .arrangement {
  display: none;
}

.app.layout-grid .workspace-scroll,
.app.layout-vertical .workspace-scroll {
  overflow-x: hidden;
}

.app.layout-grid .workspace-canvas,
.app.layout-vertical .workspace-canvas {
  min-width: 100%;
  width: 100%;
}

.app.layout-grid .grid {
  grid-auto-flow: row;
  grid-auto-columns: initial;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.app.layout-vertical .grid {
  grid-auto-flow: row;
  grid-auto-columns: initial;
  grid-template-columns: 1fr;
}

.app.performance.layout-grid .grid,
.app.performance.layout-horizontal .grid {
  grid-auto-flow: row;
  grid-auto-columns: initial;
  grid-template-columns: repeat(var(--show-cols, 4), minmax(0, var(--show-fit-width, 1fr)));
  justify-content: center;
}

.app.performance.layout-vertical .grid {
  grid-auto-flow: row;
  grid-auto-columns: initial;
  grid-template-columns: 1fr;
  justify-content: stretch;
}

.app.topbar-collapsed .topbar {
  min-height: 30px;
  padding: 4px 8px;
  gap: 0;
}

.app.topbar-collapsed .workspace-scroll {
  padding-top: 34px;
}

.app.topbar-collapsed .topbar > :not(.topbar-toggle):not(.collapsed-title-logo) {
  display: none !important;
}

.app.topbar-collapsed .topbar .topbar-toggle {
  bottom: 5px;
}

.app.topbar-collapsed .collapsed-title-logo {
  display: block;
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 210;
}

.arrangement {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 10px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #0f141f;
  width: 100%;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 180;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  scrollbar-width: thin;
}

.arrangement-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-width: 174px;
  min-height: 66px;
  align-content: space-between;
}

.arrangement-controls button {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
}

.arrangement-controls > #arr-autoplay,
.arrangement-controls > #arr-loop {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.arrangement-controls > #arr-loop:disabled,
.arrangement-controls > #arr-loop.disabled {
  opacity: 0.42;
  filter: grayscale(0.35);
  cursor: default;
  pointer-events: none;
}

.arr-length-controls {
  grid-column: 1 / span 2;
  display: grid;
  grid-template-columns: 1fr 56px 66px;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.arr-length-controls input,
.arr-length-controls select {
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #111520;
  color: var(--text);
  padding: 4px 8px;
}

.arrangement-parts {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(16, minmax(124px, 124px));
  gap: 6px;
}

.arr-part-slot {
  position: relative;
  min-height: 66px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  text-align: left;
  transform: none !important;
  overflow: hidden;
  --part-progress: 0;
}

.arr-part-slot::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(var(--part-progress));
  background: linear-gradient(90deg, rgba(106, 224, 255, 0.28), rgba(106, 224, 255, 0.12));
  pointer-events: none;
  z-index: 0;
}

.arr-part-slot:hover {
  box-shadow: none;
  border-color: rgba(106, 224, 255, 0.45);
}

.arr-part-slot.selected {
  border-color: var(--accent);
}

.arr-part-slot.active {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
}

.arr-part-slot.active.selected {
  border-color: #ffd75c;
  background: rgba(255, 215, 92, 0.12);
}

.arr-part-slot.empty {
  background: rgba(255, 255, 255, 0.015);
  border-color: rgba(255, 255, 255, 0.09);
}

.arr-part-slot.empty::before {
  display: none;
}

.arr-slot-label {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.54);
}

.arr-slot-content {
  font-size: 13px;
  font-weight: 700;
  color: rgba(238, 241, 246, 0.55);
  position: relative;
  z-index: 1;
}

.arr-part-slot.selected .arr-slot-content {
  color: rgba(245, 248, 255, 0.98);
}

.arr-slot-length {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.54);
  position: relative;
  z-index: 1;
}

.arr-slot-plus {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  border-radius: 99px;
  background: rgba(106, 224, 255, 0.16);
  border: 1px solid rgba(106, 224, 255, 0.38);
  display: grid;
  place-items: center;
  font-size: 14px;
  line-height: 1;
  opacity: 0;
  transition: opacity 120ms ease;
  z-index: 1;
}

.arr-part-slot.empty:hover .arr-slot-plus {
  opacity: 1;
}

.arr-slot-make {
  position: absolute;
  left: 50%;
  top: calc(42% + 18px);
  transform: translateX(-50%);
  font-size: 10px;
  color: rgba(226, 236, 255, 0.82);
  opacity: 0;
  white-space: nowrap;
  transition: opacity 120ms ease;
  z-index: 1;
}

.arr-part-slot.empty:hover .arr-slot-make {
  opacity: 1;
}

@media (max-width: 1100px) {
  :root {
    --tile-width: clamp(280px, 52vw, 420px);
  }
}

.tile {
  position: relative;
  background: var(--card);
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  aspect-ratio: auto;
  border-width: 1px;
}

.tile.collapsed .editable-only {
  display: none;
}

.tile.collapsed .tile-controls {
  padding: 0;
  gap: 0;
  flex: 0;
}

.tile.collapsed {
  height: fit-content;
  align-self: start;
}

.tile.selected {
  border-color: var(--accent);
}

.tile.recording {
  border-color: #ff4b4b;
  box-shadow: none;
}

.player-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #111;
  overflow: hidden;
}

.player-frame > div,
.player-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.player-frame iframe {
  pointer-events: none;
}

.video-clear-btn {
  position: absolute;
  top: 8px;
  left: auto;
  right: 8px;
  bottom: auto;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(10, 12, 18, 0.72);
  color: #f3f7ff;
  font-size: 16px;
  line-height: 1;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  transition: opacity 120ms ease, background 120ms ease;
}

.tile.has-video:hover .video-clear-btn {
  opacity: 1;
  pointer-events: auto;
}

.video-clear-btn:hover {
  background: rgba(255, 79, 79, 0.88);
}

.video-empty-hint {
  position: absolute;
  inset: auto 0 0 0 !important;
  height: auto !important;
  padding: 6px 8px;
  border-radius: 8px 8px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(10, 13, 20, 0.78);
  color: rgba(235, 241, 255, 0.92);
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
  z-index: 3;
}

.tile:not(.has-video) .player-frame:hover .video-empty-hint {
  opacity: 1;
}

.tile-controls {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow: visible;
}

.section-title {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 4px;
}

.url-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.tile-source-pool {
  flex: 1;
  min-width: 120px;
  height: 34px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #111520;
  color: var(--text);
}

.load-btn {
  font-weight: 500;
  padding: 8px 9px;
  min-width: 58px;
}

.key {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  gap: 6px;
}

.mini-label {
  margin-right: -2px;
  white-space: nowrap;
}

.status-row input {
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #111520;
  color: var(--text);
}

.status-row select {
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #111520;
  color: var(--text);
}

.value-flash {
  animation: value-flash-fade 240ms ease-out;
}

@keyframes value-flash-fade {
  0% {
    box-shadow: 0 0 0 0 rgba(106, 224, 255, 0.9);
    border-color: rgba(106, 224, 255, 0.95);
    background: rgba(106, 224, 255, 0.22);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(106, 224, 255, 0);
    border-color: rgba(255, 255, 255, 0.1);
    background: #111520;
  }
}

.seq-config-row {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 6px;
  flex-wrap: nowrap;
}

.seq-config-row input {
  width: 74px;
}

.seq-config-row select {
  width: 86px;
}

.seq-config-row .clear-btn {
  margin-left: auto;
}

.time-div-label {
  margin-left: 4px;
}

.cue-row {
  background: rgba(106, 224, 255, 0.08);
  border: 1px solid rgba(106, 224, 255, 0.35);
  border-radius: 10px;
  padding: 6px 8px;
  gap: 6px;
}

.cue-select {
  min-width: 56px;
}

.cue-select.tile-select-input {
  width: 45px;
  min-width: 45px;
}

.clear-btn {
  font-weight: 400;
  color: rgba(255, 255, 255, 0.45);
  min-height: 28px;
  padding: 5px 12px;
  background: #202736;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.clear-btn.has-content {
  color: #ffffff;
}

.tile-num-input,
.tile-select-input {
  width: 60px;
  height: 30px;
}

.cue-sec-input {
  width: 65px;
}

.cue-shift-input {
  width: 52px;
}

.cue-select-input {
  width: 40px;
  min-width: 40px;
}

.cue-vol-input {
  width: 40px;
}

.steps-input {
  width: 40px;
}

.time-div-input {
  width: 55px;
}

.perf-play-btn {
  min-width: 62px;
  white-space: nowrap;
  min-height: 28px;
  padding: 5px 10px;
  font-weight: 400;
  color: rgba(233, 238, 247, 0.9);
  background: #202736;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: none;
}

.perf-play-btn .hotkey {
  font-weight: 400;
  color: rgba(200, 206, 220, 0.8);
}

.perf-vol-input {
  width: 70px;
}

.perf-speed-select {
  width: 64px;
  height: 30px;
}

.step-indicator {
  display: grid;
  gap: 0;
  width: 100%;
}

.tile.collapsed .step-indicator {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.step {
  width: 100%;
  min-height: 20px;
  border-radius: 3px;
  border: 2px solid #0b0d13;
  background: rgba(255, 255, 255, 0.16);
  color: #e9eef7;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  transition: background 200ms ease, border-color 200ms ease, color 200ms ease;
}

.step.beat-step {
  background: rgba(255, 255, 255, 0.08);
}

.step.flash {
  background: var(--accent-2);
  color: #0b0d13;
}

.step.has-action {
  background: rgba(106, 224, 255, 0.18);
}

.step.has-action.flash {
  background: var(--accent-2);
  color: #0b0d13;
}

.step.selected-step {
  border-color: var(--accent);
}

.locked-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 18, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  text-align: center;
  padding: 12px;
}

.tile.locked .locked-overlay {
  display: flex;
}

.locked-overlay button {
  background: var(--accent);
  color: #0b0d13;
}

.footer {
  padding: 12px 28px 20px;
  display: none;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.status {
  font-weight: 600;
  color: var(--accent-2);
}

#share.copied {
  background: linear-gradient(135deg, #7ce9a6, #5fd68f);
  color: #0b0d13;
}

#share {
  min-width: 90px;
  width: 90px;
  height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.share-button {
  background: linear-gradient(135deg, rgba(110, 220, 150, 0.2), rgba(80, 200, 120, 0.2));
  border: 1px solid rgba(90, 220, 140, 0.4);
}

.share-icon {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
}

.share-hint {
  width: 260px;
  font-size: 11px;
  color: #8fd7ff;
  opacity: 0;
  min-height: 14px;
  text-align: right;
  transition: opacity 240ms ease;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 6px;
  pointer-events: none;
}

.share-hint.show {
  opacity: 1;
}

.help-panel {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 12, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.help-panel.show {
  display: flex;
}

.help-card {
  background: #111520;
  border-radius: 16px;
  padding: 20px;
  max-width: 680px;
  width: 100%;
  box-shadow: var(--shadow);
}

.help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.help-title {
  font-size: 18px;
  font-weight: 700;
}

.help-subtitle {
  font-size: 12px;
  color: var(--muted);
}

.help-close {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #0b0d13;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: inline-grid;
  place-items: center;
  line-height: 1;
  padding: 0;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.help-paragraph {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

.community-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--sessions-dock-width);
  display: block;
  z-index: 2600;
  pointer-events: none;
  transform: translateX(104%);
  transition: transform 260ms ease;
}

.community-panel.show {
  transform: translateX(0);
}

.community-card {
  background: #111520;
  border-radius: 14px 0 0 14px;
  padding: 16px;
  width: calc(100% - 8px);
  height: calc(100% - 16px);
  margin: 8px 0 8px 8px;
  overflow: hidden auto;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  position: relative;
  pointer-events: auto;
}

.community-card > * {
  flex: 0 0 auto;
}

.community-logo {
  width: 220px;
  max-width: 100%;
  height: auto;
  align-self: center;
  margin: 10px 0 10px;
}

.community-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

.community-discord-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  width: fit-content;
  padding: 10px 16px;
  border-radius: 10px;
  text-decoration: none;
  background: #5865f2;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

.sessions-current-card {
  width: 100%;
  border: 1px solid rgba(120, 160, 220, 0.34);
  border-radius: 12px;
  background: rgba(18, 26, 39, 0.92);
  padding: 12px;
  min-height: auto;
  margin-bottom: 0;
  display: block;
  overflow: visible;
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
}

.sessions-current-label {
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  margin-bottom: 6px;
}

.sessions-main-heading {
  width: 100%;
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: rgba(191, 205, 230, 0.86);
  margin: 2px 0 -2px;
}

.sessions-current-edit {
  display: block;
  width: 100%;
  border: 1px solid rgba(119, 159, 219, 0.35);
  border-radius: 8px;
  background: #101827;
  color: #e8edf8;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  padding: 10px 12px;
  margin-top: 4px;
}

.sessions-tabs {
  width: 100%;
  display: flex;
  gap: 4px;
  padding: 0;
  border-radius: 12px;
  background: transparent;
  border: none;
  margin-bottom: 10px;
}

.sessions-feed-shell {
  width: 100%;
  margin-top: 12px;
  padding: 12px 0 0;
  border-radius: 0;
  border: none;
  border-top: 1px solid rgba(86, 116, 170, 0.35);
  background: transparent;
  box-shadow: none;
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  min-height: auto;
  display: block;
  overflow: visible;
}

.sessions-tab {
  flex: 1;
  border: 1px solid transparent;
  background: transparent;
  color: #d9e5fa;
  border-radius: 9px;
  padding: 9px 8px;
  font-weight: 600;
  cursor: pointer;
}

.sessions-tab.active {
  background: linear-gradient(135deg, #4e64bb, #394d97);
  border-color: rgba(132, 158, 228, 0.36);
  color: #e8f0ff;
}

.community-publish-btn {
  width: fit-content;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid rgba(107, 221, 255, 0.4);
  background: #1a2739;
  color: #dff6ff;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  cursor: pointer;
}

.community-publish-btn:hover,
.community-publish-btn:focus-visible {
  border-color: rgba(107, 221, 255, 0.65);
  background: #22344c;
}

.community-publish-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.community-publish-form {
  display: none;
  width: 100%;
  border: 1px solid rgba(120, 160, 220, 0.34);
  border-radius: 12px;
  background: rgba(18, 26, 39, 0.92);
  padding: 10px;
  gap: 8px;
  margin: 0 0 12px;
}

.community-publish-form.show {
  display: grid;
}

.community-publish-form input,
.community-publish-form textarea {
  width: 100%;
  border: 1px solid rgba(119, 159, 219, 0.35);
  border-radius: 8px;
  background: #101827;
  color: #e8edf8;
  font-size: 12px;
  padding: 8px 10px;
  outline: none;
}

.community-publish-form textarea {
  resize: vertical;
  min-height: 58px;
  max-height: 130px;
}

.community-publish-form input:focus,
.community-publish-form textarea:focus {
  border-color: rgba(107, 221, 255, 0.7);
}

.community-publish-preview-row {
  display: grid;
  gap: 4px;
  justify-items: start;
  text-align: left;
  color: var(--muted);
  font-size: 11px;
}

.community-publish-preview-row code {
  width: 100%;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid rgba(120, 160, 220, 0.24);
  border-radius: 7px;
  background: #0f1622;
  color: #8ccff5;
  font-size: 11px;
  padding: 6px 8px;
}

.community-publish-actions {
  display: flex;
  gap: 8px;
  justify-content: stretch;
  margin-top: 12px;
  margin-bottom: 8px;
  position: static;
  z-index: auto;
  width: 100%;
}

.community-publish-submit,
.community-publish-cancel {
  border: 1px solid rgba(120, 160, 220, 0.35);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  cursor: pointer;
}

.session-action-btn {
  flex: 1;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(90, 220, 140, 0.4);
  background: linear-gradient(135deg, rgba(110, 220, 150, 0.2), rgba(80, 200, 120, 0.2));
  color: #dff6e9;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.session-publish-btn {
  border-color: rgba(111, 170, 255, 0.45);
  background: linear-gradient(135deg, rgba(103, 159, 246, 0.25), rgba(80, 116, 222, 0.22));
  color: #deebff;
}

.session-new-btn {
  width: 100%;
  flex: none !important;
  align-self: stretch;
  margin: 2px 0 10px;
  min-height: 40px !important;
  max-height: 40px !important;
  height: 40px !important;
  line-height: 1;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  border-color: rgba(140, 160, 200, 0.28);
  background: rgba(25, 35, 54, 0.45);
  color: #c8d2e8;
}

.save-glyph {
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 2px;
  position: relative;
  display: inline-block;
}

.save-glyph::before {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  top: 1px;
  height: 3px;
  background: currentColor;
}

.community-publish-submit {
  background: #26509b;
  color: #f2f7ff;
  border-color: rgba(126, 174, 255, 0.5);
}

.community-publish-submit:hover,
.community-publish-submit:focus-visible {
  background: #2e62bb;
}

.community-publish-submit.success {
  background: #1d7f53;
  border-color: rgba(107, 242, 179, 0.6);
}

.community-publish-submit.error {
  background: #8a2f37;
  border-color: rgba(255, 128, 141, 0.6);
}

.community-publish-cancel {
  background: #1f2a3d;
  color: #e1e9f8;
}

.community-publish-feedback {
  min-height: 20px;
  margin-top: 6px;
  font-size: 12px;
  color: #9dc7ff;
  text-align: left;
}

.community-list {
  overflow: visible;
  flex: 0 0 auto;
  min-height: auto;
  max-height: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
  width: 100%;
}

.sessions-list {
  display: none;
}

.sessions-list.active {
  display: flex;
}

.community-card .help-header {
  justify-content: center;
  text-align: center;
  margin-bottom: 8px;
}

.community-card .showcase-item-row {
  justify-content: center;
}

.mobile-blocker {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 16, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}

.mobile-blocker.show {
  display: flex;
}

.mobile-blocker-card {
  width: min(420px, 100%);
  background: #131a28;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 22px;
  text-align: center;
  box-shadow: var(--shadow);
}

.mobile-blocker-card h2 {
  margin: 0 0 10px;
  font-size: 22px;
}

.mobile-blocker-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.showcase-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 94vw);
  height: 100vh;
  background: #121928;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
  z-index: 1200;
  transform: translateX(105%);
  transition: transform 220ms ease;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.showcase-sidebar.show {
  transform: translateX(0);
}

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

.showcase-title {
  font-size: 18px;
  font-weight: 800;
}

.showcase-title.small {
  font-size: 15px;
}

.showcase-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.showcase-close {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.showcase-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.showcase-form input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0f1522;
  color: var(--text);
}

.showcase-list {
  margin-top: 8px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.showcase-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  margin: 6px 0 2px;
}

.showcase-item {
  border: 1px solid rgba(122, 168, 238, 0.28);
  border-radius: 12px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(31, 44, 67, 0.78), rgba(18, 26, 42, 0.86));
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.24);
  position: relative;
  overflow: hidden;
}

.showcase-item > * {
  position: relative;
  z-index: 2;
}

.showcase-thumb-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 8px;
}

.showcase-thumb-chip {
  width: 100%;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(166, 196, 255, 0.32);
  background: #111826;
}

.showcase-thumb-collage {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 1px;
  opacity: 0.16;
  z-index: 1;
  pointer-events: none;
}

.showcase-thumb-collage div {
  background-size: cover;
  background-position: center;
}

.showcase-thumb-collage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 16, 28, 0.45), rgba(11, 16, 28, 0.72));
}

.showcase-thumb {
  width: 100%;
  height: 108px;
  object-fit: cover;
  border-radius: 9px;
  border: 1px solid rgba(161, 196, 255, 0.28);
  margin-bottom: 8px;
}

.showcase-item-title {
  font-size: 14px;
  font-weight: 700;
}

.showcase-item-artist {
  margin-top: 2px;
  font-size: 11px;
  color: #b8c4dd;
}

.showcase-item-url {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #8fd7ff;
  text-decoration: none;
  word-break: break-all;
}

.showcase-item-row {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.showcase-item-row button {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  border: 1px solid rgba(116, 160, 228, 0.36);
  background: #223352;
  color: #e6f1ff;
}

.showcase-item-row a {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  text-decoration: none;
}

.session-open-btn {
  border: 1px solid rgba(121, 173, 255, 0.58);
  background: linear-gradient(135deg, rgba(84, 142, 247, 0.95), rgba(69, 108, 216, 0.95));
  color: #f3f8ff;
  font-weight: 700;
}

.session-delete-btn {
  border: 1px solid rgba(255, 129, 129, 0.58) !important;
  background: linear-gradient(135deg, rgba(172, 56, 56, 0.9), rgba(135, 40, 40, 0.9)) !important;
  color: #ffe9e9 !important;
}

.sessions-artist-edit {
  margin-bottom: 8px;
}

.showcase-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1150;
  display: none;
}

.showcase-backdrop.show {
  display: block;
}

.tile-url-popup {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(6, 8, 12, 0.65);
  z-index: 1180;
}

.tile-url-popup.show {
  display: flex;
}

.tile-url-popup-card {
  width: min(420px, calc(100vw - 24px));
  background: #111724;
  border: 1px solid rgba(106, 224, 255, 0.28);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
}

.tile-url-popup-title {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 8px;
}

#tile-url-input {
  width: 100%;
  height: 34px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #0f1420;
  color: var(--text);
}

.tile-url-popup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

#tile-url-save {
  background: linear-gradient(135deg, #6ae0ff, #3fa7ff);
  color: #0b0d13;
}

.tile-context-menu {
  position: fixed;
  z-index: 1200;
  display: none;
  flex-direction: column;
  min-width: 150px;
  padding: 6px;
  border-radius: 10px;
  background: #111724;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  gap: 4px;
}

.tile-context-menu.show {
  display: flex;
}

.tile-context-menu button {
  width: 100%;
  min-height: 32px;
  border-radius: 8px;
  text-align: left;
  padding: 0 10px;
  font-size: 12px;
  background: #1b2436;
  color: #e7ecf7;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tile-context-menu button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.app-tooltip {
  position: fixed;
  z-index: 1300;
  display: none;
  max-width: 260px;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(10, 13, 20, 0.96);
  color: #f4f7ff;
  font-size: 11px;
  line-height: 1.35;
  white-space: pre-line;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.app-tooltip.show {
  display: block;
}
