:root {
  --bg: #0b0f14;
  --bg-2: #121823;
  --card: #161f2c;
  --ink: #e8eef7;
  --muted: #9ba8bd;
  --line: #2a3446;
  --brand: #11a58f;
  --brand-2: #1779b9;
  --brand-soft: rgba(23, 121, 185, 0.18);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "Noto Sans", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 20% 0%, #1a2434 0%, var(--bg) 55%);
}

a { color: #88d2ff; }
a:hover { color: #b6e6ff; }

.auth-body { min-height: 100vh; display: grid; place-items: center; }
.auth-wrap { width: 100%; max-width: 460px; padding: 20px; }
.auth-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.45);
}

h1, h2, h3 { margin: 0 0 10px; }
h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.muted { color: var(--muted); margin: 0 0 16px; }
.footnote { color: var(--muted); font-size: 13px; margin-top: 14px; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  background: linear-gradient(90deg, #0f1724 0%, #172338 100%);
  border-bottom: 1px solid var(--line);
}
.topbar .muted { color: #b7c5d9; margin: 0; }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 14, 20, 0.72);
}
.tabs a {
  text-decoration: none;
  color: #cce4ff;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
}
.tabs a:hover {
  background: var(--brand-soft);
  border-color: #25415f;
}
.tabs a.active {
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
}

.layout {
  display: grid;
  gap: 16px;
  padding: 16px 24px 28px;
}
.layout.single { grid-template-columns: 1fr; }
.home-card {
  width: min(50vw, 980px);
  min-width: 320px;
  margin: 0 auto;
}
.home-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}
.home-grid .home-card {
  width: 100%;
  min-width: 0;
  margin: 0;
  max-width: 980px;
  justify-self: center;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  min-width: 0;
}

.preview-box {
  margin-top: 12px;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0;
  border: none;
  background: #000;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.home-card .preview-box {
  width: auto;
  max-width: 100%;
  min-width: 0;
  margin: 12px 0 0;
  justify-self: center;
}
.preview-box video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
  background: #000;
}
.preview-placeholder {
  color: #82a8cc;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.form-col, .grid-form { display: grid; gap: 10px; }
.grid-form { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
.media-upload-form {
  grid-template-columns: max-content max-content auto;
  grid-template-areas:
    "kind source ."
    "title source_label ."
    "submit submit .";
  align-items: end;
  justify-content: start;
}
.media-upload-form > * {
  min-width: 0;
}
.media-upload-form .media-kind-field {
  grid-area: kind;
  max-width: 160px;
}
.media-upload-form .media-source-field {
  grid-area: source;
  min-width: 0;
  width: auto;
  max-width: 220px;
  justify-self: start;
}
.media-upload-form .media-title-field {
  grid-area: title;
  min-width: 0;
  width: auto;
  max-width: 260px;
  justify-self: start;
}
.media-upload-form #media-source-label-create {
  grid-area: source_label;
  max-width: 220px;
  justify-self: start;
}
.media-upload-form button {
  grid-area: submit;
  align-self: start;
  justify-self: start;
  width: auto;
  min-width: 104px;
  padding: 8px 12px;
  font-size: 12px;
}
.media-table-wrap {
  width: 100%;
  overflow-x: auto;
}
.section-sep {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 2px;
}
.section-sep .muted { margin-bottom: 0; }

label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
input, select, textarea, button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--ink);
  background: #0f1520;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #2e6a9e;
  box-shadow: 0 0 0 2px rgba(46, 106, 158, 0.2);
}
button {
  cursor: pointer;
  color: #fff;
  border: none;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-2) 100%);
}
button.ghost {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
button.small { padding: 8px 10px; font-size: 12px; }
button.danger {
  background: linear-gradient(90deg, #8f2f3c 0%, #b2404f 100%);
}
button.inline-btn {
  width: auto;
  min-width: 210px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #c8d3e0;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.icon-btn {
  min-width: 44px !important;
  width: 44px;
  padding: 10px 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.icon-btn svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
}
.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  background: #38d16a;
  box-shadow: 0 0 0 3px rgba(56, 209, 106, 0.15);
  flex: 0 0 auto;
}

.alert {
  border: 1px solid #8f3f4e;
  background: #3a1e25;
  color: #ffd8e1;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 10px;
}
.ok {
  border: 1px solid #2f6b4a;
  background: #173626;
  color: #d0ffe7;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 13px;
  table-layout: fixed;
}
th, td {
  border-top: 1px solid var(--line);
  text-align: left;
  padding: 8px 6px;
  vertical-align: top;
}
.media-table {
  width: auto;
  min-width: max-content;
  table-layout: auto;
}
.media-table .col-id { width: 30px; }
.media-table .col-title { width: 180px; }
.media-table .col-kind { width: 58px; }
.media-table .col-status { width: 66px; }
.media-table .col-duration { width: 42px; }
.media-table .col-file { width: 1%; }
.media-table .col-action { width: 112px; }
.media-table th,
.media-table td {
  padding: 3px 2px;
  line-height: 1.1;
  vertical-align: middle;
}
.media-table td[data-label="ID"],
.media-table td[data-label="Typ"],
.media-table td[data-label="Status"],
.media-table td[data-label="Czas"] {
  vertical-align: middle;
  white-space: nowrap;
}
.media-table td[data-label="ID"] > *,
.media-table td[data-label="Typ"] > *,
.media-table td[data-label="Status"] > *,
.media-table td[data-label="Czas"] > * {
  vertical-align: middle;
}
.media-table td > * {
  margin-top: 0;
  margin-bottom: 0;
}
.media-table td .muted {
  margin: 0;
}
.media-status-error {
  display: none;
}
.media-table td form {
  margin: 0;
}
.media-table .icon-btn {
  width: 32px;
  min-width: 32px !important;
  padding: 6px 0;
}
.media-source-input {
  width: 100%;
  min-width: 0;
  padding-top: 5px;
  padding-bottom: 5px;
  line-height: 1.1;
}
.media-title-input {
  width: 100%;
  min-width: 0;
  padding-top: 5px;
  padding-bottom: 5px;
  line-height: 1.1;
}
.media-title-cell {
  white-space: nowrap;
}
.media-title-cell .media-thumb,
.media-title-cell .media-thumb-placeholder,
.media-title-cell .media-title-input {
  display: inline-block;
  vertical-align: middle;
}
.media-action-row {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: nowrap;
  max-width: 100%;
  width: 100%;
}
.media-flag-btn.is-hidden {
  display: none;
}
.media-flag-btn:disabled {
  opacity: 0.42;
  cursor: default;
}
.media-save-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
.media-save-row .muted {
  margin: 0;
}
#media-save-btn.is-dirty {
  border-color: #4c8fca;
  background: rgba(44, 97, 150, 0.26);
  color: #f4fbf6;
}

