:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #090b10;
  color: #f4f6fb;
  --bg: #090b10;
  --panel: #10131a;
  --panel-soft: #141821;
  --border: #252a35;
  --border-soft: #1d222c;
  --text: #f4f6fb;
  --muted: #8991a3;
  --muted-2: #697184;
  --accent: #8b7cf6;
  --accent-soft: rgba(139,124,246,.12);
  --good: #67e8a5;
  --warning: #f5c451;
  --danger: #ff6b7a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 82% 0%, rgba(89,68,190,.12), transparent 28%),
    var(--bg);
}

button {
  font: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 18px 20px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-soft);
  background: rgba(10,12,17,.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 8px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(139,124,246,.42);
  border-radius: 9px;
  background: var(--accent-soft);
  color: #b7adff;
  font-size: 15px;
  font-weight: 900;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border-radius: inherit;
}

.brand-name {
  font-size: 15px;
  font-weight: 850;
  letter-spacing: .17em;
}

.nav {
  margin-top: 38px;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.nav-item.active {
  background: var(--accent-soft);
  color: #ddd8ff;
}

.nav-item:disabled {
  opacity: .55;
}

.nav-icon {
  width: 18px;
  text-align: center;
  color: var(--muted-2);
}

.nav-item.active .nav-icon {
  color: #a99cff;
}

.nav-spacer {
  flex: 1;
}

.sidebar-status {
  padding: 16px 10px 4px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-top: 1px solid var(--border-soft);
}

.sidebar-status div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-status strong {
  color: #d9dce5;
  font-size: 12px;
}

.sidebar-status span:last-child {
  color: var(--muted-2);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 12px rgba(103,232,165,.55);
}

.status-dot.bad {
  background: var(--danger);
  box-shadow: 0 0 12px rgba(255,107,122,.45);
}

.main {
  min-width: 0;
  padding: 38px clamp(24px, 4vw, 58px) 60px;
}

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

.eyebrow,
.panel-kicker {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .19em;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 48px);
  letter-spacing: -.04em;
}

h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -.02em;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted-2);
  font-size: 11px;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #aeb5c4;
  font-weight: 800;
  letter-spacing: .1em;
}

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

.summary-card,
.panel {
  border: 1px solid var(--border);
  background: rgba(16,19,26,.82);
}

.summary-card {
  min-height: 134px;
  padding: 20px;
  border-radius: 13px;
  display: flex;
  flex-direction: column;
}

.summary-label {
  color: #a6adbc;
  font-size: 12px;
  font-weight: 700;
}

.summary-value {
  margin-top: 12px;
  font-size: 36px;
  line-height: 1;
  letter-spacing: -.04em;
}

.summary-note {
  margin-top: auto;
  padding-top: 13px;
  color: var(--muted-2);
  font-size: 11px;
}

.problem-card .summary-value {
  color: #ff8a96;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr);
  gap: 12px;
}

.health-panel {
  grid-column: 1 / -1;
  grid-row: 3;
}

.problems-panel {
  grid-column: 2;
  grid-row: 2;
}

.panel {
  min-width: 0;
  border-radius: 13px;
  overflow: hidden;
}

.panel-header {
  min-height: 76px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border-soft);
}

.health-panel .panel-header {
  min-height: 48px;
  padding: 10px 14px;
}

.health-panel h2 {
  font-size: 14px;
}

.panel-count,
.health-summary {
  min-width: 0;
  min-height: 0;
  padding: 2px 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 5px;
  color: var(--muted-2);
  background: transparent;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
}

.panel-count.danger {
  color: #ff929d;
  border-color: rgba(255,107,122,.24);
  background: rgba(255,107,122,.07);
}

.pipeline-list,
.playback-list,
.problem-list {
  min-height: 160px;
}

.service-list {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pipeline-row,
.problem-row,
.playback-row {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-soft);
}

.service-row {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-soft);
}

.pipeline-row:last-child,
.problem-row:last-child,
.playback-row:last-child,
.service-row:last-child {
  border-bottom: 0;
}

.pipeline-row,
.problem-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.item-title {
  min-width: 0;
  overflow: hidden;
  color: #e8eaf0;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-meta {
  margin-top: 5px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted-2);
  font-size: 10px;
}

.stage,
.problem-badge {
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.stage {
  color: #b8afff;
  background: var(--accent-soft);
}

.problem-badge {
  color: #ff929d;
  background: rgba(255,107,122,.09);
}

.playback-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 13px;
}

