@font-face {
  font-family: "SMF Montserrat";
  src: url("/api/fonts/montserrat/file?weight=400") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Montserrat";
  src: url("/api/fonts/montserrat/file?weight=500") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Montserrat";
  src: url("/api/fonts/montserrat/file?weight=600") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Montserrat";
  src: url("/api/fonts/montserrat/file?weight=700") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Montserrat";
  src: url("/api/fonts/montserrat/file?weight=800") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Montserrat";
  src: url("/api/fonts/montserrat/file?weight=900") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Montserrat Alternates";
  src: url("/api/fonts/montserrat-alternates/file?weight=400") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Montserrat Alternates";
  src: url("/api/fonts/montserrat-alternates/file?weight=500") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Montserrat Alternates";
  src: url("/api/fonts/montserrat-alternates/file?weight=600") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Montserrat Alternates";
  src: url("/api/fonts/montserrat-alternates/file?weight=700") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Montserrat Alternates";
  src: url("/api/fonts/montserrat-alternates/file?weight=800") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Montserrat Alternates";
  src: url("/api/fonts/montserrat-alternates/file?weight=900") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Lato";
  src: url("/api/fonts/lato/file?weight=400") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Lato";
  src: url("/api/fonts/lato/file?weight=500") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Lato";
  src: url("/api/fonts/lato/file?weight=600") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Lato";
  src: url("/api/fonts/lato/file?weight=700") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Lato";
  src: url("/api/fonts/lato/file?weight=800") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Lato";
  src: url("/api/fonts/lato/file?weight=900") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Open Sans";
  src: url("/api/fonts/open-sans/file?weight=400") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Open Sans";
  src: url("/api/fonts/open-sans/file?weight=500") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Open Sans";
  src: url("/api/fonts/open-sans/file?weight=600") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Open Sans";
  src: url("/api/fonts/open-sans/file?weight=700") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Open Sans";
  src: url("/api/fonts/open-sans/file?weight=800") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Open Sans";
  src: url("/api/fonts/open-sans/file?weight=900") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Roboto";
  src: url("/api/fonts/roboto/file?weight=400") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Roboto";
  src: url("/api/fonts/roboto/file?weight=500") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Roboto";
  src: url("/api/fonts/roboto/file?weight=600") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Roboto";
  src: url("/api/fonts/roboto/file?weight=700") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Roboto";
  src: url("/api/fonts/roboto/file?weight=800") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Roboto";
  src: url("/api/fonts/roboto/file?weight=900") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Roboto Condensed";
  src: url("/api/fonts/roboto-condensed/file?weight=400") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Roboto Condensed";
  src: url("/api/fonts/roboto-condensed/file?weight=500") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Roboto Condensed";
  src: url("/api/fonts/roboto-condensed/file?weight=600") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Roboto Condensed";
  src: url("/api/fonts/roboto-condensed/file?weight=700") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Roboto Condensed";
  src: url("/api/fonts/roboto-condensed/file?weight=800") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Roboto Condensed";
  src: url("/api/fonts/roboto-condensed/file?weight=900") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Noto Sans";
  src: url("/api/fonts/noto-sans/file?weight=400") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Noto Sans";
  src: url("/api/fonts/noto-sans/file?weight=500") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Noto Sans";
  src: url("/api/fonts/noto-sans/file?weight=600") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Noto Sans";
  src: url("/api/fonts/noto-sans/file?weight=700") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Noto Sans";
  src: url("/api/fonts/noto-sans/file?weight=800") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Noto Sans";
  src: url("/api/fonts/noto-sans/file?weight=900") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF DejaVu Sans";
  src: url("/api/fonts/dejavu-sans/file?weight=400") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF DejaVu Sans";
  src: url("/api/fonts/dejavu-sans/file?weight=500") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF DejaVu Sans";
  src: url("/api/fonts/dejavu-sans/file?weight=600") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF DejaVu Sans";
  src: url("/api/fonts/dejavu-sans/file?weight=700") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF DejaVu Sans";
  src: url("/api/fonts/dejavu-sans/file?weight=800") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF DejaVu Sans";
  src: url("/api/fonts/dejavu-sans/file?weight=900") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Roboto Bold";
  src: url("/api/fonts/roboto/file?weight=700") format("truetype");
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF Lato Bold";
  src: url("/api/fonts/lato/file?weight=700") format("truetype");
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SMF DejaVu Sans Bold";
  src: url("/api/fonts/dejavu-sans/file?weight=700") format("truetype");
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #080b12;
  --panel: #111827;
  --border: rgba(148, 163, 184, .16);
  --border-strong: rgba(148, 163, 184, .28);
  --text: #e5e7eb;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --accent: #7c3aed;
  --accent-2: #06b6d4;
  --good: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
  --blue: #3b82f6;
  --shadow: 0 18px 55px rgba(0, 0, 0, .35);
  --radius: 18px;
  --sidebar: 280px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 10% 0%, rgba(124, 58, 237, .18), transparent 38%),
    radial-gradient(circle at 90% 12%, rgba(6, 182, 212, .14), transparent 34%),
    linear-gradient(180deg, #070a11 0%, #090d16 45%, #06080d 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }

.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 22px 16px;
  background: rgba(8, 11, 18, .82); backdrop-filter: blur(18px);
  border-right: 1px solid var(--border); overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 22px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.logo {
  width: 42px; height: 42px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(124,58,237,1), rgba(6,182,212,1));
  display: grid; place-items: center; box-shadow: 0 12px 35px rgba(124, 58, 237, .35); font-weight: 900;
}
.brand h1 { font-size: 17px; line-height: 1.15; margin: 0; letter-spacing: -.02em; }
.brand span { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; font-weight: 500; }
.sidebar-close {
  display: none;
  width: 38px;
  height: 38px;
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 23, 42, .86);
  color: var(--text);
  cursor: pointer;
}
.sidebar-close:hover { background: rgba(30, 41, 59, .95); color: #fff; }
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 55;
  border: 0;
  background: rgba(2, 6, 23, .58);
  backdrop-filter: blur(2px);
  cursor: pointer;
}

.nav { display: grid; gap: 6px; margin-top: 10px; }
.nav button,
.nav a {
  width: 100%; border: 0; color: var(--muted); background: transparent;
  display: flex; align-items: center; gap: 10px; padding: 11px 12px;
  border-radius: 13px; cursor: pointer; text-align: left; transition: .18s ease;
  text-decoration: none;
}
.nav button:hover,
.nav a:hover { background: rgba(148, 163, 184, .08); color: var(--text); }
.nav button.active,
.nav a.active {
  background: linear-gradient(135deg, rgba(124, 58, 237, .22), rgba(6, 182, 212, .13));
  color: #fff; box-shadow: inset 0 0 0 1px rgba(124, 58, 237, .25);
}
.nav button span,
.nav a span { width: 24px; text-align: center; opacity: .92; }