#media-save-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.media-flag-btn {
  color: #7e8795;
  border-color: #353d4a;
  background: transparent;
}
.media-flag-btn:hover {
  color: #c7d0dc;
  border-color: #556073;
  background: rgba(255, 255, 255, 0.04);
}
.media-flag-btn.is-active {
  color: #8fd6ff;
  border-color: #3b6f9f;
  background: rgba(24, 77, 118, 0.22);
}
.status-badge {
  padding: 3px 6px;
  font-size: 11px;
  line-height: 1;
}
.playlist-table th,
.playlist-table td {
  padding: 4px 6px;
  line-height: 1.1;
  vertical-align: middle;
}
.playlist-table tr[data-playlist-item-id] td:nth-child(1),
.playlist-table tr[data-playlist-item-id] td:nth-child(2),
.playlist-table tr[data-playlist-item-id] td:nth-child(3),
.playlist-table tr[data-playlist-item-id] td:nth-child(5),
.playlist-table tr[data-playlist-item-id] td:nth-child(6),
.playlist-table tr[data-playlist-item-id] td:nth-child(7),
.playlist-table tr[data-playlist-item-id] td:nth-child(8) {
  vertical-align: middle;
  white-space: nowrap;
}
.playlist-table tr[data-playlist-item-id] td:nth-child(1) > *,
.playlist-table tr[data-playlist-item-id] td:nth-child(2) > *,
.playlist-table tr[data-playlist-item-id] td:nth-child(3) > *,
.playlist-table tr[data-playlist-item-id] td:nth-child(5) > *,
.playlist-table tr[data-playlist-item-id] td:nth-child(6) > *,
.playlist-table tr[data-playlist-item-id] td:nth-child(7) > *,
.playlist-table tr[data-playlist-item-id] td:nth-child(8) > * {
  vertical-align: middle;
}
.playlist-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin-top: 10px;
  margin-bottom: 10px;
}
.playlist-create-form {
  grid-template-columns: 200px 200px max-content;
  justify-content: start;
}
.playlist-create-form input {
  width: 100%;
  max-width: 200px;
}
.playlist-create-form button {
  width: auto;
  min-width: 0;
  justify-self: start;
  white-space: nowrap;
}
.playlist-group-tools {
  display: grid;
  gap: 8px;
  margin: 0;
}
.playlist-action-cell {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  flex-wrap: nowrap;
  position: relative;
  width: 100%;
}
.playlist-layout-anchor {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.layout-toggle-btn svg {
  width: 20px;
  height: 20px;
}
.layout-toggle-btn {
  color: #8d96a5;
  border-color: #353d4a;
  background: transparent;
}
.layout-toggle-btn:hover {
  color: #c7d0dc;
  border-color: #556073;
  background: rgba(255, 255, 255, 0.04);
}
.layout-toggle-btn.is-active {
  color: #8fd6ff;
  border-color: #3b6f9f;
  background: rgba(24, 77, 118, 0.22);
}
.layout-toggle-btn.is-open {
  color: #aeb8c7;
  border-color: #4c5667;
  background: rgba(255, 255, 255, 0.03);
}
.playlist-layout-select,
.playlist-group-layout-select,
.playlist-playlist-layout-select {
  width: 132px;
  min-width: 132px;
  padding: 5px 8px;
  font-size: 12px;
}
.playlist-layout-popup {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  z-index: 30;
  min-width: 236px;
  max-width: min(360px, calc(100vw - 24px));
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #111927;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}
.playlist-head-actions .playlist-layout-popup {
  right: 0;
  left: auto;
}
.playlist-layout-panel {
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 0;
  flex-wrap: wrap;
}
.playlist-layout-panel label {
  display: inline-grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  min-width: 0;
}
.playlist-layout-panel .playlist-layout-select,
.playlist-layout-panel .playlist-group-layout-select,
.playlist-layout-panel .playlist-playlist-layout-select {
  width: 220px;
  min-width: 220px;
}
.playlist-layout-panel .playlist-group-audio-select {
  width: 220px;
  min-width: 220px;
}
.playlist-layout-panel .playlist-item-audio-gain {
  width: 88px;
  min-width: 88px;
}
.playlist-layout-panel .playlist-group-audio-gain {
  width: 96px;
  min-width: 96px;
}
.playlist-group-audio-controls {
  display: grid;
  grid-template-columns: 68px 82px 82px;
  gap: 8px;
  align-items: end;
}
.playlist-group-audio-controls label {
  width: 100%;
}
.playlist-group-audio-controls input {
  width: 100%;
  min-width: 0;
}
[data-layout-panel^="group-"] .playlist-layout-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
[data-layout-panel^="group-"] .playlist-layout-panel label {
  width: 100%;
}
[data-layout-panel^="group-"] .playlist-layout-panel .playlist-group-layout-select,
[data-layout-panel^="group-"] .playlist-layout-panel .playlist-group-audio-select {
  width: 100%;
  min-width: 0;
}
[data-layout-panel^="group-"] .playlist-layout-panel .playlist-group-audio-gain {
  width: 100%;
  min-width: 0;
}
[data-layout-panel^="group-"] .playlist-layout-panel .playlist-group-audio-controls {
  grid-template-columns: minmax(0, 68px) minmax(0, 82px) minmax(0, 82px);
  gap: 8px;
}
.playlist-group-create-form {
  grid-template-columns: 160px max-content;
  gap: 10px;
  justify-content: end;
}
.playlist-group-tools {
  margin-left: auto;
}
.playlist-add-form {
  grid-template-columns: 220px max-content;
}
.playlist-add-form,
.playlist-group-create-form {
  margin: 0;
}
.playlist-add-picker {
  position: relative;
  width: 100%;
  max-width: 220px;
}
.playlist-add-input {
  width: 100%;
  max-width: 220px;
}
.playlist-add-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 340px;
  max-width: min(340px, calc(100vw - 32px));
  z-index: 45;
  display: grid;
  gap: 4px;
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
  background: #0d1723;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}
.playlist-add-suggestions[hidden] {
  display: none;
}
.playlist-add-option {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 0;
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
  color: #eef4fb;
  cursor: pointer;
}
.playlist-add-option:hover,
.playlist-add-option:focus {
  background: rgba(64, 136, 214, 0.22);
}
.playlist-add-option-thumb {
  width: 36px;
  height: 20px;
  min-width: 36px;
  border-radius: 2px;
  object-fit: cover;
  background: #101722;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.playlist-add-option-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.playlist-add-option-title {
  font-size: 12px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.playlist-add-option-meta {
  font-size: 10px;
  color: #91a0b5;
  line-height: 1.1;
  text-transform: lowercase;
}
.playlist-add-option-duration {
  font-size: 11px;
  color: #c9d7e7;
  white-space: nowrap;
}
.playlist-add-option.kind-camera .playlist-add-option-meta {
  color: #8cf0ad;
}
.playlist-add-option.kind-movie .playlist-add-option-meta {
  color: #73c7ff;
}
.playlist-add-option.kind-ad .playlist-add-option-meta {
  color: #ff7676;
}
.playlist-add-option.kind-still .playlist-add-option-meta {
  color: #ffd88a;
}
.playlist-group-create-form input[name="name"] {
  width: 100%;
  max-width: 160px;
}
.playlist-add-form button,
.playlist-group-create-form button {
  width: auto;
  min-width: 0;
  justify-self: start;
  padding-left: 12px;
  padding-right: 12px;
  white-space: nowrap;
}
@media (max-width: 1100px) {
  .media-upload-form {
    grid-template-columns: max-content max-content auto;
    grid-template-areas:
      "kind source ."
      "title source_label ."
      "submit submit .";
  }
}

@media (max-width: 680px) {
  .playlist-create-form {
    grid-template-columns: 1fr;
  }
  .playlist-toolbar {
    display: grid;
    gap: 10px;
  }
  .playlist-layout-panel {
    flex-wrap: wrap;
  }
}
.playlist-table .playlist-col-drag {
  width: 28px;
}
.playlist-table .playlist-col-pos {
  width: 42px;
}
.playlist-table .playlist-col-dot {
  width: 18px;
}
.playlist-table .playlist-col-miss {
  width: 56px;
}
.playlist-table th:first-child,
.playlist-table td:first-child {
  width: 28px;
  padding-right: 2px;
  white-space: nowrap;
  text-align: center;
}
.playlist-table th:nth-child(2),
.playlist-table td:nth-child(2) {
  width: 42px;
  white-space: nowrap;
  text-align: left;
  padding-right: 2px;
}
.playlist-table th:nth-child(3),
.playlist-table td:nth-child(3) {
  width: 18px;
  padding-left: 0;
  padding-right: 0;
  text-align: center;
}
.playlist-table th:nth-child(4),
.playlist-table td:nth-child(4) {
  padding-left: 8px;
}
.playlist-table th:nth-child(5),
.playlist-table td:nth-child(5) {
  width: 56px;
  white-space: nowrap;
  text-align: center;
  padding-left: 4px;
  padding-right: 4px;
}
.playlist-table th:nth-child(6),
.playlist-table td:nth-child(6) {
  width: 74px;
  white-space: nowrap;
  text-align: center;
  padding-left: 6px;
  padding-right: 6px;
}
.playlist-table th:nth-child(7),
.playlist-table td:nth-child(7) {
  width: 74px;
  white-space: nowrap;
  text-align: center;
  padding-left: 6px;
  padding-right: 6px;
}
.playlist-table th:nth-child(8),
.playlist-table td:nth-child(8) {
  width: 82px;
  white-space: nowrap;
  text-align: center;
  padding-left: 6px;
  padding-right: 6px;
}
.playlist-table th:nth-child(9),
.playlist-table td:nth-child(9) {
  width: 84px;
  white-space: nowrap;
  text-align: center;
  padding-left: 6px;
  padding-right: 6px;
}
.playlist-table tr {
  height: auto;
}
.playlist-table tr[data-group-id] td {
  background: rgba(18, 28, 42, 0.36);
}
.playlist-table td > * {
  margin-top: 0;
  margin-bottom: 0;
}
.playlist-table td:nth-child(5) > *,
.playlist-table td:nth-child(6) > *,
.playlist-table td:nth-child(7) > *,
.playlist-table td:nth-child(8) > * {
  margin-left: auto;
  margin-right: auto;
}
.playlist-table td:nth-child(9) > * {
  margin-left: auto;
  margin-right: auto;
}
.playlist-table td form {
  margin: 0;
}
.playlist-table input,
.playlist-table select,
.playlist-table button {
  width: auto;
  min-width: 0;
  padding: 4px 6px;
  font-size: 12px;
}
.playlist-table .duration-input {
  width: 64px;
  min-width: 64px;
  height: 24px;
  padding: 4px 6px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.playlist-table .small {
  padding: 3px 6px;
  line-height: 1;
}
.playlist-miss-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(198, 31, 58, 0.18);
  border: 1px solid rgba(198, 31, 58, 0.4);
  color: #ffb6c0;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.playlist-miss-badge.is-pending {
  background: rgba(255, 193, 7, 0.14);
  border-color: rgba(255, 193, 7, 0.34);
  color: #ffe08a;
}
.playlist-table .playlist-move button.small {
  width: auto;
  min-width: 28px;
}
.playlist-table .icon-btn {
  width: 32px;
  min-width: 32px !important;
  padding: 6px 0;
}
.playlist-table .drag-cell {
  width: 20px;
  min-width: 20px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.playlist-table .drag-handle-icon {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  color: #7d8ea7;
}
.playlist-table .drag-handle-pos {
  font-size: 12px;
  line-height: 1;
  color: #c9d7ea;
}
.playlist-table tr.is-dragging {
  opacity: 0.55;
}
.playlist-table tr.is-touch-dragging {
  position: relative;
  z-index: 2;
}
.playlist-table tr.drag-over {
  outline: 1px dashed #5cc1ff;
  outline-offset: -2px;
}
.playlist-drop-slot td {
  padding: 3px 0;
  border-top: 0;
  background: transparent;
}
.playlist-drop-slot td::before {
  content: "";
  display: block;
  height: 4px;
  border-radius: 999px;
  background: transparent;
}
.playlist-drop-slot.drag-over td::before {
  background: rgba(92, 193, 255, 0.35);
}
.playlist-group-row td {
  background: rgba(12, 18, 27, 0.92);
  border-top: 1px solid rgba(96, 132, 171, 0.42);
}
.playlist-grouped-item td {
  background: rgba(19, 28, 40, 0.72);
}
.playlist-grouped-item td:first-child {
  text-align: center;
}
.playlist-group-row td:first-child,
.playlist-grouped-item td:first-child {
  border-left: 1px solid rgba(96, 132, 171, 0.42);
}
.playlist-group-row td:last-child,
.playlist-grouped-item td:last-child,
.playlist-group-footer-row td:last-child {
  border-right: 1px solid rgba(96, 132, 171, 0.42);
}
.playlist-grouped-item.is-last td {
  border-bottom: 0;
}
.playlist-group-footer-row td {
  border-bottom: 1px solid rgba(96, 132, 171, 0.42);
  background: rgba(16, 24, 36, 0.72);
}
.playlist-group-footer-row td:first-child {
  border-left: 1px solid rgba(96, 132, 171, 0.42);
}
.playlist-group-row-title {
  font-weight: 700;
  color: #dce8f6;
}
.playlist-group-footer-title {
  font-size: 12px;
  font-weight: 700;
  color: #91aac7;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.playlist-group-duration {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  min-width: 64px;
  height: 24px;
  margin: 0 auto;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #dce8f6;
}
.playlist-total-row td {
  border-top: 1px solid rgba(96, 132, 171, 0.22);
  background: transparent;
  padding-top: 12px;
}
.playlist-total-duration-label {
  display: inline-block;
  width: 100%;
  text-align: right;
  padding-right: 10px;
  font-size: 11px;
  font-weight: 500;
  color: #7d8ea7;
  letter-spacing: 0.01em;
}
.playlist-total-duration-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  min-width: 64px;
  height: 24px;
  margin: 0 auto;
  text-align: center;
  color: #dce8f6;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.playlist-inline-group {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(34, 58, 84, 0.75);
  color: #91d0ff;
  font-size: 11px;
}
.playlist-table .duration-save-status {
  min-width: 56px;
  margin-left: 4px;
  font-size: 11px;
}
.item-live-marker-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.item-live-marker-slot {
  width: 8px;
  min-width: 8px;
  height: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.item-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  visibility: hidden;
  opacity: 0;
  flex: 0 0 8px;
  background: #59e390;
  box-shadow: 0 0 0 1px rgba(89, 227, 144, 0.28);
}
.item-wake-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  visibility: hidden;
  opacity: 0;
  flex: 0 0 8px;
  background: #e24a4a;
  box-shadow: 0 0 0 1px rgba(226, 74, 74, 0.32);
}
.item-wake-dot.is-visible {
  visibility: visible;
  opacity: 1;
}
.item-live-dot.is-visible {
  visibility: visible;
  opacity: 1;
}
.item-live-dot.is-current {
  background: #59e390;
  box-shadow: 0 0 0 1px rgba(89, 227, 144, 0.28);
}
.item-live-dot.is-next {
  background: #ffb14a;
  box-shadow: 0 0 0 1px rgba(255, 177, 74, 0.28);
}
.media-title-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-wrap: anywhere;
}
.media-thumb {
  width: 36px;
  height: 20px;
  min-width: 36px;
  border-radius: 2px;
  object-fit: cover;
  background: #101722;
  border: 1px solid rgba(255, 255, 255, 0.06);
  flex: 0 0 auto;
}
.media-thumb-placeholder {
  opacity: 0.22;
}
.media-title-cell .media-title-input {
  flex: 1 1 auto;
}
.playlist-media-title-cell {
  overflow-wrap: anywhere;
}
.playlist-media-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.playlist-media-thumb {
  width: 36px;
  height: 20px;
  min-width: 36px;
  border-radius: 2px;
  object-fit: cover;
  background: #101722;
  border: 1px solid rgba(255, 255, 255, 0.06);
  flex: 0 0 auto;
}
.playlist-media-thumb-placeholder {
  opacity: 0.22;
}
.media-file-cell {
  width: 1%;
}
.media-link-toggle {
  padding: 4px 8px !important;
  line-height: 1;
  min-height: 0;
}
.file-link-break {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.media-link-row[hidden] {
  display: none !important;
}
.media-link-row td {
  padding-top: 0;
  border-top: 0;
}
.media-link-editor {
  display: grid;
  grid-template-columns: minmax(220px, 352px) minmax(180px, 280px);
  gap: 10px;
  align-items: start;
  padding: 8px 0 10px;
}
.media-link-field {
  display: grid;
  gap: 4px;
  align-content: start;
}
.media-link-input {
  width: 100%;
  min-width: 0;
  padding-top: 5px;
  padding-bottom: 5px;
  line-height: 1.1;
}
.media-link-input[readonly] {
  background: #0b1018;
  color: var(--muted);
}

.inline-edit {
  display: grid;
  grid-template-columns: minmax(180px, 220px) 100px minmax(180px, 240px) 90px;
  gap: 6px;
  align-items: center;
}
.users-create-form {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.users-table-wrap {
  width: 100%;
  overflow-x: auto;
}
.users-table {
  table-layout: fixed;
}
.users-table .col-id { width: 48px; }
.users-table .col-login { width: 14%; }
.users-table .col-email { width: 18%; }
.users-table .col-role { width: 64px; }
.users-table .col-created { width: 146px; }
.users-table .col-action { width: 92px; }
.users-table th,
.users-table td {
  padding: 4px 3px;
  line-height: 1.15;
  text-align: left;
  vertical-align: middle;
}
.users-edit-row td {
  padding-top: 6px;
  padding-bottom: 10px;
  background: rgba(15, 21, 32, 0.45);
}
.inline-edit {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 72px minmax(120px, 1fr) 68px;
  gap: 4px;
  align-items: center;
  width: 100%;
  min-width: 0;
}
.users-edit-form input,
.users-edit-form select,
.users-edit-form button {
  padding: 6px 6px;
  font-size: 12px;
  min-width: 0;
  width: 100%;
}
.users-table td:last-child {
  min-width: 0;
}
.user-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  flex-wrap: nowrap;
}
.user-actions form {
  margin: 0;
}

.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: stretch;
}
.stats-row article {
  flex: 0 0 96px;
  width: 96px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  background: #0f1520;
  text-align: center;
}
.stats-row h3 { text-align: center; }
.stats-row p { font-size: 24px; margin: 2px 0 0; color: #8cc8ff; text-align: center; }
.health-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 14px !important;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #d7e8fb;
  border: 1px solid #2a3446;
}
.stats-row p.health-pill.health-ok {
  color: #9ff3b6;
  background: #123726;
  border-color: #2e6f4f;
}
.stats-row p.health-pill.health-bad {
  color: #ffd3d9;
  background: #4b1f28;
  border-color: #8f3b4d;
}

.event-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: grid;
  gap: 6px;
  font-size: 13px;
}
.monitoring-card .event-list {
  max-height: 360px;
  overflow-y: auto;
  padding-right: 8px;
}