.play-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: #b8afff;
}

.progress-track {
  height: 3px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 99px;
  background: #252a34;
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: #8b7cf6;
}

.service-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.service-name {
  color: #dfe2e9;
  font-size: 12px;
  font-weight: 700;
}

.service-type {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 10px;
  text-transform: uppercase;
}

.service-state {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.service-state .status-dot {
  width: 5px;
  height: 5px;
  box-shadow: none;
}

.empty-state {
  min-height: 160px;
  padding: 30px 20px;
  display: grid;
  place-items: center;
  color: var(--muted-2);
  font-size: 12px;
  text-align: center;
}

.error-state {
  color: #ff929d;
}

@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .sidebar {
    padding-inline: 12px;
  }

  .brand {
    justify-content: center;
    padding: 0;
  }

  .brand-name,
  .nav-item span:not(.nav-icon),
  .sidebar-status div {
    display: none;
  }

  .nav-item {
    justify-content: center;
    padding: 0;
  }

  .nav-icon {
    width: auto;
  }

  .sidebar-status {
    justify-content: center;
  }
}

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

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

@media (max-width: 600px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 20;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    height: 62px;
    padding: 7px 10px;
    border-top: 1px solid var(--border);
    border-right: 0;
  }

  .brand,
  .sidebar-status,
  .nav-spacer,
  .nav-item:nth-of-type(3),
  .nav-item:nth-of-type(4),
  .nav-item:nth-of-type(6),
  .nav-item:nth-of-type(7) {
    display: none;
  }

  .nav {
    margin: 0;
    flex-direction: row;
    justify-content: space-around;
  }

  .nav-item {
    width: auto;
    min-width: 56px;
  }

  .nav-item:nth-of-type(1),
  .nav-item:nth-of-type(2),
  .nav-item:nth-of-type(5) {
    display: flex;
  }

  .main {
    padding: 26px 15px 88px;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar-meta > span:first-child {
    display: none;
  }

  .summary-grid {
    gap: 8px;
  }

  .summary-card {
    min-height: 118px;
    padding: 16px;
  }

  .summary-value {
    font-size: 30px;
  }

  .dashboard-grid {
    gap: 8px;
  }
}

/* Views */

.view {
  display: none;
}

.view.active {
  display: block;
}

/* Activity */

.activity-toolbar {
  margin-bottom: 12px;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 190px 190px;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(16,19,26,.82);
}

