:root {
  --bg: #f7f9fb;
  --surface: #ffffff;
  --surface-soft: #eef2f5;
  --surface-strong: #071927;
  --text: #071927;
  --muted: #647386;
  --border: #d9e0e7;
  --primary: #071927;
  --primary-dark: #020d17;
  --primary-soft: #edf2f5;
  --accent: #fbd644;
  --accent-soft: #fbd644;
  --success: #24845b;
  --warning: #9a6a18;
  --danger: #bd3f48;
  --focus: #f7c600;
  --page-gutter: 38px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

body {
  margin: 0;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  min-height: 72px;
  padding: 0 var(--page-gutter);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 34px;
  flex: 0 0 auto;
  border: 2px solid var(--text);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: inset 0 -4px 0 rgba(7, 25, 39, 0.08);
}

.brand-mark::before {
  position: absolute;
  right: 7px;
  bottom: -7px;
  left: 7px;
  height: 3px;
  border-radius: 999px;
  background: var(--text);
  content: "";
}

.brand-mark::after {
  position: absolute;
  bottom: -9px;
  left: 50%;
  width: 10px;
  height: 6px;
  border-radius: 0 0 4px 4px;
  background: var(--text);
  content: "";
  transform: translateX(-50%);
}

.brand-mark span {
  width: 25px;
  height: 14px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: inset 0 -2px 0 rgba(7, 25, 39, 0.14);
}

.brand-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.brand-name {
  font-size: 24px;
  font-weight: 750;
  line-height: 1;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  gap: 10px;
  align-items: center;
  align-self: stretch;
  overflow-x: auto;
}

.main-nav a {
  position: relative;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 72px;
  padding: 0 12px;
  border-radius: 0;
  color: #405064;
  font-size: 14px;
  font-weight: 560;
  text-decoration: none;
  white-space: nowrap;
}

.main-nav a.active,
.main-nav a:hover {
  background: transparent;
  color: var(--text);
}

.main-nav a.active::after,
.main-nav a:hover::after {
  position: absolute;
  right: 10px;
  bottom: 0;
  left: 10px;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: var(--accent);
  content: "";
}

.nav-icon {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.user-menu {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}

.user-menu form,
.table-actions form,
.availability-switch-form,
.inline-form {
  margin: 0;
}

.admin-shell {
  width: calc(100vw - (var(--page-gutter) * 2));
  max-width: none;
  margin: 28px auto 64px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 22px;
}

.page-header h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 650;
  line-height: 1.1;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.panel,
.stat-card,
.login-panel,
.slide-preview {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(7, 25, 39, 0.05);
}

[hidden] {
  display: none !important;
}

.panel {
  padding: 20px;
  margin-bottom: 22px;
}

.panel.narrow {
  max-width: 760px;
}

.panel h2 {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 650;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.stat-card {
  padding: 18px;
}

.stat-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 580;
}

.stat-card strong {
  font-size: 34px;
  font-weight: 620;
  line-height: 1;
}

.admin-dashboard .admin-shell {
  margin-top: 24px;
  margin-bottom: 28px;
}

.admin-dashboard .page-header {
  margin-bottom: 16px;
}

.dashboard-stat-grid {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.dashboard-stat-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  color: inherit;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.dashboard-stat-card:hover,
.dashboard-stat-card:focus-visible {
  border-color: rgba(7, 25, 39, 0.22);
  box-shadow: 0 14px 30px rgba(7, 25, 39, 0.09);
  outline: 3px solid rgba(247, 198, 0, 0.2);
  outline-offset: 1px;
  transform: translateY(-1px);
}

.dashboard-stat-card span {
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 560;
}

.dashboard-stat-card strong {
  display: block;
  font-size: 30px;
  font-weight: 560;
  line-height: 1.05;
}

.dashboard-stat-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.dashboard-stat-card > .dashboard-icon {
  width: 48px;
  height: 48px;
  padding: 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--primary);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(360px, 0.64fr);
  gap: 14px;
  align-items: start;
}

.dashboard-main,
.dashboard-side {
  display: grid;
  gap: 14px;
}

.admin-dashboard .panel {
  padding: 16px;
  margin-bottom: 0;
}

.admin-dashboard .panel h2 {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 610;
}

.dashboard-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.dashboard-panel-header h2 {
  margin-bottom: 4px;
}

.dashboard-panel-header p {
  margin: 0;
  font-size: 13px;
}

.dashboard-pill,
.dashboard-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 560;
  white-space: nowrap;
}

.dashboard-playlist-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dashboard-playlist-item {
  display: grid;
  grid-template-columns: 34px 164px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 106px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfc;
  color: inherit;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.dashboard-playlist-item:hover,
.dashboard-playlist-item:focus-visible {
  border-color: rgba(7, 25, 39, 0.22);
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(7, 25, 39, 0.08);
  outline: 3px solid rgba(247, 198, 0, 0.18);
  outline-offset: 1px;
  transform: translateY(-1px);
}

.dashboard-order {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 560;
}

.playlist-preview.dashboard-preview {
  width: 164px;
  cursor: default;
}

.playlist-preview.dashboard-preview img {
  object-fit: contain;
  image-rendering: auto;
}

.dashboard-playlist-copy {
  min-width: 0;
}

.dashboard-playlist-title {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 610;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-playlist-item:hover .dashboard-playlist-title,
.dashboard-playlist-item:focus-visible .dashboard-playlist-title {
  color: var(--primary-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dashboard-playlist-copy small {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-duration {
  color: var(--muted);
  font-size: 14px;
  font-weight: 560;
  white-space: nowrap;
}

.dashboard-card {
  margin-bottom: 0;
}

.dashboard-metrics {
  display: grid;
  gap: 0;
  margin: 0;
}

.dashboard-metrics div {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.dashboard-metrics div:last-child {
  border-bottom: 0;
}

.dashboard-metrics dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 560;
}

.dashboard-metrics dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.heartbeat-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  color: var(--muted);
  white-space: nowrap;
}

.heartbeat-icon {
  width: min(112px, 44vw);
  min-width: 76px;
  height: 32px;
  flex: 0 1 112px;
  overflow: visible;
}

.heartbeat-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.heartbeat-line-shadow {
  stroke: rgba(247, 198, 0, 0.18);
  stroke-width: 2.4;
  opacity: 0;
}

.heartbeat-line-flat {
  stroke: rgba(189, 63, 72, 0.34);
  stroke-width: 2.4;
  opacity: 1;
}

.heartbeat-line-active {
  stroke: var(--focus);
  stroke-width: 2.8;
  stroke-dasharray: 156;
  stroke-dashoffset: 156;
  opacity: 0;
}

.heartbeat-heart {
  fill: var(--focus);
  opacity: 0.95;
  transform-box: fill-box;
  transform-origin: center;
}

.heartbeat-time {
  min-width: 0;
  color: var(--text);
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-player-card.is-online .heartbeat-line-active {
  animation: heartbeat-line 1.8s linear infinite;
}

.dashboard-player-card.is-online .heartbeat-line-shadow {
  opacity: 0;
}

.dashboard-player-card.is-online .heartbeat-line-flat {
  opacity: 0;
}

.dashboard-player-card.is-online .heartbeat-heart {
  animation: heartbeat-pulse 1.8s ease-in-out infinite;
}

.dashboard-player-card.is-online .heartbeat-time {
  display: none;
}

.dashboard-player-card.is-offline .heartbeat-status {
  opacity: 0.72;
}

.dashboard-player-card.is-offline .heartbeat-line-active {
  animation: none;
  opacity: 0;
}

.dashboard-player-card.is-offline .heartbeat-line-shadow {
  opacity: 0;
}

.dashboard-player-card.is-offline .heartbeat-line-flat {
  opacity: 1;
}

.dashboard-player-card.is-offline .heartbeat-heart {
  animation: none;
  fill: var(--danger);
  opacity: 0.58;
}

@keyframes heartbeat-line {
  0% {
    stroke-dashoffset: 156;
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  62% {
    stroke-dashoffset: 0;
    opacity: 1;
  }

  78%,
  100% {
    stroke-dashoffset: 0;
    opacity: 0;
  }
}

@keyframes heartbeat-pulse {
  0%,
  18%,
  32%,
  48%,
  100% {
    transform: scale(1);
  }

  24% {
    transform: scale(1.14);
  }

  40% {
    transform: scale(1.09);
  }
}

@media (prefers-reduced-motion: reduce) {
  .heartbeat-line-active,
  .heartbeat-heart {
    animation: none;
  }
}

.dashboard-player-card.is-online .dashboard-status-pill {
  background: rgba(36, 132, 91, 0.1);
  color: var(--success);
}

.dashboard-player-card.is-offline .dashboard-status-pill {
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
}

.dashboard-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-actions .button {
  gap: 7px;
  justify-content: center;
  min-height: 36px;
  font-weight: 560;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

td {
  font-size: 14px;
}

.table-title-link {
  color: var(--text);
  text-decoration: none;
}

.table-title-link:hover,
.table-title-link:focus-visible {
  color: var(--primary-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.table-title-button,
.table-preview-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.table-title-button {
  color: var(--text);
  font-weight: 600;
}

.table-title-button:hover,
.table-title-button:focus-visible {
  color: var(--primary-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.table-preview-button {
  display: inline-block;
  border-radius: 7px;
}

.table-preview-button:hover .webpage-snapshot-thumb,
.table-preview-button:focus-visible .webpage-snapshot-thumb {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(251, 214, 68, 0.22);
}

.url-cell {
  max-width: 360px;
  overflow-wrap: anywhere;
  color: var(--muted);
}

.webpage-snapshot-thumb {
  position: relative;
  width: 150px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f4f7f8;
  box-shadow: 0 6px 16px rgba(24, 33, 43, 0.08);
}

.webpage-snapshot-thumb img,
.playlist-web-snapshot-preview img,
.status-web-snapshot {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.webpage-snapshot-thumb.is-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.table-actions {
  text-align: right;
  white-space: nowrap;
}

.table-actions > * {
  display: inline-flex;
  margin-left: 8px;
  vertical-align: middle;
}

.table-actions > *:first-child {
  margin-left: 0;
}

.availability-switch {
  display: inline-grid;
  grid-template-columns: 42px auto;
  gap: 10px;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.availability-switch-track {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #cbd5e1;
  box-shadow: inset 0 0 0 1px rgba(100, 116, 139, 0.26);
  transition: background 160ms ease, box-shadow 160ms ease;
}

.availability-switch-track::after {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.22);
  content: "";
  transition: transform 160ms ease;
}

.availability-switch.is-on .availability-switch-track {
  background: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(7, 25, 39, 0.22);
}

.availability-switch.is-on .availability-switch-track::after {
  transform: translateX(18px);
}

.availability-switch.is-off .availability-switch-label {
  color: var(--muted);
}

.availability-switch:hover .availability-switch-label,
.availability-switch:focus-visible .availability-switch-label {
  text-decoration: underline;
}

.playlist-order-panel {
  overflow: hidden;
}

.playlist-order-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.playlist-order-header h2 {
  margin-bottom: 6px;
}

.playlist-save-status {
  min-height: 32px;
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 620;
  white-space: nowrap;
}

.playlist-save-status:empty {
  display: none;
}

.playlist-save-status[data-tone="success"] {
  background: #edf8f3;
  color: var(--success);
}

.playlist-save-status[data-tone="error"] {
  background: #fff4f4;
  color: var(--danger);
}

.playlist-table tbody tr {
  transition:
    background 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.playlist-row.is-dragging {
  opacity: 0.52;
  background: #f2f5f7;
  box-shadow: inset 3px 0 0 var(--primary);
}

.playlist-title-cell {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 280px;
}

.playlist-title-cell strong,
.playlist-title-cell span {
  display: block;
}

.playlist-title-cell > div:last-child span {
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.playlist-preview {
  position: relative;
  width: 132px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid #cfd9dd;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 5px 14px rgba(24, 33, 43, 0.08);
  cursor: grab;
  user-select: none;
}

.playlist-preview-link {
  display: block;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  appearance: none;
}

.playlist-preview:hover,
.playlist-preview:focus-visible {
  border-color: var(--focus);
  outline: 3px solid rgba(247, 198, 0, 0.22);
  outline-offset: 1px;
}

.slide-mini-preview {
  background-image: url("../../theme/tema.png?v=theme-2k-sharp");
  background-position: center;
  background-size: cover;
}

.slide-mini-preview[data-background="image"] {
  background: #ffffff var(--slide-bg-image) center / cover no-repeat;
}

.slide-mini-object {
  position: absolute;
  overflow: hidden;
}

.slide-mini-text {
  display: block;
  padding: 1px 2px;
  font-family: Arial, Helvetica, sans-serif;
  white-space: pre-wrap;
  line-height: 1.05;
}

.slide-mini-image {
  display: grid;
  place-items: center;
}

.slide-mini-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.playlist-web-preview {
  display: block;
  padding: 0;
  background: #ffffff;
}

.playlist-web-snapshot-preview {
  background: #ffffff;
}

.playlist-web-snapshot-preview span {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 2;
  padding: 4px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 760;
}

.playlist-web-preview span {
  position: absolute;
  left: 8px;
  bottom: 22px;
  z-index: 2;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.06em;
}

.playlist-web-preview strong {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 7px;
  z-index: 2;
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playlist-web-preview small {
  display: none;
}

.drag-order-inner {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-width: 76px;
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fbfb;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: grab;
  user-select: none;
}

.drag-handle:hover,
.drag-handle:focus-visible {
  border-color: var(--focus);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.drag-handle:active {
  cursor: grabbing;
}

.playlist-order-panel.is-saving .drag-handle {
  opacity: 0.5;
  pointer-events: none;
}

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  font: inherit;
  font-size: 14px;
  font-weight: 620;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: var(--primary);
  color: #ffffff;
}

.button.primary:hover {
  background: var(--primary-dark);
}

.button.secondary {
  border-color: var(--border);
  background: #ffffff;
  color: var(--text);
}

.button.secondary:hover {
  border-color: #c9d6da;
  background: #f8fbfb;
}

.button.danger {
  background: #fff4f4;
  color: var(--danger);
  border-color: #edc7ca;
}

.button.publish {
  z-index: 0;
  border-color: #e5bf28;
  background: var(--accent);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(154, 106, 24, 0.18);
}

.button.publish:hover {
  background: #f4cb27;
}

.topbar-publish-form .button.publish:not([hidden]):not(:disabled) {
  min-width: 92px;
  border-color: #d8ae12;
  overflow: visible;
}

.topbar-publish-form .button.publish:not([hidden]):not(:disabled)::after {
  position: absolute;
  inset: -5px;
  z-index: -1;
  border: 2px solid rgba(247, 198, 0, 0.78);
  border-radius: 9px;
  background: rgba(251, 214, 68, 0.18);
  content: "";
  animation: publish-pulse 1200ms ease-out infinite;
  pointer-events: none;
}

@keyframes publish-pulse {
  0% {
    opacity: 0.95;
    transform: scale(1);
  }

  70% {
    opacity: 0;
    transform: scale(1.22);
  }

  100% {
    opacity: 0;
    transform: scale(1.22);
  }
}

.button.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.button.icon {
  width: 34px;
  padding: 0;
  font-size: 18px;
}

.button:disabled {
  opacity: 0.62;
  cursor: progress;
}

.form-grid {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fcfdfd;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 400;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--primary);
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus,
.button:focus-visible {
  outline: 3px solid rgba(247, 198, 0, 0.26);
  outline-offset: 1px;
}

.two-column,
.settings-grid,
.form-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.settings-page {
  display: grid;
  grid-template-columns: minmax(540px, 1fr) minmax(360px, 460px);
  align-items: start;
  gap: 20px;
}

.settings-main-column,
.settings-side-column {
  display: grid;
  gap: 18px;
}

.settings-card {
  display: grid;
  gap: 14px;
  padding: 0;
  overflow: hidden;
}

.settings-card-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff, #f8fbfb);
}

.settings-card-header h2 {
  margin: 0 0 5px;
}

.settings-card-header p {
  max-width: 54ch;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.settings-section {
  display: grid;
  gap: 12px;
  padding: 0 20px 16px;
}

.settings-section + .settings-section {
  padding-top: 2px;
  border-top: 1px solid #eef3f4;
}

.settings-section h3 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 680;
}

.settings-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

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

.settings-note {
  margin: -2px 22px 0;
  padding: 12px 14px;
  border: 1px solid #d9ebe7;
  border-radius: 7px;
  background: #f4fbf9;
  color: #315f59;
  font-size: 13px;
  line-height: 1.45;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 20px 18px;
}

.settings-card-password {
  gap: 16px;
}

.settings-card-password > label {
  padding: 0 20px;
  max-width: 420px;
}

.settings-card-token > label {
  padding: 0 20px;
}

.settings-card-password input {
  max-width: 420px;
}

.settings-card-password .form-actions {
  padding-top: 2px;
}

.settings-card-reload {
  gap: 0;
}

.settings-reload-status {
  padding: 8px 20px 0;
}

.settings-reload-status div {
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 9px 0;
}

.settings-reload-status div:first-child {
  padding-top: 0;
}

.settings-reload-status dd {
  line-height: 1.45;
}

.settings-card-reload .form-actions {
  padding-top: 10px;
}

.settings-card-publication .settings-section,
.settings-card-archive .settings-section,
.settings-card-migrations .settings-section {
  padding-top: 0;
}

.settings-card-publication,
.settings-card-archive,
.settings-card-migrations {
  gap: 8px;
}

.settings-card-publication .button,
.settings-card-archive .button,
.settings-card-migrations .button {
  width: auto;
  min-width: 170px;
  justify-self: start;
}

.settings-card-publication .settings-card-header,
.settings-card-archive .settings-card-header,
.settings-card-migrations .settings-card-header {
  padding-bottom: 12px;
}

.settings-card-publication .settings-section,
.settings-card-archive .settings-section,
.settings-card-migrations .settings-section {
  padding-bottom: 14px;
}

.settings-card-player .form-actions {
  padding-top: 2px;
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.check-row input {
  width: 18px;
  min-height: 18px;
}

.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.inline-form input {
  width: 94px;
  min-height: 32px;
}

.playlist-duration-form {
  align-items: center;
  flex-wrap: wrap;
  max-width: 260px;
}

.playlist-duration-control {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  overflow: hidden;
}

.playlist-duration-control input {
  width: 84px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.playlist-duration-unit {
  padding: 0 10px;
  border-left: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.message {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid;
  overflow: hidden;
  transition:
    opacity 320ms ease,
    transform 320ms ease,
    max-height 320ms ease,
    margin 320ms ease,
    padding 320ms ease,
    border-width 320ms ease;
}

.message p {
  margin: 0;
}

.message + .message {
  margin-top: -8px;
}

.message.success {
  border-color: #b9e1d2;
  background: #eef8f4;
  color: #1f6b4d;
}

.message.error {
  border-color: #efc2c6;
  background: #fff4f5;
  color: #96323a;
}

.message.warning {
  border-color: #e8d18d;
  background: #fff9e8;
  color: #785411;
}

.message.is-fading {
  max-height: 0 !important;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}

.toast-message {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1000;
  width: min(340px, calc(100vw - 44px));
  margin: 0;
  padding: 14px 16px;
  border-radius: 8px;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.18);
  transform: translate(-50%, 0);
  pointer-events: none;
  will-change: opacity, transform;
  animation: toast-in 240ms cubic-bezier(0.16, 1, 0.3, 1) both;
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

.toast-message.is-fading {
  max-height: none !important;
  margin: 0;
  padding: 14px 16px;
  border-width: 1px;
  opacity: 0;
  transform: translate(-50%, 14px) scale(0.98);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 14px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.status,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 620;
}

.status.active {
  background: #e8f6ef;
  color: var(--success);
}

.status.inactive {
  background: #eceff3;
  color: var(--muted);
}

.status.warning {
  background: #fff3c4;
  color: var(--warning);
}

.badge {
  background: var(--accent-soft);
  color: var(--primary);
}

.compact-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
}

.compact-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.hint {
  padding: 12px;
  border-radius: 8px;
  background: #f7f9fb;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.admin-modal {
  width: min(760px, calc(100vw - 32px));
  max-height: min(860px, calc(100vh - 32px));
  padding: 20px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 72px rgba(15, 23, 42, 0.22);
}

.admin-modal::backdrop {
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(2px);
}

.admin-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.admin-modal-header h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.tv-preview-modal {
  width: min(1180px, calc(100vw - 32px));
}

.tv-preview-modal .admin-modal-header {
  margin-bottom: 12px;
}

[data-tv-preview-status].is-warning {
  color: #9a5b00;
}

.tv-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tv-preview-meta:empty {
  display: none;
}

.tv-preview-meta-item {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f7f9fb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.tv-preview-shell {
  display: grid;
  align-items: center;
  justify-items: center;
  min-height: 280px;
  max-height: calc(100vh - 270px);
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(15, 23, 42, 0.05) 1px, transparent 1px),
    #e8eef0;
  background-size: 24px 24px;
}

.tv-preview-viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid #0f172a;
  border-radius: 4px;
  background: #020617;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.22);
}

.tv-preview-viewport.is-stale {
  outline: 2px dashed rgba(154, 91, 0, 0.45);
  outline-offset: 4px;
}

.tv-preview-stage {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  transform-origin: 0 0;
  background: var(--slide-bg, #ffffff);
}

.tv-preview-stage[data-background="brand"] {
  background: #ffffff url("../../theme/tema.png?v=theme-2k-sharp") center / cover no-repeat;
}

.tv-preview-stage[data-background="image"] {
  background: var(--slide-bg, #ffffff) var(--slide-bg-image) center / cover no-repeat;
}

.tv-preview-object {
  position: absolute;
  min-width: 1px;
  min-height: 1px;
  overflow: hidden;
}

.tv-preview-object-image img {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.tv-preview-text {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0.04em 0.18em 0.14em;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.08;
  white-space: pre-wrap;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.tv-preview-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0.16em 0.28em;
  border-radius: 5px;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  width: min(440px, calc(100vw - 32px));
  max-width: none;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}

.confirm-modal::backdrop {
  background: rgba(7, 25, 39, 0.38);
  backdrop-filter: blur(2px);
}

.confirm-modal-card {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 72px rgba(7, 25, 39, 0.24);
}

.confirm-modal-card h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: 0;
}

.confirm-modal-message {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.publication-modal,
.archive-modal,
.migrations-modal {
  width: min(980px, calc(100vw - 32px));
}

.publish-modal-body {
  display: grid;
  gap: 18px;
}

.publish-summary {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfd;
}

.publish-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.publish-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.publish-history h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.archive-modal-section {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.archive-modal-section h3,
.migrations-modal-body h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.archive-modal-section table {
  min-width: 620px;
}

.migrations-modal-body {
  display: grid;
  gap: 14px;
}

.table-scroll {
  overflow-x: auto;
}

@media (prefers-reduced-motion: reduce) {
  .topbar-publish-form .button.publish:not([hidden]):not(:disabled)::after {
    animation: none;
  }
}

.webpage-modal .form-grid {
  gap: 14px;
}

.webpage-test {
  min-height: 72px;
  padding: 12px;
  border: 1px dashed #c7d4d8;
  border-radius: 8px;
  background: #f8fbfb;
  color: var(--muted);
  font-size: 14px;
}

.webpage-test p {
  margin: 0;
}

.webpage-test-status {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.webpage-test-status.is-ok {
  color: var(--success);
}

.webpage-test-status.is-warning {
  color: var(--warning);
}

.webpage-test-frame {
  display: block;
  width: 100%;
  height: 280px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
}

.logo-paste {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 96px;
  padding: 12px;
  border: 1px solid #d4e2e5;
  border-radius: 7px;
  background: linear-gradient(180deg, #fbfdfd, #f5f9f9);
  cursor: text;
}

.logo-paste:focus {
  outline: 3px solid rgba(247, 198, 0, 0.26);
  outline-offset: 1px;
  border-color: var(--focus);
}

.logo-paste-preview {
  display: grid;
  place-items: center;
  width: 88px;
  height: 68px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  overflow: hidden;
}

.logo-paste-preview img {
  display: block;
  max-width: 78px;
  max-height: 60px;
  object-fit: contain;
}

.logo-paste strong,
.logo-paste span,
.logo-paste small {
  display: block;
}

.logo-paste strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 620;
}

.logo-paste span,
.logo-paste small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.logo-paste small:not(:empty) {
  margin-top: 4px;
  color: var(--primary-dark);
}

.slide-preview {
  display: grid;
  align-content: center;
  min-height: 360px;
  padding: 34px;
}

.slide-preview p {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 620;
  text-transform: uppercase;
}

.slide-preview strong {
  display: block;
  font-size: 34px;
  font-weight: 620;
  line-height: 1.12;
}

.designer-shell {
  display: grid;
  grid-template-columns: minmax(280px, 15vw) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.deck-editor-shell {
  grid-template-columns: 176px minmax(260px, 14vw) minmax(0, 1fr);
}

.deck-page-strip {
  position: sticky;
  top: 84px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  height: calc(100vh - 118px);
  max-height: calc(100vh - 118px);
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(24, 33, 43, 0.05);
  overflow: hidden;
  overscroll-behavior: contain;
}

.deck-page-strip-header {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
}

.deck-page-strip-header h2 {
  margin: 0 0 2px;
  font-size: 17px;
  font-weight: 650;
}

.deck-page-strip-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 560;
}

.deck-page-list,
.deck-page-empty {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.deck-page-thumb {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fbfb;
  color: var(--text);
  text-decoration: none;
  cursor: grab;
  user-select: none;
}

.deck-page-thumb:hover,
.deck-page-thumb:focus-visible {
  border-color: var(--focus);
  outline: 3px solid rgba(247, 198, 0, 0.22);
  outline-offset: 1px;
}

.deck-page-thumb.is-selected {
  border-color: var(--primary);
  background: #f2f5f7;
  box-shadow: inset 3px 0 0 var(--primary);
}

.deck-page-thumb.is-hidden {
  background: #eef1f3;
  opacity: 0.78;
}

.deck-page-thumb.is-hidden .deck-page-preview {
  filter: grayscale(1);
}

.deck-page-thumb.is-hidden .deck-page-preview::after {
  content: "Ej aktiv";
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 4;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(189, 63, 72, 0.94);
  color: #ffffff;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
  pointer-events: none;
}

.deck-page-thumb.is-hidden .deck-page-title {
  color: var(--muted);
}

.deck-page-thumb.is-dragging {
  opacity: 0.45;
}

.deck-page-number {
  position: absolute;
  top: 7px;
  left: 7px;
  z-index: 1;
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 5px rgba(24, 33, 43, 0.12);
}

.deck-page-preview {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid #cfd9dd;
  border-radius: 6px;
  box-shadow: 0 5px 14px rgba(24, 33, 43, 0.08);
}

.deck-page-title {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deck-page-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.deck-page-save-status {
  justify-self: start;
  min-height: 28px;
  padding: 6px 9px;
  white-space: normal;
}

.deck-page-list,
.deck-editor-shell .designer-sidebar,
.deck-editor-shell .designer-main,
.deck-editor-shell .designer-canvas-wrap,
.deck-editor-shell .designer-properties,
.media-viewer-frame {
  scrollbar-color: rgba(7, 25, 39, 0.34) rgba(232, 235, 238, 0.78);
  scrollbar-width: thin;
}

.deck-page-list::-webkit-scrollbar,
.deck-editor-shell .designer-sidebar::-webkit-scrollbar,
.deck-editor-shell .designer-main::-webkit-scrollbar,
.deck-editor-shell .designer-canvas-wrap::-webkit-scrollbar,
.deck-editor-shell .designer-properties::-webkit-scrollbar,
.media-viewer-frame::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.deck-page-list::-webkit-scrollbar-track,
.deck-editor-shell .designer-sidebar::-webkit-scrollbar-track,
.deck-editor-shell .designer-main::-webkit-scrollbar-track,
.deck-editor-shell .designer-canvas-wrap::-webkit-scrollbar-track,
.deck-editor-shell .designer-properties::-webkit-scrollbar-track,
.media-viewer-frame::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(232, 240, 242, 0.72);
}

.deck-page-list::-webkit-scrollbar-thumb,
.deck-editor-shell .designer-sidebar::-webkit-scrollbar-thumb,
.deck-editor-shell .designer-main::-webkit-scrollbar-thumb,
.deck-editor-shell .designer-canvas-wrap::-webkit-scrollbar-thumb,
.deck-editor-shell .designer-properties::-webkit-scrollbar-thumb,
.media-viewer-frame::-webkit-scrollbar-thumb {
  border: 2px solid rgba(232, 240, 242, 0.72);
  border-radius: 999px;
  background: rgba(7, 25, 39, 0.34);
}

.deck-page-list::-webkit-scrollbar-thumb:hover,
.deck-editor-shell .designer-sidebar::-webkit-scrollbar-thumb:hover,
.deck-editor-shell .designer-main::-webkit-scrollbar-thumb:hover,
.deck-editor-shell .designer-canvas-wrap::-webkit-scrollbar-thumb:hover,
.deck-editor-shell .designer-properties::-webkit-scrollbar-thumb:hover,
.media-viewer-frame::-webkit-scrollbar-thumb:hover {
  background: rgba(7, 25, 39, 0.52);
}

.page-context-menu {
  position: fixed;
  z-index: 50;
  display: grid;
  min-width: 150px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 42px rgba(24, 33, 43, 0.18);
}

.publish-context-menu {
  position: fixed;
  z-index: 1200;
  display: grid;
  min-width: 228px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 46px rgba(24, 33, 43, 0.2);
}

.publish-context-menu button {
  min-height: 38px;
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 620;
  text-align: left;
  cursor: pointer;
}

.publish-context-menu button:hover,
.publish-context-menu button:focus-visible {
  background: #fff6cf;
  color: var(--primary-dark);
  outline: 0;
}

.page-context-menu[hidden] {
  display: none;
}

.page-context-menu button {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 560;
  text-align: left;
  cursor: pointer;
}

.page-context-menu button:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.designer-context-menu {
  position: fixed;
  z-index: 100;
  display: grid;
  min-width: 168px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 46px rgba(24, 33, 43, 0.22);
}

.designer-context-menu[hidden],
.designer-context-menu [hidden] {
  display: none;
}

.designer-context-menu div {
  display: grid;
  gap: 2px;
}

.designer-context-menu button {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 560;
  text-align: left;
  cursor: pointer;
}

.designer-context-menu button:hover,
.designer-context-menu button:focus-visible {
  background: var(--primary-soft);
  color: var(--primary-dark);
  outline: 0;
}

.designer-context-menu button:disabled {
  color: #aab3bd;
  cursor: not-allowed;
}

.designer-context-menu button:disabled:hover {
  background: transparent;
}

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

.designer-context-menu button.danger:hover,
.designer-context-menu button.danger:focus-visible {
  background: rgba(189, 63, 72, 0.1);
  color: var(--danger);
}

.designer-context-menu hr {
  width: 100%;
  margin: 5px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.inline-text-toolbar {
  position: fixed;
  z-index: 130;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  align-content: center;
  box-sizing: border-box;
  max-width: calc(100vw - 16px);
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(24, 33, 43, 0.18);
}

.inline-text-toolbar[hidden] {
  display: none;
}

.inline-text-toolbar button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}

.inline-text-toolbar.is-dragging {
  user-select: none;
}

.inline-text-toolbar .inline-toolbar-drag-handle {
  width: 26px;
  cursor: grab;
  touch-action: none;
}

.inline-text-toolbar.is-dragging .inline-toolbar-drag-handle {
  cursor: grabbing;
}

.inline-toolbar-grip {
  display: grid;
  grid-template-columns: repeat(2, 3px);
  gap: 3px 4px;
}

.inline-toolbar-grip i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
}

.inline-text-toolbar button:hover,
.inline-text-toolbar button:focus-visible,
.inline-text-toolbar button.is-active {
  border-color: var(--focus);
  background: var(--primary-soft);
  color: var(--primary-dark);
  outline: 0;
}

.inline-text-size-combo {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  min-height: 32px;
}

.inline-text-size {
  width: 48px;
  min-height: 32px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-right: 0;
  border-radius: 6px 0 0 6px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.inline-text-toolbar .inline-text-size-toggle {
  width: 24px;
  height: 32px;
  border-color: var(--border);
  border-radius: 0 6px 6px 0;
  background: #ffffff;
}

.inline-text-toolbar .inline-text-size-toggle:hover,
.inline-text-toolbar .inline-text-size-toggle:focus-visible,
.inline-text-toolbar .inline-text-size-toggle[aria-expanded="true"] {
  border-color: var(--focus);
  background: var(--primary-soft);
}

.inline-text-size-toggle span {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
}

.inline-size-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 2;
  display: grid;
  min-width: 72px;
  max-height: min(360px, calc(100vh - 24px));
  overflow-y: auto;
  padding: 4px 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(24, 33, 43, 0.2);
}

.inline-size-menu[hidden] {
  display: none;
}

.inline-text-toolbar .inline-size-menu button {
  display: block;
  width: 100%;
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  color: var(--text);
  font-size: 13px;
  text-align: left;
}

.inline-text-toolbar .inline-size-menu button:hover,
.inline-text-toolbar .inline-size-menu button:focus-visible,
.inline-text-toolbar .inline-size-menu button.is-active,
.inline-text-toolbar .inline-size-menu button.is-preview {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.inline-text-font,
.inline-text-line-height {
  min-height: 32px;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.inline-text-font {
  width: 132px;
}

.inline-text-line-height {
  width: 112px;
}

.inline-color-button[aria-expanded="true"] {
  border-color: var(--focus);
  background: var(--primary-soft);
}

.inline-color-swatch,
.inline-highlight-swatch {
  display: block;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(24, 33, 43, 0.28);
  border-radius: 4px;
  background: #000000;
}

.inline-highlight-swatch.is-empty {
  background:
    linear-gradient(135deg, transparent 43%, #bd3f48 43%, #bd3f48 57%, transparent 57%),
    #ffffff;
}

.inline-color-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 24px);
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(24, 33, 43, 0.18);
  transform: translateX(-50%);
}

.inline-color-menu[hidden] {
  display: none;
}

.inline-text-toolbar .inline-color-menu button,
.inline-text-toolbar .inline-color-menu .inline-custom-color-control {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(24, 33, 43, 0.18);
  border-radius: 6px;
  background: var(--swatch);
}

.inline-text-toolbar .inline-color-menu button:hover,
.inline-text-toolbar .inline-color-menu button:focus-visible,
.inline-text-toolbar .inline-color-menu .inline-custom-color-control:hover,
.inline-text-toolbar .inline-color-menu .inline-custom-color-control:focus-within {
  border-color: var(--focus);
  background: var(--swatch);
  box-shadow: 0 0 0 2px rgba(247, 198, 0, 0.22);
}

.inline-text-toolbar .inline-color-menu .inline-custom-color-control {
  position: relative;
  display: block;
  overflow: hidden;
  cursor: pointer;
}

.inline-text-toolbar .inline-color-menu .inline-custom-color-control input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.inline-text-toolbar .inline-color-menu .inline-custom-color-control span::before,
.inline-text-toolbar .inline-color-menu .inline-custom-color-control span::after {
  position: absolute;
  right: 4px;
  bottom: 8px;
  width: 9px;
  height: 2px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(24, 33, 43, 0.35);
  content: "";
}

.inline-text-toolbar .inline-color-menu .inline-custom-color-control span::after {
  transform: rotate(90deg);
}

.inline-text-toolbar .inline-color-menu .inline-custom-color-control::after {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 11px;
  height: 11px;
  border: 1px solid #ffffff;
  border-radius: 50%;
  background: conic-gradient(#ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
  box-shadow: 0 1px 2px rgba(24, 33, 43, 0.32);
  content: "";
  pointer-events: none;
}

.inline-text-toolbar .inline-color-menu button.is-clear,
.inline-text-toolbar .inline-color-menu button.is-clear:hover,
.inline-text-toolbar .inline-color-menu button.is-clear:focus-visible {
  background:
    linear-gradient(135deg, transparent 43%, #bd3f48 43%, #bd3f48 57%, transparent 57%),
    #ffffff;
}

.inline-toolbar-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
}

.inline-underline {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.inline-strike {
  text-decoration: line-through;
}

.inline-list-icon {
  font-size: 14px;
  font-weight: 750;
  line-height: 1;
}

.inline-align-icon {
  display: grid;
  gap: 3px;
  width: 18px;
}

.inline-align-icon i {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.inline-align-left i:nth-child(1),
.inline-align-right i:nth-child(1) {
  width: 18px;
}

.inline-align-left i:nth-child(2),
.inline-align-right i:nth-child(2) {
  width: 13px;
}

.inline-align-left i:nth-child(3),
.inline-align-right i:nth-child(3) {
  width: 16px;
}

.inline-align-center {
  justify-items: center;
}

.inline-align-center i:nth-child(1) {
  width: 18px;
}

.inline-align-center i:nth-child(2) {
  width: 12px;
}

.inline-align-center i:nth-child(3) {
  width: 15px;
}

.inline-align-right {
  justify-items: end;
}

.deck-page-section-title {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #f8fbfb;
}

.deck-page-section-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 620;
  text-transform: uppercase;
}

.deck-page-section-title strong {
  overflow-wrap: anywhere;
  font-size: 15px;
  font-weight: 650;
}

.autosave-row {
  display: grid;
  gap: 8px;
}

.autosave-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 620;
}

.autosave-status[data-tone="saving"],
.autosave-status[data-tone="pending"] {
  color: var(--warning);
}

.autosave-status[data-tone="saved"] {
  color: var(--success);
}

.autosave-status[data-tone="error"] {
  color: var(--danger);
}

.designer-sidebar,
.designer-main,
.designer-properties {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(24, 33, 43, 0.05);
}

.designer-sidebar {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
}

.designer-sidebar h2,
.designer-properties h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
}

.designer-main {
  min-width: 0;
  overflow: hidden;
}

.designer-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  min-height: 54px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
  background: #fbfcfc;
  overflow: visible;
}

.designer-toolbar .button.small {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.designer-toolbar .designer-history-button {
  width: 44px;
  min-height: 36px;
  padding: 0;
  border-color: #c7d4da;
  color: #17877e;
  line-height: 1;
}

.history-arrow {
  position: relative;
  display: block;
  width: 20px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
}

.history-arrow::before {
  content: "";
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border: solid currentColor;
  border-width: 3px 3px 0 0;
}

.history-arrow-left::before {
  left: -1px;
  transform: translateY(-50%) rotate(-135deg);
}

.history-arrow-right::before {
  right: -1px;
  transform: translateY(-50%) rotate(45deg);
}

.designer-toolbar .designer-history-button:hover,
.designer-toolbar .designer-history-button:focus-visible {
  border-color: var(--focus);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.toolbar-template-group {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.designer-status {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 520;
  white-space: nowrap;
}

.designer-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 16vw);
  gap: 0;
  min-height: calc(100vh - 245px);
}

.designer-canvas-wrap {
  display: grid;
  align-content: center;
  justify-items: center;
  min-width: 0;
  padding: 18px;
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(15, 23, 42, 0.05) 1px, transparent 1px),
    #e8eef0;
  background-size: 24px 24px;
}

.designer-canvas {
  position: relative;
  width: min(100%, calc((100vh - 310px) * var(--canvas-aspect, 16 / 9)));
  min-width: min(100%, 980px);
  aspect-ratio: var(--canvas-aspect, 16 / 9);
  overflow: hidden;
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 4px;
  background: var(--slide-bg, #ffffff);
  box-shadow: 0 12px 28px rgba(24, 33, 43, 0.1);
}

.designer-canvas:focus {
  outline: none;
}

.designer-canvas:focus-visible {
  box-shadow:
    0 12px 28px rgba(24, 33, 43, 0.1),
    0 0 0 2px rgba(247, 198, 0, 0.2);
}

.designer-canvas[data-background="brand"] {
  background: #ffffff url("../../theme/tema.png?v=theme-2k-sharp") center / cover no-repeat;
}

.designer-canvas[data-background="image"] {
  background: var(--slide-bg, #ffffff) var(--slide-bg-image) center / cover no-repeat;
}

.designer-object {
  position: absolute;
  min-width: 18px;
  min-height: 18px;
  outline: 1px solid transparent;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.designer-object.is-selected {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.designer-object:active {
  cursor: grabbing;
}

body.is-dragging-designer-object,
body.is-dragging-designer-object * {
  cursor: grabbing !important;
  user-select: none !important;
}

.designer-object.is-editing {
  cursor: text;
  user-select: text;
  touch-action: auto;
}

.designer-object-text {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0.04em 0.18em 0.14em;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.08;
  white-space: pre-wrap;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.designer-object-text.is-editing,
.designer-object-logo.is-editing {
  cursor: text;
  user-select: text;
}

.designer-object-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0.16em 0.28em;
  border-radius: 5px;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.designer-object-text .infotv-richtext-prosemirror,
.designer-object-logo .infotv-richtext-prosemirror {
  width: 100%;
  min-height: 100%;
  outline: none;
  caret-color: currentColor;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.designer-object-text .infotv-richtext-prosemirror p,
.designer-object-logo .infotv-richtext-prosemirror p {
  margin: 0;
}

.designer-object-text.has-text-highlight,
.designer-object-logo.has-text-highlight,
.slide-mini-text.has-text-highlight,
.tv-preview-text.has-text-highlight,
.tv-preview-logo.has-text-highlight {
  background-image: linear-gradient(
    to bottom,
    transparent 9%,
    var(--text-highlight-color) 9%,
    var(--text-highlight-color) 84%,
    transparent 84%
  );
  background-position: 0 0.08em;
  background-repeat: repeat-y;
  background-size: 100% 1.08em;
}

.designer-object-text ul,
.designer-object-text ol,
.designer-object-logo ul,
.designer-object-logo ol,
.tv-preview-text ul,
.tv-preview-text ol,
.tv-preview-logo ul,
.tv-preview-logo ol {
  margin: 0.08em 0 0.08em 1.15em;
  padding: 0 0 0 0.7em;
}

.designer-object-text li,
.designer-object-logo li,
.tv-preview-text li,
.tv-preview-logo li {
  margin: 0.02em 0;
  padding-left: 0.08em;
}

.slide-mini-text ul,
.slide-mini-text ol {
  margin: 0 0 0 1em;
  padding: 0 0 0 0.45em;
}

.slide-mini-text li {
  margin: 0;
  padding-left: 0.05em;
}

.designer-object-image img {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.designer-resize-handle {
  position: absolute;
  z-index: 5;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.28);
  cursor: nwse-resize;
}

.designer-resize-handle:focus-visible {
  outline: 3px solid rgba(247, 198, 0, 0.72);
  outline-offset: 2px;
}

.designer-object.is-editing .designer-resize-handle,
.designer-object.is-selected .designer-resize-handle {
  display: block;
}

.handle-nw {
  top: -11px;
  left: -11px;
  cursor: nwse-resize;
}

.handle-n {
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  cursor: ns-resize;
}

.handle-ne {
  top: -11px;
  right: -11px;
  cursor: nesw-resize;
}

.handle-e {
  top: 50%;
  right: -11px;
  transform: translateY(-50%);
  cursor: ew-resize;
}

.handle-s {
  left: 50%;
  bottom: -11px;
  transform: translateX(-50%);
  cursor: ns-resize;
}

.handle-sw {
  left: -11px;
  bottom: -11px;
  cursor: nesw-resize;
}

.handle-se {
  right: -11px;
  bottom: -11px;
  cursor: nwse-resize;
}

.handle-w {
  top: 50%;
  left: -11px;
  transform: translateY(-50%);
  cursor: ew-resize;
}

.designer-object:not(.is-selected) .designer-resize-handle {
  display: none;
}

.designer-object.is-selected .designer-resize-handle,
.designer-object.is-editing .designer-resize-handle {
  display: block;
}

.toolbar-select {
  width: 172px;
  min-height: 32px;
  padding: 4px 9px;
  font-size: 13px;
}

.toolbar-check {
  display: inline-flex;
  grid-template-columns: none;
  gap: 6px;
  align-items: center;
  min-height: 32px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.toolbar-check input {
  width: 16px;
  min-height: 16px;
}

.media-picker {
  display: grid;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.background-picker-card,
.standard-background-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafb;
}

.background-picker-heading span,
.background-picker-heading strong,
.standard-background-card span,
.standard-background-card strong {
  display: block;
}

.background-picker-heading span,
.standard-background-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.background-picker-heading strong,
.standard-background-card strong {
  font-size: 15px;
  font-weight: 650;
}

.background-picker-card img,
.standard-background-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  object-fit: cover;
}

.background-picker-select-label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.background-picker-select-label select {
  min-height: 38px;
  font-size: 14px;
}

.background-upload-status {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.background-upload-status[data-tone="saving"] {
  color: #755b00;
}

.background-upload-status[data-tone="saved"] {
  color: #007a4d;
}

.background-upload-status[data-tone="error"] {
  color: var(--danger);
}

.media-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.media-picker-item {
  aspect-ratio: 1;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  cursor: pointer;
}

.media-picker-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.designer-properties {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
  box-shadow: none;
}

@media (min-width: 901px) {
  .deck-editor-shell {
    height: calc(100vh - 160px);
    min-height: 620px;
    align-items: stretch;
  }

  .deck-editor-shell .deck-page-strip {
    position: static;
    height: 100%;
    max-height: none;
  }

  .deck-editor-shell .designer-sidebar,
  .deck-editor-shell .designer-main {
    max-height: 100%;
    overflow: auto;
  }

  .deck-editor-shell .designer-main {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .deck-editor-shell .designer-toolbar {
    position: sticky;
    top: 0;
    z-index: 5;
  }

  .deck-editor-shell .designer-workspace {
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }

  .deck-editor-shell .designer-canvas-wrap,
  .deck-editor-shell .designer-properties {
    min-height: 0;
    overflow: auto;
  }

  .deck-editor-shell .designer-canvas {
    width: min(100%, calc((100vh - 330px) * var(--canvas-aspect, 16 / 9)));
    min-width: 0;
  }
}

.layer-list {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.layer-items {
  display: grid;
  gap: 8px;
}

.layer-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafb;
}

.layer-item.is-selected {
  border-color: var(--primary);
  background: #f2f5f7;
}

.layer-item button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 620;
  text-align: left;
  cursor: pointer;
}

.property-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.playlist-page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: 22px;
  align-items: start;
}

.playlist-main,
.playlist-sidebar {
  min-width: 0;
}

.playlist-sidebar {
  display: grid;
  gap: 16px;
}

.playlist-sidebar .panel {
  margin-bottom: 0;
}

.playlist-compact-panel,
.playlist-side-panel,
.takeover-scheduler {
  padding: 16px 18px;
}

.playlist-compact-panel .playlist-order-header {
  margin-bottom: 14px;
}

.playlist-side-panel h2,
.takeover-scheduler h2 {
  margin-bottom: 8px;
}

.playlist-side-panel .form-grid,
.takeover-scheduler .takeover-form {
  gap: 12px;
}

.playlist-side-panel .button.primary,
.takeover-scheduler .button.primary[type="submit"] {
  width: 100%;
}

.quick-info-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.quick-info-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quick-info-list dt {
  color: var(--muted);
}

.quick-info-list dd {
  margin: 0;
  font-weight: 760;
}

.takeover-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
}

.takeover-form {
  display: grid;
  grid-template-columns: minmax(190px, 1.2fr) minmax(190px, 1.2fr) minmax(140px, 0.8fr) minmax(120px, 0.7fr) auto;
  gap: 10px;
  align-items: end;
}

.takeover-scheduler {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.takeover-scheduler .takeover-form {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.takeover-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.takeover-content-grid {
  display: grid;
  grid-template-columns: minmax(190px, 1.2fr) minmax(190px, 1.2fr) minmax(140px, 0.8fr) minmax(120px, 0.7fr);
  gap: 10px;
  align-items: end;
}

.playlist-sidebar .takeover-content-grid {
  grid-template-columns: 1fr;
}

.takeover-schedule-details .schedule-form {
  max-width: 760px;
}

.takeover-schedule-details:not([open]) {
  margin-bottom: 0;
}

.takeover-scheduler .form-actions {
  padding: 4px 0 0;
}

.takeover-scheduler .form-actions .button {
  margin-bottom: 0;
}

.schedule-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.schema-popover {
  position: relative;
  display: inline-block;
}

.schema-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.schema-trigger::before {
  content: "▸";
}

.schema-trigger[aria-expanded="true"] {
  border-color: var(--border);
  background: #f8fafb;
}

.schema-trigger[aria-expanded="true"]::before {
  content: "▾";
}

.schema-popover-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 80;
  width: min(460px, calc(100vw - 48px));
  margin-top: 0;
  box-shadow: 0 18px 42px rgba(7, 25, 39, 0.16);
}

.schema-popover-panel[hidden] {
  display: none;
}

.takeover-schema-popover,
.takeover-schema-popover .schema-trigger,
.takeover-schema-popover .schema-popover-panel {
  width: 100%;
}

.takeover-schema-popover .schema-trigger {
  justify-content: space-between;
  border-color: var(--border);
  background: #ffffff;
  color: var(--muted);
}

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

.takeover-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafb;
}

.takeover-row strong,
.takeover-row span {
  display: block;
}

.takeover-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: #e7f7ef;
  color: #167245;
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.schedule-details summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 620;
}

.schedule-form {
  display: grid;
  gap: 10px;
  min-width: 320px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafb;
}

.day-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.day-checks label {
  display: inline-flex;
  grid-template-columns: none;
  gap: 5px;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #ffffff;
  font-size: 12px;
}

.day-checks input {
  width: 14px;
  min-height: 14px;
}

.media-library-panel {
  max-width: 1180px;
}

.media-upload-panel {
  max-width: 1180px;
}

.media-dropzone {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 118px;
  padding: 18px;
  border: 2px dashed #b9c9d0;
  border-radius: 8px;
  background: #f8fbfb;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.media-dropzone.is-drag-over {
  border-color: var(--focus);
  background: #fff9d8;
  box-shadow: 0 0 0 4px rgba(247, 198, 0, 0.16);
}

.media-dropzone.is-uploading {
  opacity: 0.78;
}

.media-library-dropzone {
  margin-bottom: 14px;
}

.media-dropzone-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.media-dropzone-copy h2,
.media-dropzone-copy p {
  margin: 0;
}

.media-dropzone-copy h2 {
  font-size: 20px;
}

.media-dropzone-copy p,
.media-dropzone-copy span {
  color: var(--muted);
  font-size: 13px;
}

.media-dropzone-copy span[data-tone="saving"] {
  color: var(--primary-dark);
}

.media-dropzone-copy span[data-tone="warning"] {
  color: var(--warning);
}

.media-dropzone-copy span[data-tone="error"] {
  color: var(--danger);
}

.media-dropzone-copy span[data-tone="saved"] {
  color: var(--success);
}

.media-library-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.media-library-header h2 {
  margin: 0;
}

.media-library-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.media-library-header span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.background-library-panel {
  scroll-margin-top: 86px;
}

.background-upload-form {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(280px, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fbfb;
}

.background-upload-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.background-upload-form input {
  min-height: 38px;
}

.background-upload-dropzone {
  min-height: 92px;
  padding: 14px;
}

.background-upload-dropzone .media-dropzone-copy h2 {
  font-size: 18px;
}

.background-upload-form > .button {
  justify-content: center;
  min-height: 40px;
}

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

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

.media-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
}

.media-card.is-old-unused {
  border-color: #deb857;
  background: #fffdf5;
}

.media-thumb {
  display: grid;
  place-items: center;
  height: 84px;
  padding: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #f4f7f8;
  cursor: pointer;
  font: inherit;
  appearance: none;
}

.media-thumb img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.background-thumb {
  height: auto;
  aspect-ratio: 16 / 9;
}

.background-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.is-standard-background {
  background: #fbfcfd;
}

.background-standard-badge {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: #edf8f3;
  color: var(--success);
  font-size: 11px;
  font-weight: 800;
}

.media-meta {
  min-width: 0;
}

.background-name-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: end;
  margin-bottom: 6px;
}

.background-name-form label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.background-name-form input {
  min-height: 34px;
  font-size: 13px;
}

.media-card strong,
.media-card span,
.media-card code {
  display: block;
  overflow: hidden;
  max-width: 100%;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.media-card strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
}

.media-card span,
.media-card code {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.media-card .media-old-unused-warning {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin-top: 4px;
  padding: 4px 7px;
  border: 1px solid #e2bf62;
  border-radius: 999px;
  background: #fff5cf;
  color: #77500c;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
}

.media-old-unused-warning span {
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #9a6a18;
  color: #ffffff;
  font-size: 10px;
  line-height: 1;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.media-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.media-usage {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-usage.is-used {
  color: var(--warning);
}

.media-card-actions form {
  flex: 0 0 auto;
}

.media-viewer-modal {
  width: min(1120px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
}

.media-viewer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.media-zoom-icon {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.media-zoom-icon::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: -4px;
  width: 7px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: center;
}

.media-viewer-frame {
  display: grid;
  place-items: center;
  min-height: 260px;
  max-height: calc(100vh - 210px);
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #eef3f4;
}

.media-viewer-frame img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 230px);
  object-fit: contain;
}

.media-viewer-modal.is-zoomed .media-viewer-frame {
  place-items: start;
  overflow: auto;
}

.media-viewer-modal.is-zoomed .media-viewer-frame img {
  max-width: none;
  max-height: none;
}

.muted {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.status-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.status-list div {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.status-list dt {
  color: var(--muted);
  font-weight: 600;
}

.status-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.status-live-panel {
  overflow: hidden;
}

.status-live-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}

.status-live-header h2,
.status-active-grid h3 {
  margin: 0;
}

.status-live-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.status-heartbeat-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 86px;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid #cfd9dd;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 760;
}

.status-heartbeat-pill::before {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #94a3b8;
  content: "";
}

.status-live-panel.is-live .status-heartbeat-pill {
  border-color: rgba(20, 184, 166, 0.42);
  color: #0f766e;
  background: rgba(20, 184, 166, 0.08);
}

.status-live-panel.is-live .status-heartbeat-pill::before {
  background: #14b8a6;
}

.status-live-panel.is-stale .status-heartbeat-pill {
  border-color: rgba(220, 38, 38, 0.24);
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.07);
}

.status-live-panel.is-stale .status-heartbeat-pill::before {
  background: #dc2626;
}

.status-active-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(340px, 1fr);
  gap: 24px;
  align-items: start;
}

.status-active-preview {
  margin-top: 12px;
}

.status-preview-frame {
  width: min(100%, 520px);
  cursor: default;
  transform-origin: center;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.status-preview-frame.is-offline-preview {
  border-color: #cbd5e1;
  filter: grayscale(1);
  opacity: 0.72;
}

.status-preview-frame.is-offline-preview::after {
  position: absolute;
  inset: 0;
  background: rgba(241, 245, 249, 0.5);
  content: "";
}

.status-preview-offline-label {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  transform: translate(-50%, -50%);
  padding: 8px 14px;
  border: 1px solid rgba(100, 116, 139, 0.35);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.86);
  color: #64748b;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.status-list-compact div {
  grid-template-columns: 160px minmax(0, 1fr);
  padding: 9px 0;
}

.playlist-web-preview small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-web-frame {
  display: block;
  padding: 0;
  background: #ffffff;
}

.status-web-frame-preview {
  position: absolute;
  left: 0;
  top: 0;
  width: 1600px;
  height: 900px;
  border: 0;
  pointer-events: none;
  transform: scale(0.325);
  transform-origin: 0 0;
}

.status-web-snapshot {
  position: absolute;
  inset: 0;
}

.status-web-caption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
  display: grid;
  max-width: min(82%, 360px);
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
}

.status-web-caption span {
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 760;
}

.status-web-caption strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-web-caption small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 880px) {
  .dashboard-grid,
  .dashboard-playlist-item,
  .status-active-grid,
  .status-live-header {
    grid-template-columns: 1fr;
  }

  .dashboard-panel-header {
    display: grid;
  }

  .dashboard-playlist-item {
    align-items: start;
  }

  .dashboard-preview {
    width: min(100%, 260px);
  }

  .dashboard-duration {
    justify-self: start;
  }

  .dashboard-metrics div,
  .dashboard-actions {
    grid-template-columns: 1fr;
  }
}

.login-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(7, 25, 39, 0.08), rgba(247, 198, 0, 0.08)),
    var(--bg);
}

.login-panel {
  width: min(420px, 100%);
  padding: 28px;
}

.login-panel h1 {
  margin: 0 0 20px;
  font-size: 28px;
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
  }

  .admin-shell {
    width: min(100% - 24px, 1280px);
    margin-top: 18px;
  }

  .page-header,
  .playlist-order-header,
  .header-actions,
  .user-menu {
    align-items: stretch;
    flex-direction: column;
  }

  .table-actions {
    text-align: left;
    white-space: normal;
  }

  .table-actions > * {
    margin: 4px 6px 4px 0;
  }

  .stat-grid,
  .two-column,
  .settings-grid,
  .settings-page,
  .settings-field-grid,
  .settings-field-grid.compact,
  .playlist-page-layout,
  .takeover-content-grid,
  .takeover-row,
  .form-layout,
  .designer-shell,
  .deck-editor-shell,
  .designer-workspace,
  .background-upload-form {
    grid-template-columns: 1fr;
  }

  .deck-page-strip {
    position: static;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .deck-page-list {
    max-height: min(560px, 62vh);
  }

  .designer-properties {
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  table {
    display: block;
    overflow-x: auto;
  }
}

@media (min-width: 901px) and (max-width: 1280px) {
  .settings-page {
    grid-template-columns: 1fr;
  }

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