.side-card {
  margin-top: 22px; padding: 15px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(17, 24, 39, .9), rgba(15, 23, 42, .68));
  border: 1px solid var(--border); display: grid; gap: 8px;
}
.side-title { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-card small { color: var(--muted); line-height: 1.45; }
.meter { height: 8px; background: rgba(148, 163, 184, .12); border-radius: 999px; overflow: hidden; }
.meter span { display: block; height: 100%; width: 0%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; min-height: 72px;
  display: grid; grid-template-columns: minmax(180px, 1fr) minmax(320px, 560px) minmax(180px, 1fr);
  align-items: center; gap: 16px;
  padding: 16px 24px; background: rgba(8, 11, 18, .72); backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.top-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mobile-toggle {
  display: none; width: 42px; height: 42px; border: 1px solid var(--border);
  background: rgba(17, 24, 39, .82); color: var(--text); border-radius: 13px; cursor: pointer;
}
.topbar h2 { font-size: 20px; margin: 0; letter-spacing: -.03em; }
.topbar p { color: var(--muted); margin: 3px 0 0; font-size: 13px; }

.top-actions, .toolbar-actions, .toolbar-left, .mini-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.top-actions { justify-content: flex-end; }

.stream-status-bar {
  min-width: 0;
  min-height: 46px;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) 58px;
  align-items: center;
  gap: 10px;
  padding: 7px 8px 7px 11px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 23, 42, .58);
}
.stream-status-indicator {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #64748b;
  box-shadow: 0 0 0 4px rgba(100, 116, 139, .12);
}
.stream-status-bar.online {
  border-color: rgba(34, 197, 94, .3);
  background: rgba(20, 83, 45, .12);
}
.stream-status-bar.online .stream-status-indicator {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, .13);
}
.stream-status-bar.starting {
  border-color: rgba(56, 189, 248, .3);
  background: rgba(14, 116, 144, .12);
}
.stream-status-bar.starting .stream-status-indicator {
  background: #38bdf8;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, .13);
}
.stream-status-bar.degraded {
  border-color: rgba(245, 158, 11, .34);
  background: rgba(120, 53, 15, .15);
}
.stream-status-bar.degraded .stream-status-indicator {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, .14);
}
.stream-status-bar.stopping {
  border-color: rgba(248, 113, 113, .28);
  background: rgba(127, 29, 29, .13);
}
.stream-status-bar.stopping .stream-status-indicator {
  background: #f87171;
  box-shadow: 0 0 0 4px rgba(248, 113, 113, .13);
}
.stream-status-copy,
.stream-status-primary,
.stream-status-media {
  min-width: 0;
}
.stream-status-copy {
  display: grid;
  gap: 3px;
}
.stream-status-primary,
.stream-status-media {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.stream-status-primary strong {
  color: #cbd5e1;
  font-size: 12px;
  text-transform: uppercase;
}
.stream-status-bar.online .stream-status-primary strong {
  color: #86efac;
}
.stream-status-bar.starting .stream-status-primary strong { color: #7dd3fc; }
.stream-status-bar.degraded .stream-status-primary strong { color: #fbbf24; }
.stream-status-bar.stopping .stream-status-primary strong { color: #fca5a5; }
.stream-status-primary span,
.stream-status-media time {
  flex: none;
  color: var(--muted);
  font-size: 11px;
}
.stream-status-media span {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stream-status-media time {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.stream-monitor-button {
  width: 58px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(17, 24, 39, .78);
  color: var(--text);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}
.stream-monitor-button:disabled {
  cursor: default;
  opacity: .38;
}
.stream-monitor-button:not(:disabled):hover {
  border-color: var(--border-strong);
  background: rgba(30, 41, 59, .9);
}
.stream-monitor-button[aria-pressed="false"] {
  border-color: rgba(34, 197, 94, .35);
  background: rgba(34, 197, 94, .12);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.btn {
  border: 1px solid var(--border); background: rgba(17, 24, 39, .76); color: var(--text);
  border-radius: 10px; padding: 10px 13px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: .18s ease; white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: var(--border-strong); transform: translateY(-1px); background: rgba(21, 31, 50, .95); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; box-shadow: 0 12px 35px rgba(124, 58, 237, .28); }
.btn.good { background: rgba(34, 197, 94, .13); border-color: rgba(34, 197, 94, .3); color: #bbf7d0; }
.btn.warn { background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .28); color: #fde68a; }
.btn.danger { background: rgba(239, 68, 68, .13); border-color: rgba(239, 68, 68, .32); color: #fecaca; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn:disabled { cursor: not-allowed; opacity: .62; transform: none; }
.btn i { font-size: .95em; line-height: 1; }
.btn.icon-button {
  position: relative;
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  font-size: 15px;
}
.btn.icon-button i { color: currentColor; }
.btn.danger.icon-button {
  background: rgba(239, 68, 68, .22);
  border-color: rgba(248, 113, 113, .48);
  color: #fff;
}
.btn.primary.icon-button {
  box-shadow: 0 10px 24px rgba(124, 58, 237, .24);
}
.action-menu {
  position: relative;
  display: inline-flex;
}
.action-menu-trigger {
  padding-right: 10px;
}
.action-menu-chevron {
  color: var(--muted);
  font-size: 11px !important;
  margin-left: 2px;
}
.action-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: var(--action-menu-offset, 0);
  z-index: 40;
  width: min(320px, calc(100vw - 32px));
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(10, 16, 28, .98);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .38), 0 0 0 1px rgba(34, 211, 238, .08);
}
.action-menu-item {
  width: 100%;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.action-menu-item:hover {
  border-color: rgba(34, 211, 238, .28);
  background: rgba(34, 211, 238, .08);
  transform: translateY(-1px);
}
.action-menu-item:disabled {
  cursor: not-allowed;
  opacity: .58;
  transform: none;
}
.action-menu-item i {
  margin-top: 2px;
  color: #67e8f9;
}
.action-menu-item span {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.action-menu-item strong {
  font-size: 13px;
  line-height: 1.2;
}
.action-menu-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.tag-chip-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  vertical-align: middle;
}
.tag-chip {
  --tag-color: #38bdf8;
  display: inline-flex;
  align-items: center;
  max-width: 96px;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--tag-color) 48%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--tag-color) 16%, transparent);
  color: color-mix(in srgb, var(--tag-color) 88%, white);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tag-chip-more {
  --tag-color: #94a3b8;
  min-width: 28px;
  justify-content: center;
}
.tag-menu {
  position: relative;
  display: inline-flex;
}
.tag-menu-trigger {
  min-height: 30px;
}
.tag-menu-trigger-icon {
  position: relative;
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  justify-content: center;
}
.tag-menu-trigger-icon i {
  transition: opacity .14s ease, transform .14s ease;
}
.tag-menu-trigger-icon.is-empty::after {
  content: "+";
  position: absolute;
  display: grid;
  place-items: center;
  inset: 0;
  color: var(--text);
  font-size: 19px;
  font-weight: 950;
  line-height: 1;
  opacity: 0;
  transform: scale(.72);
  transition: opacity .16s ease, transform .16s ease;
}
.tag-menu-trigger-icon.is-empty:hover i,
.tag-menu-trigger-icon.is-empty:focus-visible i {
  opacity: 0;
  transform: scale(.72);
}
.tag-menu-trigger-icon.is-empty:hover::after,
.tag-menu-trigger-icon.is-empty:focus-visible::after {
  opacity: 1;
  transform: scale(1);
}
.tag-menu-panel {
  position: fixed;
  z-index: 95;
  width: min(340px, calc(100vw - 32px));
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(10, 16, 28, .98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .42), 0 0 0 1px rgba(34, 211, 238, .08);
}
.tag-menu-panel::before {
  content: "";
  position: absolute;
  top: -6px;
  left: var(--tag-menu-origin-x, 20px);
  width: 10px;
  height: 10px;
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  background: rgba(10, 16, 28, .98);
  transform: rotate(45deg);
}
.tag-option-list {
  display: grid;
  gap: 4px;
  max-height: 220px;
  overflow: auto;
  padding-right: 2px;
}
.tag-option {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 5px 7px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-weight: 800;
  transition: background .16s ease, border-color .16s ease;
}
.tag-option-toggle {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.tag-option-toggle > span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tag-option:hover,
.tag-option.selected {
  border-color: rgba(34, 211, 238, .24);
  background: rgba(34, 211, 238, .08);
}
.tag-option-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 34px;
}
.tag-delete-button {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #fda4af;
  opacity: .58;
  transition: opacity .16s ease, background .16s ease, border-color .16s ease;
}
.tag-delete-button:hover,
.tag-delete-button:focus-visible {
  border-color: rgba(251, 113, 133, .58);
  background: rgba(251, 113, 133, .14);
  opacity: 1;
}
.tag-color-dot,
.tag-color-swatch {
  --tag-color: #38bdf8;
  background: var(--tag-color);
}
.tag-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tag-color) 18%, transparent);
}
.tag-create {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.tag-create .field {
  min-width: 0;
  width: 100%;
}
.tag-palette {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.tag-color-swatch {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 999px;
  cursor: pointer;
}
.tag-color-swatch.active {
  box-shadow: 0 0 0 3px rgba(34, 211, 238, .22);
}
.tag-menu-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.tag-menu-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 6px;
}
.tag-filter-panel {
  gap: 12px;
}
.tag-filter-builder {
  display: grid;
  gap: 10px;
  max-height: min(520px, calc(100vh - 220px));
  overflow: auto;
  padding-right: 2px;
}
.tag-filter-block {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 23, 42, .58);
}
.tag-filter-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tag-filter-segment {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(2, 6, 23, .3);
}
.tag-filter-segment button {
  min-width: 44px;
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}
.tag-filter-segment button.active {
  background: rgba(34, 211, 238, .16);
  color: var(--text);
}
.tag-filter-remove {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(15, 23, 42, .62);
  color: var(--muted);
  cursor: pointer;
}
.tag-filter-remove:disabled {
  cursor: not-allowed;
  opacity: .45;
}
.tag-filter-tag-list {
  display: grid;
  gap: 5px;
  max-height: 220px;
  overflow: auto;
  padding-right: 2px;
}
.tag-filter-tag-option {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.tag-filter-tag-option span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tag-filter-tag-option strong {
  min-height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
}
.tag-filter-tag-option.yes {
  border-color: rgba(34, 211, 238, .32);
  background: rgba(34, 211, 238, .1);
}
.tag-filter-tag-option.yes strong {
  background: rgba(34, 211, 238, .18);
  color: #67e8f9;
}
.tag-filter-tag-option.not {
  border-color: rgba(248, 113, 113, .34);
  background: rgba(127, 29, 29, .16);
}
.tag-filter-tag-option.not strong {
  background: rgba(248, 113, 113, .18);
  color: #fecaca;
}
.tag-filter-add-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 2px;
}
.tag-filter-add-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.tag-manager-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 6, 23, .72);
  backdrop-filter: blur(6px);
}
.tag-manager-dialog {
  width: min(760px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(9, 14, 25, .98);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .48), 0 0 0 1px rgba(34, 211, 238, .08);
}
.tag-manager-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.tag-manager-head h3 {
  margin: 0;
  font-size: 18px;
}
.tag-manager-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.tag-manager-list {
  display: grid;
  gap: 8px;
  overflow: auto;
  padding-right: 2px;
}
.tag-manager-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 23, 42, .58);
}
.tag-manager-row.invalid {
  border-color: rgba(248, 113, 113, .55);
}
.tag-manager-order {
  display: grid;
  gap: 6px;
}
.tag-manager-order .btn.icon-button {
  width: 30px;
  min-width: 30px;
  height: 30px;
}
.tag-manager-fields {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(170px, 1.1fr) minmax(160px, .9fr) auto;
  align-items: end;
  gap: 10px;
}
.tag-manager-fields label,
.tag-manager-fields > div {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.tag-manager-fields span:not(.tag-chip) {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.tag-manager-error {
  padding: 10px 12px;
  border: 1px solid rgba(248, 113, 113, .38);
  border-radius: 10px;
  background: rgba(127, 29, 29, .22);
  color: #fecaca;
  font-size: 13px;
  font-weight: 800;
}
.tag-manager-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.tag-manager-spacer {
  flex: 1;
}
.file-btn input, .upload-zone input { display: none; }

.help-action-button {
  position: relative;
  gap: 0;
  overflow: visible;
  padding: 0;
}

.help-action-button.is-passive {
  cursor: help;
}

.help-action-button.is-passive:active {
  transform: none;
}

.help-action-button.is-disabled {
  cursor: not-allowed;
  opacity: 1;
  transform: none;
}

.help-action-button.is-disabled .button-help-label {
  opacity: .54;
}

.help-action-button.is-disabled .button-help-mark {
  opacity: 1;
}

.button-help-label {
  padding: 10px 12px;
}

.button-help-mark {
  position: relative;
  display: inline-grid;
  align-self: stretch;
  min-width: 38px;
  place-items: center;
  border-left: 1px solid rgba(148, 163, 184, .32);
  border-radius: 0 12px 12px 0;
  background: rgba(96, 165, 250, .08);
  color: #bfdbfe;
  font-size: 14px;
  font-weight: 900;
  transition: background-color .16s ease, color .16s ease;
}

.button-help-mark:hover {
  background: rgba(96, 165, 250, .2);
  color: #eff6ff;
}

.button-help-tooltip {
  position: absolute;
  left: 50%;
  right: auto;
  bottom: calc(100% + 10px);
  z-index: 30;
  width: var(--button-help-tooltip-width, min(340px, calc(100vw - 48px)));
  padding: 10px 12px;
  border: 1px solid rgba(96, 165, 250, .3);
  border-radius: 8px;
  background: rgba(8, 15, 28, .98);
  box-shadow: 0 14px 38px rgba(0, 0, 0, .36);
  color: #dbeafe;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  white-space: normal;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  transform: translate(calc(-50% + var(--button-help-tooltip-offset, 0px)), 5px);
  transition: opacity .16s ease, transform .16s ease;
}

.help-action-button:hover .button-help-tooltip,
.help-action-button:focus-visible .button-help-tooltip,
.button-help-mark:hover .button-help-tooltip,
.button-help-mark:focus-within .button-help-tooltip {
  opacity: 1;
  transform: translate(calc(-50% + var(--button-help-tooltip-offset, 0px)), 0);
}

.toolbar[data-batch-delete-pending="true"] {
  border-color: rgba(239, 68, 68, .3);
}

.status-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px;
  font-size: 12px; border: 1px solid var(--border); background: rgba(148, 163, 184, .08); color: var(--muted);
}
.dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; background: var(--muted-2); }
.status-pill.online .dot, .dot.good { background: var(--good); box-shadow: 0 0 0 4px rgba(34,197,94,.12); }
.status-pill.offline .dot, .dot.bad { background: var(--bad); box-shadow: 0 0 0 4px rgba(239,68,68,.12); }