.activity-search,
.activity-filter {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.activity-search > span,
.activity-filter > span {
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.activity-search input,
.activity-filter select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  background: #0d1016;
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

.activity-search input::placeholder {
  color: var(--muted-2);
}

.activity-search input:focus,
.activity-filter select:focus {
  border-color: rgba(139,124,246,.7);
  box-shadow: 0 0 0 3px rgba(139,124,246,.08);
}

.activity-panel {
  width: 100%;
}

.activity-list {
  min-height: 240px;
}

.activity-row {
  padding: 15px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--border-soft);
}

.activity-row:last-child {
  border-bottom: 0;
}

.activity-main {
  min-width: 0;
}

.activity-badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.activity-problem {
  padding: 5px 8px;
  border-radius: 7px;
  color: #ff929d;
  background: rgba(255,107,122,.09);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.activity-problem.missing {
  color: var(--warning);
  background: rgba(245,196,81,.09);
}

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

  .activity-search {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .activity-toolbar {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .activity-search {
    grid-column: auto;
  }

  .activity-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .activity-badges {
    justify-content: flex-start;
  }
}

/* Downloads */

.download-row {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-soft);
}

.download-row:last-child {
  border-bottom: 0;
}

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

.download-main {
  min-width: 0;
}

.download-badges {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.download-progress {
  height: 5px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
}

.download-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.download-stats {
  margin-top: 7px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--muted-2);
  font-size: 10px;
}

.download-errors:empty {
  display: none;
}

.download-errors {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-soft);
  color: #ff929d;
  background: rgba(255,107,122,.05);
  font-size: 11px;
}

@media (max-width: 600px) {
  .download-row-top {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .download-badges {
    justify-content: flex-start;
  }
}

/* Dedicated Playback view */

.playback-view-list {
  display: grid;
  gap: 14px;
}

.playback-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 16px;
  padding: 14px;
  border-top: 1px solid var(--border);
}

.playback-card:first-child {
  border-top: 0;
}

.playback-poster {
  width: 92px;
  height: 138px;
  object-fit: cover;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.playback-poster-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.playback-card-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.playback-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.playback-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.playback-card-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.playback-details {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 18px;
  color: var(--muted);
  font-size: 13px;
}

.playback-details strong {
  color: var(--text);
  font-weight: 600;
}

.playback-detail-progress {
  display: grid;
  gap: 6px;
}

.playback-time {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.playback-live {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

@media (max-width: 700px) {
  .playback-card {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }

  .playback-poster {
    width: 72px;
    height: 108px;
  }

  .playback-card-top {
    flex-direction: column;
    gap: 8px;
  }

  .playback-card-badges {
    justify-content: flex-start;
  }

  .playback-details {
    flex-direction: column;
    gap: 5px;
  }
}

/* Missing media */

.missing-row .activity-row-side {
  min-width: 120px;
}

.status-badge.missing-available {
  border-color: rgba(74, 222, 128, 0.28);
  background: rgba(74, 222, 128, 0.10);
}

.status-badge.missing-upcoming {
  border-color: rgba(168, 85, 247, 0.30);
  background: rgba(168, 85, 247, 0.11);
}

.status-badge.missing-unknown {
  opacity: 0.72;
}

@media (max-width: 700px) {
  .missing-row .activity-row-side {
    min-width: 0;
  }
}

/* Services management */

.services-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.services-heading h2 {
  margin: 2px 0 6px;
}

.services-description {
  margin: 0;
  color: var(--muted);
}

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

.service-management-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.service-management-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.service-management-name {
  font-size: 1.05rem;
  font-weight: 700;
}

.service-management-type {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.service-management-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.service-management-state.bad {
  color: #fca5a5;
}

.service-management-state.disabled {
  opacity: 0.55;
}

.service-management-state.disabled .status-dot {
  opacity: 0.45;
}

.service-management-details {
  display: grid;
  gap: 10px;
}

.service-management-details > div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}

.service-management-details span {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.service-management-details strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.88rem;
  font-weight: 500;
}

.service-management-actions,
.service-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.service-management-actions {
  margin-top: auto;
  padding-top: 2px;
}

.service-primary-button,
.service-secondary-button,
.service-danger-button,
.service-close-button {
  border: 1px solid var(--border);
  border-radius: 9px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition:
    border-color 120ms ease,
    background 120ms ease,
    opacity 120ms ease;
}

.service-primary-button,
.service-secondary-button,
.service-danger-button {
  min-height: 38px;
  padding: 8px 14px;
}

.settings-panel {
  max-width: 640px;
}

.settings-content {
  padding: 18px 20px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.settings-user {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.service-primary-button {
  border-color: rgba(168, 85, 247, 0.45);
  background: rgba(168, 85, 247, 0.17);
  color: var(--text);
}

.service-primary-button:hover {
  background: rgba(168, 85, 247, 0.25);
}

.service-secondary-button {
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
}

.service-secondary-button:hover {
  background: rgba(255, 255, 255, 0.07);
}

.service-danger-button {
  margin-left: auto;
  border-color: rgba(248, 113, 113, 0.24);
  background: rgba(248, 113, 113, 0.07);
  color: #fca5a5;
}

.service-danger-button:hover {
  background: rgba(248, 113, 113, 0.13);
}

.service-primary-button:disabled,
.service-secondary-button:disabled,
.service-danger-button:disabled {
  cursor: wait;
  opacity: 0.5;
}

.service-editor {
  margin-top: 20px;
}

.service-editor[hidden] {
  display: none;
}

.service-close-button {
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
}

.service-close-button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.service-form-grid,
.service-login-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.service-form-field {
  display: grid;
  gap: 7px;
}

.service-form-field > span,
.service-enabled-field > span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.service-form-field input,
.service-form-field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  padding: 9px 11px;
  font: inherit;
  outline: none;
}

.service-form-field input:focus,
.service-form-field select:focus {
  border-color: rgba(168, 85, 247, 0.7);
}

.service-form-wide {
  grid-column: 1 / -1;
}

.service-enabled-field {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  margin-top: 2px;
  cursor: pointer;
}

.service-enabled-field input {
  width: 17px;
  height: 17px;
  accent-color: #a855f7;
}

.service-credential-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.service-credential-section[hidden],
.service-login-fields[hidden],
#serviceAPIKeyFields[hidden] {
  display: none;
}

.service-field-help {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.service-form-actions {
  justify-content: flex-end;
  margin-top: 22px;
}

.service-management-message {
  display: none;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px 13px;
  font-size: 0.86rem;
}

.service-management-message:not(:empty) {
  display: block;
}

.service-management-message.success {
  border-color: rgba(74, 222, 128, 0.28);
  background: rgba(74, 222, 128, 0.08);
}

.service-management-message.error {
  border-color: rgba(248, 113, 113, 0.28);
  background: rgba(248, 113, 113, 0.08);
  color: #fca5a5;
}

@media (max-width: 900px) {
  .service-management-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .services-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .services-heading .service-primary-button {
    width: 100%;
  }

  .service-form-grid,
  .service-login-fields {
    grid-template-columns: 1fr;
  }

  .service-form-wide {
    grid-column: auto;
  }

  .service-management-details > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .service-management-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .service-management-actions .service-danger-button {
    grid-column: 1 / -1;
    margin-left: 0;
  }

  .service-management-actions button {
    width: 100%;
  }
}

[hidden] { display: none !important; }
.auth-form { display: grid; gap: 16px; padding: 20px; }
.auth-message { margin: 0; padding: 0 20px 20px; overflow-wrap: anywhere; }
.settings-content { flex-wrap: wrap; }
.service-management-card, .settings-panel, .service-form-field { min-width: 0; }
.service-form-field input { max-width: 100%; box-sizing: border-box; }
@media (max-width: 600px) {
  .nav { overflow-x: auto; justify-content: flex-start; }
  .nav-item[data-view="services"], .nav-item[data-view="settings"] { display: flex; flex-shrink: 0; }
  .auth-form input { font-size: 16px; }
}

/* Dashboard lifecycle cards: percentages describe the current stage only. */
.pipeline-panel { grid-column: 1 / -1; }
.pipeline-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr)); gap: 14px; padding: 16px; }
.pipeline-card { min-width: 0; padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: linear-gradient(145deg, rgba(168,85,247,.06), rgba(255,255,255,.015)); }
.pipeline-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pipeline-card-heading > div { min-width: 0; }
.pipeline-card h3 { margin: 0; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.pipeline-card .item-meta { margin: 5px 0 0; }
.pipeline-stage { flex-shrink: 0; max-width: 45%; border-radius: 6px; padding: 5px 7px; background: rgba(168,85,247,.12); color: #d4b2ff; font-size: 10px; line-height: 1.5; }
.pipeline-progress-label { display: flex; justify-content: space-between; align-items: baseline; margin-top: 22px; color: var(--muted); font-size: 11px; }
.pipeline-progress-label strong { font-size: 20px; color: #e8ddff; }
.pipeline-progress { height: 7px; overflow: hidden; border-radius: 10px; margin-top: 8px; background: rgba(255,255,255,.07); }
.pipeline-progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8b5cf6, #c084fc); transition: width .5s ease; }
.pipeline-progress.unmeasured .pipeline-progress-fill { opacity: .35; background: repeating-linear-gradient(110deg, #a78bfa 0 7px, transparent 7px 14px); }
.pipeline-progress.paused .pipeline-progress-fill { background: #e0ad65; }
.pipeline-progress.unmeasured.paused .pipeline-progress-fill { background: repeating-linear-gradient(110deg, #e0ad65 0 7px, transparent 7px 14px); }
.pipeline-detail { min-height: 28px; margin: 10px 0 14px; color: var(--muted); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.pipeline-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.pipeline-steps li { border-top: 2px solid var(--border); padding-top: 7px; color: var(--muted-2); font-size: 9px; text-align: center; }
.pipeline-steps [aria-current="step"] { color: #d4b2ff; border-color: #a78bfa; }
.pipeline-problem { color: #ffb1b9; font-size: 11px; margin: 14px 0 0; }
@media (max-width: 820px) {
  .dashboard-grid > .panel { grid-column: 1; grid-row: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .pipeline-progress-fill { transition: none; }
}

/* Keep live media first and the secondary counters beside service health. */
#dashboardView .dashboard-grid { display: flex; flex-direction: column; }
#dashboardView .summary-grid { margin: 0; gap: 8px; }
#dashboardView .summary-card { min-height: 54px; padding: 10px 14px; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; border-radius: 9px; }
#dashboardView .summary-value { margin: 0; padding: 0; font-size: 22px; }
#dashboardView .summary-label { font-size: 11px; }
@media (max-width: 600px) {
  #dashboardView .summary-card { min-height: 46px; padding: 9px 12px; }
  #dashboardView .summary-value { font-size: 19px; }
}

/* Modal navigation, shared across desktop and mobile. */
.app-shell { display: block; }
#navigationDrawer { position: fixed; inset: 0 auto 0 0; width: min(300px, 90vw); max-width: 90vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 24px 18px; border: 0; border-right: 1px solid var(--border); color: var(--text); overflow-y: auto; background: #10131a; z-index: 100; }
#navigationDrawer:not([open]) { display: none; }
#navigationDrawer[open] { display: flex; flex-direction: column; }
#navigationDrawer::backdrop, .request-dialog::backdrop { background: rgba(0,0,0,.65); backdrop-filter: blur(3px); }
#navigationDrawer .brand, #navigationDrawer .sidebar-status { display: flex; justify-content: flex-start; }
#navigationDrawer .brand-name, #navigationDrawer .nav-item span, #navigationDrawer .sidebar-status div { display: block; }
#navigationDrawer .nav { display: flex; flex-direction: column; margin-top: 24px; overflow: visible; justify-content: flex-start; }
#navigationDrawer .nav-item { display: flex; width: 100%; justify-content: flex-start; padding: 10px 12px; }
#navigationDrawer .nav-spacer { display: block; min-height: 18px; }
.drawer-close { align-self: flex-end; background: transparent; border: 0; color: var(--text); font-size: 28px; min-width: 44px; min-height: 44px; cursor: pointer; }
.topbar-heading { display: flex; align-items: center; gap: 18px; }
.menu-toggle { width: 44px; height: 44px; flex-shrink: 0; background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 9px; font-size: 22px; cursor: pointer; }
.playback-art { position: relative; width: 58px; height: 86px; border-radius: 8px; overflow: hidden; background: var(--panel-soft); flex-shrink: 0; }
.poster-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.playback-art .playback-poster { position: relative; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.playback-row { grid-template-columns: 58px minmax(0,1fr); }
.media-search-form { display: flex; gap: 12px; align-items: flex-end; padding: 20px 20px 12px; }
.media-search-form label { flex: 1; min-width: 0; }
.request-message { color: var(--muted); font-size: 12px; margin: 0; padding: 0 20px 18px; }
.media-search-results { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,320px),1fr)); gap: 12px; padding: 0 20px 20px; }
.media-search-results:empty { display: none; }
.request-result { display: flex; gap: 14px; border: 1px solid var(--border); padding: 14px; border-radius: 10px; min-width: 0; }
.request-art { width: 75px; min-width: 75px; height: 112px; border-radius: 7px; overflow: hidden; background: var(--panel-soft); }
.request-poster { width: 100%; height: 100%; object-fit: cover; }
.request-result-content { min-width: 0; }
.request-result h3 { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.request-result p { color: var(--muted); font-size: 12px; }
.request-overview { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.request-settings { margin-top: 18px; }
.request-dialog { width: min(480px,calc(100vw - 32px)); padding: 24px; color: var(--text); border: 1px solid var(--border); border-radius: 14px; background: var(--panel); }
.request-dialog h2 { font-size: 20px; overflow-wrap: anywhere; }
.request-dialog p { color: var(--muted); font-size: 13px; line-height: 1.5; }
.request-dialog-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; }
button:disabled { cursor: not-allowed; opacity: .55; }
@media (max-width: 600px) {
  .main { padding-bottom: 26px; }
  .topbar-heading { gap: 12px; }
  .topbar-heading h1 { font-size: 28px; }
  .media-search-form { flex-wrap: wrap; }
  .media-search-form label { flex-basis: 100%; }
  .media-search-form button { width: 100%; }
}

#servicesView .health-panel { margin-bottom: 18px; }

.dashboard-topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; }
.dashboard-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.dashboard-brand h1 { font-size: clamp(20px, 3vw, 28px); letter-spacing: .17em; padding-left: .17em; }
.dashboard-brand img { display: block; width: 88px; height: 88px; object-fit: contain; }
.dashboard-topbar .topbar-meta { justify-self: end; }
@media (max-width: 700px) {
  .dashboard-topbar { gap: 12px; }
  .dashboard-topbar .topbar-meta { grid-column: 1 / -1; justify-self: end; }
  .dashboard-brand { grid-column: 2; grid-row: 1; }
  .dashboard-brand img { width: 72px; height: 72px; }
}
