:root {
  color-scheme: light;
  --bg: #eef2f5;
  --surface: #ffffff;
  --ink: #16202a;
  --muted: #65717c;
  --line: #d8e0e7;
  --accent: #007c89;
  --accent-strong: #005f69;
  --danger: #b43143;
  --shadow: 0 18px 45px rgba(22, 32, 42, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

body:not(.display-body) {
  height: 100vh;
  overflow: hidden;
}

.display-body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: #0d1116;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  overflow: auto;
  overflow-x: hidden;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: #f8fafb;
}

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

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.brand h1,
.brand p,
.topbar h2,
.eyebrow,
.panel h2,
.panel-title span {
  margin: 0;
}

.brand h1 {
  font-size: 20px;
  line-height: 1.1;
}

.place-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.place-panel .field {
  margin-bottom: 0;
}

.place-panel input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
}

.studio-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.nav-item {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.nav-item.active {
  border-color: var(--accent);
  background: rgba(0, 124, 137, 0.1);
  color: var(--accent-strong);
}

.brand p,
.eyebrow,
.panel-title span {
  color: var(--muted);
  font-size: 13px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel h2 {
  font-size: 15px;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.metric-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafb;
}

.metric-grid strong,
.metric-grid span {
  display: block;
}

.metric-grid strong {
  font-size: 22px;
  line-height: 1;
}

.metric-grid span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.screen-list {
  display: grid;
  gap: 8px;
}

.screen-row {
  display: grid;
  grid-template-columns: 10px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 40px;
}

.screen-row strong,
.screen-row small {
  display: block;
}

.screen-row strong {
  font-size: 13px;
}

.screen-row small {
  color: var(--muted);
  font-size: 12px;
}

.screen-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #a9b3bd;
}

.screen-dot.online {
  background: #2f9e44;
}

.screen-dot.offline {
  background: #c2413f;
}

.playlist {
  display: grid;
  gap: 8px;
}

.playlist-section {
  display: grid;
  gap: 8px;
}

.playlist-section + .playlist-section {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.playlist-section-header {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.playlist-section-header span {
  border-radius: 999px;
  background: #e9eef2;
  color: var(--ink);
  padding: 1px 7px;
}

.playlist-empty {
  margin: 0;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 10px;
  font-size: 12px;
}

.slide-item {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 60px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  text-align: left;
  padding: 10px;
}

.slide-item.inactive {
  background: #f8fafb;
  opacity: 0.72;
}

.slide-item.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 124, 137, 0.12);
}

.slide-swatch {
  width: 8px;
  height: 38px;
  border-radius: 6px;
  background: var(--accent);
}

.slide-item strong,
.slide-item span {
  display: block;
}

.slide-item strong {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.slide-item span {
  color: var(--muted);
  font-size: 12px;
}

.slide-actions {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.slide-delete {
  border-radius: 999px;
  background: rgba(190, 18, 60, 0.08);
  color: var(--danger);
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 850;
}

.button-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.button,
.icon-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 40px;
}

.button {
  flex: 1;
  padding: 0 12px;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.button.danger {
  color: var(--danger);
}

.wide-button {
  width: 100%;
  margin-bottom: 12px;
}

.field,
.toggle {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.field span,
.toggle span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.field small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.field input,
.field select,
.field textarea {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
}

.field input[readonly] {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field textarea {
  resize: vertical;
}

.toggle {
  grid-template-columns: 18px 1fr;
  align-items: center;
}

.workspace {
  display: flex;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overflow-x: hidden;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  position: sticky;
  top: 0;
  z-index: 15;
  backdrop-filter: blur(12px);
}

.topbar h2 {
  font-size: 22px;
}

.toolbar {
  display: flex;
  gap: 8px;
}

.operator-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, auto));
  gap: 8px;
  margin-left: auto;
}

.operator-summary span {
  display: grid;
  gap: 2px;
  min-width: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
}

.operator-summary strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  text-transform: capitalize;
  white-space: nowrap;
}

.operator-summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.status-strip span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 750;
}

.icon-button {
  width: 42px;
  font-size: 21px;
}

.preview-zone {
  display: grid;
  min-height: 390px;
  flex: 0 0 auto;
  place-items: center;
  padding: 22px 28px;
}