.content { padding: 24px; display: grid; gap: 22px; }
.section { display: none; animation: fade .18s ease; }
.section.active { display: block; }
@keyframes fade { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.grid { display: grid; gap: 16px; min-width: 0; }
.grid > *,
.section,
.card,
.card-body {
  min-width: 0;
}
.grid.cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.two { grid-template-columns: minmax(0, 1.18fr) minmax(360px, .82fr); }
.mt { margin-top: 16px; }

.card {
  background: linear-gradient(180deg, rgba(17, 24, 39, .9), rgba(12, 18, 30, .9));
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.card-head { padding: 17px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h3 { margin: 0; font-size: 15px; letter-spacing: -.01em; }
.card-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.card-head-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.card-body { padding: 18px; }
.stack { display: grid; gap: 12px; }
.collapsible-card > summary.card-head {
  position: relative;
  padding-right: 62px;
  cursor: pointer;
  list-style: none;
}
.collapsible-card > summary.card-head::-webkit-details-marker { display: none; }
.collapsible-card > summary.card-head::marker { content: ""; }
.collapsible-card > summary.card-head::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 30px;
  height: 30px;
  margin-top: -15px;
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 8px;
  background: rgba(15, 23, 42, .42);
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}
.collapsible-card > summary.card-head::before {
  content: "";
  position: absolute;
  right: 29px;
  top: 50%;
  z-index: 1;
  width: 7px;
  height: 7px;
  margin-top: -5px;
  border: solid #93c5fd;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  transition: transform .16s ease, border-color .16s ease;
}
.collapsible-card[open] > summary.card-head::before {
  margin-top: -2px;
  transform: rotate(-135deg);
}
.collapsible-card > summary.card-head:hover::after {
  border-color: rgba(96, 165, 250, .45);
  background-color: rgba(59, 130, 246, .12);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .08);
}
.collapsible-card > summary.card-head:hover::before {
  border-color: #dbeafe;
}
.stat { padding: 18px; min-height: 128px; position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; inset: auto -25px -35px auto; width: 110px; height: 110px; background: radial-gradient(circle, rgba(124, 58, 237, .22), transparent 65%); pointer-events: none; }
.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.stat .value { font-size: 29px; font-weight: 800; letter-spacing: -.05em; margin-bottom: 7px; }
.stat .sub { color: var(--muted); font-size: 13px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .01em; border: 1px solid var(--border);
  color: var(--muted); background: rgba(148, 163, 184, .08); white-space: nowrap; width: fit-content;
}
.badge.good { color: #bbf7d0; border-color: rgba(34,197,94,.25); background: rgba(34,197,94,.11); }
.badge.warn { color: #fde68a; border-color: rgba(245,158,11,.25); background: rgba(245,158,11,.11); }
.badge.bad { color: #fecaca; border-color: rgba(239,68,68,.25); background: rgba(239,68,68,.11); }
.badge.blue { color: #bfdbfe; border-color: rgba(59,130,246,.25); background: rgba(59,130,246,.11); }
.badge.purple { color: #ddd6fe; border-color: rgba(124,58,237,.28); background: rgba(124,58,237,.13); }

.state-line { display: grid; grid-template-columns: 54px 1fr auto; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--border); background: rgba(15, 23, 42, .46); border-radius: 15px; margin-bottom: 10px; }
.num { color: var(--muted-2); font-size: 12px; font-weight: 800; }
.state-line strong { display: block; }
.state-line small { display: block; color: var(--muted); margin-top: 4px; }

.upload-zone { display: grid; gap: 6px; padding: 20px; border: 1px dashed rgba(6, 182, 212, .42); background: rgba(6, 182, 212, .06); border-radius: 16px; cursor: pointer; transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease; }
.upload-zone span { color: var(--muted); font-size: 13px; }
.upload-zone-button { width: 100%; color: var(--text); font: inherit; text-align: left; }
.upload-zone.is-dragging {
  border-color: rgba(34, 211, 238, .95);
  background: rgba(6, 182, 212, .14);
  box-shadow: inset 0 0 0 2px rgba(34, 211, 238, .16);
}
.media-upload-console {
  display: grid;
  gap: 14px;
}
.media-upload-transfer-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.media-upload-dropzone {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  width: 100%;
  min-height: 150px;
  padding: 22px;
  border: 1px dashed rgba(6, 182, 212, .42);
  border-radius: 16px;
  background: rgba(6, 182, 212, .06);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.media-upload-dropzone:hover,
.media-upload-dropzone:focus-visible,
.media-upload-dropzone.is-dragging {
  border-color: rgba(34, 211, 238, .9);
  background: rgba(6, 182, 212, .12);
  box-shadow: inset 0 0 0 2px rgba(34, 211, 238, .12), 0 16px 38px rgba(6, 182, 212, .08);
  transform: translateY(-1px);
}
.media-upload-dropzone:disabled {
  cursor: wait;
  opacity: .72;
  transform: none;
}
.media-upload-dropzone-icon,
.media-upload-file-icon {
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(96, 165, 250, .22);
  border-radius: 16px;
  background: rgba(59, 130, 246, .1);
  color: #bfdbfe;
}
.media-upload-dropzone-icon {
  width: 54px;
  height: 54px;
  font-size: 22px;
}
.media-upload-dropzone strong,
.media-upload-dropzone small {
  display: block;
}
.media-upload-dropzone strong {
  margin-bottom: 7px;
  font-size: 15px;
}
.media-upload-dropzone small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.media-upload-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.media-upload-summary span,
.media-upload-hint {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(15, 23, 42, .45);
  color: var(--muted);
  font-size: 12px;
}
.media-upload-summary strong {
  color: var(--text);
}
.media-upload-active-list {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(15, 23, 42, .34);
}
.media-upload-active-head,
.media-upload-local-main,
.media-upload-local-actions,
.media-upload-local-progress {
  display: flex;
  align-items: center;
  gap: 12px;
}
.media-upload-active-head,
.media-upload-local-actions {
  justify-content: space-between;
}
.media-upload-active-head > strong {
  font-size: 13px;
}
.media-upload-local-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(96, 165, 250, .18);
  border-radius: 14px;
  background: rgba(15, 23, 42, .62);
}
.media-upload-file-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 13px;
}
.media-upload-local-main {
  min-width: 0;
}
.media-upload-local-main > div {
  min-width: 0;
}
.media-upload-local-main strong,
.media-upload-local-main small {
  display: block;
}
.media-upload-local-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-upload-local-main small,
.media-upload-hint {
  color: var(--muted);
  font-size: 12px;
}
.media-upload-local-progress {
  grid-column: 1 / -1;
}
.media-upload-local-progress strong {
  min-width: 42px;
  text-align: right;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.media-upload-local-actions {
  grid-column: 1 / -1;
}
.media-upload-local-actions > div {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}
.media-upload-hint {
  justify-content: flex-start;
  border-radius: 13px;
  line-height: 1.45;
}
.media-upload-hint i {
  color: #67e8f9;
}
@media (max-width: 640px) {
  .media-upload-dropzone {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 18px;
  }

  .media-upload-active-head,
  .media-upload-local-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .media-upload-local-card {
    grid-template-columns: 1fr;
  }

  .media-upload-local-actions > div {
    justify-content: flex-start;
    margin-left: 0;
  }
}

.ingest-transport,
.ingest-job {
  display: grid;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(15, 23, 42, .46);
}

.ingest-jobs { display: grid; gap: 18px; }
.ingest-job-section,
.ingest-job-list { display: grid; gap: 10px; }
.ingest-job-section + .ingest-job-section {
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.ingest-job-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ingest-job-section-head > strong {
  color: var(--text);
  font-size: 13px;
}
.ingest-job-section-head > span {
  display: inline-grid;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  place-items: center;
  border: 1px solid rgba(96, 165, 250, .22);
  border-radius: 999px;
  background: rgba(59, 130, 246, .08);
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.compact-empty { padding: 14px; }
.ingest-history-footer {
  display: flex;
  justify-content: center;
  padding-top: 0;
}
.ingest-job-head,
.ingest-job-foot,
.ingest-progress-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.ingest-job-head > div { min-width: 0; }
.ingest-job-head strong,
.ingest-job-head small { display: block; }
.ingest-job-head strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ingest-job-head small,
.ingest-job-foot {
  color: var(--muted);
  font-size: 12px;
}
.progress-track {
  height: 8px;
  overflow: hidden;
  flex: 1;
  border-radius: 999px;
  background: rgba(148, 163, 184, .12);
}
.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .18s ease;
}
.ingest-error { color: #fecaca; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 0 0 18px; border-bottom: 1px solid var(--border); }
.field, label input, label select, label textarea { min-width: 190px; border: 1px solid var(--border); background: rgba(15, 23, 42, .88); color: var(--text); border-radius: 13px; padding: 10px 12px; outline: none; }
.field:focus, label input:focus, label select:focus { border-color: rgba(6, 182, 212, .55); box-shadow: 0 0 0 4px rgba(6, 182, 212, .08); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 960px; }
th, td { padding: 13px 18px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; background: rgba(15, 23, 42, .55); }
.list-load-sentinel {
  display: flex;
  justify-content: center;
  padding: 12px;
}

.video-list > .list-load-sentinel {
  border: 1px dashed rgba(148, 163, 184, .22);
  border-radius: 14px;
  background: rgba(15, 23, 42, .34);
}

.scroll-top-button {
  position: fixed;
  right: 22px;
  bottom: 88px;
  z-index: 65;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, .26);
  color: var(--text);
  background: rgba(15, 23, 42, .88);
  box-shadow: 0 18px 38px rgba(0, 0, 0, .28);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease, border-color .18s ease, background .18s ease;
}

.scroll-top-button.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.scroll-top-button:hover {
  border-color: rgba(34, 211, 238, .48);
  background: rgba(8, 47, 73, .92);
}
.table-sort {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}
.table-sort::after {
  content: "";
  width: 9px;
  height: 6px;
  opacity: .48;
  background:
    linear-gradient(currentColor, currentColor) 0 0 / 9px 1px no-repeat,
    linear-gradient(currentColor, currentColor) 2px 5px / 7px 1px no-repeat;
  transition: opacity .16s ease, transform .16s ease;
}
.table-sort.active::after {
  width: 7px;
  height: 7px;
  opacity: 1;
  background: none;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}
.table-sort.active[data-direction="asc"]::after { transform: rotate(225deg) translate(-1px, -1px); }
.table-sort.active[data-direction="desc"]::after { transform: rotate(45deg) translate(-1px, -1px); }
.table-sort:hover,
.table-sort.active { color: var(--text); }
.table-sort:hover::after { opacity: .85; }
.split-sort-heading {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.mini-sort {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 8px;
  background: rgba(15, 23, 42, .35);
  color: var(--muted);
  cursor: pointer;
  transition: border-color .16s ease, color .16s ease, background .16s ease;
}
.mini-sort:hover,
.mini-sort.active {
  border-color: rgba(34, 211, 238, .45);
  color: var(--text);
  background: rgba(14, 165, 233, .12);
}
.mini-sort::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: -2px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  opacity: 0;
  transform: rotate(45deg);
}
.mini-sort.active::after { opacity: .9; }
.mini-sort.active[data-direction="asc"]::after { transform: rotate(225deg) translate(-1px, -1px); }
.mini-sort.active[data-direction="desc"]::after { transform: rotate(45deg) translate(-1px, -1px); }
td { color: #dbe4ef; }
tr { transition: background .16s ease, box-shadow .16s ease; }
tr:hover td { background: rgba(148, 163, 184, .075); }
tr:hover td:first-child { box-shadow: inset 3px 0 0 rgba(34, 211, 238, .58); }
.track-cell strong { display: block; font-size: 14px; color: var(--text); }
.track-cell span { display: block; color: var(--muted); margin-top: 3px; font-size: 12px; }
.track-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: nowrap;
}
.track-title-line .track-title {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  color: var(--text);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inline-editable-title {
  min-width: 0;
  cursor: text;
  border-radius: 8px;
  outline: none;
  transition: color .16s ease;
}
.inline-editable-title:hover,
.inline-editable-title:focus-visible {
  color: #fff;
}
.inline-editable-title.editing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  cursor: default;
}
.inline-editable-title.editing .btn.icon-button {
  flex: 0 0 34px;
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
}
.inline-title-input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 8px 10px;
}
.track-title-line .inline-editable-title.editing {
  flex: 1 1 auto;
  width: 100%;
  max-width: min(420px, 100%);
}
.track-title-line .inline-title-input {
  width: 100%;
}
.track-title-line .tag-chip-row,
.track-title-line .tag-chip {
  display: inline-flex;
  margin-top: 0;
}
.track-title-line .tag-menu {
  flex: 0 0 auto;
}
.track-last-played strong {
  font-size: 12px;
  font-weight: 600;
  color: #dbe4ef;
  white-space: nowrap;
}
.track-last-played span {
  font-size: 11px;
}
.track-number {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.track-actions-head,
.track-row-actions {
  width: 1%;
  min-width: 286px;
  text-align: right;
  white-space: nowrap;
}

.track-row-actions > * {
  display: inline-flex;
  margin-left: 6px;
}

.track-row-actions > *:first-child { margin-left: 0; }
.tooltip-anchor {
  position: relative;
  display: inline-flex;
  overflow: visible;
  outline: none;
}
.tooltip-anchor > .button-help-tooltip {
  display: none;
}
.tooltip-anchor:hover .button-help-tooltip,
.tooltip-anchor:focus-within .button-help-tooltip {
  display: block;
  opacity: 1;
  transform: translate(calc(-50% + var(--button-help-tooltip-offset, 0px)), 0);
}
.queue-presence-button {
  min-width: 46px;
  padding-inline: 9px;
  justify-content: center;
  border-color: rgba(34, 197, 94, .42);
  background: rgba(16, 185, 129, .13);
  color: #bbf7d0;
  font-weight: 900;
}
.queue-presence-button:hover {
  border-color: rgba(34, 197, 94, .72);
  background: rgba(16, 185, 129, .22);
  color: #ecfdf5;
}
.queue-presence-button.multiple {
  border-color: rgba(245, 158, 11, .48);
  background: rgba(245, 158, 11, .14);
  color: #fde68a;
}
.queue-presence-button.multiple:hover {
  border-color: rgba(245, 158, 11, .78);
  background: rgba(245, 158, 11, .24);
  color: #fffbeb;
}
.queue-presence-tooltip {
  display: grid;
  gap: 4px;
  color: #dbeafe;
  text-align: center;
}
.queue-presence-tooltip strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .01em;
  white-space: normal;
  word-break: break-word;
}
.queue-presence-tooltip span {
  color: #9fb5ce;
  font-size: 11px;
  font-weight: 700;
}

.empty { padding: 28px; color: var(--muted); text-align: center; }

.cards-list { display: grid; gap: 12px; padding: 18px; }
.playlist-card, .track-chip { border: 1px solid var(--border); background: rgba(15, 23, 42, .58); border-radius: 16px; padding: 14px; }
.playlist-card { cursor: pointer; }
.playlist-card.active { border-color: rgba(6, 182, 212, .52); box-shadow: 0 0 0 4px rgba(6, 182, 212, .08); }
.playlist-card h4 { margin: 0 0 7px; font-size: 15px; }
.playlist-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.form-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; margin-bottom: 12px; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.form-grid { display: grid; gap: 14px; padding: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }

.playlist-tracks { display: grid; gap: 8px; margin-top: 14px; }
.track-chip { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; }
.track-chip small { color: var(--muted); }

.section-tabs {
  display: inline-flex;
  align-items: flex-end;
  gap: 4px;
  padding: 14px 18px 0;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 23, 42, .28);
  width: 100%;
}

.section-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}

.section-tabs button:hover {
  color: var(--text);
  background: rgba(148, 163, 184, .07);
}

.section-tabs button.active {
  color: var(--text);
  border-color: var(--border);
  background: linear-gradient(180deg, rgba(124, 58, 237, .18), rgba(15, 23, 42, .9));
  box-shadow: inset 0 2px 0 rgba(34, 211, 238, .62);
}

.section-tab-panel {
  min-height: 220px;
}

.section-tab-panel.padded {
  padding: 18px;
}

.section-tab-panel.padded > .toolbar {
  margin: 0;
}

.section-tab-panel.padded > .table-wrap,
.section-tab-panel.padded > .video-list {
  margin: 18px -18px -18px;
}

.duration-filter {
  display: inline-flex;
  align-items: stretch;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 13px;
  overflow: hidden;
  background: rgba(15, 23, 42, .82);
}

.duration-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-right: 1px solid var(--border);
  background: rgba(15, 23, 42, .18);
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  padding: 0 13px;
  transition: background .16s ease, color .16s ease;
}

.duration-filter-toggle:hover,
.duration-filter-toggle.active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(124, 58, 237, .38), rgba(6, 182, 212, .28));
}