.rtmp-devices-wrap {
  margin-top: 14px;
}
.rtmp-devices-wrap > h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: #c9d7ea;
}
.rtmp-device-create {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.rtmp-device-create input[type="text"] {
  width: 220px;
  max-width: 100%;
}
.rtmp-device-create input[type="number"] {
  width: 78px;
  max-width: 78px;
}
.rtmp-devices-list {
  display: grid;
  gap: 8px;
}
.rtmp-device-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #0f1520;
}
.rtmp-device-card.is-offline {
  padding-right: 72px;
}
.rtmp-device-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.rtmp-device-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 10px;
}
.rtmp-device-dot.is-online {
  background: #6be675;
  box-shadow: 0 0 0 2px rgba(107, 230, 117, 0.18);
}
.rtmp-device-dot.is-offline {
  background: #ff6b6b;
  box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.16);
}
.rtmp-device-route-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
  border: 1px solid transparent;
  white-space: nowrap;
}
.rtmp-device-route-badge.is-lan {
  background: rgba(86, 193, 255, 0.14);
  border-color: rgba(86, 193, 255, 0.28);
  color: #8dd9ff;
}
.rtmp-device-route-badge.is-wan {
  background: rgba(255, 184, 77, 0.16);
  border-color: rgba(255, 184, 77, 0.28);
  color: #ffd08a;
}
.rtmp-device-route-badge.is-mix {
  background: rgba(203, 134, 255, 0.16);
  border-color: rgba(203, 134, 255, 0.28);
  color: #e1b7ff;
}
.rtmp-device-name {
  width: 220px;
  max-width: 100%;
}
.rtmp-device-tv-count {
  width: 78px;
  max-width: 78px;
}
.rtmp-device-tv-count::-webkit-outer-spin-button,
.rtmp-device-tv-count::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.rtmp-device-tv-count[type="number"] {
  -moz-appearance: textfield;
}
.rtmp-device-save {
  width: auto;
  min-width: 0;
  padding-left: 10px;
  padding-right: 10px;
  flex: 0 0 auto;
}
.rtmp-device-alert {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 107, 107, 0.18);
  color: #ff9b9b;
  border: 1px solid rgba(255, 107, 107, 0.35);
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}
.rtmp-device-meta {
  display: grid;
  gap: 2px;
  justify-items: end;
  font-size: 12px;
  color: #b9cbe0;
  line-height: 1.2;
}
.rtmp-device-card.is-offline .rtmp-device-meta {
  padding-right: 8px;
}
.rtmp-device-stream {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px 10px;
  grid-template-columns: auto auto;
  justify-content: start;
}
.rtmp-device-stream label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: #b9cbe0;
  min-width: 0;
  max-width: 100%;
}
.rtmp-device-url-lan {
  width: 220px !important;
}
.rtmp-device-url-wan {
  width: 258px !important;
}
.rtmp-device-stream input {
  width: 100%;
  font-size: 12px;
}
.rtmp-device-delete {
  position: absolute;
  top: 8px;
  right: 8px;
}

