:root {
  --bg: #01050f;
  --bg-2: #05112a;
  --bg-3: #081c3d;
  --card: rgba(6, 13, 30, 0.78);
  --card-strong: rgba(9, 18, 40, 0.92);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-strong: rgba(255, 255, 255, 0.22);
  --text: #f1f5ff;
  --muted: #9fb4d9;
  --accent: #7ec4ff;
  --accent-strong: #8ff5ff;
  --ok: #42d2b1;
  --warn: #fdb469;
  --danger: #ff7a94;
  --shadow-sm: 0 15px 35px rgba(1, 5, 15, 0.45);
  --shadow-lg: 0 45px 140px rgba(1, 5, 15, 0.78);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --frost-blur: 24px;
  --viewer-height: 100vh;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "SF Pro Display", "SF Pro Text", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial;
  color: var(--text);
  background: radial-gradient(circle at 20% 20%, rgba(126, 196, 255, 0.18), transparent 55%),
    radial-gradient(circle at 80% 0%, rgba(143, 245, 255, 0.18), transparent 50%),
    linear-gradient(135deg, var(--bg), var(--bg-2) 60%, var(--bg-3));
  min-height: 100%;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

body.clip-bin-open {
  overflow: hidden;
  touch-action: none;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
}

body::before {
  background: radial-gradient(circle at 10% 80%, rgba(255, 123, 168, 0.18), transparent 45%),
    radial-gradient(circle at 90% 20%, rgba(124, 196, 255, 0.15), transparent 40%);
  filter: blur(60px);
}

body::after {
  background-image: linear-gradient(120deg, rgba(255, 255, 255, 0.04) 0, transparent 55%),
    linear-gradient(60deg, rgba(255, 255, 255, 0.02) 15%, transparent 60%);
  mix-blend-mode: screen;
  opacity: 0.7;
}

::selection {
  background: rgba(126, 196, 255, 0.35);
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

p {
  margin-top: 0;
}

ul {
  padding-left: 20px;
}

button {
  font: inherit;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  padding: 10px 16px;
  color: var(--text);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02));
  background-color: rgba(13, 21, 41, 0.72);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  backdrop-filter: blur(var(--frost-blur));
  -webkit-backdrop-filter: blur(var(--frost-blur));
  min-height: 44px;
}

button:hover:not(:disabled) {
  border-color: var(--accent);
  box-shadow: 0 18px 40px rgba(126, 196, 255, 0.4);
  transform: translateY(-1px);
}

button:active:not(:disabled) {
  transform: translateY(0) scale(0.99);
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

button.delete-btn,
.delete-btn {
  padding: 0;
  min-height: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  box-shadow: none;
  background: var(--danger);
  color: #fff;
}

button.delete-btn:hover,
.delete-btn:hover {
  transform: none;
  border: none;
  box-shadow: none;
  opacity: 0.85;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(2, 8, 20, 0.7);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(calc(var(--frost-blur) / 1.5));
  -webkit-backdrop-filter: blur(calc(var(--frost-blur) / 1.5));
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 44px;
  background-image:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04)),
    url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23f1f5ff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center, right 14px center;
  background-size: cover, 12px 8px;
  cursor: pointer;
}

select:hover {
  border-color: rgba(255, 255, 255, 0.35);
}

select:focus {
  border-color: var(--accent);
}

select::-ms-expand {
  display: none;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(126, 196, 255, 0.25);
}

input::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.01em;
}

.container {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: clamp(16px, 5vw, 48px);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.container>h1 {
  margin: 12px 0 0;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
}

.subtitle {
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 10px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(calc(var(--frost-blur) * 0.75));
  -webkit-backdrop-filter: blur(calc(var(--frost-blur) * 0.75));
  box-shadow: var(--shadow-sm);
  margin-bottom: 8px;
}

.topbar a {
  font-weight: 500;
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: clamp(18px, 3vw, 28px);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  backdrop-filter: blur(var(--frost-blur));
  -webkit-backdrop-filter: blur(var(--frost-blur));
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent 60%);
  opacity: 0.25;
  pointer-events: none;
}

.card>* {
  position: relative;
}

.card h2 {
  margin: 0 0 12px;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
}

.muted {
  color: var(--muted);
}

.pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 0.9rem;
}

.pill.ok {
  color: var(--ok);
  border-color: rgba(66, 210, 177, 0.4);
  background: rgba(66, 210, 177, 0.08);
}

.pill.warn {
  color: var(--warn);
  border-color: rgba(253, 180, 105, 0.4);
  background: rgba(253, 180, 105, 0.08);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 14px 0;
}

.controls>* {
  flex: 1 1 180px;
  min-width: 0;
}

.controls button {
  white-space: normal;
  word-break: break-word;
  font-weight: 600;
}

.controls #prev-btn,
.controls #next-btn {
  font-size: 1rem;
  min-height: 56px;
  letter-spacing: 0.02em;
}