.duration-filter-input {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.duration-filter-input input {
  width: 54px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  outline: none;
  padding: 0;
}

.duration-filter-input input::-webkit-outer-spin-button,
.duration-filter-input input::-webkit-inner-spin-button {
  margin: 0;
}

.duration-filter-input input[type="number"] {
  appearance: textfield;
}

.queue-panel-toolbar {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.queue-panel-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.section-tab-panel > .empty {
  padding: 18px;
}

.queue-list { display: grid; }
.queue-row {
  position: relative;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto minmax(132px, auto) auto auto;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  cursor: grab;
  transition: background .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.queue-row:hover {
  background: rgba(148, 163, 184, .075);
  box-shadow: inset 3px 0 0 rgba(34, 211, 238, .58);
}
.queue-row:active { cursor: grabbing; }
.queue-row.locked,
.queue-row.now { cursor: default; }
.queue-row.locked { background: rgba(59, 130, 246, .08); }
.queue-row.now { background: rgba(34, 197, 94, .06); }
.queue-row.locked:hover { background: linear-gradient(90deg, rgba(59, 130, 246, .14), rgba(59, 130, 246, .06)); }
.queue-row.now:hover { background: linear-gradient(90deg, rgba(34, 197, 94, .14), rgba(34, 197, 94, .055)); }
.queue-row.previewing {
  background: linear-gradient(90deg, rgba(124, 58, 237, .16), rgba(6, 182, 212, .07));
  box-shadow: inset 3px 0 0 var(--accent-2);
}
.queue-row.jump-highlight {
  animation: queue-jump-highlight 2.2s ease;
}
.queue-row.previewing .queue-title strong { color: #dbeafe; }
.queue-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.queue-title strong { display: block; font-size: 14px; }
.queue-title span { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.queue-play-stats {
  display: grid;
  gap: 3px;
  min-width: 132px;
  font-variant-numeric: tabular-nums;
}
.queue-play-stats strong {
  color: #dbe4ef;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.queue-play-stats span {
  color: var(--muted);
  font-size: 11px;
}

@keyframes queue-jump-highlight {
  0% {
    background: rgba(34, 197, 94, .2);
    box-shadow: inset 4px 0 0 rgba(34, 197, 94, .95), 0 0 0 1px rgba(34, 197, 94, .34);
  }

  65% {
    background: rgba(34, 197, 94, .12);
    box-shadow: inset 4px 0 0 rgba(34, 197, 94, .72), 0 0 0 1px rgba(34, 197, 94, .18);
  }

  100% {
    background: transparent;
    box-shadow: inset 0 0 0 rgba(34, 197, 94, 0), 0 0 0 1px rgba(34, 197, 94, 0);
  }
}
.queue-title-line {
  display: flex !important;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-top: 0 !important;
}
.queue-title-line strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.queue-title-line .tag-chip-row,
.queue-title-line .tag-chip {
  display: inline-flex;
  margin-top: 0;
}
.video-queue-row {
  grid-template-columns: 62px 112px minmax(0, 1fr) auto minmax(128px, auto) auto;
}
.video-queue-row.single-loop {
  background: rgba(34, 197, 94, .06);
}
.video-queue-row.single-loop:hover {
  background: linear-gradient(90deg, rgba(34, 197, 94, .14), rgba(34, 197, 94, .055));
}
.queue-video-preview {
  width: 112px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #05070c;
}
.queue-video-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.queue-video-missing {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.video-loop-interval {
  display: grid;
  gap: 6px;
  min-width: 128px;
}
.video-loop-interval label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}
.video-loop-interval-input {
  width: 58px;
  min-height: 30px;
  padding: 5px 7px;
  font-size: 12px;
}

.now-id { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; color: #bfdbfe; font-size: 13px; }
.now-title { font-size: 22px; font-weight: 800; letter-spacing: -.04em; text-align: center; }
.now-sub { color: var(--muted); font-size: 13px; text-align: center; }
.round-btn { width: 56px; height: 56px; border-radius: 999px; border: 0; color: white; background: linear-gradient(135deg, var(--accent), var(--accent-2)); cursor: pointer; font-size: 20px; }
.time-row { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
input[type="range"] { width: 100%; accent-color: var(--accent-2); }
.volume { width: min(100%, 620px); }

.hint { border: 1px dashed rgba(6, 182, 212, .35); background: rgba(6, 182, 212, .06); color: #bae6fd; border-radius: 16px; padding: 14px 16px; font-size: 13px; line-height: 1.55; }
.log { margin: 0; max-width: 100%; padding: 18px; background: #05070c; color: #b8f7d4; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 12px; line-height: 1.7; min-height: 430px; overflow: auto; border-top: 1px solid var(--border); }

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-wrap {
  width: min(100%, 440px);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.auth-brand h1,
.auth-brand p {
  margin: 0;
}

.auth-brand h1 {
  font-size: 24px;
  letter-spacing: 0;
}

.auth-brand p {
  color: var(--muted);
  margin-top: 3px;
  font-size: 14px;
}

.auth-card {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(15, 23, 42, .9), rgba(15, 23, 42, .78));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.auth-card-head {
  padding: 24px 24px 0;
}

.auth-mode {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  padding: 7px 11px;
  font-size: 12px;
  background: rgba(15, 23, 42, .75);
  margin-bottom: 16px;
}

.auth-card h2 {
  font-size: 28px;
  margin: 0 0 8px;
  letter-spacing: 0;
}

.auth-card p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.auth-form {
  display: grid;
  gap: 14px;
  padding: 24px;
}

.auth-form label {
  display: grid;
  gap: 8px;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 700;
}

.auth-form input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(2, 6, 23, .62);
  color: var(--text);
  padding: 14px 15px;
  outline: none;
}

.auth-form input:focus {
  border-color: rgba(6, 182, 212, .9);
  box-shadow: 0 0 0 4px rgba(6, 182, 212, .12);
}

.auth-form button {
  border: 0;
  border-radius: 14px;
  padding: 14px 16px;
  font-weight: 850;
  cursor: pointer;
  color: #00111f;
  background: linear-gradient(135deg, var(--accent), #0ea5e9);
  box-shadow: 0 18px 40px rgba(6, 182, 212, .2);
}

.auth-form button:disabled {
  cursor: wait;
  opacity: .7;
}

.auth-status {
  min-height: 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.auth-status.error { color: var(--bad); }
.auth-status.ok { color: var(--good); }

.auth-note {
  border-top: 1px solid var(--border);
  padding: 16px 24px 22px;
  color: var(--muted);
  background: rgba(15, 23, 42, .44);
  font-size: 13px;
  line-height: 1.55;
}

.media-integrity-card {
  margin-bottom: 18px;
}

.react-toast-viewport {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 130;
  display: flex;
  width: min(400px, calc(100vw - 28px));
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.react-toast {
  --toast-accent: var(--accent);
  position: relative;
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr) 30px;
  gap: 12px;
  min-height: 72px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: rgba(10, 16, 31, .97);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .38);
  color: var(--text);
  padding: 13px 12px 14px 10px;
  pointer-events: auto;
  animation: react-toast-enter .18s ease-out both;
}

.react-toast.success {
  --toast-accent: var(--good);
  border-color: rgba(34, 197, 94, .38);
}

.react-toast.error {
  --toast-accent: var(--bad);
  border-color: rgba(239, 68, 68, .42);
}

.react-toast.info {
  --toast-accent: #38bdf8;
  border-color: rgba(56, 189, 248, .38);
}

.react-toast.warning {
  --toast-accent: #fbbf24;
  border-color: rgba(251, 191, 36, .42);
}

.react-toast-marker {
  width: 4px;
  height: 100%;
  border-radius: 2px;
  background: var(--toast-accent);
}

.react-toast-copy {
  display: grid;
  align-content: center;
  min-width: 0;
  gap: 4px;
}

.react-toast-copy strong,
.react-toast-copy span {
  overflow-wrap: anywhere;
}

.react-toast-copy strong {
  font-size: 14px;
}

.react-toast-copy span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.react-toast-close {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 20px;
}

.react-toast-close:hover,
.react-toast-close:focus-visible {
  background: rgba(148, 163, 184, .12);
  color: var(--text);
}

.react-toast-timer {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--toast-accent);
  transform-origin: left;
  animation: react-toast-timeout var(--toast-duration) linear forwards;
}

.react-toast:hover .react-toast-timer,
.react-toast:focus-within .react-toast-timer {
  animation-play-state: paused;
}

@keyframes react-toast-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@keyframes react-toast-timeout {
  to {
    transform: scaleX(0);
  }
}

.react-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 6, 23, .62);
  backdrop-filter: blur(10px);
}

.react-popup {
  width: min(100%, 560px);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: rgba(15, 23, 42, .98);
  box-shadow: var(--shadow);
  padding: 18px;
}

.react-popup.success {
  border-color: rgba(34, 197, 94, .42);
}

.react-popup.error {
  border-color: rgba(239, 68, 68, .48);
}

.react-popup.info {
  border-color: rgba(56, 189, 248, .42);
}

.react-popup.warning {
  border-color: rgba(251, 191, 36, .48);
}

.react-popup-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.react-popup h3,
.react-popup p {
  margin: 0;
}

.react-popup h3 {
  font-size: 20px;
  margin-top: 4px;
}

.react-popup p {
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.5;
}

.react-popup-kicker {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

@media (max-width: 640px) {
  .react-toast-viewport {
    right: 14px;
    bottom: 14px;
    left: 14px;
    width: auto;
  }

  .react-toast {
    min-height: 66px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .react-toast {
    animation: none;
  }
}

.media-integrity-summary,
.media-integrity-missing {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

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

.media-integrity-summary span,
.media-integrity-missing div {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 10px;
  background: rgba(15, 23, 42, .72);
  color: var(--muted);
  font-size: 12px;
}

.media-integrity-missing div {
  display: grid;
  gap: 2px;
}

.media-integrity-missing strong {
  color: var(--text);
  font-size: 12px;
}

@media (max-width: 1180px) {
  .topbar { grid-template-columns: minmax(180px, .8fr) minmax(280px, 1.4fr) auto; }
  .top-actions .status-pill { display: none; }
  .grid.cards-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.two { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 60; transform: translateX(-100%); transition: .2s ease; width: min(86vw, 320px); }
  body.sidebar-open .sidebar,
  .sidebar.open { transform: translateX(0); }
  .sidebar.open ~ .main { pointer-events: none; }
  .sidebar-close { display: inline-grid; place-items: center; }
  .sidebar-backdrop { display: block; }
  .mobile-toggle { display: inline-grid; place-items: center; }
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
  }
  .top-left { min-width: 0; }
  .top-left > div { min-width: 0; }
  .topbar h2, .topbar p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .stream-status-bar { grid-column: 1 / -1; grid-row: 2; width: 100%; }
  .top-actions { grid-column: 2; grid-row: 1; justify-content: flex-end; flex-wrap: nowrap; }
  .content { padding: 16px; }
  .card-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .card-head-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .tag-manager-backdrop { padding: 10px; align-items: stretch; }
  .tag-manager-dialog {
    max-height: calc(100vh - 20px);
    align-self: center;
  }
  .tag-manager-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .tag-manager-order {
    grid-column: 1 / -1;
    display: flex;
  }
  .tag-manager-fields {
    grid-template-columns: 1fr;
  }
  .tag-manager-actions {
    flex-wrap: wrap;
  }
  .tag-manager-spacer { display: none; }
  .grid.cards-4, .form-grid { grid-template-columns: 1fr; }
  .grid.three { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .state-line, .queue-row, .track-chip { grid-template-columns: 1fr; }
  .queue-video-preview { width: min(100%, 220px); }
  .queue-row-actions { justify-content: flex-start; }
  table { min-width: 860px; }
}

@media (max-width: 480px) {
  .topbar p { display: none; }
  .stream-status-primary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .stream-status-media { align-items: center; }
  .stream-status-media span { font-size: 12px; }
  .stream-status-media time { font-size: 10px; }
}

.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 6px 0 0;
}

.visual-preview {
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: #05070c;
  display: grid;
  place-items: center;
}

.visual-preview img,
.visual-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.visual-empty-preview {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 18px;
}

.visuals-list,
.video-list {
  display: grid;
  gap: 12px;
}

.visual-card {
  position: relative;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, .58);
  border-radius: 16px;
  padding: 12px;
}

.visual-card.active {
  border-color: rgba(34, 197, 94, .35);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, .07);
}

.visual-thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  background: #05070c;
  border: 1px solid var(--border);
}

.visual-thumb img,
.visual-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-preview-button {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: #05070c;
  color: var(--text);
  cursor: pointer;
  display: block;
}

.video-preview-button img {
  transition: transform .18s ease, opacity .18s ease;
}

.video-preview-button:hover img {
  transform: scale(1.025);
  opacity: .9;
}

.video-preview-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: rgba(148, 163, 184, .72);
  font-size: 28px;
}

.video-preview-play {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: rgba(2, 6, 23, .68);
  border: 1px solid rgba(255, 255, 255, .22);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .32);
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.video-preview-button:hover .video-preview-play {
  transform: translate(-50%, -50%) scale(1.06);
  background: rgba(6, 182, 212, .76);
  border-color: rgba(255, 255, 255, .38);
}

.visual-info {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.visual-info small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.visual-info small strong {
  color: var(--muted-2);
  font-weight: 800;
}

.visual-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.visual-title-row strong {
  display: block;
  min-width: 0;
  font-size: 14px;
  color: var(--text);
  overflow: visible;
  overflow-wrap: anywhere;
  white-space: normal;
}
.visual-title-row .inline-editable-title {
  display: inline;
  max-width: 100%;
  padding: 2px 4px;
  margin: -2px -4px;
  overflow: visible;
  overflow-wrap: anywhere;
  white-space: normal;
}
.visual-title-row .inline-editable-title.editing {
  display: inline-flex;
  width: min(460px, 100%);
  overflow: visible;
}
.media-title-line {
  display: inline;
  min-width: 0;
  max-width: 100%;
}
.compact-check-row {
  align-items: center;
  flex-wrap: wrap;
}
.compact-check-row .media-title-line {
  flex: 0 1 auto;
}
.compact-check-row .inline-editable-title.editing {
  display: inline-flex;
  width: min(460px, 100%);
}
.compact-check-row .inline-title-input {
  width: 100%;
}
.media-title-accessories {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  gap: 8px;
  margin-left: 8px;
  flex-wrap: wrap;
}
.media-title-accessories .badge {
  flex: 0 0 auto;
}

.visual-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.visual-action-groups {
  min-width: max-content;
}

.visual-card[data-delete-pending="true"] {
  border-color: rgba(239, 68, 68, .38);
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.check-row input[type="checkbox"],
.inline-check input[type="checkbox"] {
  flex: 0 0 auto;
  min-width: 0;
  width: 16px;
  height: 16px;
  padding: 0;
}

.compact-check-row {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}
.compact-check-row strong {
  flex: 1 1 auto;
  min-width: 0;
}

.video-queue-row:active {
  cursor: grabbing;
}

@media (max-width: 820px) {
  .visual-card {
    grid-template-columns: 1fr;
  }

  .visual-actions {
    justify-content: flex-start;
  }
}

.scene-grid {
  align-items: start;
}

.scene-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: #05070c;
  display: grid;
  place-items: center;
}

.scene-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.scene-bg.fit-cover {
  object-fit: cover;
}

.scene-bg.fit-contain {
  object-fit: contain;
  background: #05070c;
}

.scene-bg.fit-stretch {
  object-fit: fill;
}

.scene-overlay-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scene-text-overlay {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  line-height: 1.1;
  letter-spacing: 0;
  text-shadow: 0 4px 18px rgba(0, 0, 0, .75);
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
  pointer-events: auto;
  cursor: grab;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0;
  user-select: none;
  touch-action: none;
}

.scene-text-overlay:hover {
  border-color: rgba(255, 255, 255, .35);
  background: rgba(15, 23, 42, .2);
}

.scene-text-overlay.active {
  border-color: rgba(34, 197, 94, .9);
  background: rgba(34, 197, 94, .08);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, .25), 0 14px 40px rgba(0, 0, 0, .25);
}

.scene-text-overlay:active,
.scene-text-overlay.dragging {
  cursor: grabbing;
}

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

.scene-element-stream_uptime,
.scene-element-countdown {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.scene-elements-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(2, 6, 23, .22);
}

.scene-element-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 23, 42, .72);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.scene-element-item.disabled {
  opacity: .58;
}

.scene-element-item.disabled .scene-element-title {
  text-decoration: line-through;
}

.scene-element-item:hover {
  border-color: var(--border-strong);
  background: rgba(21, 31, 50, .9);
}

.scene-element-item.active {
  border-color: rgba(34, 197, 94, .7);
  background: rgba(34, 197, 94, .09);
}

.scene-element-index {
  grid-row: span 2;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(148, 163, 184, .14);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.scene-element-title {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 800;
}

.scene-element-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.scene-element-content {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.scene-element-meta {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--muted);
  font-size: 12px;
}

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

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

.field-label-title {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.hint a {
  color: #67e8f9;
  font-weight: 700;
}

.compact-grid {
  gap: 10px;
}

.bitrate-settings-grid {
  display: grid;
  gap: 10px;
}

.bitrate-setting-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(250px, .72fr) minmax(250px, .72fr);
  gap: 12px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 8px;
  background: rgba(15, 23, 42, .38);
}

.bitrate-preset-name {
  align-self: center;
  display: grid;
  gap: 2px;
}

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

.bitrate-setting-row span {
  color: var(--muted);
  font-size: 12px;
}

.bitrate-inline-field {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr);
  align-items: center;
  gap: 10px;
}

.bitrate-inline-field > span {
  min-width: 48px;
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 720px) {
  .bitrate-setting-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .bitrate-inline-field {
    grid-template-columns: 64px minmax(0, 1fr);
  }
}

#settings.section.active {
  display: flex;
  flex-direction: column;
}

#workspaceSettingsCard { order: 1; }
#liveStreamSettingsCard { order: 2; }
#bitrateProfileSettingsCard { order: 3; }
#renderCacheCard { order: 4; }

.workspace-channel-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(300px, 1fr) minmax(300px, 1fr);
  gap: 12px;
}

.destination-profile-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.field.needs-attention {
  animation: live-readiness-action 2.4s ease;
}

.live-key-selector {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15, 23, 42, .3);
}

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

.color-field {
  height: 44px;
  padding: 6px;
}

.has-bottom-player .app {
  padding-bottom: 120px;
}

.bottom-player {
  position: fixed;
  left: 300px;
  right: 20px;
  bottom: 18px;
  z-index: 70;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) max-content minmax(280px, 2fr) minmax(130px, 170px) 36px;
  grid-template-areas: "track controls seek volume close";
  column-gap: clamp(14px, 1.4vw, 24px);
  align-items: center;
  padding: 12px 16px;
  border: 1px solid rgba(96, 165, 250, .22);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, .98), rgba(15, 23, 42, .9)),
    rgba(15, 23, 42, .96);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .48), 0 0 0 1px rgba(15, 23, 42, .9);
  backdrop-filter: blur(18px);
  transform: translateY(140%);
  opacity: 0;
  pointer-events: none;
  transition: transform .22s ease, opacity .22s ease;
}