.reconvert-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
}
.stream-side-row {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-top: 8px;
  width: 100%;
}
.stream-side-card {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  width: 100%;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.stream-side-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 240px));
  gap: 10px 14px;
  align-items: end;
  justify-content: start;
  width: 100%;
}
.stream-side-fields-compact {
  grid-template-columns: repeat(auto-fit, minmax(180px, 208px));
  gap: 10px 8px;
}
.stream-side-wide {
  grid-column: 1 / -1;
}
.stream-inline-field {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) max-content;
  align-items: end;
  gap: 12px;
  min-width: 0;
}
.stream-inline-field > label:first-child {
  min-width: 0;
}
.stream-inline-checkbox {
  white-space: nowrap;
  align-self: center;
  margin-bottom: 0;
  width: auto !important;
  min-width: 0 !important;
}
.nowrap-label {
  white-space: nowrap;
}
.stream-shift-left {
  margin-left: -18px;
}
.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  margin: 0;
}
.checkbox-inline input[type="checkbox"] {
  margin: 0;
  width: 16px;
  min-width: 16px;
  height: 16px;
}
.stream-side-card label {
  width: 100%;
  min-width: 0;
}
.stream-side-card input,
.stream-side-card select {
  width: 100%;
  min-width: 0;
}
.stream-side-card h3 {
  margin: 0;
}
.stream-side-card .checkbox-row {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  margin-bottom: 0;
  line-height: 1.2;
  width: auto;
  color: var(--muted);
}
.stream-side-card .checkbox-row input[type="checkbox"] {
  margin: 0;
  flex: 0 0 auto;
  width: 16px;
  min-width: 16px;
  height: 16px;
  padding: 0;
  accent-color: #4c8fca;
  opacity: 0.55;
}
.stream-side-card .checkbox-row span {
  display: inline-block;
  color: #7e8795;
}
.stream-side-card .checkbox-row input[type="checkbox"]:checked {
  opacity: 1;
}
.stream-side-card .checkbox-row input[type="checkbox"]:checked + span {
  color: #dfe8f2;
}
.fallback-current-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.fallback-current-row > span {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fallback-current-row .inline-icon-btn,
.fallback-current-row > .icon-btn {
  flex: 0 0 auto;
  margin-left: auto;
}
.fallback-meta {
  display: grid;
  gap: 6px;
  align-self: end;
  min-width: 200px;
}
.inline-icon-form {
  display: inline-flex;
  margin: 0;
}
.inline-icon-btn {
  margin: 0;
}
.fallback-status-row {
  margin: -24px 0 0;
}
.reconvert-row .muted {
  margin: 0;
  flex: 1 1 auto;
}
.reconvert-status {
  margin-top: 10px;
  margin-bottom: 0;
}
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}
.status-badge.ok {
  background: #1a3b2a;
  color: #94f1bf;
  border-color: #2d6a4b;
}
.status-badge.err {
  background: #4b1f28;
  color: #ffbcc8;
  border-color: #8f3b4d;
}
.status-badge.miss {
  background: #232833;
  color: #b9c2d3;
  border-color: #465067;
}
.status-badge.work {
  background: #3e3416;
  color: #ffe2a0;
  border-color: #7c6a2f;
}
.kind-tag {
  display: inline-block;
  font-weight: 700;
}
.kind-tag.kind-movie {
  color: #73c7ff;
}
.kind-tag.kind-ad {
  color: #ff7676;
}
.kind-tag.kind-camera {
  color: #8cf0ad;
}
.kind-tag.kind-still {
  color: #ffd88a;
}
.kind-tag.kind-group {
  color: #ffffff;
}
.media-ad-btn {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #ffb1b1;
}
.media-ad-btn.is-active {
  color: #fff0f0;
  background: linear-gradient(90deg, #8f2f3c 0%, #c84b4b 100%);
}
.playlist-total-duration {
  display: inline-block;
  margin-left: 6px;
  font-variant-numeric: tabular-nums;
  color: #dce8f6;
  font-weight: 700;
}
.layout-topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.layout-create-form {
  grid-template-columns: minmax(140px, 170px) minmax(150px, 210px) 130px max-content;
  justify-content: start;
}
.layout-create-form input,
.layout-create-form select {
  width: 100%;
  min-width: 0;
}
.layout-create-form button {
  width: auto;
  min-width: 0;
  justify-self: start;
  white-space: nowrap;
}
.layout-install-form {
  display: flex;
  align-items: center;
}
.layout-install-form button {
  width: auto;
  min-width: 0;
  white-space: nowrap;
}
.layout-workspace {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.layout-list {
  min-width: 0;
}
.layout-list-items {
  display: grid;
  gap: 8px;
}
.layout-list-item {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  background: #0f1520;
}
.layout-list-item.active {
  border-color: #2e6a9e;
  background: rgba(23, 121, 185, 0.16);
}
.layout-list-name {
  color: #e8eef7;
  font-weight: 700;
}
.layout-list-meta {
  color: var(--muted);
  font-size: 12px;
}
.layout-editor {
  min-width: 0;
  display: grid;
  gap: 14px;
}
.layout-edit-form {
  display: grid;
  gap: 14px;
}
.layout-meta-row {
  display: grid;
  grid-template-columns: minmax(228px, 344px) 132px 94px 132px;
  gap: 10px 12px;
  align-items: end;
}
.layout-editor-grid {
  display: grid;
  grid-template-columns: 344px 375px;
  gap: 12px;
}
.layout-config-grid label input,
.layout-config-grid label select,
.layout-config-grid label textarea {
  width: 100%;
}
.ticker-compact-field {
  max-width: 75%;
}
.layout-config-wide {
  grid-column: 1 / -1;
}
.ticker-source-options {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ticker-source-options-title {
  color: var(--muted);
  font-size: 12px;
  margin-right: 4px;
}
.color-alpha-field {
  display: grid;
  grid-template-columns: 102px 126px 12px;
  gap: 6px;
  align-items: center;
}
.color-alpha-field input[type="color"] {
  width: 102px;
  min-width: 102px;
  height: 32px;
  padding: 2px;
  border-radius: 8px;
}
.color-alpha-field input[type="number"] {
  width: 126px;
  min-width: 126px;
  padding-left: 6px;
  padding-right: 6px;
}
.color-alpha-field span {
  color: var(--muted);
  font-size: 11px;
}
.layout-config-grid textarea {
  min-height: 92px;
  resize: vertical;
}
.layout-runtime-note {
  margin: -2px 0 0;
}
.layout-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.layout-actions button {
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
  white-space: nowrap;
}
.weather-icon-map-editor {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  padding: 8px 10px 10px;
}
.weather-icon-map-editor summary {
  cursor: pointer;
  color: #dbe7f5;
  font-weight: 600;
  user-select: none;
}
.weather-icon-gallery-wrap {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  padding: 8px 10px 10px;
}
.weather-icon-gallery-wrap summary {
  cursor: pointer;
  color: #dbe7f5;
  font-weight: 600;
  user-select: none;
}
.weather-icon-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.weather-icon-gallery-item {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 8px 6px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
}
.weather-icon-gallery-item img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}
.weather-icon-gallery-item span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  word-break: break-word;
}
.weather-icon-map-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin-top: 10px;
}
.weather-icon-map-row {
  display: grid;
  gap: 6px;
}
.weather-icon-map-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.weather-icon-map-head img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  flex: 0 0 auto;
}
.weather-icon-map-row select {
  max-width: 220px;
}
.weather-city-field {
  position: relative;
}
.weather-inline-grid {
  display: grid;
  gap: 10px 12px;
  align-items: end;
}
.weather-inline-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 180px));
}
.weather-inline-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 140px));
}
.weather-compact-field {
  max-width: none;
}
.weather-offset-field {
  max-width: none;
}
.weather-city-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  display: grid;
  gap: 4px;
  padding: 6px;
  background: #0d1723;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}