.device-frame {
  width: min(100%, 900px);
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: #0d1116;
  padding: 12px;
  box-shadow: var(--shadow);
}

.device-frame.portrait {
  width: min(58vh, 430px);
  aspect-ratio: 9 / 16;
}

.sign-screen {
  position: relative;
  display: flex;
  min-height: 100%;
  overflow: hidden;
  border-radius: 4px;
  isolation: isolate;
  background: #152026;
  --transition-duration: 520ms;
}

.sign-screen.transition-fast {
  --transition-duration: 300ms;
}

.sign-screen.transition-slow {
  --transition-duration: 900ms;
}

.transition-fade {
  animation: signFade var(--transition-duration) ease both;
}

.transition-slide {
  animation: signSlide var(--transition-duration) cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.transition-zoom {
  animation: signZoom var(--transition-duration) cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.transition-wipe::before {
  position: absolute;
  inset: 0;
  z-index: 8;
  content: "";
  background: #0d1116;
  animation: signWipe var(--transition-duration) ease both;
}

@keyframes signFade {
  from {
    opacity: 0.18;
  }
  to {
    opacity: 1;
  }
}

@keyframes signSlide {
  from {
    opacity: 0.2;
    transform: translateX(26px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes signZoom {
  from {
    opacity: 0.2;
    transform: scale(1.04);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes signWipe {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(100%);
  }
}

.media-wash {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(135deg, #007c89, #f2b84b);
}

.media-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #0d1116;
}

.media-stage {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  background: #0d1116;
}

.media-only .media-stage {
  display: block;
}

.live-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
}

.overlay-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.live-mode .live-layer {
  display: grid;
  place-items: center;
}

.weather-overlay-mode .live-layer {
  pointer-events: none;
}

.screen-overlay {
  position: absolute;
  max-width: min(72%, 760px);
  color: #fff;
  opacity: var(--overlay-opacity, 0.9);
  --overlay-duration: 900ms;
  --overlay-x: 0px;
  --overlay-y: 0px;
  transform: translate(var(--overlay-x), var(--overlay-y));
}

.effect-fast {
  --overlay-duration: 520ms;
}

.effect-slow {
  --overlay-duration: 1400ms;
}

.overlay-top-left {
  top: clamp(16px, 3vw, 42px);
  left: clamp(16px, 3vw, 42px);
}

.overlay-top-right {
  top: clamp(16px, 3vw, 42px);
  right: clamp(16px, 3vw, 42px);
}

.overlay-bottom-left {
  bottom: clamp(16px, 3vw, 42px);
  left: clamp(16px, 3vw, 42px);
}

.overlay-bottom-right {
  right: clamp(16px, 3vw, 42px);
  bottom: clamp(16px, 3vw, 42px);
}

.overlay-center {
  top: 50%;
  left: 50%;
  --overlay-x: -50%;
  --overlay-y: -50%;
}

.overlay-bottom {
  right: 0;
  bottom: 0;
  left: 0;
  max-width: none;
}

.overlay-badge {
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: color-mix(in srgb, var(--overlay-color), #111827 22%);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  padding: clamp(9px, 1.4vw, 16px) clamp(14px, 2.4vw, 30px);
  font-size: clamp(18px, 2.6vw, 42px);
  font-weight: 900;
  text-transform: uppercase;
}

.overlay-lower-third {
  border-left: clamp(6px, 0.8vw, 12px) solid var(--overlay-color);
  border-radius: 8px;
  background: rgba(8, 13, 18, 0.78);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
  padding: clamp(14px, 2.4vw, 30px) clamp(18px, 3vw, 38px);
  font-size: clamp(24px, 3.8vw, 58px);
  font-weight: 850;
  line-height: 1;
  backdrop-filter: blur(8px);
}

.overlay-ticker {
  overflow: hidden;
  background: color-mix(in srgb, var(--overlay-color), #101820 28%);
  padding: clamp(9px, 1.4vw, 16px) 0;
  white-space: nowrap;
}

.overlay-ticker span {
  display: inline-block;
  min-width: 100%;
  padding-left: 100%;
  font-size: clamp(18px, 2.4vw, 38px);
  font-weight: 850;
  animation: tickerMove 14s linear infinite;
}

.overlay-qr {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(10px, 1.8vw, 22px);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: #111827;
  padding: clamp(12px, 1.8vw, 22px);
  font-size: clamp(18px, 2.2vw, 34px);
  font-weight: 850;
}

.qr-mark {
  width: clamp(54px, 7vw, 112px);
  aspect-ratio: 1;
  border: 8px solid #111827;
  background:
    linear-gradient(90deg, #111827 14%, transparent 0 36%, #111827 0 52%, transparent 0 76%, #111827 0),
    linear-gradient(#111827 14%, transparent 0 36%, #111827 0 52%, transparent 0 76%, #111827 0);
  background-color: #fff;
  background-size: 28px 28px;
}

.effect-fade {
  animation: overlayFade var(--overlay-duration) ease both;
}

.effect-slide-left {
  animation: overlaySlideLeft var(--overlay-duration) cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.effect-slide-up {
  animation: overlaySlideUp var(--overlay-duration) cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.effect-flash {
  animation: overlayFlash var(--overlay-duration) ease both;
}

.effect-expand {
  animation: overlayExpand var(--overlay-duration) cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.effect-typewriter {
  overflow: hidden;
  width: fit-content;
  white-space: nowrap;
  animation: overlayType var(--overlay-duration) steps(18, end) both;
}

.effect-pulse {
  animation: overlayPulse 1600ms ease-in-out infinite;
}

@keyframes overlayFade {
  from {
    opacity: 0;
  }
}

@keyframes overlaySlideLeft {
  from {
    opacity: 0;
    transform: translate(calc(var(--overlay-x) - 34px), var(--overlay-y));
  }
  to {
    transform: translate(var(--overlay-x), var(--overlay-y));
  }
}

@keyframes overlaySlideUp {
  from {
    opacity: 0;
    transform: translate(var(--overlay-x), calc(var(--overlay-y) + 34px));
  }
  to {
    transform: translate(var(--overlay-x), var(--overlay-y));
  }
}

@keyframes overlayFlash {
  0%,
  45% {
    filter: brightness(2.4);
    opacity: 1;
  }
  100% {
    filter: brightness(1);
  }
}

@keyframes overlayExpand {
  from {
    opacity: 0;
    transform: translate(var(--overlay-x), var(--overlay-y)) scale(0.72);
  }
  to {
    transform: translate(var(--overlay-x), var(--overlay-y)) scale(1);
  }
}

@keyframes overlayType {
  from {
    max-width: 0;
  }
  to {
    max-width: 760px;
  }
}

@keyframes overlayPulse {
  50% {
    transform: translate(var(--overlay-x), var(--overlay-y)) scale(1.04);
    filter: brightness(1.16);
  }
}

@keyframes tickerMove {
  to {
    transform: translateX(-100%);
  }
}

.live-layer.weather-bottom {
  align-items: end;
  justify-items: stretch;
  padding: 0;
}

.live-layer.weather-top {
  align-items: start;
  justify-items: stretch;
  padding: 0;
}

.live-layer.weather-left {
  align-items: stretch;
  justify-items: start;
}

.live-layer.weather-right {
  align-items: stretch;
  justify-items: end;
}

.screen-media {
  width: 100%;
  height: 100%;
  display: block;
}

.screen-media.fit-cover {
  object-fit: cover;
}

.screen-media.fit-contain {
  object-fit: contain;
}

.media-wash::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    radial-gradient(circle at 82% 20%, rgba(255, 255, 255, 0.7), transparent 18%),
    linear-gradient(90deg, rgba(10, 18, 24, 0.72), rgba(10, 18, 24, 0.2));
}

.has-media .media-wash {
  background: linear-gradient(90deg, rgba(10, 18, 24, 0.78), rgba(10, 18, 24, 0.26));
}

.has-media .media-wash::after {
  background:
    linear-gradient(0deg, rgba(10, 18, 24, 0.48), rgba(10, 18, 24, 0.12)),
    radial-gradient(circle at 86% 18%, rgba(255, 255, 255, 0.3), transparent 16%);
}

.screen-content {
  position: relative;
  z-index: 2;
  display: flex;
  width: 100%;
  min-height: 100%;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(20px, 4vw, 54px);
  color: #fff;
}

.media-only .screen-content,
.live-mode:not(.weather-overlay-mode) .screen-content {
  display: none;
}

.media-only .media-wash,
.live-mode:not(.weather-overlay-mode) .media-wash {
  background: transparent;
}

.media-only .media-wash::after,
.live-mode:not(.weather-overlay-mode) .media-wash::after {
  background: transparent;
}

.weather-card {
  display: grid;
  gap: 16px;
  width: min(78%, 760px);
  color: #fff;
  text-align: center;
}

.weather-card-bottom,
.weather-card-top {
  width: 100%;
  min-height: var(--weather-size, 110px);
  align-self: end;
  gap: 6px;
  background: rgba(13, 17, 22, var(--weather-opacity, 0.65));
  padding: clamp(10px, 1.8vw, 20px) clamp(18px, 3vw, 42px);
  backdrop-filter: blur(8px);
}

.weather-card-top {
  align-self: start;
}

.weather-card-left,
.weather-card-right {
  width: min(42%, calc(var(--weather-size, 110px) * 3.1));
  min-height: 100%;
  align-content: center;
  background: rgba(13, 17, 22, var(--weather-opacity, 0.65));
  padding: clamp(18px, 3vw, 34px);
  backdrop-filter: blur(8px);
}

.weather-card .weather-label {
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(18px, 2.2vw, 30px);
  font-weight: 800;
  text-transform: uppercase;
}

.weather-card strong {
  font-size: clamp(82px, 13vw, 190px);
  line-height: 0.9;
}

.weather-card-bottom strong,
.weather-card-top strong,
.weather-card-left strong,
.weather-card-right strong {
  font-size: clamp(28px, calc(var(--weather-size, 110px) * 0.42), 74px);
}

.weather-card span:last-child,
.web-empty {
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(20px, 2.8vw, 40px);
  font-weight: 750;
}

.forecast-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.weather-detail-hours .forecast-strip {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.forecast-strip span {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: 8px;
}

.forecast-strip strong {
  font-size: clamp(14px, 1.5vw, 20px);
}

.forecast-strip em {
  font-style: normal;
  font-size: clamp(18px, 2.5vw, 32px);
  font-weight: 850;
}

.weather-card-left .forecast-strip,
.weather-card-right .forecast-strip {
  grid-template-columns: 1fr;
}

.weather-compact {
  gap: 6px;
}

.weather-compact .weather-label {
  font-size: clamp(12px, calc(var(--weather-size, 110px) * 0.16), 22px);
}

.weather-compact .forecast-strip span {
  padding: 6px;
}

.weather-compact .forecast-strip strong {
  font-size: clamp(11px, calc(var(--weather-size, 110px) * 0.13), 16px);
}

.weather-compact .forecast-strip em {
  font-size: clamp(14px, calc(var(--weather-size, 110px) * 0.2), 24px);
}

.weather-compact.weather-card-bottom,
.weather-compact.weather-card-top {
  min-height: var(--weather-size, 96px);
}

.web-embed {
  width: 100%;
  height: 100%;
  border: 0;
  background: #0d1116;
}

.scoreboard-card {
  display: grid;
  align-content: center;
  gap: clamp(10px, 1.4vw, 20px);
  width: 100%;
  height: 100%;
  padding: clamp(20px, 3.2vw, 54px);
  background:
    radial-gradient(circle at 14% 16%, rgba(44, 183, 201, 0.24), transparent 28%),
    linear-gradient(135deg, #071018, #13212c 48%, #0c161d);
  color: #fff;
}

.scoreboard-label {
  color: #78e0ef;
  font-size: clamp(18px, 2.5vw, 38px);
  font-weight: 900;
  text-transform: uppercase;
}

.scoreboard-card > strong {
  font-size: clamp(54px, 8vw, 128px);
  line-height: 0.94;
}

.scoreboard-card > span:last-child {
  color: rgba(255, 255, 255, 0.7);
  font-size: clamp(20px, 2.4vw, 38px);
}

.score-list {
  display: grid;
  gap: clamp(12px, 1.4vw, 22px);
}

.score-game {
  display: grid;
  gap: clamp(9px, 1.25vw, 18px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: clamp(12px, 1.7vw, 24px);
}

.score-team {
  display: grid;
  grid-template-columns: clamp(34px, 4.2vw, 68px) minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(8px, 1.2vw, 16px);
  min-width: 0;
}

.score-team img {
  width: clamp(34px, 4.2vw, 68px);
  height: clamp(34px, 4.2vw, 68px);
  object-fit: contain;
}

.score-team strong {
  display: block;
  font-size: clamp(22px, 3.3vw, 54px);
  line-height: 1.02;
  white-space: normal;
}

.score-team small {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.62);
  font-size: clamp(12px, 1.3vw, 20px);
  font-weight: 850;
  letter-spacing: 0;
}

.score-team em {
  min-width: clamp(48px, 5.4vw, 92px);
  border-radius: 8px;
  background: #f2b84b;
  color: #101820;
  padding: 0.18em 0.35em;
  font-style: normal;
  font-size: clamp(28px, 4.2vw, 68px);
  font-weight: 950;
  line-height: 1;
  text-align: center;
}

.score-status {
  justify-self: start;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.78);
  padding: 0.45em 0.8em;
  font-size: clamp(11px, 1.2vw, 18px);
  font-weight: 850;
  text-transform: uppercase;
  white-space: nowrap;
}

.scoreboard-rotation {
  color: rgba(255, 255, 255, 0.58);
  font-size: clamp(12px, 1.3vw, 20px);
  font-weight: 800;
  text-transform: uppercase;
}

.sports-mode .overlay-layer {
  display: none;
}

.time-strip,
.screen-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(13px, 1.3vw, 19px);
  font-weight: 700;
}

.message-block {
  max-width: 72%;
}

.sign-screen[data-text-position="center"] .screen-content {
  justify-content: space-between;
  align-items: flex-start;
}

.sign-screen[data-text-position="top"] .screen-content,
.sign-screen[data-text-position="bottom"] .screen-content {
  justify-content: flex-start;
  gap: 18px;
}

.sign-screen[data-text-position="bottom"] .screen-content {
  flex-direction: column-reverse;
}

.sign-screen[data-text-position="left"] .screen-content,
.sign-screen[data-text-position="right"] .screen-content {
  justify-content: center;
}

.sign-screen[data-text-position="right"] .screen-content {
  align-items: flex-end;
  text-align: right;
}

.sign-screen[data-text-position="top"] .message-block,
.sign-screen[data-text-position="bottom"] .message-block {
  width: 100%;
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(8, 13, 18, 0.54);
  padding: clamp(14px, 2.2vw, 28px);
  backdrop-filter: blur(7px);
}

.sign-screen[data-text-position="left"] .message-block,
.sign-screen[data-text-position="right"] .message-block {
  width: min(46%, 560px);
  max-width: 560px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(8, 13, 18, 0.58);
  padding: clamp(18px, 3vw, 42px);
  backdrop-filter: blur(7px);
}

.sign-screen[data-text-position="top"] .message-block h3,
.sign-screen[data-text-position="bottom"] .message-block h3 {
  font-size: clamp(30px, 4.8vw, 72px);
}

.sign-screen[data-text-position="left"] .message-block h3,
.sign-screen[data-text-position="right"] .message-block h3 {
  font-size: clamp(32px, 5.2vw, 76px);
}

.sign-screen[data-text-position="top"] .message-block p:last-child,
.sign-screen[data-text-position="bottom"] .message-block p:last-child {
  max-width: 980px;
  margin-top: 10px;
  font-size: clamp(16px, 1.9vw, 28px);
}

.category {
  margin: 0 0 14px;
  color: #f4d06f;
  font-size: clamp(14px, 1.4vw, 22px);
  font-weight: 800;
  text-transform: uppercase;
}

.message-block h3 {
  margin: 0;
  color: #fff;
  font-size: clamp(42px, 7vw, 96px);
  line-height: 0.95;
}

.message-block p:last-child {
  max-width: 720px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.87);
  font-size: clamp(18px, 2.2vw, 34px);
  line-height: 1.2;
}

.screen-footer span {
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  padding: 9px 14px;
  background: rgba(0, 0, 0, 0.22);
}

.editor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 0 28px 28px;
  align-items: start;
  width: 100%;
  max-width: 1460px;
  margin: 0 auto;
}

.editor-grid > .panel {
  align-self: start;
}

.schedule-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.schedule-card {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  padding: 12px;
}

.schedule-card strong {
  font-size: 14px;
}

.schedule-card span {
  color: var(--muted);
  font-size: 12px;
}

.media-editor {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.panel-title.compact {
  margin-bottom: 10px;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  padding: 0;
  font-size: 12px;
  font-weight: 800;
}

#clearMedia {
  width: 100%;
}

.media-preview-box {
  display: grid;
  min-height: 112px;
  place-items: center;
  overflow: hidden;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f8fafb;
  color: var(--muted);
  font-size: 12px;
}

.media-preview-box.has-preview {
  border-style: solid;
  background: #0d1116;
}

.media-preview-box.drag-over {
  border-color: var(--accent);
  background: rgba(0, 124, 137, 0.1);
  color: var(--accent-strong);
}

.media-preview {
  width: 100%;
  height: 140px;
  display: block;
  object-fit: contain;
}

.media-error-card {
  display: grid;
  gap: 10px;
  width: min(82%, 720px);
  margin: 12% auto 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(13, 17, 22, 0.84);
  color: #fff;
  padding: 24px;
  text-align: center;
}

.media-error-card strong {
  font-size: clamp(28px, 4vw, 56px);
}

.media-error-card span,
.media-error-card small {
  color: rgba(255, 255, 255, 0.78);
  overflow-wrap: anywhere;
}

.media-status {
  min-height: 18px;
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.update-status {
  min-height: 34px;
  margin: 10px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  color: var(--muted);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.4;
}

.update-status[data-tone="working"] {
  border-color: rgba(0, 124, 137, 0.35);
  background: rgba(0, 124, 137, 0.08);
  color: var(--accent-strong);
}

.update-status[data-tone="success"] {
  border-color: rgba(21, 128, 61, 0.28);
  background: rgba(21, 128, 61, 0.08);
  color: #166534;
}

.update-status[data-tone="error"] {
  border-color: rgba(190, 18, 60, 0.28);
  background: rgba(190, 18, 60, 0.08);
  color: var(--danger);
}

.media-library {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.media-library-list {
  display: grid;
  gap: 7px;
}

.media-library-list > span {
  color: var(--muted);
  font-size: 12px;
}

.media-library-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.media-library-item,
.media-delete-button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
  text-align: left;
  overflow-wrap: anywhere;
}

.media-delete-button {
  width: auto;
  color: var(--danger);
  font-size: 12px;
  font-weight: 750;
  text-align: center;
}

.overlay-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.overlay-list:empty::before {
  content: "No overlays on this slide.";
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 12px;
  font-size: 12px;
}

.overlay-item {
  display: grid;
  grid-template-columns: 14px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px;
  text-align: left;
}

.overlay-item.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 124, 137, 0.12);
}

.overlay-swatch {
  width: 14px;
  height: 34px;
  border-radius: 999px;
}

.overlay-item strong,
.overlay-item small {
  display: block;
}

.overlay-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.overlay-item small {
  color: var(--muted);
  font-size: 12px;
}

.cast-steps {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.screen-link-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.screen-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px 44px;
  grid-template-areas: "meta open copy";
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  padding: 9px 10px;
}

.screen-link > div {
  grid-area: meta;
  display: grid;
  gap: 2px;
  min-width: 0;
}

.screen-link strong,
.screen-link span {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screen-link strong {
  font-size: 12px;
}

.screen-link span {
  color: var(--muted);
  font-size: 11px;
}

.screen-link button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--accent-strong);
  min-height: 30px;
  min-width: 0;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 850;
}

.screen-link button[data-action="open"] {
  grid-area: open;
}

.screen-link button[data-action="copy"] {
  grid-area: copy;
  display: inline-block;
}

.cast-steps span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  color: var(--muted);
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 750;
}

.copy-status {
  min-height: 18px;
  margin: 10px 0 0;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.login-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(0, 124, 137, 0.15), transparent 28%),
    linear-gradient(135deg, #eef2f5, #dfe8ee);
}

.login-shell {
  width: min(92vw, 420px);
}

.login-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 24px;
  box-shadow: var(--shadow);
}

.login-brand {
  margin-bottom: 22px;
}

.theme-market .media-wash {
  background: linear-gradient(135deg, #007c89, #f2b84b 58%, #e85d4f);
}

.theme-transit .media-wash {
  background: linear-gradient(135deg, #111827, #2cb7c9 54%, #f7c948);
}

.theme-health .media-wash {
  background: linear-gradient(135deg, #0f766e, #98d8aa 55%, #ffffff);
}

.theme-health .category {
  color: #c7f9d4;
}

.theme-event .media-wash {
  background: linear-gradient(135deg, #1f2937, #d94654 48%, #f7c948);
}

.fullscreen-mode .sidebar,
.fullscreen-mode .topbar,
.fullscreen-mode .editor-grid {
  display: none;
}

.fullscreen-mode .app-shell {
  display: block;
}

.fullscreen-mode .workspace,
.fullscreen-mode .preview-zone {
  min-height: 100vh;
}

.fullscreen-mode .preview-zone {
  padding: 0;
  background: #0d1116;
}

.fullscreen-mode .device-frame {
  width: 100vw;
  height: 100vh;
  max-width: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.fullscreen-mode .sign-screen {
  border-radius: 0;
}

.display-page {
  position: relative;
  display: grid;
  place-items: center;
  width: 100vw;
  width: 100dvw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #0d1116;
}

.tv-mode-button {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 20;
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(13, 17, 22, 0.82);
  color: #fff;
  padding: 12px 16px;
  font-weight: 850;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(8px);
}

.tv-launcher .tv-mode-button {
  display: block;
}

.tv-launcher .tv-mode-button.quiet {
  opacity: 0.3;
}

.tv-launcher .tv-mode-button:hover,
.tv-launcher .tv-mode-button:focus-visible {
  opacity: 1;
}

.tv-active .tv-mode-button {
  display: none;
}

.display-sign-screen {
  width: min(100dvw, calc(100dvh * 16 / 9));
  height: min(100dvh, calc(100dvw * 9 / 16));
  min-height: 0;
  border-radius: 0;
}

.tv-safe .display-sign-screen {
  width: min(92dvw, calc(92dvh * 16 / 9));
  height: min(92dvh, calc(92dvw * 9 / 16));
}

.tv-safe-2 .display-sign-screen {
  width: min(88dvw, calc(88dvh * 16 / 9));
  height: min(88dvh, calc(88dvw * 9 / 16));
}

.tv-safe-3 .display-sign-screen {
  width: min(84dvw, calc(84dvh * 16 / 9));
  height: min(84dvh, calc(84dvw * 9 / 16));
}

.tv-safe-4 .display-sign-screen {
  width: min(80dvw, calc(80dvh * 16 / 9));
  height: min(80dvh, calc(80dvw * 9 / 16));
}

.tv-safe-5 .display-sign-screen {
  width: min(74dvw, calc(74dvh * 16 / 9));
  height: min(74dvh, calc(74dvw * 9 / 16));
}

.tv-safe-6 .display-sign-screen {
  width: min(68dvw, calc(68dvh * 16 / 9));
  height: min(68dvh, calc(68dvw * 9 / 16));
}

.tv-safe-7 .display-sign-screen {
  width: min(62dvw, calc(62dvh * 16 / 9));
  height: min(62dvh, calc(62dvw * 9 / 16));
}

@media (max-width: 940px) {
  body:not(.display-body) {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }

  .editor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .operator-summary {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 620px) {
  .topbar,
  .preview-zone,
  .editor-grid,
  .sidebar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .operator-summary {
    grid-template-columns: 1fr;
  }

  .preview-zone {
    min-height: 260px;
  }

  .editor-grid {
    grid-template-columns: 1fr;
  }

  .device-frame,
  .device-frame.portrait {
    width: 100%;
  }

  .message-block {
    max-width: 100%;
  }

  .sign-screen[data-text-position="left"] .message-block,
  .sign-screen[data-text-position="right"] .message-block {
    width: 100%;
    max-width: 100%;
  }

  .sign-screen[data-text-position="right"] .screen-content {
    text-align: left;
  }

  .message-block h3 {
    font-size: 38px;
  }

  .message-block p:last-child {
    font-size: 18px;
  }
}
