.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 20;
}

.panel-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 92vw);
  height: 100dvh;
  background: rgba(10, 14, 20, 0.92);
  backdrop-filter: blur(14px);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  transform: translateX(105%);
  transition: transform 0.35s ease;
  z-index: 21;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel.open {
  transform: translateX(0);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.tabs {
  display: flex;
  gap: 0.4rem;
}

.tab {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-dim);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab.active {
  color: var(--bg-3);
  background: var(--accent);
  border-color: var(--accent);
}

.tab-panel {
  padding: 1.1rem;
  overflow-y: auto;
  flex: 1;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.field-grow {
  flex: 1;
}

.field input,
.field select,
.field textarea {
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
}

/* Native <select> popups render with the OS's own light/dark chrome, driven
   by color-scheme (set on :root) rather than these colors — this pair keeps
   the closed control itself readable and matches option colors when the
   browser does honor them (Chromium/Firefox on most platforms). */
.field select option {
  background: var(--bg-2);
  color: var(--text);
}

.field input[type="color"] {
  padding: 0.2rem;
  height: 2.2rem;
  cursor: pointer;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
}

.checkbox-field input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.section {
  margin-top: 1.4rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.section h4 {
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
}

.hint-text {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin: 0 0 0.6rem;
  line-height: 1.4;
}

.hint-text.warn {
  color: #ffb066;
}

.instance-origin {
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
}

.code-input {
  width: 100%;
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  resize: vertical;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn {
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-3);
  font-weight: 600;
  margin-top: 0.4rem;
}

.btn-danger {
  border-color: rgba(255, 107, 107, 0.4);
  color: #ff8080;
}

/* the band's shows (saved through tabs on jam.geyser.at) */
.shows-save {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}
.shows-save input {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
}
.shows-save input:focus { outline: none; border-color: var(--accent); }
.shows-save .btn-accent { margin-top: 0; }
.shows-status { margin: 0.6rem 0 0; }
.shows-list {
  list-style: none;
  margin: 0.7rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 18rem;
  overflow-y: auto;
}
.shows-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-right: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}
.shows-item.current {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}
.shows-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-align: left;
  font: inherit;
  color: var(--text);
  background: transparent;
  border: 0;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
}
.shows-main:hover .shows-name { color: var(--accent); }
.shows-name { font-size: 0.88rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shows-meta { font-size: 0.72rem; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shows-empty { font-size: 0.78rem; color: var(--text-dim); padding: 0.4rem 0; }
.btn-small { padding: 0.3rem 0.6rem; font-size: 0.74rem; }
.btn:disabled { opacity: 0.45; cursor: default; }

/* the way to mo-tion and to the source, at the foot of the settings */
.panel-source { margin: 18px 0 8px; text-align: center; }
.panel-source a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* a dynamic start: cues that hang on the show's start move with it */
.start-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.4rem 0 1rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}
.start-bar.compact { margin: 0.2rem 0 0.8rem; }
.start-label { font-size: 0.82rem; font-weight: 600; }
.start-input {
  font-family: var(--font-time, inherit);
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 0.3rem 0.5rem;
}
.start-buttons { display: flex; gap: 0.35rem; }
.start-buttons .btn-accent { margin-top: 0; }
.start-hint { flex-basis: 100%; font-size: 0.74rem; color: var(--text-dim); }
.start-bar.compact .start-hint { flex-basis: auto; }
.start-bind { margin-left: auto; }
.live-item-offset { margin-left: 0.4rem; font-size: 0.7em; opacity: 0.7; }
