:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --panel: #17181b;
  --panel-raised: #202227;
  --line: #303239;
  --muted: #9da0a8;
  --accent: #cfff4f;
  --blue: #5b8cff;
}

html.viewer-document { color-scheme: normal; }

* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: #50545e #17181c; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { border-radius: 999px; background: #17181c; }
*::-webkit-scrollbar-thumb { border: 2px solid #17181c; border-radius: 999px; background: #50545e; }
*::-webkit-scrollbar-thumb:hover { background: #696e79; }
[hidden] { display: none !important; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background-color: transparent !important;
  background: none !important;
}

button,
input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.viewer-page, .viewer-page .viewer-stage, .viewer-page .viewer-canvas-frame, .viewer-page #board, .viewer-page .media-layer { background: transparent; }
.viewer-page .empty-state { display: none !important; }

.viewer-stage,
.viewer-canvas-frame,
.canvas-frame {
  position: relative;
  overflow: hidden;
  background: transparent;
  --scene-background: transparent;
}

.viewer-canvas-frame::before,
.canvas-frame::before { position: absolute; z-index: 0; inset: 0; background: var(--scene-background); content: ""; pointer-events: none; }

.viewer-stage { width: 100%; height: 100%; container-type: size; }
.viewer-canvas-frame { position: absolute; inset: 0; width: 100%; height: 100%; container-type: size; }

.canvas-frame {
  width: 100%;
  height: 100%;
  flex: 0 0 auto;
  box-shadow: 0 16px 52px rgb(0 0 0 / 22%);
  container-type: size;
}

.media-layer,
#board {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.media-layer {
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.scene-media {
  position: absolute;
  display: block;
  border: 0;
  object-fit: fill;
  pointer-events: none;
}

.scene-embed {
  overflow: hidden;
  background: #000;
}

.scene-embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.scene-media.is-interactive {
  z-index: 5;
  pointer-events: auto;
  box-shadow: 0 0 0 2px #5b8cff, 0 10px 34px rgb(0 0 0 / 25%);
}

.scene-media.is-interactive iframe { pointer-events: auto; }
.scene-media.is-interactive video { pointer-events: auto; }
.host-page .scene-media.is-selected { outline: 2px solid rgb(91 140 255 / 72%); outline-offset: -1px; }

.broadcast-graphic { display: flex; overflow: hidden; color: #fff; font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
.graphic-lower-third { align-items: stretch; border-radius: 0.8cqh; box-shadow: 0 1.2cqh 3cqh rgb(0 0 0 / 28%); }
.lower-third-accent { flex: 0 0 1.1cqh; background: #cfff4f; }
.lower-third-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; justify-content: center; gap: 0.45cqh; padding: 1.5cqh 2cqh; }
.lower-third-copy strong { overflow: hidden; font-size: 4.1cqh; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.lower-third-copy small { overflow: hidden; font-size: 2.3cqh; opacity: 0.76; text-overflow: ellipsis; white-space: nowrap; }
.graphic-glass { border: 1px solid rgb(255 255 255 / 22%); background: rgb(10 13 18 / 76%); backdrop-filter: blur(18px) saturate(1.3); }
.graphic-news { border-radius: 0; background: linear-gradient(105deg, #c40019 0 24%, #12141a 24%); }
.graphic-news .lower-third-accent { background: #fff; }
.graphic-news .lower-third-copy { padding-left: 3cqh; }
.graphic-neon { border: 1px solid #48eaff; background: rgb(3 5 16 / 88%); box-shadow: 0 0 2cqh rgb(72 234 255 / 38%), inset 0 0 2cqh rgb(184 68 255 / 14%); }
.graphic-neon .lower-third-accent { background: linear-gradient(#48eaff, #bb44ff); box-shadow: 0 0 1.6cqh #48eaff; }
.graphic-ticker { align-items: center; border-radius: 0; white-space: nowrap; }
.graphic-ticker.graphic-news { border-top: 0.75cqh solid #e40024; background: #101218; }
.graphic-ticker.graphic-neon { border-width: 1px 0; }
.ticker-track { display: flex; width: max-content; min-width: 200%; animation: ticker-scroll var(--ticker-duration, 18s) linear infinite; will-change: transform; }
.ticker-track span { flex: 0 0 auto; padding-right: 7cqh; font-size: 3.15cqh; font-weight: 780; line-height: 7.2cqh; letter-spacing: 0.025em; }
@keyframes ticker-scroll { to { transform: translateX(-50%); } }

.scene-transition { position: fixed; z-index: 8; inset: 0; overflow: hidden; pointer-events: none; }
.scene-transition::before,
.transition-art-frame { position: absolute; inset: -8%; width: 116%; height: 116%; }
.scene-transition::before { z-index: 1; content: ""; opacity: 0; }
.transition-art-frame { z-index: 2; display: none; overflow: visible; visibility: hidden; }
.transition-art-frame img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; transform: translate(var(--art-shift-x, 0), var(--art-shift-y, 0)) scale(var(--art-coverage-scale, 1)); transform-origin: center; }
.scene-transition.is-running::before,
.scene-transition.is-running .transition-art-frame { animation-duration: var(--transition-duration); animation-timing-function: cubic-bezier(0.76, 0, 0.24, 1); animation-fill-mode: both; }
.transition-fade::before { background: #000; animation-name: transition-fade; }

.cover-pieces { position: absolute; z-index: 3; inset: -12%; display: none; overflow: hidden; }
.cover-pieces i { position: absolute; inset: 0; display: block; will-change: transform; }
[class*="transition-cover-"] .cover-pieces { display: block; }
.scene-transition.is-running .cover-pieces i { animation-duration: var(--transition-duration); animation-fill-mode: both; animation-timing-function: cubic-bezier(0.74, 0, 0.2, 1); }
.scene-transition.is-running[class*="transition-cover-left"] .cover-pieces i { animation-name: cover-pieces-left; }
.scene-transition.is-running[class*="transition-cover-right"] .cover-pieces i { animation-name: cover-pieces-right; }
.transition-cover-left-1 .cover-pieces i, .transition-cover-right-1 .cover-pieces i { background: linear-gradient(110deg, #313746, #7f91b3 62%, #b5c9e8); }
.transition-cover-left-1 .cover-pieces i:nth-child(1), .transition-cover-right-1 .cover-pieces i:nth-child(1) { clip-path: polygon(0 0, 29% 0, 17% 100%, 0 100%); --piece-angle: -4deg; }
.transition-cover-left-1 .cover-pieces i:nth-child(2), .transition-cover-right-1 .cover-pieces i:nth-child(2) { clip-path: polygon(25% 0, 54% 0, 42% 100%, 13% 100%); background: linear-gradient(115deg, #596477, #9babc3); --piece-angle: 3deg; }
.transition-cover-left-1 .cover-pieces i:nth-child(3), .transition-cover-right-1 .cover-pieces i:nth-child(3) { clip-path: polygon(50% 0, 79% 0, 67% 100%, 38% 100%); background: linear-gradient(115deg, #71859b, #b8d8d0); --piece-angle: -2deg; }
.transition-cover-left-1 .cover-pieces i:nth-child(4), .transition-cover-right-1 .cover-pieces i:nth-child(4) { clip-path: polygon(75% 0, 100% 0, 100% 100%, 63% 100%); background: linear-gradient(115deg, #a7bec8, #4e586a); --piece-angle: 4deg; }
.transition-cover-left-1 .cover-pieces i:nth-child(5), .transition-cover-right-1 .cover-pieces i:nth-child(5) { clip-path: polygon(46% 0, 49% 0, 37% 100%, 34% 100%); background: #d8e6df; --piece-angle: 0deg; }
.transition-cover-left-2 .cover-pieces i, .transition-cover-right-2 .cover-pieces i { background: linear-gradient(135deg, #ca8178, #8d5b63); }
.transition-cover-left-2 .cover-pieces i:nth-child(1), .transition-cover-right-2 .cover-pieces i:nth-child(1) { clip-path: polygon(0 0, 58% 0, 0 58%); --piece-angle: -7deg; }
.transition-cover-left-2 .cover-pieces i:nth-child(2), .transition-cover-right-2 .cover-pieces i:nth-child(2) { clip-path: polygon(58% 0, 100% 0, 100% 46%, 34% 100%, 0 100%, 0 58%); background: linear-gradient(145deg, #665d67, #9c8582); --piece-angle: 5deg; }
.transition-cover-left-2 .cover-pieces i:nth-child(3), .transition-cover-right-2 .cover-pieces i:nth-child(3) { clip-path: polygon(100% 42%, 100% 100%, 36% 100%); background: linear-gradient(145deg, #e0aa84, #bd766e); --piece-angle: -5deg; }
.transition-cover-left-2 .cover-pieces i:nth-child(4), .transition-cover-right-2 .cover-pieces i:nth-child(4) { clip-path: polygon(42% 0, 48% 0, 0 68%, 0 61%); background: #f0d3bd; --piece-angle: 2deg; }
.transition-cover-left-2 .cover-pieces i:nth-child(5), .transition-cover-right-2 .cover-pieces i:nth-child(5) { clip-path: polygon(100% 31%, 100% 37%, 28% 100%, 21% 100%); background: #ead7a7; --piece-angle: -2deg; }
.transition-cover-left-3 .cover-pieces i, .transition-cover-right-3 .cover-pieces i { background: linear-gradient(90deg, #62556f, #9384aa 58%, #acd0d3); }
.transition-cover-left-3 .cover-pieces i:nth-child(1), .transition-cover-right-3 .cover-pieces i:nth-child(1) { clip-path: polygon(0 0, 100% 0, 91% 23%, 0 32%); --piece-angle: 3deg; }
.transition-cover-left-3 .cover-pieces i:nth-child(2), .transition-cover-right-3 .cover-pieces i:nth-child(2) { clip-path: polygon(0 27%, 92% 18%, 100% 47%, 8% 56%); background: linear-gradient(90deg, #51495c, #80718f); --piece-angle: -3deg; }
.transition-cover-left-3 .cover-pieces i:nth-child(3), .transition-cover-right-3 .cover-pieces i:nth-child(3) { clip-path: polygon(7% 51%, 100% 42%, 92% 72%, 0 81%); background: linear-gradient(90deg, #a8d2d3, #a69ac1); --piece-angle: 2deg; }
.transition-cover-left-3 .cover-pieces i:nth-child(4), .transition-cover-right-3 .cover-pieces i:nth-child(4) { clip-path: polygon(0 76%, 93% 67%, 100% 100%, 0 100%); background: linear-gradient(90deg, #4e4859, #71657f); --piece-angle: -2deg; }
.transition-cover-left-3 .cover-pieces i:nth-child(5), .transition-cover-right-3 .cover-pieces i:nth-child(5) { clip-path: polygon(0 48%, 100% 38%, 100% 42%, 0 52%); background: #ddd4e8; --piece-angle: 0deg; }

[class*="transition-art-"]::before { display: block; background: #000; animation-name: transition-art-midpoint-shield; animation-timing-function: linear; }
[class*="transition-art-"] .transition-art-frame { display: block; }
.scene-transition.is-running[class*="transition-art-"] .transition-art-frame { visibility: visible; }
.transition-art-left .transition-art-frame { animation-name: transition-art-left; }
.transition-art-right .transition-art-frame { animation-name: transition-art-right; }
.transition-art-up .transition-art-frame { animation-name: transition-art-up; }
.transition-art-down .transition-art-frame { animation-name: transition-art-down; }
.transition-art-ul .transition-art-frame { animation-name: transition-art-ul; }
.transition-art-ur .transition-art-frame { animation-name: transition-art-ur; }
.transition-art-dl .transition-art-frame { animation-name: transition-art-dl; }
.transition-art-dr .transition-art-frame { animation-name: transition-art-dr; }
.transition-art-fast-left .transition-art-frame { animation-name: transition-art-fast-left; }
.transition-art-fast-right .transition-art-frame { animation-name: transition-art-fast-right; }
.transition-art-fast-up .transition-art-frame { animation-name: transition-art-fast-up; }
.transition-art-fast-down .transition-art-frame { animation-name: transition-art-fast-down; }
.transition-art-fast-ul .transition-art-frame { animation-name: transition-art-fast-ul; }
.transition-art-fast-ur .transition-art-frame { animation-name: transition-art-fast-ur; }
.transition-art-fast-dl .transition-art-frame { animation-name: transition-art-fast-dl; }
.transition-art-fast-dr .transition-art-frame { animation-name: transition-art-fast-dr; }
.scene-transition.is-running[class*="transition-art-fast-"] .transition-art-frame { animation-timing-function: linear; }
.transition-art-bounce-left .transition-art-frame { animation-name: transition-art-bounce-left; }
.transition-art-bounce-right .transition-art-frame { animation-name: transition-art-bounce-right; }
.transition-art-bounce-up .transition-art-frame { animation-name: transition-art-bounce-up; }
.transition-art-bounce-down .transition-art-frame { animation-name: transition-art-bounce-down; }
.transition-art-spin-in .transition-art-frame { animation-name: transition-art-spin-in; }
.transition-art-expand .transition-art-frame { animation-name: transition-art-expand; }
.transition-art-fade .transition-art-frame { animation-name: transition-fade; animation-timing-function: ease-in-out; }

@keyframes transition-fade { 0%, 100% { opacity: 0; } 46%, 54% { opacity: 1; } }
@keyframes cover-pieces-left { 0% { transform: translateX(125%) rotate(var(--piece-angle)); } 44%, 56% { transform: translateX(0) rotate(0); } 100% { transform: translateX(-125%) rotate(var(--piece-angle)); } }
@keyframes cover-pieces-right { 0% { transform: translateX(-125%) rotate(var(--piece-angle)); } 44%, 56% { transform: translateX(0) rotate(0); } 100% { transform: translateX(125%) rotate(var(--piece-angle)); } }
@keyframes transition-art-midpoint-shield { 0%, 49.4%, 50.6%, 100% { opacity: 0; } 49.9%, 50.1% { opacity: 1; } }
@keyframes transition-art-left { 0% { transform: translateX(var(--art-offscreen-x, 220vw)); } 46%, 54% { transform: translateX(0); } 100% { transform: translateX(var(--art-offscreen-neg-x, -220vw)); } }
@keyframes transition-art-right { 0% { transform: translateX(var(--art-offscreen-neg-x, -220vw)); } 46%, 54% { transform: translateX(0); } 100% { transform: translateX(var(--art-offscreen-x, 220vw)); } }
@keyframes transition-art-up { 0% { transform: translateY(var(--art-offscreen-y, 220vh)); } 46%, 54% { transform: translateY(0); } 100% { transform: translateY(var(--art-offscreen-neg-y, -220vh)); } }
@keyframes transition-art-down { 0% { transform: translateY(var(--art-offscreen-neg-y, -220vh)); } 46%, 54% { transform: translateY(0); } 100% { transform: translateY(var(--art-offscreen-y, 220vh)); } }
@keyframes transition-art-ul { 0% { transform: translate(var(--art-offscreen-x, 220vw), var(--art-offscreen-y, 220vh)); } 46%, 54% { transform: translate(0); } 100% { transform: translate(var(--art-offscreen-neg-x, -220vw), var(--art-offscreen-neg-y, -220vh)); } }
@keyframes transition-art-ur { 0% { transform: translate(var(--art-offscreen-neg-x, -220vw), var(--art-offscreen-y, 220vh)); } 46%, 54% { transform: translate(0); } 100% { transform: translate(var(--art-offscreen-x, 220vw), var(--art-offscreen-neg-y, -220vh)); } }
@keyframes transition-art-dl { 0% { transform: translate(var(--art-offscreen-x, 220vw), var(--art-offscreen-neg-y, -220vh)); } 46%, 54% { transform: translate(0); } 100% { transform: translate(var(--art-offscreen-neg-x, -220vw), var(--art-offscreen-y, 220vh)); } }
@keyframes transition-art-dr { 0% { transform: translate(var(--art-offscreen-neg-x, -220vw), var(--art-offscreen-neg-y, -220vh)); } 46%, 54% { transform: translate(0); } 100% { transform: translate(var(--art-offscreen-x, 220vw), var(--art-offscreen-y, 220vh)); } }
@keyframes transition-art-fast-left { 0% { transform: translateX(var(--art-offscreen-x, 220vw)); } 50% { transform: translateX(0); } 100% { transform: translateX(var(--art-offscreen-neg-x, -220vw)); } }
@keyframes transition-art-fast-right { 0% { transform: translateX(var(--art-offscreen-neg-x, -220vw)); } 50% { transform: translateX(0); } 100% { transform: translateX(var(--art-offscreen-x, 220vw)); } }
@keyframes transition-art-fast-up { 0% { transform: translateY(var(--art-offscreen-y, 220vh)); } 50% { transform: translateY(0); } 100% { transform: translateY(var(--art-offscreen-neg-y, -220vh)); } }
@keyframes transition-art-fast-down { 0% { transform: translateY(var(--art-offscreen-neg-y, -220vh)); } 50% { transform: translateY(0); } 100% { transform: translateY(var(--art-offscreen-y, 220vh)); } }
@keyframes transition-art-fast-ul { 0% { transform: translate(var(--art-offscreen-x, 220vw), var(--art-offscreen-y, 220vh)); } 50% { transform: translate(0); } 100% { transform: translate(var(--art-offscreen-neg-x, -220vw), var(--art-offscreen-neg-y, -220vh)); } }
@keyframes transition-art-fast-ur { 0% { transform: translate(var(--art-offscreen-neg-x, -220vw), var(--art-offscreen-y, 220vh)); } 50% { transform: translate(0); } 100% { transform: translate(var(--art-offscreen-x, 220vw), var(--art-offscreen-neg-y, -220vh)); } }
@keyframes transition-art-fast-dl { 0% { transform: translate(var(--art-offscreen-x, 220vw), var(--art-offscreen-neg-y, -220vh)); } 50% { transform: translate(0); } 100% { transform: translate(var(--art-offscreen-neg-x, -220vw), var(--art-offscreen-y, 220vh)); } }
@keyframes transition-art-fast-dr { 0% { transform: translate(var(--art-offscreen-neg-x, -220vw), var(--art-offscreen-neg-y, -220vh)); } 50% { transform: translate(0); } 100% { transform: translate(var(--art-offscreen-x, 220vw), var(--art-offscreen-y, 220vh)); } }
@keyframes transition-art-bounce-left { 0%, 100% { transform: translateX(var(--art-offscreen-x, 220vw)); } 46%, 54% { transform: translateX(0); } }
@keyframes transition-art-bounce-right { 0%, 100% { transform: translateX(var(--art-offscreen-neg-x, -220vw)); } 46%, 54% { transform: translateX(0); } }
@keyframes transition-art-bounce-up { 0%, 100% { transform: translateY(var(--art-offscreen-y, 220vh)); } 46%, 54% { transform: translateY(0); } }
@keyframes transition-art-bounce-down { 0%, 100% { transform: translateY(var(--art-offscreen-neg-y, -220vh)); } 46%, 54% { transform: translateY(0); } }
@keyframes transition-art-spin-in { 0% { border-radius: 50%; opacity: 0; transform: scale(0) rotate(-540deg); } 46%, 54% { border-radius: 0; opacity: 1; transform: scale(1) rotate(0); } 100% { border-radius: 50%; opacity: 0; transform: scale(0) rotate(540deg); } }
@keyframes transition-art-expand { 0%, 100% { border-radius: 50%; opacity: 0; transform: scale(0); } 46%, 54% { border-radius: 0; opacity: 1; transform: scale(1); } }

.embed-error {
  display: grid;
  place-items: center;
  padding: 16px;
  background: #171717;
  color: #ddd;
  font-size: 0.8rem;
  text-align: center;
}

.scene-text {
  overflow: hidden;
  padding: 0.06em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#board {
  z-index: 2;
  display: block;
  background: transparent;
}

.viewer-stage #board { cursor: none; }

.empty-state {
  position: absolute;
  z-index: 3;
  inset: 50% auto auto 50%;
  margin: 0;
  color: #777;
  font-size: clamp(1rem, 2vw, 1.35rem);
  letter-spacing: -0.02em;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: opacity 180ms ease;
}

.empty-state.is-hidden { opacity: 0; }

.status-pill {
  position: fixed;
  z-index: 10;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 999px;
  background: rgb(12 12 12 / 82%);
  color: #ddd;
  font-size: 0.76rem;
  font-weight: 650;
  backdrop-filter: blur(12px);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f0b429;
  box-shadow: 0 0 9px currentColor;
}

[data-state="live"] .status-dot { background: #31d158; }
[data-state="offline"] .status-dot { background: #ff453a; }

.host-page {
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr);
  background: #111216;
}

.toolbar {
  position: relative;
  z-index: 30;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-bottom: 1px solid #292b31;
  background: rgb(20 21 25 / 97%);
  color: #f4f4f5;
  box-shadow: 0 7px 24px rgb(0 0 0 / 20%);
  backdrop-filter: blur(16px);
}

.compact-brand {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  margin-right: 4px;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--accent), #8eea67);
  color: #15170f;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: -0.03em;
  box-shadow: 0 6px 18px rgb(183 255 79 / 13%);
}

.compact-brand div { display: grid; line-height: 1.08; }
.compact-brand strong { font-size: 0.83rem; letter-spacing: -0.015em; }
.compact-brand small { margin-top: 3px; color: #83868f; font-size: 0.6rem; }

.toolbar-group,
.brush-controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
}

.edit-actions { margin-left: auto; }
.toolbar-divider { width: 1px; height: 25px; background: var(--line); }
.toolbar-divider-subtle { height: 20px; margin: 0 3px; background: #373941; }

.icon-button,
.panel-close {
  position: relative;
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #c9cbd1;
  cursor: pointer;
  text-decoration: none;
  transition: color 130ms ease, background 130ms ease, border-color 130ms ease, transform 130ms ease;
}

.icon-button i { font-size: 0.95rem; }
.panel-close i { font-size: 0.9rem; }
.upload-card > i { width: 24px; color: #91b9ff; font-size: 1.25rem; text-align: center; }

.icon-button:hover,
.icon-button:focus-visible,
.panel-close:hover { background: #292b31; color: #fff; outline: none; }
.icon-button:active { transform: translateY(1px); }
.icon-button.is-active { border-color: #b6e63f; background: var(--accent); color: #11140c; }
.icon-button.accent { border-color: transparent; background: transparent; color: #c9cbd1; }
.icon-button.accent:hover { background: #292b31; color: #fff; }
.icon-button.accent[aria-expanded="true"] { border-color: #405572; background: #22324a; color: #a9c8ff; }
.icon-button.danger { color: #ff8d88; }
.icon-button.is-busy svg { animation: pulse 800ms ease-in-out infinite alternate; }
.icon-button.is-busy i { animation: pulse 800ms ease-in-out infinite alternate; }
.icon-button.small-action { width: 31px; height: 31px; }
.icon-button.small-action i { font-size: 0.74rem; }

.count-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border: 2px solid #141519;
  border-radius: 999px;
  background: #555861;
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 12px;
  text-align: center;
}

.icon-button.has-viewers .count-badge { background: #2aaf58; }

.color-control,
.size-control { position: relative; display: flex; align-items: center; }

.color-picker-trigger {
  width: 34px;
  height: 34px;
  padding: 4px;
  border: 1px solid #3b3d45;
  border-radius: 10px;
  background-color: #24262b;
  background-image: linear-gradient(45deg, #3b3d43 25%, transparent 25%), linear-gradient(-45deg, #3b3d43 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #3b3d43 75%), linear-gradient(-45deg, transparent 75%, #3b3d43 75%);
  background-position: 0 0, 0 5px, 5px -5px, -5px 0;
  background-size: 10px 10px;
  cursor: pointer;
}
.color-picker-trigger.rectangular { width: 46px; }
.color-swatch { display: block; width: 100%; height: 100%; border: 1px solid rgb(255 255 255 / 22%); border-radius: 6px; box-shadow: 0 1px 5px rgb(0 0 0 / 28%); }

.size-control {
  gap: 6px;
  width: 92px;
  padding: 0 8px;
}

.size-control input[type="range"] {
  width: 65px;
  min-width: 0;
  height: 20px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}
.size-control input[type="range"]::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #8fb8ff, var(--accent));
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 9%);
}
.size-control input[type="range"]::-moz-range-track {
  height: 5px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #8fb8ff, var(--accent));
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 9%);
}
.size-control input[type="range"]::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: -5.5px;
  appearance: none;
  border: 3px solid #f7f8fa;
  border-radius: 50%;
  background: #17181b;
  box-shadow: 0 2px 8px rgb(0 0 0 / 45%);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.size-control input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 3px solid #f7f8fa;
  border-radius: 50%;
  background: #17181b;
  box-shadow: 0 2px 8px rgb(0 0 0 / 45%);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.size-control input[type="range"]:hover::-webkit-slider-thumb,
.size-control input[type="range"]:focus-visible::-webkit-slider-thumb { transform: scale(1.12); box-shadow: 0 0 0 4px rgb(207 255 79 / 14%), 0 2px 8px rgb(0 0 0 / 45%); }
.size-control input[type="range"]:hover::-moz-range-thumb,
.size-control input[type="range"]:focus-visible::-moz-range-thumb { transform: scale(1.12); box-shadow: 0 0 0 4px rgb(207 255 79 / 14%), 0 2px 8px rgb(0 0 0 / 45%); }
.size-control input[type="range"]:focus-visible { outline: none; }
.size-control output { min-width: 19px; color: #8f929b; font-size: 0.66rem; font-weight: 700; text-align: right; }
.context-toolbar .size-control { display: flex; width: 116px; min-width: 116px; align-items: center; gap: 7px; padding: 0 5px; white-space: nowrap; }
.context-toolbar .size-control input[type="range"] { width: 78px; flex: 0 0 78px; }
.context-toolbar .size-control output { display: block; min-width: 21px; flex: 0 0 21px; line-height: 1; }

.compact-status {
  display: inline-flex;
  height: 30px;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid #30323a;
  border-radius: 999px;
  color: #aeb0b7;
  font-size: 0.67rem;
  font-weight: 700;
  white-space: nowrap;
}

.global-tooltip { position: fixed; z-index: 500; width: max-content; max-width: 230px; padding: 6px 8px; border: 1px solid #3c3f47; border-radius: 7px; background: #0d0e10; color: #f5f5f5; font-size: 0.68rem; font-weight: 650; line-height: 1.2; pointer-events: none; white-space: nowrap; box-shadow: 0 7px 24px rgb(0 0 0 / 45%); }

.floating-panel {
  position: fixed;
  z-index: 50;
  top: 72px;
  width: min(390px, calc(100vw - 24px));
  padding: 14px;
  border: 1px solid #343740;
  border-radius: 15px;
  background: rgb(24 25 29 / 98%);
  color: #f4f4f5;
  box-shadow: 0 24px 70px rgb(0 0 0 / 42%);
  backdrop-filter: blur(18px);
}
.media-panel { left: 185px; }
.audio-panel { left: 230px; width: min(460px, calc(100vw - 24px)); max-height: min(660px, calc(100vh - 88px)); overflow-y: auto; }
.transition-art-panel { left: 270px; width: min(460px, calc(100vw - 294px)); max-height: min(660px, calc(100vh - 88px)); overflow: hidden; }
.smoothing-panel { left: 310px; width: min(430px, calc(100vw - 334px)); max-height: min(720px, calc(100vh - 88px)); overflow-x: hidden; overflow-y: auto; }
.viewer-panel { right: 14px; overflow-x: hidden; }
.text-panel { left: 245px; }
.studio-panel { left: 110px; width: min(720px, calc(100vw - 134px)); max-height: min(760px, calc(100vh - 88px)); overflow-x: hidden; overflow-y: auto; }
#scenes-panel, #slideshows-panel { display: grid; height: min(760px, calc(100vh - 88px)); overflow: hidden; }
#scenes-panel { grid-template-rows: auto auto minmax(80px, 1fr) auto; }
.slideshow-panel { left: 150px; width: min(900px, calc(100vw - 174px)); grid-template-rows: auto auto minmax(72px, 0.55fr) minmax(0, 1.45fr); }
.slideshow-panel .studio-editor { grid-template-rows: auto auto auto minmax(120px, 240px) auto auto; min-width: 0; min-height: 0; overflow: hidden; }
.twitch-events-panel { left: 185px; width: min(820px, calc(100vw - 24px)); overflow-x: hidden; }
.graphics-panel { left: 300px; width: min(460px, calc(100vw - 24px)); }

.twitch-accent { color: #bf94ff; }
.twitch-accent:hover, .twitch-accent[aria-expanded="true"] { background: #2d1d43; color: #d9c0ff; }

.smoothing-preview {
  position: relative;
  height: 190px;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid #383b44;
  border-radius: 13px;
  background: #111217;
  isolation: isolate;
}
.smoothing-preview-backdrop { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(145deg, #25162f, #924352 44%, #e69a69); }
.smoothing-preview-backdrop::before { position: absolute; inset: 0; background: repeating-linear-gradient(28deg, transparent 0 26px, rgb(255 255 255 / 7%) 27px 29px); content: ""; }
.smoothing-preview-backdrop span { position: absolute; border-radius: 50%; background: rgb(255 221 174 / 24%); filter: blur(1px); }
.smoothing-preview-backdrop span:nth-child(1) { top: 18px; left: 24px; width: 66px; height: 66px; }
.smoothing-preview-backdrop span:nth-child(2) { right: 34px; bottom: 12px; width: 88px; height: 88px; background: rgb(68 18 83 / 32%); }
.smoothing-preview-backdrop span:nth-child(3) { top: 36px; right: 90px; width: 32px; height: 32px; background: rgb(255 255 255 / 20%); }
.smoothing-preview-surface { position: absolute; z-index: 1; inset: 18px; display: grid; place-content: center; justify-items: center; gap: 5px; overflow: hidden; background: radial-gradient(circle at 18% 8%, #278cff, transparent 35%), radial-gradient(circle at 88% 20%, #8538ee, transparent 42%), linear-gradient(150deg, #071228, #10123e); color: #f7f8ff; text-align: center; }
.smoothing-preview-surface::before { position: absolute; inset: 0; background: linear-gradient(90deg, rgb(255 255 255 / 4%) 1px, transparent 1px), linear-gradient(rgb(255 255 255 / 4%) 1px, transparent 1px); background-size: 24px 24px; content: ""; }
.smoothing-preview-surface i { z-index: 1; color: #b8c9ff; font-size: 1.05rem; }
.smoothing-preview-surface strong { z-index: 1; font-size: 0.78rem; letter-spacing: -0.01em; }
.smoothing-preview-surface small { z-index: 1; color: #9ca9c8; font-size: 0.6rem; }
.smoothing-section-heading { display: flex; align-items: center; justify-content: space-between; margin: 16px 1px 8px; }
.smoothing-section-heading strong { color: #dcdee3; font-size: 0.7rem; }
.smoothing-section-heading small { color: var(--muted); font-size: 0.61rem; }
.smoothing-section-heading button { padding: 3px 7px; border: 0; border-radius: 6px; background: transparent; color: #93a7c7; cursor: pointer; font-size: 0.62rem; font-weight: 720; }
.smoothing-section-heading button:hover { background: #292c33; color: #dce8ff; }
.smoothing-effects { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.smoothing-effects button { display: grid; min-width: 0; justify-items: center; gap: 6px; padding: 10px 4px 9px; border: 1px solid #343740; border-radius: 10px; background: #202227; color: #aeb1ba; cursor: pointer; font-size: 0.62rem; font-weight: 720; }
.smoothing-effects button i { font-size: 0.85rem; }
.smoothing-effects button:hover { border-color: #505561; background: #282b31; color: #fff; }
.smoothing-effects button.is-active { border-color: #678bc7; background: #263b5c; color: #d6e5ff; box-shadow: inset 0 0 0 1px rgb(132 174 243 / 10%); }
.smoothing-edge-picker { display: grid; grid-template: repeat(3, 48px) / repeat(3, minmax(0, 1fr)); gap: 6px; padding: 8px; border: 1px solid #343740; border-radius: 12px; background: #15161a; }
.smoothing-edge-picker button { display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #363942; border-radius: 9px; background: #202227; color: #a9acb5; cursor: pointer; font-size: 0.63rem; font-weight: 720; }
.smoothing-edge-picker button:hover { border-color: #545966; color: #fff; }
.smoothing-edge-picker button.is-active { border-color: #7097d6; background: #29456f; color: #e4efff; box-shadow: 0 0 15px rgb(76 135 229 / 15%); }
.smoothing-edge-picker [data-smoothing-edge="top"] { grid-area: 1 / 2; }
.smoothing-edge-picker [data-smoothing-edge="left"] { grid-area: 2 / 1; }
.smoothing-edge-picker [data-smoothing-edge="right"] { grid-area: 2 / 3; }
.smoothing-edge-picker [data-smoothing-edge="bottom"] { grid-area: 3 / 2; }
.smoothing-edge-center { display: grid; grid-area: 2 / 2; place-content: center; justify-items: center; gap: 3px; border: 1px dashed #424650; border-radius: 8px; color: #666b76; font-size: 0.55rem; text-transform: uppercase; }
.smoothing-space-control { display: grid; gap: 9px; margin-top: 15px; padding: 12px; border: 1px solid #343740; border-radius: 11px; background: #202227; }
.smoothing-space-control > span { display: flex; align-items: center; justify-content: space-between; }
.smoothing-space-control strong { color: #dcdee3; font-size: 0.68rem; }
.smoothing-space-control output { min-width: 48px; color: #a9c7fa; font-size: 0.66rem; font-weight: 760; text-align: right; }
.smoothing-space-control small { color: #777b85; font-size: 0.58rem; }
.smoothing-space-control input[type="range"] { width: 100%; height: 5px; border-radius: 999px; outline: none; appearance: none; background: linear-gradient(90deg, #759ce0, #9867de); cursor: pointer; }
.smoothing-space-control input[type="range"]::-webkit-slider-thumb { width: 15px; height: 15px; border: 3px solid #eef4ff; border-radius: 50%; appearance: none; background: #263b5c; box-shadow: 0 2px 8px rgb(0 0 0 / 42%); }
.smoothing-space-control input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border: 3px solid #eef4ff; border-radius: 50%; background: #263b5c; box-shadow: 0 2px 8px rgb(0 0 0 / 42%); }

.context-toolbar {
  position: fixed;
  z-index: 24;
  top: 64px;
  left: 50%;
  display: block;
  max-width: calc(100vw - 28px);
  padding: 9px 11px 11px;
  border: 1px solid #363941;
  border-top: 0;
  border-radius: 0 0 13px 13px;
  background: rgb(24 25 29 / 97%);
  color: #f1f1f3;
  opacity: 0;
  transform: translate(-50%, -10px);
  transition: opacity 200ms ease, transform 200ms ease;
  box-shadow: 0 12px 34px rgb(0 0 0 / 28%);
  backdrop-filter: blur(16px);
}

.context-toolbar.is-open { opacity: 1; transform: translate(-50%, 0); }
.context-region { display: flex; align-items: end; gap: 8px; }
.draw-context, .video-context, .image-context, .drawing-context { align-items: center; }
.context-label { display: flex; align-items: center; gap: 7px; padding: 0 5px; color: #d9dbe0; font-size: 0.68rem; font-weight: 800; white-space: nowrap; }
.context-label i { color: #9fc0ff; }
.context-tool-group { display: flex; gap: 4px; }
.context-divider { width: 1px; height: 28px; background: #3b3e46; }
.context-icon-button { display: grid; width: 34px; height: 34px; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 8px; background: #101115; color: #b7bac2; cursor: pointer; }
.context-icon-button:hover { background: #292b31; color: #fff; }
.context-icon-button.is-active { border-color: #b6e63f; background: var(--accent); color: #11140c; }
.context-icon-button.is-mixed { border-color: #6f7888; background: linear-gradient(135deg, var(--accent) 50%, #252830 50%); color: #f4f5f7; }
.context-action-button { display: inline-flex; height: 34px; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid #3b3e46; border-radius: 8px; background: #17191e; color: #d5d7dc; cursor: pointer; font-size: 0.65rem; font-weight: 720; white-space: nowrap; }
.context-action-button:hover { border-color: #535864; background: #292c33; color: #fff; }
.context-action-button.is-active { border-color: #6e8fc7; background: #283b5a; color: #c4d9ff; }

.advanced-color-picker { position: fixed; z-index: 180; display: grid; width: 310px; gap: 11px; padding: 14px; border: 1px solid #40434c; border-radius: 15px; background: rgb(22 23 27 / 98%); color: #f4f4f5; box-shadow: 0 24px 70px rgb(0 0 0 / 52%); backdrop-filter: blur(18px); }
.color-picker-heading { display: flex; align-items: center; justify-content: space-between; }
.color-picker-heading > div { display: grid; gap: 2px; }
.color-picker-heading strong { font-size: 0.82rem; }
.color-picker-heading small { color: #91959f; font-size: 0.59rem; }
.color-picker-heading button { display: grid; width: 28px; height: 28px; place-items: center; border: 0; border-radius: 7px; background: transparent; color: #aeb1b8; cursor: pointer; }
.color-picker-heading button:hover { background: #30323a; color: #fff; }
.color-picker-preview { height: 58px; padding: 6px; border: 1px solid #3a3d45; border-radius: 11px; background-color: #26282e; background-image: linear-gradient(45deg, #3e4148 25%, transparent 25%), linear-gradient(-45deg, #3e4148 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #3e4148 75%), linear-gradient(-45deg, transparent 75%, #3e4148 75%); background-position: 0 0, 0 7px, 7px -7px, -7px 0; background-size: 14px 14px; }
.color-picker-preview span { display: block; width: 100%; height: 100%; border-radius: 7px; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 12%); }
.color-gradient { display: grid; grid-template-columns: 68px minmax(0, 1fr); align-items: center; gap: 8px; color: #a5a8b0; font-size: 0.62rem; font-weight: 720; }
.color-gradient input { width: 100%; height: 18px; margin: 0; appearance: none; border-radius: 999px; outline: none; cursor: pointer; }
.color-gradient input::-webkit-slider-thumb { width: 15px; height: 15px; appearance: none; border: 2px solid #fff; border-radius: 50%; background: transparent; box-shadow: 0 1px 5px #000; }
.color-gradient.hue input { background: linear-gradient(90deg, #f33, #ff0, #0f0, #0ff, #33f, #f0f, #f33); }
.color-gradient.saturation input { background: linear-gradient(90deg, #777, #ff3b30); }
.color-gradient.brightness input { background: linear-gradient(90deg, #000, #fff); }
.color-gradient.alpha input { background-color: #33353b; background-image: linear-gradient(90deg, transparent, #fff), linear-gradient(45deg, #52555e 25%, transparent 25%, transparent 75%, #52555e 75%); background-size: auto, 10px 10px; }
.color-number-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.color-number-grid label, .color-hex-field { display: grid; gap: 4px; color: #9296a0; font-size: 0.56rem; font-weight: 750; }
.color-number-grid input, .color-hex-field input { min-width: 0; height: 33px; padding: 0 7px; border: 1px solid #3b3e47; border-radius: 8px; outline: none; background: #101115; color: #fff; font-size: 0.68rem; }
.color-hex-field { grid-template-columns: 38px minmax(0, 1fr); align-items: center; }
.color-picker-actions { display: grid; grid-template-columns: 1fr 1.25fr; gap: 7px; }
.color-picker-actions button { min-height: 34px; border: 1px solid #3e424b; border-radius: 8px; background: #292c33; color: #e8e9eb; cursor: pointer; font-size: 0.63rem; font-weight: 720; }
.color-picker-actions button:hover { border-color: #6584b8; background: #303d52; }

.context-toolbar label,
.selected-text-alignment { display: grid; gap: 5px; color: #989ba4; font-size: 0.58rem; font-weight: 760; }
.context-toolbar textarea,
.context-toolbar select,
.context-toolbar input[type="number"] {
  height: 34px;
  padding: 6px 8px;
  border: 1px solid #3a3d45;
  border-radius: 8px;
  outline: none;
  background: #101115;
  color: #f5f5f6;
  font-size: 0.7rem;
}
.context-toolbar textarea:focus,
.context-toolbar select:focus,
.context-toolbar input[type="number"]:focus { border-color: #6f8fca; }
.selected-text-copy textarea { width: min(230px, 25vw); min-width: 130px; resize: none; }
.context-toolbar select { width: 150px; }
.selected-text-size input { width: 64px; }
.selected-text-color input { width: 34px; height: 34px; padding: 2px; border: 1px solid #3a3d45; border-radius: 9px; background: #101115; cursor: pointer; }
.selected-text-alignment > div { display: flex; gap: 3px; }
.selected-text-alignment button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #101115;
  color: #aeb1b8;
  cursor: pointer;
}
.selected-text-alignment button:hover { background: #292b31; color: #fff; }
.selected-text-alignment button.is-active { border-color: #49699e; background: #263957; color: #bdd3ff; }
.twitch-connection-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px; margin-bottom: 11px; border: 1px solid #353840; border-radius: 12px; background: #15161a; }
.twitch-status-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 10px; background: #282a30; color: #aaaeb8; font-size: 1.1rem; }
.twitch-connection-card[data-state="live"] .twitch-status-icon { background: #9147ff; color: #fff; box-shadow: 0 0 22px rgb(145 71 255 / 32%); }
.twitch-connection-card[data-state="connecting"] .twitch-status-icon { background: #312443; color: #c8a4ff; }
.twitch-connection-card > span:nth-child(2) { display: grid; min-width: 0; gap: 2px; }
.twitch-connection-card strong { overflow: hidden; font-size: 0.78rem; text-overflow: ellipsis; white-space: nowrap; }
.twitch-connection-card small { color: #999ca5; font-size: 0.62rem; }
.small-text-button { border: 0; background: transparent; cursor: pointer; font-size: 0.64rem; font-weight: 750; }
.danger-text { color: #ff929d; }
.integration-setup { display: grid; gap: 7px; padding: 11px; margin-bottom: 11px; border: 1px solid #4a3c2d; border-radius: 11px; background: #241d16; }
.integration-setup strong { color: #f4d7b0; font-size: 0.72rem; }
.integration-setup p { margin: 0; color: #b8a997; font-size: 0.64rem; line-height: 1.45; }
.integration-setup code { display: block; min-width: 0; max-width: 100%; overflow-x: auto; padding: 7px 8px; border-radius: 7px; background: #15110e; color: #e8d7c2; font-size: 0.6rem; white-space: nowrap; }
.auth-link-controls { display: grid; gap: 7px; margin-bottom: 14px; }
.auth-link-controls > small { color: #8f929c; font-size: 0.61rem; }
.primary-button.twitch-button { width: max-content; padding: 0 13px; background: #9147ff; color: #fff; }
.copy-link-row { display: grid; grid-template-columns: minmax(0, 1fr) 36px; gap: 6px; }
.copy-link-row input { min-width: 0; height: 36px; padding: 0 9px; border: 1px solid #454852; border-radius: 8px; outline: none; background: #0f1013; color: #d7d8dc; font-size: 0.63rem; }
.copy-link-row button { border: 1px solid #454852; border-radius: 8px; background: #282a30; color: #fff; cursor: pointer; }
.twitch-binding-list { display: grid; gap: 7px; }
.twitch-binding-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 9px; border: 1px solid #343740; border-radius: 11px; background: #15161a; }
.twitch-binding-row.has-missing-scene { border-color: #87505a; background: #21171a; }
.twitch-binding-fields { display: grid; grid-template-columns: minmax(120px, 1.2fr) minmax(115px, 1fr) 84px minmax(115px, 1fr) 102px; gap: 7px; }
.twitch-binding-fields label { display: grid; gap: 4px; color: #9699a2; font-size: 0.56rem; font-weight: 750; }
.twitch-binding-fields select, .twitch-binding-fields input { min-width: 0; width: 100%; min-height: 33px; padding: 5px 7px; border: 1px solid #3a3d45; border-radius: 8px; outline: none; background: #0e0f12; color: #f3f3f4; font-size: 0.65rem; }
.twitch-binding-actions { display: flex; align-items: end; gap: 3px; padding-bottom: 1px; }
.twitch-binding-actions .audio-icon-button { width: 30px; height: 33px; }
.full-width { width: 100%; min-height: 36px; margin-top: 9px; }
.integration-error { margin: 9px 0 0; padding: 8px 9px; border-radius: 8px; background: #351a20; color: #ff9ca7; font-size: 0.63rem; line-height: 1.4; }

.panel-actions, .studio-editor-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 11px; }
.panel-actions .primary-button, .panel-actions .secondary-button, .studio-editor-actions button { min-height: 34px; padding: 0 12px; }
.scene-list, .slideshow-list { display: grid; min-width: 0; min-height: 0; max-width: 100%; align-content: start; gap: 6px; padding-right: 5px; margin-bottom: 12px; overflow-x: hidden; overflow-y: auto; }
.scene-row.is-special-canvas { border-color: rgb(145 71 255 / 45%); background: linear-gradient(100deg, rgb(145 71 255 / 13%), rgb(29 29 36 / 88%)); }
.scene-row.is-special-canvas .scene-select strong::before { content: "\f5ae"; margin-right: 8px; font-family: "Font Awesome 6 Free"; font-weight: 900; color: #b987ff; }
.scene-row-actions button.is-enabled { color: #7fffb0; background: rgb(45 190 103 / 14%); }
.drawing-history-panel { width: min(780px, calc(100vw - 24px)); max-height: min(720px, calc(100vh - 100px)); }
.drawing-history-tools { display: grid; grid-template-columns: minmax(130px, 1fr) 38px 38px auto; gap: 8px; margin-bottom: 9px; }
.drawing-history-tools select { min-width: 0; }
.drawing-history-tools button { min-height: 36px; margin: 0; }
.drawing-history-tools .secondary-button { width: 38px; padding: 0; }
.drawing-history-tools .history-clear-button { width: 38px; padding: 0; }
.drawing-history-tools .danger-button.is-unban { color: #a9f6c2; background: #173723; }
.drawing-moderation-status { display: grid; gap: 2px; min-height: 48px; margin-bottom: 10px; padding: 8px 10px; border-left: 3px solid #9147ff; background: #17171d; }
.drawing-moderation-status strong { color: #f2f2f4; font-size: 0.72rem; }
.drawing-moderation-status span { overflow: hidden; color: #9c9ca7; font-size: 0.62rem; line-height: 1.4; text-overflow: ellipsis; }
.drawing-review-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(220px, 0.85fr); gap: 10px; min-height: 0; }
.drawing-preview-wrap { display: grid; min-width: 0; align-content: start; border: 1px solid #303039; background: #0b0b0f; }
.drawing-preview-wrap canvas { display: block; width: 100%; aspect-ratio: 16 / 9; background: #09090d; }
.drawing-preview-footer { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 8px; border-top: 1px solid #303039; }
.drawing-preview-footer span { overflow: hidden; color: #9c9ca7; font-size: 0.61rem; text-overflow: ellipsis; white-space: nowrap; }
.drawing-preview-footer .secondary-button { width: auto; min-height: 30px; margin: 0; padding: 0 9px; }
.drawing-history-list { display: grid; align-content: start; gap: 6px; overflow-y: auto; min-height: 180px; max-height: min(430px, calc(100vh - 270px)); padding-right: 4px; }
.drawing-history-row { display: flex; width: 100%; align-items: center; gap: 9px; padding: 8px; border: 1px solid #ffffff12; border-radius: 6px; background: #111118; color: #ededf0; cursor: pointer; text-align: left; }
.drawing-history-row:hover, .drawing-history-row.is-selected { border-color: #815dc4; background: #1b1722; }
.drawing-history-row > i { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: #caa7ff; background: #9147ff1f; }
.drawing-history-row span { display: grid; min-width: 0; }
.drawing-history-row small { color: #8e8d98; }
@media (max-width: 680px) {
  .drawing-review-layout { grid-template-columns: 1fr; overflow-y: auto; }
  .drawing-history-list { max-height: 220px; }
  .drawing-history-panel { max-height: calc(100dvh - 84px); }
}
.host-drawer-pointers { position: absolute; inset: 0; z-index: 60; pointer-events: none; overflow: visible; }
.drawer-pointer { position: absolute; transform: translate(-4px, -4px); transition: left 60ms linear, top 60ms linear; color: #b987ff; }
.drawer-pointer i { filter: drop-shadow(0 2px 3px #000); }
.drawer-pointer span { display: block; width: max-content; margin: -1px 0 0 10px; padding: 3px 7px; border-radius: 7px; color: white; background: #7737cb; font-size: 11px; font-weight: 750; box-shadow: 0 4px 12px #0008; }
.scene-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border: 1px solid #33363e; border-radius: 10px; background: #1d1f24; transition: border-color 120ms ease, background 120ms ease; }
.scene-row.is-selected { border-color: #6d8fff; background: #232938; }
.scene-row.is-live { box-shadow: inset 3px 0 #cfff4f; }
.scene-row[draggable="true"], .slideshow-row[draggable="true"] { cursor: grab; }
.scene-row.is-dragging, .slideshow-row.is-dragging { opacity: 0.42; cursor: grabbing; }
.scene-select { display: flex; min-width: 0; min-height: 46px; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 0; background: transparent; color: #f4f4f5; cursor: pointer; text-align: left; }
.scene-select strong { overflow: hidden; font-size: 0.76rem; text-overflow: ellipsis; white-space: nowrap; }
.scene-select > span { display: flex; gap: 5px; }
.studio-badge { padding: 3px 5px; border-radius: 5px; background: #343944; color: #aeb5c3; font-size: 0.5rem; font-weight: 850; letter-spacing: 0.08em; }
.studio-badge.live { background: #cfff4f; color: #12150c; }
.scene-row-actions, .entry-actions { display: flex; gap: 3px; padding-right: 6px; }
.scene-row-actions .audio-icon-button, .entry-actions .audio-icon-button { width: 28px; height: 28px; }
.studio-editor { display: grid; min-width: 0; max-width: 100%; gap: 10px; padding: 12px; overflow-x: hidden; border: 1px solid #343740; border-radius: 12px; background: #121317; }
.studio-editor-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.studio-editor-heading strong { font-size: 0.83rem; }
.studio-editor-heading small { color: #969aa5; font-size: 0.64rem; }
.studio-editor label, .graphics-form label { display: grid; gap: 5px; color: #b8bac1; font-size: 0.65rem; font-weight: 700; }
.studio-editor input, .studio-editor select, .graphics-form input, .graphics-form select { width: 100%; min-height: 34px; padding: 7px 9px; border: 1px solid #3a3d45; border-radius: 8px; outline: none; background: #0e0f12; color: #f5f5f5; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) 130px; gap: 8px; }
.deploy-button, .danger-button { min-height: 38px; padding: 0 13px; border: 0; border-radius: 9px; cursor: pointer; font-size: 0.72rem; font-weight: 820; }
.deploy-button { background: #5b8cff; color: #fff; }
.danger-button { background: #3b1b20; color: #ff9ca7; }
.secondary-button { border: 1px solid #3c3f48; border-radius: 9px; background: #24262c; color: #e7e7e9; cursor: pointer; }
.slideshow-row { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border: 1px solid #343740; border-radius: 9px; background: #1d1f24; color: #f2f2f3; }
.slideshow-row.is-selected { border-color: #6d8fff; background: #232938; }
.slideshow-select { display: flex; min-width: 0; min-height: 44px; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 0; background: transparent; color: inherit; cursor: pointer; text-align: left; }
.slideshow-select > span:first-child { display: grid; min-width: 0; gap: 2px; }
.slideshow-row-actions { display: flex; padding-right: 6px; }
.slideshow-row-actions .audio-icon-button { width: 28px; height: 28px; }
.slideshow-row strong { font-size: 0.74rem; }
.slideshow-row small { color: #969aa5; font-size: 0.6rem; }
.repeat-controls { display: grid; grid-template-columns: 120px 110px; gap: 8px; align-items: end; }
.repeat-controls label:first-child { display: flex; min-height: 34px; align-items: center; gap: 7px; }
.repeat-controls input[type="checkbox"] { width: 16px; min-height: 16px; }
.slideshow-entries { display: grid; width: 100%; height: 100%; min-width: 0; min-height: 120px; max-width: 100%; max-height: 240px; grid-auto-rows: max-content; align-content: start; gap: 6px; padding-right: 6px; overflow-x: hidden; overflow-y: scroll; overscroll-behavior: contain; scrollbar-gutter: stable; }
.slideshow-entry { display: grid; min-width: 0; min-height: 47px; height: max-content; max-width: 100%; grid-template-columns: 25px minmax(0, 1.2fr) 74px minmax(0, 1fr) 84px auto; align-items: center; align-self: start; gap: 6px; padding: 7px; overflow: hidden; border: 1px solid #30333b; border-radius: 9px; background: #1a1c20; }
.slideshow-entry select, .slideshow-entry input { min-width: 0; min-height: 31px; padding: 5px 7px; font-size: 0.66rem; }
.entry-order { color: #8f94a0; font-size: 0.62rem; font-weight: 850; text-align: center; }
.slideshow-add-row { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.slideshow-add-row button { border: 0; border-radius: 8px; background: #2d3038; color: #fff; cursor: pointer; font-weight: 750; }
.studio-editor-actions { margin: 2px 0 0; }
.graphics-form { display: grid; gap: 10px; }
.graphic-preview { position: relative !important; width: 100% !important; height: 100px !important; min-height: 100px; border-radius: 10px; container-type: size; }
.graphic-preview.graphic-ticker { height: 64px !important; min-height: 64px; }
.graphic-preview .lower-third-copy strong { font-size: 24px; }
.graphic-preview .lower-third-copy small { font-size: 14px; }
.graphic-preview .ticker-track span { font-size: 18px; line-height: 62px; }

.transition-art-list { display: grid; min-width: 0; max-width: 100%; max-height: min(430px, 58vh); gap: 7px; padding-right: 4px; overflow-x: hidden; overflow-y: auto; }
.transition-art-row { display: grid; min-width: 0; max-width: 100%; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 7px; overflow: hidden; border: 1px solid #343740; border-radius: 10px; background: #1d1f24; }
.transition-art-row.is-active { border-color: #7194d0; background: #24344e; box-shadow: inset 3px 0 #cfff4f; }
.transition-art-select { display: flex; min-width: 0; align-items: center; gap: 9px; padding: 0; border: 0; background: transparent; color: #f3f4f5; cursor: pointer; text-align: left; }
.transition-art-select img { width: 54px; height: 38px; flex: 0 0 auto; border-radius: 6px; background-color: #22242a; background-image: linear-gradient(45deg, #343740 25%, transparent 25%), linear-gradient(-45deg, #343740 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #343740 75%), linear-gradient(-45deg, transparent 75%, #343740 75%); background-position: 0 0, 0 5px, 5px -5px, -5px 0; background-size: 10px 10px; object-fit: contain; }
.transition-art-select span { display: grid; min-width: 0; gap: 3px; }
.transition-art-select strong { overflow: hidden; font-size: 0.72rem; text-overflow: ellipsis; white-space: nowrap; }
.transition-art-select small { color: #9297a3; font-size: 0.59rem; }

.pin-control {
  position: relative;
  display: flex;
  height: 36px;
  align-items: center;
  gap: 5px;
  padding: 0 4px 0 9px;
  border: 1px solid #3a3d45;
  border-radius: 10px;
  background: #202227;
  color: #9497a0;
  font-size: 0.59rem;
  font-weight: 750;
  letter-spacing: 0.08em;
}
.pin-control strong { margin-left: 3px; color: #fff; font-size: 0.82rem; letter-spacing: 0.16em; }
.pin-control button { display: grid; width: 27px; height: 27px; place-items: center; border: 0; border-radius: 7px; background: transparent; color: #9ea1aa; cursor: pointer; }
.pin-control button:hover { background: #30333a; color: #fff; }

.zoom-controls { position: fixed; z-index: 38; left: 50%; bottom: 14px; display: flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid #3a3d45; border-radius: 11px; background: rgb(21 22 26 / 92%); transform: translateX(-50%); box-shadow: 0 10px 32px rgb(0 0 0 / 34%); backdrop-filter: blur(14px); }
.zoom-controls .icon-button { width: 31px; height: 31px; }
.zoom-controls .icon-button i { font-size: 0.75rem; }
.zoom-controls output { min-width: 39px; color: #aaaeb8; font-size: 0.62rem; font-weight: 750; text-align: center; }

.text-form { display: grid; gap: 11px; }
.text-form label { display: grid; gap: 5px; color: #b8bac1; font-size: 0.67rem; font-weight: 700; }
.text-form textarea,
.text-form select,
.text-form input[type="number"] { width: 100%; padding: 8px 9px; border: 1px solid #3a3d45; border-radius: 9px; outline: none; background: #111216; color: #f5f5f5; resize: vertical; }
.text-options { display: grid; grid-template-columns: minmax(0, 1fr) 76px 58px 92px; gap: 8px; align-items: end; }
.text-preview {
  display: grid;
  min-height: 84px;
  place-items: center;
  padding: 14px;
  overflow: hidden;
  border: 1px solid #353842;
  border-radius: 11px;
  background: #f5f3ee;
  line-height: 1.1;
  text-align: center;
  overflow-wrap: anywhere;
}
.primary-button { min-height: 38px; border: 0; border-radius: 9px; background: var(--accent); color: #12150c; cursor: pointer; font-size: 0.73rem; font-weight: 800; }

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.panel-heading div { display: grid; gap: 3px; }
.panel-heading strong { font-size: 0.88rem; }
.panel-heading small { color: var(--muted); font-size: 0.68rem; }
.panel-close { width: 31px; height: 31px; }

.upload-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px dashed #4a4e58;
  border-radius: 11px;
  background: #202227;
  color: #dfe0e4;
  cursor: pointer;
  transition: border-color 130ms ease, background 130ms ease;
}
.upload-card:hover { border-color: #749bdb; background: #252a33; }
.upload-card span { display: grid; gap: 3px; }
.upload-card strong { font-size: 0.77rem; }
.upload-card small { color: var(--muted); font-size: 0.65rem; }

.embed-form { display: grid; gap: 6px; margin-top: 13px; }
.embed-form label { color: #b8bac1; font-size: 0.67rem; font-weight: 700; }
.embed-form div { display: flex; gap: 7px; }
.embed-form input {
  min-width: 0;
  flex: 1;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #3a3d45;
  border-radius: 9px;
  outline: none;
  background: #111216;
  color: #f5f5f5;
  font-size: 0.73rem;
}
.embed-form input:focus { border-color: #759de4; box-shadow: 0 0 0 3px rgb(91 140 255 / 13%); }
.embed-form button,
.secondary-button {
  border: 1px solid #4b6898;
  border-radius: 9px;
  background: #2f4c7c;
  color: #edf4ff;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 750;
}
.embed-form button { padding: 0 13px; }

.compact-upload { padding: 11px 12px; }
.audio-link-form { display: grid; gap: 7px; margin-top: 11px; }
.audio-link-form > input,
.audio-link-form div input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #3a3d45;
  border-radius: 9px;
  outline: none;
  background: #111216;
  color: #f5f5f5;
  font-size: 0.72rem;
}
.audio-link-form > input:focus,
.audio-link-form div input:focus { border-color: #759de4; box-shadow: 0 0 0 3px rgb(91 140 255 / 13%); }
.audio-link-form div { display: flex; gap: 7px; }
.audio-link-form div input { flex: 1; }
.audio-link-form button { padding: 0 14px; border: 1px solid #4b6898; border-radius: 9px; background: #2f4c7c; color: #edf4ff; cursor: pointer; font-size: 0.7rem; font-weight: 750; }
.youtube-audio-form { padding-top: 11px; border-top: 1px solid #343740; }
.youtube-audio-form button { border-color: #7d3434; background: #752828; }
.youtube-audio-form button i { margin-right: 4px; }
.youtube-audio-source { position: fixed; z-index: -1; top: -4px; left: -4px; width: 2px; height: 2px; border: 0; opacity: 0.001; pointer-events: none; }
.audio-section-heading { display: flex; align-items: center; justify-content: space-between; margin: 16px 1px 8px; color: #d9dae0; font-size: 0.7rem; font-weight: 750; }
.audio-section-heading small { color: var(--muted); font-size: 0.62rem; font-weight: 650; }
.audio-list { display: grid; gap: 7px; }
.audio-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid #343740;
  border-radius: 11px;
  background: #202227;
  transition: border-color 130ms ease, background 130ms ease;
}
.audio-row.is-playing { border-color: #6f9532; background: #252d1d; }
.audio-info { display: grid; min-width: 0; gap: 3px; }
.audio-info strong { overflow: hidden; color: #eceef2; font-size: 0.72rem; text-overflow: ellipsis; white-space: nowrap; }
.audio-info small { color: var(--muted); font-size: 0.6rem; }
.audio-transport,
.audio-ordering { display: flex; align-items: center; gap: 2px; }
.audio-ordering { padding-left: 6px; border-left: 1px solid #393c44; }
.audio-icon-button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #afb2ba;
  cursor: pointer;
}
.audio-icon-button i { font-size: 0.67rem; }
.audio-icon-button:hover { background: #34373f; color: #fff; }
.audio-icon-button.danger { color: #ff8d88; }

.viewer-list { display: grid; min-width: 0; max-width: 100%; gap: 6px; max-height: min(390px, 56vh); overflow-x: hidden; overflow-y: auto; }
.panel-empty { margin: 18px 0; color: var(--muted); font-size: 0.73rem; text-align: center; }
.viewer-row {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid #343740;
  border-radius: 10px;
  background: #202227;
  color: #e7e8eb;
  text-align: left;
}
.viewer-row:hover { border-color: #596274; background: #262930; }
.viewer-row.is-keyed { border-color: #7194d0; background: #24344e; }
.viewer-row.is-frozen { border-color: #6a7b92; }
.viewer-key-target { display: flex; min-width: 0; flex: 1 1 auto; align-items: center; justify-content: space-between; gap: 10px; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; text-align: left; }
.viewer-identity { display: grid; gap: 3px; min-width: 0; }
.viewer-identity strong { overflow: hidden; font-size: 0.76rem; text-overflow: ellipsis; white-space: nowrap; }
.viewer-identity small { color: var(--muted); font-size: 0.65rem; }
.viewer-identity small { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-action { color: #9dbef5; font-size: 0.65rem; font-weight: 800; text-transform: uppercase; }
.viewer-freeze { position: relative; display: flex; flex: 0 0 auto; align-items: center; gap: 6px; color: #87909f; cursor: pointer; }
.viewer-freeze i { width: 12px; font-size: 0.68rem; text-align: center; }
.viewer-freeze input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.viewer-freeze-track { position: relative; width: 29px; height: 17px; border: 1px solid #50545e; border-radius: 999px; background: #30333a; transition: background 140ms ease, border-color 140ms ease; }
.viewer-freeze-track::after { position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: #a4a7ae; content: ""; transition: transform 140ms ease, background 140ms ease; }
.viewer-freeze input:checked + .viewer-freeze-track { border-color: #6e94d2; background: #345684; }
.viewer-freeze input:checked + .viewer-freeze-track::after { background: #fff; transform: translateX(12px); }
.viewer-freeze input:focus-visible + .viewer-freeze-track { outline: 2px solid #8eaeeb; outline-offset: 2px; }
.secondary-button { width: 100%; margin-top: 10px; padding: 9px; background: transparent; color: #b9c9e5; }
.secondary-button.inline-button { width: auto; margin-top: 0; padding: 0 11px; }

.scene-root-dropzone { display: flex; min-height: 34px; align-items: center; justify-content: center; gap: 7px; border: 1px dashed #3c414b; border-radius: 9px; color: #848b97; font-size: 0.62rem; font-weight: 700; transition: border-color 120ms ease, background 120ms ease, color 120ms ease; }
.scene-root-dropzone.is-drop-target { border-color: #6f93ce; background: #202d42; color: #c8dbff; }
.scene-folder { display: grid; min-width: 0; gap: 5px; margin-left: min(calc(var(--folder-depth, 0) * 14px), 70px); padding: 5px; border: 1px solid #30343c; border-radius: 11px; background: #17191d; }
.scene-folder.is-collapsed { gap: 0; }
.scene-folder-heading { display: flex; min-width: 0; min-height: 42px; align-items: center; justify-content: space-between; gap: 7px; padding: 5px 6px 5px 9px; border: 1px solid transparent; border-radius: 8px; color: #e1e3e7; transition: border-color 120ms ease, background 120ms ease; }
.scene-folder-heading[draggable="true"] { cursor: grab; }
.scene-folder-heading.is-dragging { opacity: 0.45; cursor: grabbing; }
.scene-folder-heading.is-drop-target { border-color: #6d91ce; background: #23334d; }
.scene-folder-identity { display: flex; min-width: 0; align-items: center; gap: 9px; }
.scene-folder-identity > i { color: #d9ad4c; font-size: 0.85rem; }
.scene-folder-identity > span { display: grid; min-width: 0; gap: 2px; }
.scene-folder-identity strong { overflow: hidden; font-size: 0.72rem; text-overflow: ellipsis; white-space: nowrap; }
.scene-folder-identity small { color: #878d98; font-size: 0.56rem; }
.scene-folder-actions { display: flex; flex: 0 0 auto; gap: 2px; }
.scene-folder-actions .audio-icon-button { width: 28px; height: 28px; }
.scene-folder-contents { display: grid; min-width: 0; gap: 5px; }
.scene-folder-contents[hidden] { display: none; }
.scene-folder-empty { margin: 2px 5px 6px; padding: 9px; border: 1px dashed #333841; border-radius: 7px; color: #666d79; font-size: 0.6rem; text-align: center; }

.folder-delete-dialog { width: min(470px, calc(100vw - 28px)); padding: 0; border: 1px solid #41444d; border-radius: 16px; background: #1a1b1f; color: #f4f4f5; box-shadow: 0 28px 90px rgb(0 0 0 / 58%); }
.folder-delete-dialog::backdrop { background: rgb(5 6 8 / 72%); backdrop-filter: blur(5px); }
.folder-delete-dialog form { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; padding: 18px; }
.folder-dialog-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 11px; background: #39252a; color: #ff9a9f; }
.folder-delete-dialog form > div:nth-child(2) { display: grid; gap: 7px; }
.folder-delete-dialog strong { font-size: 0.9rem; }
.folder-delete-dialog p { margin: 0; color: #a6a9b1; font-size: 0.68rem; line-height: 1.5; }
.folder-dialog-actions { display: flex; grid-column: 1 / -1; justify-content: flex-end; gap: 7px; margin-top: 5px; }
.folder-dialog-actions button { width: auto; min-height: 37px; margin: 0; padding: 0 12px; }

.host-workspace {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #d9dce2;
  touch-action: none;
}
.host-workspace.is-keyed {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  overflow: hidden;
  background-color: #22242a;
  background-image: linear-gradient(45deg, #292c32 25%, transparent 25%), linear-gradient(-45deg, #292c32 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #292c32 75%), linear-gradient(-45deg, transparent 75%, #292c32 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}
.host-workspace .canvas-frame, .host-workspace .media-layer { overflow: visible; }
.host-workspace .canvas-frame { will-change: transform; }
.host-workspace .canvas-frame { background-color: #22242a; background-image: linear-gradient(45deg, #30333a 25%, transparent 25%), linear-gradient(-45deg, #30333a 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #30333a 75%), linear-gradient(-45deg, transparent 75%, #30333a 75%); background-position: 0 0, 0 8px, 8px -8px, -8px 0; background-size: 16px 16px; }
.host-workspace .canvas-frame::after { position: absolute; z-index: 6; inset: 0; box-shadow: 0 0 0 100vmax rgb(12 14 18 / 62%); content: ""; pointer-events: none; }
.host-workspace #board { cursor: crosshair; touch-action: none; }

.host-empty {
  padding: 10px 14px;
  border: 1px dashed #c3c5ca;
  border-radius: 10px;
  background: rgb(255 255 255 / 84%);
  font-size: 0.88rem;
}

.master-indicator {
  position: fixed;
  z-index: 30;
  right: 14px;
  bottom: 14px;
  display: flex;
  max-width: min(720px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid rgb(117 126 148 / 48%);
  border-radius: 15px;
  background: rgb(14 16 21 / 91%);
  box-shadow: 0 12px 38px rgb(0 0 0 / 34%);
  pointer-events: none;
  backdrop-filter: blur(16px) saturate(130%);
}

.master-indicator[hidden] { display: none; }

.master-indicator-segment {
  --indicator-color: 103 177 255;
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  min-width: 142px;
  max-width: 260px;
  min-height: 48px;
  padding: 7px 13px 8px 11px;
  background: linear-gradient(135deg, rgb(var(--indicator-color) / 14%), transparent 72%);
  color: rgb(var(--indicator-color));
}

.master-indicator-segment[hidden] { display: none; }
.master-indicator-segment + .master-indicator-segment { border-left: 1px solid rgb(255 255 255 / 9%); }
.master-indicator-segment > i { width: 18px; font-size: 0.75rem; text-align: center; }
.master-indicator-keyed { --indicator-color: 72 181 255; }
.master-indicator-live { --indicator-color: 161 123 255; }
.master-indicator-audio { --indicator-color: 255 174 73; }

.master-indicator-copy {
  display: grid;
  min-width: 0;
  padding-left: 7px;
  line-height: 1.08;
}

.master-indicator-copy small {
  overflow: hidden;
  color: rgb(var(--indicator-color) / 78%);
  font-size: 0.49rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.master-indicator-copy strong {
  overflow: hidden;
  margin-top: 3px;
  color: #f4f5f8;
  font-size: 0.68rem;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.master-indicator-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  overflow: hidden;
  background: rgb(var(--indicator-color) / 14%);
}

.master-indicator-progress[hidden] { display: none; }
.master-indicator-progress > span { display: block; width: 0; height: 100%; background: rgb(var(--indicator-color)); box-shadow: 0 0 8px rgb(var(--indicator-color) / 70%); transition: width 100ms linear; }
.master-indicator-progress.is-indeterminate > span { width: 38%; animation: master-indicator-indeterminate 1.25s ease-in-out infinite; }

@keyframes master-indicator-indeterminate {
  from { transform: translateX(-110%); }
  to { transform: translateX(285%); }
}

.master-indicator-keyed.is-disconnected {
  --indicator-color: 255 89 80;
  box-shadow: inset 0 0 22px rgb(255 65 57 / 12%);
}

.toast {
  position: fixed;
  z-index: 70;
  right: 16px;
  bottom: 16px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 10px 13px;
  border: 1px solid #3b3d45;
  border-radius: 10px;
  background: #16171a;
  color: #eee;
  font-size: 0.75rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
  box-shadow: 0 10px 32px rgb(0 0 0 / 30%);
}
.toast.is-visible { opacity: 1; transform: translateY(0); }

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

.viewer-gate {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  background: #0c0d0f;
}

.host-login-page { min-height: 100dvh; background: #0c0d0f; }

.url-join .viewer-gate { visibility: hidden; }

.join-form {
  display: grid;
  width: min(420px, 100%);
  gap: 34px;
  color: #f4f4f5;
}

.join-heading { display: grid; gap: 8px; }
.join-heading span { color: #777a82; font-size: 0.67rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.join-heading h1 { margin: 0; font-size: clamp(2.3rem, 8vw, 3.4rem); font-weight: 560; letter-spacing: -0.065em; line-height: 0.95; }

.join-name { display: grid; gap: 9px; }
.join-name span,
.join-pin legend { color: #8d9098; font-size: 0.68rem; font-weight: 650; letter-spacing: 0.04em; }
.join-name input {
  width: 100%;
  height: 58px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid #34363c;
  border-radius: 0;
  outline: none;
  background: transparent;
  color: #f5f5f6;
  font-size: clamp(1.15rem, 4vw, 1.45rem);
  font-weight: 480;
  transition: border-color 150ms ease;
}
.join-name input::placeholder { color: #4e5057; }
.join-name input:focus { border-color: #b7b9bf; }

.join-pin { min-width: 0; padding: 0; border: 0; }
.join-pin legend { padding: 0; margin-bottom: 12px; }
.pin-digits { display: grid; grid-template-columns: repeat(4, minmax(0, 68px)); gap: 11px; }
.pin-digit {
  width: 100%;
  aspect-ratio: 1 / 1.05;
  padding: 0;
  border: 1px solid #303238;
  border-radius: 13px;
  outline: none;
  background: #151619;
  color: transparent;
  -webkit-text-fill-color: transparent;
  caret-color: transparent;
  font-size: 1.7rem;
  font-weight: 620;
  text-align: center;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.pin-digit:nth-child(1) { --pin-color: #ff9f43; --pin-surface: #352417; }
.pin-digit:nth-child(2) { --pin-color: #42d67d; --pin-surface: #173025; }
.pin-digit:nth-child(3) { --pin-color: #4da3ff; --pin-surface: #17283b; }
.pin-digit:nth-child(4) { --pin-color: #ff5b63; --pin-surface: #381b20; }
.pin-digit:hover { border-color: #474a52; }
.pin-digit:focus { border-color: #c9cbd0; background: #1b1c20; transform: translateY(-1px); }
.pin-digit.has-value {
  border-color: var(--pin-color);
  background: var(--pin-surface);
  box-shadow: 0 0 0 1px var(--pin-color), 0 0 26px color-mix(in srgb, var(--pin-color) 48%, transparent);
}
.pin-digit.has-value:focus { border-color: var(--pin-color); background: var(--pin-surface); }

.gate-error { margin: -17px 0 -14px; color: #ee7773; font-size: 0.73rem; }
.join-button {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 12px;
  background: #f1f1f2;
  color: #111214;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 760;
  transition: background 140ms ease, transform 140ms ease;
}
.join-button:hover { background: #fff; }
.join-button:active { transform: translateY(1px); }
.viewer-profile { position: fixed; z-index: 9; left: 14px; bottom: 14px; display: flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid rgb(255 255 255 / 14%); border-radius: 999px; background: rgb(12 12 12 / 76%); color: #ddd; cursor: pointer; font-size: 0.7rem; opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity 180ms ease, transform 180ms ease, background 130ms ease; backdrop-filter: blur(10px); }
.viewer-profile.is-revealed { opacity: 1; pointer-events: auto; transform: translateY(0); }
.viewer-profile small { color: #8f929a; }

.audio-engine-page {
  background: #08090b;
  color: #f4f4f5;
}

.audio-engine-shell,
.audio-engine-activation {
  width: 100%;
  height: 100%;
}

.audio-engine-gate { background: #08090b; }

.audio-join-form {
  width: min(340px, 100%);
  gap: 30px;
}

.audio-join-form .join-heading h1 {
  font-size: clamp(2.15rem, 8vw, 3rem);
}

.audio-engine-activation {
  display: grid;
  place-items: center;
  padding: 28px;
}

.audio-engine-activate {
  display: grid;
  justify-items: center;
  gap: 22px;
  padding: 28px;
  border: 0;
  outline: none;
  background: transparent;
  color: #f5f5f6;
  cursor: pointer;
}

.audio-engine-activate strong {
  font-size: clamp(1rem, 3vw, 1.2rem);
  font-weight: 620;
  letter-spacing: -0.025em;
}

.audio-engine-icon {
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  border: 1px solid #3b3e45;
  border-radius: 50%;
  background: #17191d;
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 0 0 0 rgb(91 140 255 / 38%);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
  animation: audio-engine-pulse 1.8s ease-out infinite;
}

.audio-engine-activate:hover .audio-engine-icon,
.audio-engine-activate:focus-visible .audio-engine-icon {
  border-color: #7c9eff;
  background: #202633;
  transform: scale(1.04);
}

.audio-engine-activate:focus-visible strong { text-decoration: underline; text-underline-offset: 5px; }

.audio-engine-active {
  margin: 0;
  color: #d7d8dc;
  font-size: clamp(1rem, 3vw, 1.2rem);
  font-weight: 560;
  letter-spacing: -0.02em;
}

.audio-engine-runtime {
  position: fixed;
  top: 0;
  left: -10000px;
  width: 480px;
  height: 270px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.audio-engine-frame {
  position: relative;
  width: 480px;
  height: 270px;
  overflow: hidden;
  background: #000;
}

#audio-engine-canvas,
.audio-engine-runtime .media-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

@keyframes audio-engine-pulse {
  65% { box-shadow: 0 0 0 18px rgb(91 140 255 / 0%); }
  100% { box-shadow: 0 0 0 18px rgb(91 140 255 / 0%); }
}

[disabled],
.is-disabled { cursor: not-allowed; opacity: 0.42; }

@keyframes pulse { to { opacity: 0.35; transform: scale(0.88); } }

@media (max-width: 1380px) {
  .compact-brand div { display: none; }
  .compact-brand { margin-right: 0; }
}

@media (max-width: 860px) {
  .host-page { grid-template-rows: calc(58px + env(safe-area-inset-top)) minmax(0, 1fr); min-height: 100dvh; }
  .toolbar {
    gap: 7px;
    padding: calc(7px + env(safe-area-inset-top)) 9px 7px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    scroll-padding-inline: 9px;
  }
  .toolbar::-webkit-scrollbar { display: none; }
  .edit-actions { margin-left: 0; }
  .compact-brand div { display: none; }
  .compact-brand { margin-right: 0; }
  .brand-mark { width: 34px; height: 34px; }
  .compact-status span:last-child { display: none; }
  .compact-status { width: 30px; justify-content: center; padding: 0; }
  .floating-panel {
    top: calc(66px + env(safe-area-inset-top));
    max-height: calc(100dvh - 78px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overscroll-behavior: contain;
  }
  .media-panel, .text-panel { right: 12px; left: 12px; width: auto; overflow-y: auto; }
  .audio-panel, .transition-art-panel, .smoothing-panel { right: 12px; left: 12px; width: auto; }
  .studio-panel, .slideshow-panel, .twitch-events-panel, .graphics-panel { right: 12px; left: 12px; width: auto; }
  .viewer-panel { right: 12px; left: 12px; width: auto; }
  #scenes-panel, #slideshows-panel { height: calc(100dvh - 78px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .slideshow-entry { grid-template-columns: 24px minmax(110px, 1fr) 72px; }
  .slideshow-entry > :nth-child(4), .slideshow-entry > :nth-child(5) { grid-column: span 1; }
  .slideshow-entry .entry-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .twitch-binding-row { grid-template-columns: 1fr; }
  .twitch-binding-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .twitch-binding-actions { justify-content: flex-end; }
  .context-toolbar {
    top: calc(58px + env(safe-area-inset-top));
    right: 8px;
    left: 8px;
    max-width: none;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    transform: translateY(-10px);
  }
  .context-toolbar.is-open { transform: translateY(0); }
  .zoom-controls { bottom: calc(10px + env(safe-area-inset-bottom)); }
  .master-indicator { right: 9px; bottom: calc(58px + env(safe-area-inset-bottom)); max-width: calc(100vw - 18px); }
  .master-indicator-segment { min-width: 125px; max-width: 210px; padding-inline: 9px; }
  .toast { right: 10px; bottom: calc(58px + env(safe-area-inset-bottom)); }
}

@media (max-width: 540px) {
  .host-page { grid-template-rows: calc(60px + env(safe-area-inset-top)) minmax(0, 1fr); }
  .toolbar { padding-right: 8px; padding-left: 8px; }
  .toolbar-divider { display: block; flex: 0 0 1px; margin-inline: 1px; }
  .icon-button { width: 42px; height: 42px; border-radius: 11px; }
  .compact-brand { display: none; }
  .size-control { width: 112px; padding: 0 3px; }
  .size-control output { display: block; }
  .pin-control span { font-size: 0; }
  .master-indicator { left: 9px; overflow-x: auto; }
  .master-indicator-segment { flex: 1 0 126px; min-width: 126px; }
  .pin-control strong { font-size: 0.78rem; }
  .host-workspace.is-keyed { padding: 6px; }
  .floating-panel {
    top: calc(68px + env(safe-area-inset-top));
    right: 7px;
    bottom: calc(7px + env(safe-area-inset-bottom));
    left: 7px;
    width: auto;
    max-height: none;
    padding: 12px;
    border-radius: 17px;
  }
  .media-panel, .audio-panel, .transition-art-panel, .smoothing-panel,
  .studio-panel, .slideshow-panel, .twitch-events-panel, .graphics-panel,
  .text-panel, .viewer-panel { right: 7px; left: 7px; width: auto; }
  .media-panel, .audio-panel, .transition-art-panel, .smoothing-panel,
  .twitch-events-panel, .graphics-panel, .text-panel, .viewer-panel { overflow-x: hidden; overflow-y: auto; }
  #scenes-panel, #slideshows-panel { height: auto; }
  #scenes-panel { grid-template-rows: auto auto minmax(72px, 1fr) auto; }
  .slideshow-panel { grid-template-rows: auto auto minmax(62px, 0.42fr) minmax(0, 1.58fr); }
  .slideshow-panel .studio-editor { grid-template-rows: auto auto auto minmax(110px, 200px) auto auto; padding: 10px; }
  .scene-list, .slideshow-list { margin-bottom: 8px; }
  .scene-row-actions .audio-icon-button { width: 27px; }
  .scene-folder { margin-left: min(calc(var(--folder-depth, 0) * 8px), 32px); padding: 4px; }
  .scene-folder-heading { align-items: flex-start; flex-wrap: wrap; }
  .scene-folder-identity { min-height: 30px; flex: 1 1 150px; }
  .scene-folder-actions { flex: 0 0 auto; margin-left: auto; }
  .scene-row { align-items: flex-start; flex-wrap: wrap; }
  .scene-row .scene-select { flex-basis: 100%; }
  .scene-row-actions { width: 100%; justify-content: flex-end; }
  .slideshow-entry {
    grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    padding: 8px;
  }
  .slideshow-entry > .entry-order { grid-area: 1 / 1 / 4 / 2; }
  .slideshow-entry > :nth-child(2) { grid-area: 1 / 2 / 2 / 4; }
  .slideshow-entry > :nth-child(3) { grid-area: 2 / 2; }
  .slideshow-entry > :nth-child(4) { grid-area: 2 / 3; }
  .slideshow-entry > :nth-child(5) { grid-area: 3 / 2; }
  .slideshow-entry > .entry-actions { grid-area: 3 / 3; justify-content: flex-end; }
  .slideshow-add-row { grid-template-columns: minmax(0, 1fr) auto; }
  .repeat-controls { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .settings-grid, .text-options { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .text-options label:first-child { grid-column: 1 / -1; }
  .twitch-binding-fields { grid-template-columns: 1fr; }
  .twitch-binding-actions .audio-icon-button { width: 42px; height: 42px; }
  .auth-link-controls .primary-button, .primary-button.twitch-button { width: 100%; }
  .embed-form div, .audio-link-form div { align-items: stretch; }
  .embed-form button, .audio-link-form button { min-height: 42px; }
  .context-toolbar { top: calc(60px + env(safe-area-inset-top)); padding: 8px; }
  .context-region { width: max-content; min-width: 100%; }
  .selected-text-copy textarea { width: 180px; min-width: 180px; }
  .advanced-color-picker {
    top: auto !important;
    right: 7px !important;
    bottom: calc(7px + env(safe-area-inset-bottom)) !important;
    left: 7px !important;
    width: auto;
    max-height: calc(100dvh - 14px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow-y: auto;
  }
  .smoothing-edge-picker { grid-template: repeat(3, 44px) / repeat(3, minmax(0, 1fr)); }
  .smoothing-effects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .smoothing-preview { height: 148px; }
  .smoothing-preview-surface { inset: 12px; }
  .folder-delete-dialog form { grid-template-columns: 38px minmax(0, 1fr); padding: 14px; }
  .folder-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .folder-dialog-actions button { width: 100%; padding-inline: 8px; }
  .folder-dialog-actions button:first-child { grid-column: 1 / -1; }
  .zoom-controls .icon-button { width: 36px; height: 36px; }
  .toast { right: 8px; left: 8px; max-width: none; text-align: center; }
  .host-page input, .host-page select, .host-page textarea { font-size: 16px; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .host-page { grid-template-rows: calc(52px + env(safe-area-inset-top)) minmax(0, 1fr); }
  .toolbar { padding-top: calc(4px + env(safe-area-inset-top)); padding-bottom: 4px; }
  .icon-button { width: 38px; height: 38px; }
  .floating-panel { top: calc(58px + env(safe-area-inset-top)); bottom: 5px; }
  .context-toolbar { top: calc(52px + env(safe-area-inset-top)); }
  .smoothing-preview { height: 112px; }
}

@media (pointer: coarse) {
  .panel-close, .audio-icon-button, .context-icon-button, .selected-text-alignment button { min-width: 42px; min-height: 42px; }
  .scene-select, .slideshow-select, .viewer-row, button, a { touch-action: manipulation; }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
  .viewer-profile { transition: none; }
  .audio-engine-icon { animation: none; }
}