.controls #next-btn {
  background: linear-gradient(135deg, rgba(126, 196, 255, 0.35), rgba(143, 245, 255, 0.2));
  color: var(--text);
  border-color: rgba(126, 196, 255, 0.4);
}

.controls #prev-btn {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
}

.controls #index-label {
  flex: 0 0 auto;
  text-align: right;
  font-weight: 600;
  color: var(--muted);
}

.controls a {
  text-align: center;
  padding: 12px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
  white-space: normal;
  word-break: break-word;
}

.controls a:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

#slides-grid>div {
  display: flex;
  flex-direction: column;
}

.slide-item {
  text-align: left;
  min-height: 80px;
  border-radius: var(--radius-md);
  white-space: pre-wrap;
  font-size: 0.9rem;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.1));
  color: var(--text);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.5;
  position: relative;
}

.slide-item .media-missing {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 94, 94, 0.92);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  letter-spacing: 0.02em;
}

.slide-item.has-bg {
  border-color: rgba(126, 196, 255, 0.45);
}

.slide-text {
  white-space: pre-wrap;
}

.slide-meta {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.slide-badge {
  background: rgba(126, 196, 255, 0.18);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.slide-item.active {
  border-color: rgba(126, 196, 255, 0.7);
  box-shadow: 0 10px 40px rgba(126, 196, 255, 0.35);
}

.slide-item.selected {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
}

.slide-item.drag-over {
  border-style: dashed;
  border-color: var(--accent);
}

.slide-item:hover {
  transform: translateY(-2px);
}

.importers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.imports {
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.import-item button {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.import-item .delete-btn {
  top: -6px;
  right: -6px;
  position: absolute;
}

.copy-indicator {
  background: rgba(126, 196, 255, 0.8);
  color: #02060f;
  border-radius: 4px;
  font-size: 0.65rem;
  padding: 2px 6px;
}

.autocomplete {
  margin-top: 6px;
  display: grid;
  gap: 6px;
}

.ac-item {
  text-align: left;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 12px;
}

.ac-item:hover {
  border-color: var(--accent);
}

.viewer {
  min-height: var(--viewer-height, 100vh);
  height: var(--viewer-height, 100vh);
  display: grid;
  grid-template-rows: 1fr auto;
  background: transparent;
}

.slide-stack {
  position: relative;
  overflow: hidden;
}

.slide {
  display: grid;
  place-items: center;
  font-size: clamp(22px, 6vw, 64px);
  padding: min(3vh, 24px);
  text-align: center;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: var(--radius-lg);
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(calc(var(--frost-blur) * 0.75));
  -webkit-backdrop-filter: blur(calc(var(--frost-blur) * 0.75));
}

body.viewer-page {
  background: #000;
  min-height: var(--viewer-height, 100vh);
  overflow: hidden;
}

body.viewer-page .viewer {
  background: radial-gradient(circle at 50% -20%, rgba(78, 125, 255, 0.18), transparent 55%),
    radial-gradient(circle at 20% 10%, rgba(255, 108, 173, 0.14), transparent 48%),
    #000;
  padding: clamp(8px, 4vw, 24px);
  min-height: var(--viewer-height, 100vh);
  height: var(--viewer-height, 100vh);
  overflow: hidden;
}

body.viewer-page .slide-stack {
  padding: clamp(12px, 4vw, 32px);
}

body.viewer-page .slide {
  background: rgba(3, 6, 16, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 40px 140px rgba(0, 0, 0, 0.85);
  padding: min(4vh, 32px);
}

body.viewer-page .status {
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  margin: 0;
  width: 100%;
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

body.viewer-page .status.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

body.viewer-page #toggle-all {
  margin-left: auto;
}

body.viewer-page #all-lyrics {
  padding: clamp(18px, 4vw, 32px);
  background: rgba(0, 0, 0, 0.7);
}

.status {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(2, 4, 12, 0.8);
  backdrop-filter: blur(calc(var(--frost-blur) / 2));
  -webkit-backdrop-filter: blur(calc(var(--frost-blur) / 2));
}

.status button {
  min-height: 38px;
}

#toggle-all {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

#slide-context-menu {
  position: fixed;
  background: rgba(8, 10, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  z-index: 130;
  display: none;
  min-width: 180px;
  overflow: hidden;
}

#slide-context-menu.open {
  display: flex;
  flex-direction: column;
}

#slide-context-menu button {
  background: none;
  border: none;
  color: var(--text);
  text-align: left;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.9rem;
}

#slide-context-menu button:hover {
  background: rgba(126, 196, 255, 0.2);
}

#all-lyrics {
  display: none;
  border-radius: var(--radius-lg);
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.timer-ui {
  gap: 16px;
}

.timer-ui .muted {
  white-space: nowrap;
}

.timer-rollers {
  flex-wrap: wrap;
  gap: 12px;
}

.timer-rollers select {
  background: rgba(255, 255, 255, 0.05);
  text-align: center;
  font-size: 1.3rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  border-radius: 14px;
  min-width: 90px;
  padding: 12px 18px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.timer-rollers .muted {
  align-self: center;
  font-weight: 600;
}

.timer-input {
  font-size: 1.5rem;
  text-align: center;
}

#screen-preview {
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: var(--shadow-sm);
}

#screen-preview iframe {
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: #000;
}