.bottom-player.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.bottom-player-main,
.bottom-player-seek,
.bottom-player-side {
  min-width: 0;
}

.bottom-player-main {
  grid-area: track;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.bottom-player-art {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: #cffafe;
  background: linear-gradient(135deg, rgba(124, 58, 237, .7), rgba(6, 182, 212, .55));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}

.bottom-track-info { min-width: 0; }

.bottom-track-info .now-id {
  margin-bottom: 2px;
  font-size: 11px;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.bottom-track-info .now-title {
  font-size: 15px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0;
}

.bottom-player-buttons {
  grid-area: controls;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.bottom-player-seek {
  grid-area: seek;
  justify-self: center;
  min-width: min(280px, 100%);
  max-width: 760px;
  width: 100%;
}

.bottom-player input[type="range"] {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2) 0 var(--progress, 0%), rgba(148, 163, 184, .22) var(--progress, 0%) 100%);
  accent-color: var(--accent-2);
  cursor: pointer;
}

.bottom-player-side {
  grid-area: volume;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  overflow: hidden;
}

.bottom-volume {
  display: grid;
  grid-template-columns: auto minmax(0, 150px);
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  color: #bfdbfe;
}

.bottom-volume input[type="range"] {
  min-width: 0;
  width: 100%;
}

.bottom-player-close {
  grid-area: close;
  align-self: center;
  justify-self: end;
  position: relative;
  z-index: 1;
}

@media (max-width: 1200px) {
  .bottom-player {
    left: 20px;
    grid-template-columns: minmax(180px, .9fr) max-content minmax(220px, 1.5fr) minmax(120px, 150px) 36px;
    column-gap: 14px;
  }
}

@media (max-width: 900px) {
  .bottom-player {
    grid-template-columns: minmax(0, 1fr) 40px;
    grid-template-areas:
      "track close"
      "controls controls"
      "seek seek"
      "volume volume";
    row-gap: 12px;
  }

  .bottom-player-main,
  .bottom-player-buttons,
  .bottom-player-seek,
  .bottom-player-side,
  .bottom-player-close { grid-column: auto; }
  .bottom-player-side { justify-content: flex-start; }
  .has-bottom-player .app { padding-bottom: 300px; }
}

@media (max-width: 720px) {
  .bottom-player {
    left: 12px;
    right: 12px;
    bottom: 12px;
    border-radius: 18px;
  }

  .has-bottom-player .app { padding-bottom: 330px; }
}

.round-btn {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  min-width: 52px;
  padding: 0;
  line-height: 1;
  text-align: center;
  font-size: 19px;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(6, 182, 212, .2);
  transition: transform .16s ease, filter .16s ease, box-shadow .16s ease;
}

.round-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(6, 182, 212, .28);
}