.weather-city-suggestions[hidden] {
  display: none;
}
.weather-city-suggestion {
  width: 100%;
  padding: 7px 9px;
  border: 0;
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
  color: #eef4fb;
  cursor: pointer;
}
.weather-city-suggestion:hover,
.weather-city-suggestion:focus {
  background: rgba(64, 136, 214, 0.22);
}
@media (max-width: 1100px) {
  .layout-workspace {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .layout-meta-row {
    grid-template-columns: minmax(206px, 280px) 122px 88px 116px;
  }
  .layout-editor-grid {
    grid-template-columns: 280px 325px;
  }
  .ticker-compact-field {
    max-width: 75%;
  }
  .weather-icon-map-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .weather-icon-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .weather-icon-map-grid {
    grid-template-columns: 1fr;
  }
  .weather-inline-grid-2,
  .weather-inline-grid-4 {
    grid-template-columns: 1fr;
  }
  .weather-compact-field,
  .weather-offset-field {
    max-width: 100%;
  }
}
@media (max-width: 640px) {
  .layout-create-form {
    grid-template-columns: minmax(130px, 156px) minmax(140px, 180px) 120px max-content;
    gap: 8px 10px;
  }
  .layout-meta-row {
    grid-template-columns: 1fr;
    gap: 8px 10px;
  }
  .layout-editor-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}
@media (max-width: 900px) {
  .layout-topbar {
    align-items: stretch;
  }
  .layout-workspace {
    grid-template-columns: 1fr;
  }
  .layout-list-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .layout-actions {
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .layout-actions button {
    width: auto;
  }
}
@media (max-width: 640px) {
  .layout-list-items {
    grid-template-columns: 1fr;
  }
  .layout-meta-row,
  .layout-editor-grid,
  .layout-create-form {
    grid-template-columns: 1fr;
  }
  .color-alpha-field {
    grid-template-columns: 102px 126px 12px;
  }
}
.reload-row {
  margin-top: 8px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}
.reload-row .muted {
  margin: 0;
}
.playlist-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  flex-wrap: nowrap;
}
.playlist-head-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  scrollbar-width: thin;
}
.playlist-head-actions form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
  flex: 0 0 auto;
}
.playlist-save-form input[type="time"] {
  width: 88px;
  text-align: center;
}
.playlist-save-form .inline-btn {
  min-width: 92px;
}
.playlist-save-form .inline-btn.is-dirty {
  border-color: #4c8fca;
  background: rgba(44, 97, 150, 0.26);
  color: #f4fbf6;
}
.playlist-save-status {
  display: block;
  flex: 0 0 auto;
  margin-left: auto;
  margin-right: 48px;
  text-align: right;
}
.playlist-move {
  display: flex;
  gap: 6px;
}
.duration-input {
  width: 64px;
  appearance: textfield;
  -moz-appearance: textfield;
}
.duration-input::-webkit-outer-spin-button,
.duration-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.duration-save-status {
  display: inline-block;
  min-width: 72px;
  margin-left: 8px;
  font-size: 12px;
  color: var(--muted);
}
.duration-save-status.is-pending { color: #ffcf6d; }
.duration-save-status.is-ok { color: #8fe6b8; }
.duration-save-status.is-err { color: #ff9fae; }
.save-stream-row {
  margin-top: 14px;
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.stream-updated-at {
  margin: 0 0 0 auto;
  text-align: right;
}
.save-stream-btn {
  width: auto;
  min-width: 180px;
}
.collapse-btn {
  width: auto;
  min-width: 220px;
}
.preset-toggle-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(150px, 210px) 160px;
  grid-template-areas:
    "preset gain"
    "toggle .";
  gap: 10px 12px;
  align-items: start;
  justify-content: start;
}
.preset-toggle-row label {
  width: 100%;
  margin: 0;
}
.stream-preset-field {
  grid-area: preset;
}
.stream-output-gain-field {
  grid-area: gain;
}
.stream-output-gain-field input {
  width: 100%;
  min-width: 0;
}
.preset-toggle-row .collapse-btn {
  grid-area: toggle;
  justify-self: start;
  width: auto !important;
  min-width: 220px;
  margin-bottom: 0;
  white-space: nowrap;
}
.collapse-wrap {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.collapse-wrap > .section-sep {
  grid-column: 1 / -1;
}
.monitoring-card .collapse-wrap {
  display: block;
}
.collapse-wrap[hidden] {
  display: none !important;
}
form.grid-form[action="/stream/update"] .stream-url-field {
  grid-column: span 2;
}
form.grid-form[action="/stream/update"] #camera-interval-sec {
  max-width: 130px;
}
form.grid-form[action="/stream/update"] #camera-clip-sec {
  max-width: 130px;
}
.monitoring-card .stats-row {
  margin-bottom: 14px;
}
.monitor-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.monitor-controls {
  display: flex;
  gap: 12px;
  align-items: end;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.monitor-controls label {
  min-width: 140px;
  max-width: 160px;
  margin: 0;
}
.monitor-single-chart {
  margin-bottom: 12px;
}
.chart-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #0f1520;
}
.chart-card h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: #c9d7ea;
}
.chart-card canvas {
  width: 100%;
  height: 220px;
  display: block;
  border-radius: 8px;
  max-height: 220px;
  cursor: crosshair;
}
.chart-tooltip {
  position: fixed;
  z-index: 9999;
  max-width: 280px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #314159;
  background: rgba(11, 15, 20, 0.96);
  color: #dbe8f8;
  font-size: 12px;
  line-height: 1.4;
  pointer-events: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  white-space: normal;
}
.chart-legend {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 12px;
  color: #c2d3e8;
}
.chart-legend .lg {
  display: inline-block;
  width: 12px;
  height: 3px;
  margin-right: 6px;
  vertical-align: middle;
  border-radius: 2px;
}
.chart-legend .camera-fail { background: #e04f5f; }
.chart-legend .camera-short { background: #ffb15c; }
.chart-legend .preload-miss-camera { background: #ff5d8f; }
.chart-legend .preload-miss-group { background: #ff7a00; }
.chart-legend .preload-skip-camera { background: #ffd166; }
.chart-legend .preload-skip-group { background: #f2c14e; }
.chart-legend .preload-skip-item { background: #87d37c; }
.chart-legend .publisher { background: #5cc1ff; }
.chart-legend .publisher-restart { background: #7ef29a; }
.chart-legend .publisher-dts { background: #00f0c8; }
.chart-legend .worker { background: #b58cff; }
.chart-legend .nginx-drop { background: #fee440; }
.chart-legend .nginx-disconnect { background: #f15bb5; }
.chart-legend .nginx-hls { background: #00bbf9; }
.chart-legend .nginx-hls-clients { background: #ff4fa3; }
.chart-legend .nginx-clients { background: #9ef01a; }
.chart-legend .nginx-throughput { background: #ff9f1c; }
.chart-legend .nginx-throughput-rtmp { background: #38d16a; }
.chart-legend .nginx-throughput-hls { background: #00bbf9; }
.chart-legend .adaptive-camera { background: #00d1ff; }
.chart-legend .runtime-camera { background: #74e8ff; }
.chart-legend .adaptive-group { background: #ff8f1f; }
.chart-legend .runtime-group { background: #ffc27a; }
.chart-legend .adaptive-group-full { background: #ff4d4d; }
.chart-legend .adaptive-item { background: #a7f432; }
.chart-legend .runtime-item { background: #d2ff86; }
.adaptive-group-full { background: #ff4d4d; }
.chart-legend .sys-cpu { background: #5cc1ff; }
.chart-legend .sys-gpu { background: #c77dff; }
.chart-legend .sys-mem { background: #ffd166; }
.chart-legend .sys-disk { background: #ff7f7f; }
.chart-legend .sys-health { background: #7ef29a; }
.events-toggle-bottom {
  margin-top: 12px;
}

@media (max-width: 680px) {
  .topbar { flex-direction: column; align-items: flex-start; }
  .home-card {
    width: 100%;
    min-width: 0;
  }
  .home-card .preview-box {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .home-grid {
    grid-template-columns: 1fr;
  }
  .reconvert-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .stream-side-row {
    flex-direction: column;
  }
  .preset-toggle-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  .preset-toggle-row .stream-preset-field,
  .preset-toggle-row .stream-output-gain-field {
    width: auto;
    max-width: 240px;
  }
  .monitor-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .monitor-controls label {
    min-width: 0;
    max-width: none;
  }
  .preset-toggle-row .collapse-btn {
    width: auto;
    max-width: 240px;
  }
  .rtmp-device-create {
    flex-wrap: wrap;
    align-items: stretch;
  }
  .rtmp-device-card {
    grid-template-columns: 1fr;
    align-items: start;
    padding-right: 42px;
  }
  .rtmp-device-main {
    flex-wrap: wrap;
  }
  .rtmp-device-meta {
    justify-items: start;
  }
  .rtmp-device-stream {
    grid-column: 1;
    grid-template-columns: 1fr;
  }
  .reload-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .save-stream-row {
    justify-content: flex-start;
  }
  .media-upload-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "kind submit"
      "source source"
      "title title"
      "source_label source_label";
  }
  .media-upload-form button {
    width: auto;
    justify-self: start;
  }
  .media-table .col-title { width: 1%; }
  .media-table .col-status { width: 82px; }
  .media-table .col-file { width: 1%; }
  .media-table .col-action { width: 112px; }
}

@media (min-width: 901px) {
  .home-card .preview-box {
    justify-self: center;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 0;
  }
  #home-hls-video {
    width: 100%;
    height: 100%;
    max-height: none;
    max-width: none;
    aspect-ratio: auto;
  }
}

@media (max-width: 680px) {
  .playlist-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .media-upload-form {
    grid-template-columns: 1fr;
    grid-template-areas:
      "kind"
      "source"
      "title"
      "source_label"
      "submit";
  }
  .media-save-row {
    flex-direction: column;
    align-items: flex-end;
  }
  .media-table {
    table-layout: auto;
  }
  .media-table colgroup,
  .media-table thead {
    display: none;
  }
  .media-table tbody,
  .media-table tr,
  .media-table td {
    display: block;
    width: 100%;
  }
  .media-table tbody {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .media-table tr {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: start;
    align-items: start;
    row-gap: 6px;
    column-gap: 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    background: #0f1520;
    height: 100%;
  }
  .media-table td {
    border-top: none;
    padding: 0;
    min-width: 0;
    width: 100%;
    max-width: 260px;
    align-self: start;
  }
  .media-table td[data-label="ID"] { max-width: 70px; }
  .media-table td[data-label="Tytuł"] { max-width: 210px; }
  .media-table td[data-label="Typ"] { max-width: 88px; }
  .media-table td[data-label="Status"] { max-width: 150px; }
  .media-table td[data-label="Plik"] { max-width: 180px; }
  .media-table td[data-label="Akcja"] { max-width: 140px; }
  .media-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
  }
  .media-table td[data-label="Akcja"] form {
    display: flex;
    justify-content: flex-start;
  }
  .media-table td .muted,
  .media-table td .file-details,
  .media-table td form {
    margin: 0;
  }
  .media-table-wrap {
    overflow-x: visible;
  }
}

@media (max-width: 520px) {
  .media-table td,
  .media-table td[data-label] {
    max-width: 100%;
  }
}

@media (max-width: 700px) {
  .stream-side-row {
    flex-direction: column;
  }
}

/* Media table should behave like playlist: shrink smoothly instead of
   switching into card blocks. Keep this override last so it wins over
   earlier experimental responsive rules. */
@media (max-width: 820px) {
  .media-table {
    width: 100%;
    min-width: 100%;
    table-layout: auto;
    font-size: 12px;
  }
  .media-table colgroup {
    display: table-column-group;
  }
  .media-table thead {
    display: table-header-group;
  }
  .media-table tbody {
    display: table-row-group;
  }
  .media-table tr {
    display: table-row;
    border: none;
    border-radius: 0;
    padding: 0;
    background: transparent;
    height: auto;
  }
  .media-table th,
  .media-table td {
    display: table-cell;
    width: auto;
    max-width: none;
    min-width: 0;
    padding: 4px 5px;
    vertical-align: top;
    border-top: 1px solid var(--line);
  }
  .playlist-table th,
  .playlist-table td {
    padding: 4px 5px;
    line-height: 1.1;
  }
  .playlist-table .duration-input {
    width: 62px;
    min-width: 62px;
    height: 22px;
    padding: 2px 4px;
  }
  .playlist-table .small {
    padding: 2px 5px;
  }
  .media-table td::before {
    display: none;
    content: none;
  }
  .media-table td[data-label],
  .media-table td[data-label="ID"],
  .media-table td[data-label="Tytuł"],
  .media-table td[data-label="Typ"],
  .media-table td[data-label="Status"],
  .media-table td[data-label="Akcja"] {
    max-width: none;
  }
  .media-table td .muted,
  .media-table td .file-details,
  .media-table td form {
    margin: 0;
  }
  .media-table-wrap {
    overflow-x: auto;
  }
  .media-table .col-title { width: 150px; }
  .media-table .col-kind { width: 60px; }
  .media-table .col-status { width: 72px; }
  .media-table .col-duration { width: 42px; }
  .media-table .col-action { width: 112px; }
}

@media (max-width: 520px) {
  .media-table {
    width: 100%;
    min-width: 100%;
    table-layout: fixed;
    font-size: 11px;
  }
  .media-table th,
  .media-table td {
    padding: 3px 4px;
  }
  .playlist-table th,
  .playlist-table td {
    padding: 3px 4px;
    line-height: 1.1;
  }
  .playlist-table .duration-input {
    width: 58px;
    min-width: 58px;
    height: 20px;
    padding: 1px 3px;
  }
  .playlist-table .small {
    padding: 1px 4px;
  }
  .media-table .col-id { width: 30px; }
  .media-table .col-title { width: 132px; }
  .media-table .col-kind { width: 56px; }
  .media-table .col-status { width: 72px; }
  .media-table .col-duration { width: 44px; }
  .media-table .col-action { width: 90px; }
  .media-table-wrap {
    overflow-x: hidden;
  }
  .media-table th:nth-child(3),
  .media-table th:nth-child(4),
  .media-table th:nth-child(5),
  .media-table th:nth-child(6),
  .media-table th:nth-child(7),
  .media-table td:nth-child(3),
  .media-table td:nth-child(4),
  .media-table td:nth-child(5),
  .media-table td:nth-child(6),
  .media-table td:nth-child(7) {
    white-space: nowrap;
    text-align: center;
  }
  .file-details summary::after {
    content: "";
  }
  .media-action-row {
    flex-wrap: nowrap;
  }
  .users-table {
    font-size: 11px;
  }
  .users-table th,
  .users-table td {
    padding: 4px 3px;
  }
  .users-table .col-id { width: 42px; }
  .users-table .col-role { width: 56px; }
  .users-table .col-created { width: 118px; }
  .users-table .col-action { width: 84px; }
  .inline-edit {
    grid-template-columns: minmax(96px, 1fr) 64px minmax(96px, 1fr) 56px;
    gap: 3px;
  }
}

/* Final media title cell override: keep thumbnail + title inside the title
   column on narrow screens and prevent spill into the "Typ" column. */
.media-title-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.media-title-cell .media-thumb,
.media-title-cell .media-thumb-placeholder {
  flex: 0 0 36px;
}
.media-title-cell .media-title-input {
  width: auto;
  max-width: 100%;
  min-width: 0;
  flex: 1 1 0%;
  box-sizing: border-box;
}

@media (max-width: 520px) {
  .media-table {
    width: 100%;
    min-width: 100%;
    table-layout: auto;
  }
  .media-table colgroup,
  .media-table thead {
    display: none;
  }
  .media-table tbody {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .media-table tr {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto auto;
    grid-template-areas:
      "id title title title"
      "kind status duration action"
      "file file file file";
    gap: 6px 8px;
    padding: 10px 12px;
    border: 1px solid #38455c;
    border-radius: 12px;
    background: #1b2534;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
  }
  .media-table td,
  .media-table th {
    display: block;
    width: 100%;
    max-width: none;
    min-width: 0;
    padding: 0;
    border-top: none;
  }
  .media-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
  }
  .media-table td[data-label="ID"] {
    grid-area: id;
    max-width: 42px;
  }
  .media-table td[data-label="ID"]::before,
  .media-table td[data-label="Tytuł"]::before {
    display: none;
  }
  .media-table td[data-label="Tytuł"] {
    grid-area: title;
    overflow: hidden;
  }
  .media-table td[data-label="Typ"] {
    grid-area: kind;
  }
  .media-table td[data-label="Status"] {
    grid-area: status;
  }
  .media-table td[data-label="Czas"] {
    grid-area: duration;
  }
  .media-table td[data-label="Akcja"] {
    grid-area: action;
  }
  .media-table td[data-label="Plik"] {
    grid-area: file;
  }
  .media-table tr.media-link-row {
    grid-template-columns: 1fr;
    grid-template-areas: none;
    padding: 8px 12px 10px;
  }
  .media-table tr.media-link-row td::before {
    display: none;
  }
  .media-link-editor {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .media-table-wrap {
    overflow-x: visible;
  }
  .media-title-cell {
    overflow: visible;
  }
  .media-title-cell .media-title-input,
  .media-source-input {
    width: 100%;
    max-width: 100%;
  }
  .media-title-cell {
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }
  .media-title-cell .media-title-input {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .media-action-row {
    width: auto;
    justify-content: flex-end;
  }

  .playlist-table {
    width: 100%;
    min-width: 100%;
    table-layout: auto;
  }
  .playlist-table colgroup,
  .playlist-table thead {
    display: none;
  }
  .playlist-table tbody,
  .playlist-table tfoot {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .playlist-table tr {
    display: grid;
    gap: 6px 8px;
    padding: 10px 12px;
    border: 1px solid #38455c;
    border-radius: 12px;
    background: #1b2534;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
    height: auto;
  }
  .playlist-table td,
  .playlist-table th {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: none;
    padding: 0;
    border-top: none;
    white-space: normal;
  }
  .playlist-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
  }
  .playlist-drop-slot {
    display: none !important;
  }
  .playlist-table tr[data-playlist-item-id] {
    grid-template-columns: 20px 32px 16px repeat(4, minmax(0, 1fr));
    grid-template-areas:
      "drag pos dot media media actions actions"
      ". . . miss kind status duration";
  }
  .playlist-table tr[data-playlist-item-id] td[data-label="Przeciągnij"] {
    grid-area: drag;
    max-width: 20px;
  }
  .playlist-table tr[data-playlist-item-id] td[data-label="Poz."] {
    grid-area: pos;
    max-width: 32px;
  }
  .playlist-table tr[data-playlist-item-id] td[data-label="Status emisji"] {
    grid-area: dot;
    max-width: 16px;
  }
  .playlist-table tr[data-playlist-item-id] td[data-label="Media"] {
    grid-area: media;
    min-width: 0;
  }
  .playlist-table tr[data-playlist-item-id] td[data-label="Miss"] {
    grid-area: miss;
  }
  .playlist-table tr[data-playlist-item-id] td[data-label="Rodzaj"] {
    grid-area: kind;
  }
  .playlist-table tr[data-playlist-item-id] td[data-label="Status"] {
    grid-area: status;
  }
  .playlist-table tr[data-playlist-item-id] td[data-label="Czas"] {
    grid-area: duration;
  }
  .playlist-table tr[data-playlist-item-id] td[data-label="Akcje"] {
    grid-area: actions;
  }
  .playlist-table tr[data-playlist-item-id] td[data-label="Przeciągnij"]::before,
  .playlist-table tr[data-playlist-item-id] td[data-label="Poz."]::before,
  .playlist-table tr[data-playlist-item-id] td[data-label="Status emisji"]::before,
  .playlist-table tr[data-playlist-item-id] td[data-label="Media"]::before {
    display: none;
  }
  .playlist-table tr[data-playlist-item-id] td[data-label="Przeciągnij"],
  .playlist-table tr[data-playlist-item-id] td[data-label="Poz."],
  .playlist-table tr[data-playlist-item-id] td[data-label="Status emisji"] {
    align-self: center;
  }
  .playlist-table tr[data-playlist-item-id] .playlist-media-title-cell {
    min-width: 0;
    overflow: hidden;
  }
  .playlist-table tr[data-playlist-item-id] .playlist-media-title-wrap {
    display: flex;
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }
  .playlist-table tr[data-playlist-item-id] .playlist-media-title-wrap > span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .playlist-table tr[data-playlist-item-id] .playlist-action-cell {
    width: auto;
    justify-content: flex-end;
  }
  .playlist-table tr[data-playlist-item-id] .duration-save-status {
    display: inline-block;
    margin-left: 6px;
    min-width: 0;
  }

  .playlist-group-row {
    grid-template-columns: 32px 16px repeat(4, minmax(0, 1fr));
    grid-template-areas:
      "pos dot media media actions actions"
      ". . miss kind status duration";
    background: #1b2534;
  }
  .playlist-group-row td[data-label="Przeciągnij"] {
    display: none;
  }
  .playlist-group-row td[data-label="Poz."] {
    grid-area: pos;
    max-width: 32px;
  }
  .playlist-group-row td[data-label="Status emisji"] {
    grid-area: dot;
    max-width: 16px;
  }
  .playlist-group-row td[data-label="Media"] {
    grid-area: media;
    min-width: 0;
  }
  .playlist-group-row td[data-label="Miss"] {
    grid-area: miss;
  }
  .playlist-group-row td[data-label="Rodzaj"] {
    grid-area: kind;
  }
  .playlist-group-row td[data-label="Status"] {
    grid-area: status;
  }
  .playlist-group-row td[data-label="Czas"] {
    grid-area: duration;
  }
  .playlist-group-row td[data-label="Akcje"] {
    grid-area: actions;
  }
  .playlist-group-row td[data-label="Poz."]::before,
  .playlist-group-row td[data-label="Status emisji"]::before,
  .playlist-group-row td[data-label="Media"]::before {
    display: none;
  }

  .playlist-group-footer-row {
    grid-template-columns: 16px repeat(4, minmax(0, 1fr));
    grid-template-areas: "dot miss status duration duration";
    background: #16212f;
  }
  .playlist-group-footer-row td[data-label="Przeciągnij"],
  .playlist-group-footer-row td[data-label="Poz."],
  .playlist-group-footer-row td[data-label="Media"],
  .playlist-group-footer-row td[data-label="Rodzaj"],
  .playlist-group-footer-row td[data-label="Akcje"] {
    display: none;
  }
  .playlist-group-footer-row td[data-label="Status emisji"] {
    grid-area: dot;
    max-width: 16px;
  }
  .playlist-group-footer-row td[data-label="Status"] {
    grid-area: status;
  }
  .playlist-group-footer-row td[data-label="Czas"] {
    grid-area: duration;
  }
  .playlist-group-footer-row td[data-label="Status emisji"]::before,
  .playlist-group-footer-row td[data-label="Status"]::before,
  .playlist-group-footer-row td[data-label="Czas"]::before {
    display: none;
  }

  .playlist-total-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas: "label label duration";
    background: #1b2534;
  }
  .playlist-total-row td[data-label="Przeciągnij"],
  .playlist-total-row td[data-label="Poz."],
  .playlist-total-row td[data-label="Status emisji"],
  .playlist-total-row td[data-label="Akcje"] {
    display: none;
  }
  .playlist-total-row td[data-label="Media"] {
    grid-area: label;
  }
  .playlist-total-row td[data-label="Czas"] {
    grid-area: duration;
  }
  .playlist-total-row td[data-label="Media"]::before,
  .playlist-total-row td[data-label="Czas"]::before {
    display: none;
  }
  .playlist-total-duration-label {
    width: auto;
    padding-right: 0;
    text-align: left;
  }
  .playlist-total-duration-value {
    margin: 0 auto;
  }
}