#screen-preview>div:first-child {
  background: rgba(0, 0, 0, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.overlay-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  flex: 1 1 220px;
}

.overlay-toggle .muted {
  color: var(--text);
  font-weight: 500;
  white-space: normal;
}

#bg-selected-label {
  flex: 1 1 100%;
  color: var(--muted);
  font-size: 0.9rem;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
}

#bg-preview-button {
  min-height: 44px;
}

.bg-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 2, 10, 0.75);
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.bg-panel-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

#bg-preview-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 90;
  background: rgba(2, 4, 12, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 16px;
  width: min(1100px, calc(100vw - 32px));
  max-height: min(90vh, 900px);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
  backdrop-filter: blur(var(--frost-blur));
  -webkit-backdrop-filter: blur(var(--frost-blur));
}

#bg-preview-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.bg-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.bg-preview-header strong {
  font-size: 1rem;
}

.bg-panel-content {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 18px;
  flex: 1;
  min-height: 0;
}

@media (max-width: 900px) {
  .bg-panel-content {
    grid-template-columns: 1fr;
  }
}

.bg-panel-stage {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.35);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 220px;
}

.bg-panel-stage video {
  width: 100%;
  border-radius: var(--radius-sm);
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 180px;
  max-height: 360px;
  object-fit: cover;
}

.bg-panel-stage-placeholder {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.bg-panel-stage[data-empty="true"] video {
  display: none;
}

.bg-panel-stage[data-empty="false"] .bg-panel-stage-placeholder {
  display: none;
}

.bg-panel-stage-caption {
  font-size: 0.85rem;
  color: var(--muted);
}

.bg-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  max-height: none;
  overflow-y: auto;
  padding-right: 6px;
  min-height: 0;
}

.bg-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  padding: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  min-height: 150px;
  position: relative;
}

.bg-card:hover {
  border-color: var(--accent);
  box-shadow: 0 12px 30px rgba(126, 196, 255, 0.2);
  transform: translateY(-2px);
}

.bg-card video,
.bg-card .bg-card-thumb {
  width: 100%;
  height: 100px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.bg-card-section {
  grid-column: 1 / -1;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 2px;
}

.bg-card-desc {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: left;
}

.bg-card-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: var(--text);
  cursor: pointer;
  font-size: 0.85rem;
}

.bg-card-name {
  font-size: 0.85rem;
  text-align: left;
  color: var(--text);
  word-break: break-word;
}

.bg-card-none .bg-card-thumb {
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0, rgba(255, 255, 255, 0.05) 8px, rgba(255, 255, 255, 0.02) 8px, rgba(255, 255, 255, 0.02) 16px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 600;
}

.upload-progress {
  width: 100%;
  display: none;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.upload-progress.visible {
  display: flex;
}

.upload-progress-track {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.upload-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(135deg, rgba(126, 196, 255, 0.9), rgba(143, 245, 255, 0.8));
  border-radius: 999px;
  transition: width 0.15s ease;
}

.upload-progress-label {
  min-width: 48px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255, 255, 255, 0.15);
  transition: 0.2s;
  border-radius: 999px;
}

.slider:before {
  content: "";
  position: absolute;
  height: 22px;
  width: 22px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}

.switch input:checked+.slider {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 0 12px rgba(126, 196, 255, 0.4);
}

.switch input:checked+.slider:before {
  transform: translateX(24px);
}

.card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.card li {
  margin-bottom: 6px;
}

@media (max-width: 600px) and (orientation: portrait) {
  body.viewer-page .slide {
    font-size: clamp(36px, 9vw, 100px);
    padding: min(6vh, 38px);
  }

  body.viewer-page .status {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  body.viewer-page .status button,
  body.viewer-page .status a,
  body.viewer-page .status #slide-index,
  body.viewer-page .status #room-name {
    width: 100%;
  }
}

@media (max-width: 1024px) {
  .container {
    padding: clamp(16px, 4vw, 36px);
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    position: static;
  }

  .controls {
    flex-direction: column;
  }

  .controls>* {
    flex: 1 1 100%;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .slide-item {
    min-height: 68px;
    font-size: 0.85rem;
  }
}

@media (orientation: portrait) and (max-width: 520px) {
  #screen-preview iframe {
    height: min(50vh, 420px) !important;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .container {
    padding: 12px;
  }

  #screen-preview iframe {
    height: min(40vh, 320px) !important;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@supports not (backdrop-filter: blur(1px)) {

  .card,
  .topbar,
  button,
  input,
  select,
  textarea,
  .slide,
  .status {
    background-color: rgba(8, 10, 18, 0.95);
  }
}

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

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
}