.round-btn:active { transform: translateY(0); }

.small-round {
  width: 42px;
  height: 42px;
  min-width: 42px;
  font-size: 16px;
}

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

.visual-actions:has(.inline-confirm-actions[data-pending="true"]) > :not(.inline-confirm-actions),
.visual-actions:has(.inline-confirm-actions[data-pending="true"]) .inline-confirm-actions[data-pending="false"] {
  display: none;
}

.preview-playing-row td {
  background: linear-gradient(90deg, rgba(124, 58, 237, .16), rgba(6, 182, 212, .07));
}

.preview-playing-row td:first-child {
  box-shadow: inset 3px 0 0 var(--accent-2);
}

.preview-playing-row .track-title { color: #dbeafe; }

.server-time-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(15, 23, 42, .56);
}

.server-time-card strong {
  display: block;
  margin-bottom: 4px;
}

.server-time-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.scene-selected-type {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(2, 6, 23, .22);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.scene-visibility-toggle {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, .8);
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  line-height: 1;
}

.scene-visibility-toggle:hover {
  border-color: var(--border-strong);
  background: rgba(30, 41, 59, .95);
}

.scene-visibility-toggle.on {
  color: #86efac;
}

.scene-visibility-toggle.off {
  color: #fca5a5;
}

.scene-media-fields[hidden] {
  display: none !important;
}

.scene-element-media {
  padding: 0;
  overflow: hidden;
  background: transparent;
}

.scene-element-media.active {
  border-color: rgba(34, 197, 94, .9);
  background: rgba(34, 197, 94, .04);
}

.scene-media-content {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.scene-media-content.fit-contain {
  object-fit: contain;
}

.scene-media-content.fit-cover {
  object-fit: cover;
}

.scene-media-content.fit-stretch {
  object-fit: fill;
}

.scene-media-content.blend-normal {
  mix-blend-mode: normal;
}

.scene-media-content.blend-screen {
  mix-blend-mode: screen;
}

.scene-media-content.blend-lighten {
  mix-blend-mode: lighten;
}

.scene-media-content.blend-green-screen {
  mix-blend-mode: normal;
}

.scene-media-key-source {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.scene-media-missing {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border: 1px dashed rgba(248, 113, 113, .6);
  border-radius: 10px;
  background: rgba(127, 29, 29, .2);
  color: #fecaca;
  font-size: 13px;
  font-weight: 800;
}

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

.duration-field-group {
  display: grid;
  gap: 8px;
}

.render-duration-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 10px;
  background: rgba(15, 23, 42, .38);
}

.inline-check {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.switch-control {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 13px;
  background: rgba(15, 23, 42, .44);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.switch-control:hover {
  border-color: rgba(56, 189, 248, .42);
  background: rgba(15, 23, 42, .68);
}

.switch-control:disabled {
  cursor: not-allowed;
  opacity: .58;
}

.switch-control-track {
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 26px;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(51, 65, 85, .94), rgba(15, 23, 42, .96));
  box-shadow: inset 0 1px 8px rgba(2, 6, 23, .42);
  transition: border-color .16s ease, background .16s ease;
}

.switch-control-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #e2e8f0;
  box-shadow: 0 4px 10px rgba(2, 6, 23, .38);
  transition: transform .18s ease, background .18s ease;
}

.switch-control.is-on .switch-control-track {
  border-color: rgba(34, 211, 238, .72);
  background: linear-gradient(90deg, #7c3aed, #06b6d4 62%, #22c55e);
}

.switch-control.is-on .switch-control-thumb {
  transform: translateX(22px);
  background: #fff;
}

.switch-control-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.switch-control-text strong {
  font-size: 13px;
  line-height: 1.2;
}

.switch-control-text small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.advanced-panel {
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 10px;
  background: rgba(2, 6, 23, .26);
}

.advanced-panel summary {
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.advanced-panel .stack {
  margin-top: 12px;
}

.render-duration-summary {
  min-width: 220px;
  color: var(--muted);
  font-size: 12px;
}

.audio-normalization-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}

.audio-normalization-panel .switch-control {
  flex: 1 1 280px;
}

.compact-number-field {
  min-width: 140px;
}

.output-workflow-layout {
  display: grid;
  gap: 18px;
}

.output-workflow-grid {
  display: grid;
  grid-template-columns: minmax(300px, .82fr) minmax(0, 1.18fr);
  gap: 16px;
  align-items: start;
}

.output-settings-column,
.output-steps-column {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.encoder-select-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15, 23, 42, .28);
}
.encoder-select-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.encoder-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.encoder-select-title strong,
.encoder-select-title > span {
  display: block;
}
.encoder-select-title > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.encoder-title-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-help-mark {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  color: var(--muted);
  outline: none;
}

.inline-help-mark .button-help-mark {
  width: 22px;
  min-width: 22px;
  height: 22px;
  border: 1px solid rgba(96, 165, 250, .28);
  border-radius: 999px;
  background: rgba(15, 23, 42, .72);
}

.inline-help-mark:hover .button-help-mark,
.inline-help-mark:focus-within .button-help-mark,
.inline-help-mark:focus .button-help-mark {
  border-color: rgba(56, 189, 248, .62);
  background: rgba(14, 116, 144, .18);
  color: #dff8ff;
}

.help-mark-label {
  color: #9fb5ce;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.benchmark-help {
  display: grid;
  gap: 5px;
  line-height: 1.35;
}

.encoder-mode-help {
  display: grid;
  gap: 8px;
  line-height: 1.4;
}

.encoder-mode-help > span {
  display: grid;
  gap: 2px;
}

.encoder-mode-help strong {
  display: block;
  color: #eff6ff;
  font-size: 12px;
}

.benchmark-help strong,
.benchmark-help span {
  display: block;
}

@media (max-width: 1100px) {
  .output-workflow-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .encoder-select-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .encoder-head-actions {
    justify-content: flex-start;
    width: 100%;
  }
}

.encoder-option-list {
  display: grid;
  gap: 6px;
}
.encoder-option-row {
  display: grid;
  grid-template-columns: auto minmax(120px, .5fr) minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}
.encoder-option-row strong {
  color: #dbe4ef;
  font-size: 13px;
}
.encoder-option-row[data-state="disabled"] {
  opacity: .72;
}

.output-status {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(15, 23, 42, .62);
  color: var(--text);
  font-weight: 700;
  outline: none;
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease, color .2s ease;
}

@property --status-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.output-status[data-state="running"] {
  --status-angle: 0deg;
  border-color: transparent;
  background:
    linear-gradient(rgba(15, 23, 42, .96), rgba(15, 23, 42, .96)) padding-box,
    conic-gradient(from var(--status-angle), rgba(34, 197, 94, .18), #22c55e, rgba(56, 189, 248, .8), rgba(34, 197, 94, .18)) border-box;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .08);
  color: #dcfce7;
  animation: local-test-border 1.4s linear infinite;
}

.output-status[data-state="passed"] {
  border-color: rgba(34, 197, 94, .5);
  background: rgba(22, 101, 52, .22);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .07);
  color: #bbf7d0;
}

.output-status[data-state="failed"] {
  border-color: rgba(248, 113, 113, .52);
  background: rgba(127, 29, 29, .26);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .07);
  color: #fecaca;
}

@keyframes local-test-border {
  to {
    --status-angle: 360deg;
  }
}

@media (prefers-reduced-motion: reduce) {
  .output-status[data-state="running"] {
    animation: none;
  }
}

.workflow-step {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(2, 6, 23, .3);
  transition: border-color .2s ease, opacity .2s ease;
}

.workflow-step[data-state="locked"] {
  opacity: .58;
}

.workflow-step[data-state="active"] {
  border-color: rgba(56, 189, 248, .52);
}

.workflow-step[data-state="done"] {
  border-color: rgba(34, 197, 94, .46);
}

.workflow-step-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.workflow-step-head > div {
  display: grid;
  gap: 4px;
}

.workflow-step-head strong {
  color: var(--text);
  font-size: 14px;
}

.workflow-step-head span:not(.workflow-step-index) {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.workflow-step-index {
  display: grid;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, .34);
  border-radius: 999px;
  background: rgba(15, 23, 42, .68);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.workflow-step[data-state="active"] .workflow-step-index {
  border-color: rgba(56, 189, 248, .58);
  color: #bae6fd;
}

.workflow-step[data-state="done"] .workflow-step-index {
  border-color: rgba(34, 197, 94, .58);
  color: #bbf7d0;
}

.prepare-ready-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(2, 6, 23, .28);
}

.prepare-ready-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.prepare-ready-head > div {
  display: grid;
  gap: 3px;
}

.prepare-ready-head strong {
  color: var(--text);
  font-size: 13px;
}

.prepare-ready-head span {
  color: var(--muted);
  font-size: 12px;
}

.prepare-ready-pill {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 999px;
  background: rgba(15, 23, 42, .5);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.prepare-ready-meter {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .72);
}

.prepare-ready-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #22c55e);
  transition: width .25s ease;
}

.prepare-ready-detail {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.prepare-ready-card[data-state="preparing"] .prepare-ready-meter span {
  width: 58%;
  background: linear-gradient(90deg, #38bdf8, #f59e0b, #38bdf8);
  background-size: 180% 100%;
  animation: prepare-meter 1.2s linear infinite;
}

.prepare-ready-card.determinate-progress-card .prepare-ready-meter span {
  width: var(--workflow-progress, 0%);
  background: linear-gradient(90deg, #38bdf8, #22c55e);
  animation: none;
}

.audio-scan-ready-card[data-state="preparing"] .prepare-ready-meter span {
  width: var(--audio-scan-progress, 0%);
  background: linear-gradient(90deg, #38bdf8, #22c55e);
  animation: none;
}

.upload-progress-card[data-state="preparing"] .prepare-ready-meter span {
  background: linear-gradient(90deg, #38bdf8, #22c55e);
  animation: none;
}

.audio-scan-ready-card[data-state="warn"] {
  border-color: rgba(245, 158, 11, .5);
}

.audio-scan-ready-card[data-state="warn"] .prepare-ready-meter span {
  width: var(--audio-scan-progress, 0%);
}

.audio-scan-ready-card[data-state="warn"] .prepare-ready-pill {
  border-color: rgba(245, 158, 11, .46);
  background: rgba(146, 64, 14, .28);
  color: #fde68a;
}

.prepare-ready-card[data-state="ready"] {
  border-color: rgba(34, 197, 94, .34);
}

.prepare-ready-card[data-state="ready"] .prepare-ready-meter span {
  width: 100%;
}

.prepare-ready-card[data-state="ready"] .prepare-ready-pill {
  border-color: rgba(34, 197, 94, .36);
  background: rgba(22, 101, 52, .28);
  color: #bbf7d0;
}

.prepare-ready-card[data-state="error"] {
  border-color: rgba(248, 113, 113, .42);
}

.prepare-ready-card[data-state="error"] .prepare-ready-meter span {
  width: 100%;
  background: #ef4444;
}

.prepare-ready-card[data-state="error"] .prepare-ready-pill {
  border-color: rgba(248, 113, 113, .4);
  background: rgba(127, 29, 29, .32);
  color: #fecaca;
}

@keyframes prepare-meter {
  from {
    background-position: 0 0;
  }

  to {
    background-position: 180% 0;
  }
}

.small-log {
  min-height: 220px;
  max-height: 420px;
}

.workflow-readable-report {
  display: grid;
  flex: 1 0 100%;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 12px;
  background: rgba(15, 23, 42, .38);
}

.workflow-readable-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.workflow-readable-grid > div {
  display: grid;
  gap: 4px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, .12);
  border-radius: 8px;
  background: rgba(2, 6, 23, .28);
}

.workflow-readable-grid span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.workflow-readable-grid strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-readable-message {
  padding-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 860px) {
  .workflow-readable-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .workflow-readable-grid {
    grid-template-columns: 1fr;
  }
}

.preflight-report {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(2, 6, 23, .38);
}

.preflight-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-size: 13px;
}

.preflight-head span,
.preflight-steps {
  color: var(--muted);
}

.preflight-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preflight-list {
  display: grid;
  gap: 6px;
}

.preflight-row {
  display: grid;
  grid-template-columns: minmax(96px, .8fr) minmax(0, 1.5fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 30px;
  padding: 7px 8px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 8px;
  background: rgba(15, 23, 42, .46);
  color: var(--muted);
  font-size: 12px;
}

.preflight-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preflight-row strong {
  color: var(--text);
  font-size: 11px;
  text-transform: uppercase;
}

.preflight-steps {
  display: grid;
  gap: 4px;
  font-size: 12px;
}

.resource-profile {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(2, 6, 23, .28);
}

.resource-profile-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.resource-profile-head > div {
  display: grid;
  gap: 3px;
}

.resource-profile-head strong {
  color: var(--text);
  font-size: 13px;
}

.resource-profile-head span,
.resource-note {
  color: var(--muted);
  font-size: 12px;
}

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

.resource-grid > div {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 8px;
  background: rgba(15, 23, 42, .42);
}

.resource-grid span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.resource-grid strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
}

.resource-note {
  line-height: 1.45;
}

.output-profile-summary {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border: 1px solid rgba(56, 189, 248, .24);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(8, 47, 73, .32), rgba(15, 23, 42, .48));
  box-shadow: inset 3px 0 0 rgba(56, 189, 248, .55);
}

.output-profile-summary span {
  color: #9bd5ee;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.output-profile-summary strong {
  color: #e5f7ff;
  font-size: 12px;
  line-height: 1.45;
}

.render-report {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(2, 6, 23, .28);
}

.render-report {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 10px;
}

.render-report > div {
  display: grid;
  gap: 4px;
}

.render-report span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.render-report strong {
  color: var(--text);
  font-size: 12px;
}

.output-files-card {
  margin-top: 18px;
}

.live-confirm {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(96, 165, 250, .28);
  border-radius: 8px;
  background: rgba(59, 130, 246, .08);
}

.live-confirm strong {
  color: var(--text);
  font-size: 13px;
}

.live-confirm span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.live-scheduler {
  display: grid;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, .14);
}

.live-scheduler-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.live-scheduler-head > div {
  display: grid;
  gap: 3px;
}

.live-scheduler-head strong {
  color: var(--text);
  font-size: 14px;
}

.live-scheduler-head span,
.live-schedule-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.live-scheduler-panel {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 8px;
  background: rgba(15, 23, 42, .35);
}

.live-scheduler-panel > .help-action-button {
  justify-self: start;
}

.live-schedule-list {
  display: grid;
  gap: 8px;
  max-height: 358px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.live-schedule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 8px;
  background: rgba(15, 23, 42, .3);
}

.live-schedule-row[data-state="scheduled"],
.live-schedule-row[data-state="running"] {
  border-color: rgba(34, 211, 238, .28);
}

.live-schedule-row[data-state="failed"] {
  border-color: rgba(248, 113, 113, .45);
  background: rgba(248, 113, 113, .08);
}

.live-schedule-row > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.live-schedule-row strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-schedule-row span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.live-schedule-warning {
  color: #facc15 !important;
}

.live-schedule-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.live-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn.compact {
  min-height: 30px;
  padding: 6px 10px;
}

.icon-button:not(.btn) {
  width: 38px;
  min-width: 38px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.destination-profile-list,
.admin-users-list {
  display: grid;
  gap: 10px;
}

.destination-key-grid {
  display: grid;
  grid-template-columns: minmax(220px, .75fr) minmax(320px, 1.25fr);
  align-items: start;
  gap: 16px;
}

.destination-key-grid .field-label {
  min-width: 0;
}

.destination-profile-row {
  display: flex;
  width: 100%;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15, 23, 42, .42);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.destination-profile-row > span:first-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.destination-profile-row small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.destination-profile-row:hover,
.destination-profile-row.active {
  border-color: rgba(34, 211, 238, .58);
  background: rgba(34, 211, 238, .08);
}

.admin-create-grid {
  display: grid;
  grid-template-columns: minmax(150px, .8fr) minmax(220px, 1fr) minmax(200px, 1fr) auto;
  gap: 10px;
}

.admin-user-row {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15, 23, 42, .36);
}

.admin-user-summary {
  display: grid;
  grid-template-columns: minmax(180px, .7fr) minmax(0, 2fr);
  gap: 18px;
}

.admin-user-summary > div:first-child {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: start;
  gap: 8px;
}

.admin-user-summary > div:first-child small {
  flex-basis: 100%;
  color: var(--muted);
}

.admin-user-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 8px;
}

.admin-user-metrics span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.admin-user-metrics small,
.admin-quota-grid label {
  color: var(--muted);
  font-size: 12px;
}

.admin-user-metrics strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-quota-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  gap: 10px;
}

.admin-quota-grid label {
  display: grid;
  gap: 6px;
}

.admin-user-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.admin-user-actions > span {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
}

.admin-password-reset {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  gap: 10px;
}

.live-playback-policy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.live-playback-policy > label {
  display: grid;
  gap: 3px;
}

.live-playback-policy > label > span {
  color: var(--muted);
  font-size: 12px;
}

.live-play-count {
  width: 112px;
  min-width: 112px;
}

.prepare-ready-card.needs-attention {
  animation: live-readiness-card 2.4s ease;
}

.btn.needs-attention {
  animation: live-readiness-action 2.4s ease;
}

@keyframes live-readiness-card {
  0%, 100% { box-shadow: none; }
  18%, 55% { border-color: rgba(248, 113, 113, .82); box-shadow: 0 0 0 3px rgba(248, 113, 113, .12); }
}

@keyframes live-readiness-action {
  0%, 100% { box-shadow: none; }
  18%, 55% { border-color: rgba(34, 211, 238, .9); box-shadow: 0 0 0 4px rgba(34, 211, 238, .16); }
}

@media (prefers-reduced-motion: reduce) {
  .prepare-ready-card.needs-attention,
  .btn.needs-attention {
    animation: none;
    border-color: rgba(248, 113, 113, .82);
  }
}

@media (max-width: 640px) {
  .live-scheduler-grid {
    grid-template-columns: 1fr;
  }

  .live-schedule-row {
    align-items: stretch;
    flex-direction: column;
  }

  .live-schedule-actions {
    justify-content: stretch;
  }

  .live-playback-policy {
    align-items: stretch;
    flex-direction: column;
  }

  .live-play-count {
    width: 100%;
  }
}

@media (max-width: 1100px) {
  .admin-create-grid,
  .admin-quota-grid,
  .destination-key-grid,
  .workspace-channel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 640px) {
  .admin-create-grid,
  .admin-quota-grid,
  .admin-user-metrics,
  .destination-key-grid,
  .admin-password-reset,
  .workspace-channel-grid {
    grid-template-columns: 1fr;
  }

  .destination-profile-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-user-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

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

.live-telemetry-grid > div {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 8px;
  background: rgba(15, 23, 42, .42);
}

.live-telemetry-grid span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.live-telemetry-grid strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.cache-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.storage-cleanup-panel {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(280px, auto) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 8px;
  background: rgba(15, 23, 42, .42);
}

.storage-cleanup-panel > div:first-child {
  display: grid;
  gap: 4px;
}

.storage-cleanup-panel strong {
  color: var(--text);
  font-size: 13px;
}

.storage-cleanup-panel > div:first-child span {
  color: var(--muted);
  font-size: 12px;
}

.cache-summary > div,
.cache-bucket-row {
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 8px;
  background: rgba(15, 23, 42, .42);
}

.cache-summary span,
.cache-bucket-row span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.cache-summary strong,
.cache-bucket-row strong {
  color: var(--text);
  font-size: 13px;
}

.cache-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 220px) auto;
  gap: 8px;
  align-items: center;
}

.cache-buckets {
  display: grid;
  gap: 8px;
}

.cache-bucket-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, auto);
  gap: 12px;
  align-items: center;
}

.cache-bucket-row > div {
  display: grid;
  gap: 4px;
}

.preview-stream-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 132px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(2, 6, 23, .58);
  padding: 18px;
}

.preview-stream-url {
  width: 100%;
  overflow-wrap: anywhere;
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 720px) {
  .resource-grid {
    grid-template-columns: 1fr;
  }

  .live-telemetry-grid {
    grid-template-columns: 1fr;
  }

  .resource-profile-head {
    align-items: stretch;
    flex-direction: column;
  }

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

  .cache-summary,
  .cache-controls,
  .cache-bucket-row,
  .storage-cleanup-panel {
    grid-template-columns: 1fr;
  }
}

.hidden {
  display: none !important;
}

.scene-grid > .card:first-child {
  position: sticky;
  top: 16px;
  align-self: start;
  z-index: 6;
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.scene-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.render-preview-panel {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(2, 6, 23, .35);
}

.render-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.render-preview-head strong {
  font-size: 13px;
}

.render-preview-head span {
  color: var(--muted);
  font-size: 12px;
}

.render-preview-panel img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border-radius: 12px;
  background: #020617;
}
