:root {
  --bg: #0b0f14;
  --surface: #151a22;
  --surface-soft: #202735;
  --surface-strong: #0f141b;
  --text: #edf2f7;
  --muted: #98a7bb;
  --line: #2a3443;
  --primary: #38bdf8;
  --primary-strong: #0ea5e9;
  --ok: #34d399;
  --warn: #f59e0b;
  --danger: #f87171;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
}

html {
  height: 100%;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

body:not(.login-page) {
  overflow: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--text);
  background: #0d1219;
}

textarea {
  resize: vertical;
}

@media (hover: none) and (pointer: coarse), (max-width: 760px) {
  html,
  body {
    touch-action: pan-x pan-y;
  }

  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="hidden"]),
  select,
  textarea {
    font-size: 16px !important;
  }
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.field-label-with-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: fit-content;
  max-width: 100%;
}

.field-label-with-info > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-info-icon {
  position: relative;
  display: inline-grid;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  place-items: center;
  border: 1px solid rgba(56, 189, 248, 0.55);
  border-radius: 999px;
  color: var(--primary);
  background: rgba(56, 189, 248, 0.12);
  cursor: help;
  text-transform: none;
}

.field-info-icon svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.field-info-icon::after {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  z-index: 120;
  width: max-content;
  max-width: min(260px, 72vw);
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: #0d1219;
  box-shadow: var(--shadow);
  content: attr(data-tooltip);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  text-transform: none;
  transform: translate(-50%, 4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  visibility: hidden;
  white-space: normal;
}

.field-info-icon:hover::after,
.field-info-icon:focus::after,
.field-info-icon:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
  visibility: visible;
}

.field-info-icon:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.readonly-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.readonly-field strong {
  min-height: 42px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--text);
  background: var(--surface-strong);
  font-size: 14px;
  font-weight: 700;
  text-transform: none;
}

.readonly-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  background: var(--surface-strong);
}

.table-sort-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  text-decoration: none;
}

.table-sort-link:hover,
.table-sort-link:focus {
  color: var(--text);
}

.table-sort-link.is-active {
  color: var(--text);
}

.sort-indicator {
  min-width: 8px;
  color: var(--primary);
  font-size: 11px;
  line-height: 1;
}

tr.expiring-soon-row td {
  background: rgba(245, 158, 11, 0.12);
  border-bottom-color: rgba(245, 158, 11, 0.36);
}

tr.expiring-soon-row td:first-child {
  box-shadow: inset 3px 0 0 var(--warn);
}

.service-cell {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.connection-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 12px;
  font-weight: 800;
}

.connection-pill.is-active {
  border-color: rgba(52, 211, 153, 0.42);
  color: #bbf7d0;
  background: rgba(52, 211, 153, 0.14);
}

.connection-pill.is-full {
  border-color: rgba(248, 113, 113, 0.44);
  color: #fecaca;
  background: rgba(248, 113, 113, 0.14);
}

.customer-devices-cell {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 360px;
  max-width: 540px;
}

.customer-device-summary {
  flex: 0 0 78px;
  display: grid;
  place-items: center;
  min-height: 44px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.08);
}

.customer-device-summary strong,
.customer-device-summary span {
  display: block;
  line-height: 1;
}

.customer-device-summary strong {
  color: var(--text);
  font-size: 17px;
  white-space: nowrap;
}

.customer-device-summary span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.customer-device-list {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.customer-device-label {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 12px;
  font-weight: 800;
}

.customer-device-chip {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-width: 0;
  max-width: 172px;
  padding: 5px 8px 5px 5px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.42);
}

.customer-device-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.customer-device-main strong,
.customer-device-main small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-device-main strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.customer-device-main small {
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
}

.customer-device-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.customer-device-more {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.1);
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.customers-page {
  display: grid;
  gap: 14px;
}

.customers-head {
  margin-bottom: 0;
}

.customers-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.customers-filters {
  grid-template-columns: minmax(260px, 1fr) minmax(150px, 190px) minmax(170px, 220px) auto;
  margin-bottom: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.customers-filters label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.customers-filters label > span,
.customers-filters label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.customers-table-wrap {
  background: var(--surface);
}

.customers-table {
  min-width: 1180px;
}

.customers-table td {
  vertical-align: top;
}

.customers-table th:first-child,
.customers-table td:first-child {
  min-width: 230px;
}

.customer-table-customer {
  min-width: 230px;
}

.customer-table-customer-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.customer-table-username {
  width: fit-content;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.customer-table-detail,
.customer-table-contact,
.customer-service-days {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.customer-table-contact {
  color: #cbd5e1;
}

.customer-table-online {
  white-space: nowrap;
}

.customer-table-devices {
  min-width: 390px;
}

.customer-service-days {
  flex-basis: 100%;
}

.dense-table th,
.dense-table td {
  padding: 9px;
}

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

.panel-shell-page {
  overflow: hidden;
  background: #020617;
}

.panel-shell-root {
  position: fixed;
  inset: 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
}

.panel-shell-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--bg);
}

.sidebar {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: #080b10;
  color: #fff;
  padding: 18px 10px;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  min-height: 44px;
}

.sidebar-brand {
  align-items: center;
  gap: 10px;
  min-height: 0;
  padding: 2px 4px 6px;
}

.brand-logo-wrap {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
}

.brand-logo {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.brand-text {
  min-width: 0;
  line-height: 1.1;
}

.sidebar-brand small {
  margin-top: 3px;
}

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

.brand strong,
.brand small {
  display: block;
}

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

.nav {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.nav-group {
  display: grid;
  gap: 4px;
}

.nav-parent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #c6d2e1;
  cursor: pointer;
  list-style: none;
  padding: 9px 10px;
  border-radius: 6px;
  font-weight: 700;
}

.nav-parent > .nav-icon-button {
  margin-left: auto;
}

.nav-parent-actions {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
  margin-left: auto;
  order: 2;
}

.nav-parent-actions .nav-icon-button {
  margin-left: 0;
}

.nav-parent-badge {
  order: 1;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--primary);
  color: #04111f;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.13);
}

.nav-parent-badge[hidden] {
  display: none;
}

.nav-action-menu {
  position: relative;
  display: inline-flex;
}

.nav-action-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  display: grid;
  gap: 2px;
  min-width: 156px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1219;
  box-shadow: var(--shadow);
}

.nav-action-popover[hidden] {
  display: none;
}

.nav-action-popover button {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 34px;
  width: 100%;
  border: 0;
  border-radius: 6px;
  padding: 8px;
  color: #c6d2e1;
  background: transparent;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.nav-action-popover button:hover {
  color: #fff;
  background: #172033;
}

.nav-action-popover button.danger:hover {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.22);
}

.nav-action-popover svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-parent::-webkit-details-marker {
  display: none;
}

.nav-parent::after {
  content: '>';
  color: #6f7f94;
  flex: 0 0 auto;
  margin-left: 2px;
  order: 3;
  transform: rotate(0deg);
  transition: transform 140ms ease;
}

.nav-group[open] > .nav-parent::after {
  transform: rotate(90deg);
}

.nav-group.active > .nav-parent,
.nav-parent:hover {
  background: #172033;
  color: #fff;
}

.nav-subitems {
  display: grid;
  gap: 4px;
  margin: 2px 0 2px 10px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

.nav-cli-conversations {
  max-height: 300px;
  overflow: auto;
}

.nav-project-group {
  display: grid;
  gap: 3px;
}

.nav-project-group.is-collapsed > .nav-project-thread-list {
  display: none;
}

.nav-project-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px;
  align-items: center;
  min-height: 30px;
  padding: 2px 0 2px 2px;
  color: #93a4b8;
}

.nav-project-row.muted {
  color: #718096;
}

.nav-project-row.is-drop-target .nav-project-label {
  background: rgba(56, 189, 248, 0.08);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.18);
  border-radius: 6px;
}

.nav-project-row.is-drop-over .nav-project-label {
  color: #e0f2fe;
  background: rgba(14, 165, 233, 0.22);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.42);
}

.nav-project-empty.is-drop-target {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.06);
}

.nav-project-empty.is-drop-over {
  color: #c7eaff;
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(14, 165, 233, 0.16);
}

.nav-project-label {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  min-width: 0;
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-project-toggle {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  grid-template-columns: 10px 16px minmax(0, 1fr) auto;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.nav-project-toggle:hover {
  color: #cbd5e1;
}

.nav-project-chevron {
  display: inline-grid;
  place-items: center;
  width: 10px;
  height: 16px;
}

.nav-project-chevron::before {
  content: '>';
  display: block;
  color: #718096;
  font-size: 12px;
  line-height: 1;
  transform: rotate(90deg);
  transition: transform 140ms ease;
}

.nav-project-group.is-collapsed .nav-project-chevron::before {
  transform: rotate(0deg);
}

.nav-project-label svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-project-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-project-statuses {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-width: max-content;
}

.nav-project-status {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid rgba(148, 163, 184, 0.34);
  border-top-color: var(--primary);
  animation: cliThreadSpin 780ms linear infinite;
}

.nav-project-unread {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.14);
}

.nav-project-row.unread .nav-project-label {
  color: #e0f2fe;
}

.nav-project-row.running .nav-project-label {
  color: #dbeafe;
}

.nav-project-thread-list {
  display: grid;
  gap: 4px;
}

.nav-project-group.is-project > .nav-project-thread-list {
  margin-left: 18px;
  padding-left: 10px;
  border-left: 1px solid rgba(148, 163, 184, 0.18);
}

.nav-project-empty {
  margin: 0 0 2px;
  padding: 6px 8px;
  border: 1px dashed rgba(148, 163, 184, 0.22);
  border-radius: 6px;
  color: #7f8ea3;
  font-size: 11px;
  line-height: 1.3;
}

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

.nav-thread-row[draggable="true"] .nav-sub-link {
  cursor: grab;
}

.nav-thread-row.is-dragging {
  opacity: 0.46;
}

.nav-thread-row.is-dragging .nav-sub-link {
  cursor: grabbing;
}

.nav-thread-row .nav-sub-link {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding-left: 6px;
}

.nav-thread-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
}

.nav-thread-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-thread-row .nav-sub-link:hover,
.nav-thread-row .nav-sub-link.active {
  background: #101827;
}

.nav-thread-row .nav-sub-link.active {
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.34), rgba(56, 189, 248, 0.16));
  box-shadow: inset 3px 0 0 var(--primary), inset 0 0 0 1px rgba(56, 189, 248, 0.28);
  color: #fff;
}

.nav-thread-row .nav-sub-link.unread {
  color: #e0f2fe;
}

.nav-thread-row .nav-sub-link.unread:hover {
  background: rgba(56, 189, 248, 0.12);
}

.nav-thread-row .nav-sub-link.active.unread {
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.38), rgba(56, 189, 248, 0.18));
  color: #fff;
}

.nav-thread-row .nav-sub-link.active .nav-thread-indicator:not(.running) {
  background: rgba(255, 255, 255, 0.72);
  opacity: 1;
}

.nav-thread-row .nav-sub-link.running {
  color: #dbeafe;
}

.nav-thread-row .nav-sub-link.active.running {
  color: #fff;
}

.nav-thread-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-thread-indicator {
  position: absolute;
  right: -2px;
  bottom: -1px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #475569;
  border: 1px solid #080b10;
  opacity: 0.72;
}

.nav-thread-indicator.running {
  right: -4px;
  bottom: -3px;
  width: 12px;
  height: 12px;
  background: transparent;
  border: 2px solid rgba(148, 163, 184, 0.34);
  border-top-color: var(--primary);
  opacity: 1;
  animation: cliThreadSpin 780ms linear infinite;
}

.nav-thread-indicator.unread:not(.running) {
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.14);
  opacity: 1;
}

@keyframes cliThreadSpin {
  to {
    transform: rotate(360deg);
  }
}

.nav-thread-actions {
  display: inline-flex;
  gap: 2px;
}

.nav-icon-button {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #c6d2e1;
  background: transparent;
  cursor: pointer;
}

.nav-icon-button:hover {
  border-color: var(--line);
  background: #172033;
  color: #fff;
}

.nav-icon-button.danger:hover {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.35);
}

.nav-icon-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-link {
  display: flex;
  align-items: center;
  color: #c6d2e1;
  padding: 9px 10px;
  border-radius: 6px;
}

.nav-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.nav-link .nav-label {
  width: 100%;
}

.nav-label-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item-badge {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 18px;
  margin-left: auto;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.nav-link:hover .nav-item-badge,
.nav-link.active .nav-item-badge {
  background: rgba(56, 189, 248, 0.24);
  color: #e0f2fe;
}

.nav-label svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.9;
}

.nav-sub-link {
  padding: 8px 10px;
  font-size: 13px;
}

.nav-link:hover,
.nav-link.active {
  background: #172033;
  color: #fff;
}

.nav-sub-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 4px;
  align-items: center;
}

.nav-sub-row .nav-link {
  min-width: 0;
}

.nav-sub-action {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: #c6d2e1;
  background: transparent;
}

.nav-sub-action:hover {
  color: #fff;
  background: #172033;
}

.nav-sub-link.running {
  color: var(--warn);
}

.nav-cli-open-link {
  font-weight: 700;
}

.nav-cli-launch-link {
  justify-content: space-between;
  gap: 8px;
  font-weight: 800;
}

.nav-cli-launch-link .nav-label {
  width: auto;
  flex: 1 1 auto;
}

.nav-cli-state {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}

.nav-cli-running {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(148, 163, 184, 0.34);
  border-top-color: var(--primary);
  animation: cliThreadSpin 780ms linear infinite;
}

.nav-cli-launch-link:not(.running) .nav-cli-running,
.nav-cli-running[hidden] {
  display: none;
}

.nav-cli-launch-link.running .nav-label {
  color: #dbeafe;
}

.main {
  min-width: 0;
  min-height: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 15, 20, 0.9);
  backdrop-filter: blur(10px);
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
}

.topbar p {
  margin: 2px 0 0;
  color: var(--muted);
}

.topbar-title {
  min-width: 0;
}

.topbar-utility {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  margin-left: auto;
}

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

.server-metrics {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-left: auto;
}

.topbar-utility .server-metrics {
  margin-left: 0;
}

.server-meter {
  display: grid;
  gap: 5px;
  flex: 0 0 96px;
  width: 96px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(152, 167, 187, 0.24);
  border-radius: 6px;
  color: var(--text);
  background: linear-gradient(180deg, rgba(32, 39, 53, 0.86), rgba(15, 20, 27, 0.86));
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  text-decoration: none;
}

a.server-meter:hover {
  border-color: rgba(63, 187, 240, 0.6);
  color: var(--text);
}

.server-meter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
}

.server-meter-head b {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.server-meter-head span {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.server-meter-track {
  overflow: hidden;
  display: block;
  height: 4px;
  border-radius: 999px;
  background: rgba(152, 167, 187, 0.16);
}

.server-meter-track i {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: var(--primary);
  transition: width 260ms ease;
}

.server-meter-ram .server-meter-track i {
  background: var(--ok);
}

.server-meter-disk .server-meter-track i {
  background: var(--warn);
}

.server-meter-down .server-meter-track i {
  background: #60a5fa;
}

.server-meter-up .server-meter-track i {
  background: #f472b6;
}

.server-meter-devices-online {
  flex-basis: 156px;
  width: 156px;
}

.server-meter-devices-online .server-meter-track i {
  background: var(--ok);
}

.server-meter-devices-online.is-empty .server-meter-track i {
  background: var(--muted);
}

.server-meter-down,
.server-meter-up {
  flex-basis: 156px;
  width: 156px;
}

.credit-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 6px;
  color: var(--primary);
  background: rgba(56, 189, 248, 0.12);
  font-weight: 800;
}

.credit-label {
  margin-right: 4px;
}

.credit-value-infinity {
  display: none;
}

.content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 22px;
}

.page-cli {
  overflow: hidden;
}

.page-cli .shell {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.page-cli .main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  min-height: 0;
}

.content-cli {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  padding-bottom: 16px;
}

.content.is-loading {
  opacity: 0.68;
}

[data-filter-fragment] {
  position: relative;
  min-height: 96px;
}

.filter-fragment-loading {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 30;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  padding: 84px 18px 18px;
  color: var(--text);
  font-weight: 700;
  background: rgba(11, 15, 20, 0.72);
  backdrop-filter: blur(2px);
  pointer-events: none;
}

[data-filter-fragment].is-loading .filter-fragment-loading {
  display: flex;
}

.filter-fragment-error {
  margin: 12px 0;
  padding: 11px 14px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 8px;
  color: #fecaca;
  background: rgba(127, 29, 29, 0.35);
  font-weight: 700;
}

.filter-fragment-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(237, 242, 247, 0.24);
  border-top-color: var(--primary);
  border-radius: 999px;
  animation: filter-fragment-spin 0.8s linear infinite;
}

@keyframes filter-fragment-spin {
  to {
    transform: rotate(360deg);
  }
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card,
.panel-card,
.form-card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 16px;
}

button.metric-card {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

button.metric-card:hover,
button.metric-card:focus-visible {
  border-color: var(--primary);
}

.metric-card span,
.metric-card small {
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin: 5px 0;
  font-size: 28px;
}

.grid {
  display: grid;
  gap: 18px;
}

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

.grid.two > * {
  min-width: 0;
}

.expiry-alert {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.12);
}

.expiry-alert strong {
  display: block;
  margin-bottom: 4px;
  color: var(--warn);
  font-size: 16px;
}

.expiry-alert p {
  margin: 0;
  color: var(--muted);
}

.expiry-alert span {
  color: var(--muted);
}

.panel-card,
.form-card {
  padding: 18px;
}

.form-section {
  display: grid;
  gap: 14px;
}

.form-section h2,
.source-card h3,
.episode-season h3 {
  margin: 0;
}

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

.section-head.compact {
  margin-bottom: 8px;
}

.section-head h2,
.panel-card h2 {
  margin: 0;
  font-size: 18px;
}

.section-head p,
.muted {
  color: var(--muted);
  margin: 4px 0 0;
}

.filters,
.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

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

.form-grid .wide-field {
  grid-column: span 2;
}

.script-account-card {
  margin-bottom: 16px;
}

.script-account-grid {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  margin-bottom: 0;
}

.script-account-grid .script-account-credential {
  grid-column: span 2;
}

.script-account-grid .script-account-url-field {
  grid-column: span 3;
}

.script-account-grid > .button {
  align-self: end;
  min-width: 160px;
  width: 100%;
}

.script-edit-table {
  min-width: 1180px;
}

.script-edit-table th,
.script-edit-table td {
  vertical-align: top;
}

.script-table-field {
  min-width: 180px;
}

.script-table-field.is-compact {
  min-width: 132px;
}

.script-table-field.is-long {
  min-width: 320px;
}

.script-table-field input {
  min-width: 0;
}

.script-table-field input.is-saving {
  border-color: #f59e0b;
}

.script-table-field input.is-saved {
  border-color: #16a34a;
  box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.2);
}

.script-table-field input.is-error {
  border-color: #dc2626;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.2);
}

.script-field-status {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.25;
}

.script-field-status.is-saving {
  color: #b45309;
}

.script-field-status.is-saved {
  color: #15803d;
}

.script-field-status.is-error {
  color: #b91c1c;
}

.settings-update-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.settings-update-form-grid {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.settings-server-metrics-layout,
.settings-api-layout,
.settings-ai-layout {
  margin-top: 18px;
}

.media-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
  align-items: start;
}

.media-editor-main {
  min-width: 0;
}

.media-editor-side {
  position: sticky;
  top: 86px;
}

.media-artwork-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.media-artwork-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.media-artwork-head h3 {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.media-artwork-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.4fr) minmax(170px, 0.46fr) minmax(220px, 0.82fr);
  grid-template-areas:
    "backdrop poster logo"
    "backdrop poster logo-spa";
  gap: 8px;
  align-items: stretch;
}

.media-artwork-grid .media-asset-field {
  grid-column: auto;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 7px;
  padding: 8px;
}

.media-artwork-grid .media-asset-control {
  gap: 6px;
}

.media-artwork-grid .media-asset-field input {
  padding: 8px 9px;
}

.media-artwork-grid .media-asset-field .button {
  min-height: 34px;
}

.media-artwork-grid .media-asset-field-backdrop {
  grid-area: backdrop;
}

.media-artwork-grid .media-asset-field-poster {
  grid-area: poster;
}

.media-artwork-grid .media-asset-field-logo {
  grid-area: logo;
}

.media-artwork-grid .media-asset-field-logo-spa {
  grid-area: logo-spa;
}

.media-asset-field {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.media-asset-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  min-width: 0;
}

.media-asset-field.compact-preview {
  padding: 0;
  border: 0;
  background: transparent;
}

.media-asset-field.compact-preview .media-asset-control {
  grid-template-columns: 1fr;
}

.media-asset-field label {
  min-width: 0;
}

.media-asset-field .button {
  min-height: 40px;
}

.media-asset-preview {
  display: grid;
  min-height: 126px;
  place-items: center;
  padding: 8px;
  overflow: hidden;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-strong);
}

.media-asset-preview img {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  object-fit: contain;
  object-position: center;
  background: var(--surface-soft);
}

.media-asset-preview span {
  display: grid;
  min-height: 96px;
  place-items: center;
  font-size: 12px;
  text-align: center;
}

.media-artwork-grid .media-asset-preview {
  height: 100%;
  min-height: 0;
  padding: 6px;
}

.media-artwork-grid .media-asset-preview img {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}

.media-artwork-grid .media-asset-field-backdrop .media-asset-preview {
  width: 100%;
  min-height: 198px;
  justify-self: stretch;
}

.media-artwork-grid .media-asset-field-poster .media-asset-preview {
  min-height: 198px;
}

.media-artwork-grid .media-asset-field-logo .media-asset-preview,
.media-artwork-grid .media-asset-field-logo-spa .media-asset-preview {
  min-height: 76px;
}

.media-artwork-grid .media-asset-preview span {
  min-height: 0;
}

.media-asset-field.compact-preview .media-asset-preview {
  min-height: 78px;
  padding: 6px;
}

.media-asset-field.compact-preview .media-asset-preview span {
  min-height: 64px;
}

.media-asset-field.compact-preview .media-asset-preview img {
  max-height: 110px;
}

.episode-image-generator {
  display: grid;
  gap: 8px;
  align-self: stretch;
}

.episode-image-generator .media-asset-field {
  grid-column: auto;
}

.episode-image-generator-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.episode-image-generator-actions [data-episode-image-status] {
  min-width: 180px;
  font-size: 12px;
}

.media-asset-preview-poster img {
  width: min(132px, 100%);
  aspect-ratio: 2 / 3;
}

.media-artwork-grid .media-asset-preview-poster img {
  width: 100%;
}

.media-asset-preview-logo img,
.media-asset-preview-logo-spa img {
  aspect-ratio: 16 / 5;
  object-fit: contain;
}

.media-artwork-grid .media-asset-preview-logo img,
.media-artwork-grid .media-asset-preview-logo-spa img {
  height: 100%;
  max-height: 100%;
}

.editor-head {
  align-items: center;
}

.editor-title,
.editor-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.editor-head-actions {
  justify-content: flex-end;
}

.customer-editor-form {
  gap: 12px;
}

.customer-editor-tabs {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px -2px 4px;
  padding: 2px;
  background: var(--surface);
}

.customer-editor-tab {
  display: grid;
  gap: 2px;
  min-width: 118px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 11px;
  color: var(--muted);
  background: var(--surface-strong);
  cursor: pointer;
  text-align: left;
}

.customer-editor-tab:hover,
.customer-editor-tab.active {
  border-color: rgba(56, 189, 248, 0.58);
  color: var(--text);
  background: rgba(56, 189, 248, 0.12);
}

.customer-editor-tab span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 800;
}

.customer-editor-tab small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
  font-size: 11px;
  font-weight: 700;
}

.customer-editor-section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.customer-editor-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  min-height: 56px;
  padding: 11px 13px;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.customer-editor-summary::-webkit-details-marker {
  display: none;
}

.customer-editor-summary::marker {
  content: "";
}

.customer-editor-summary::after {
  content: ">";
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 140ms ease, color 140ms ease, border-color 140ms ease;
}

.customer-editor-section[open] > .customer-editor-summary {
  border-bottom: 1px solid var(--line);
}

.customer-editor-section[open] > .customer-editor-summary::after {
  border-color: rgba(56, 189, 248, 0.45);
  color: var(--primary);
  transform: rotate(90deg);
}

.customer-editor-summary-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.customer-editor-summary-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.customer-editor-summary-title small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.customer-editor-summary-meta {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.customer-editor-section-body {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.customer-editor-section-body .form-grid {
  margin-bottom: 0;
}

.customer-editor-status-row {
  padding-top: 2px;
}

.service-controls {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(150px, auto) minmax(220px, 1.2fr);
  gap: 12px;
  align-items: end;
}

.field-group {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.form-grid .customer-plan-field {
  grid-column: 1 / -1;
}

.customer-plan-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.customer-plan-option {
  position: relative;
  min-height: 112px;
  display: block;
  overflow: hidden;
  padding: 18px 16px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 8px;
  color: var(--text);
  background:
    linear-gradient(145deg, rgba(32, 39, 53, 0.94), rgba(13, 18, 25, 0.96)),
    var(--surface-strong);
  cursor: pointer;
  text-transform: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.customer-plan-option:hover {
  border-color: rgba(56, 189, 248, 0.48);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

.customer-plan-option:has(input:checked) {
  border-color: rgba(56, 189, 248, 0.78);
  background:
    linear-gradient(145deg, rgba(56, 189, 248, 0.18), rgba(52, 211, 153, 0.08)),
    var(--surface-strong);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.46), 0 14px 30px rgba(0, 0, 0, 0.24);
}

.customer-plan-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.customer-plan-check {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(152, 167, 187, 0.42);
  border-radius: 999px;
  background: rgba(11, 15, 20, 0.5);
}

.customer-plan-check::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 4px;
  width: 6px;
  height: 11px;
  border: solid #061014;
  border-width: 0 2px 2px 0;
  opacity: 0;
  transform: rotate(45deg);
}

.customer-plan-option:has(input:checked) .customer-plan-check {
  border-color: var(--primary);
  background: var(--primary);
}

.customer-plan-option:has(input:focus-visible) {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.customer-plan-option:has(input:checked) .customer-plan-check::after {
  opacity: 1;
}

.customer-plan-copy {
  position: relative;
  display: grid;
  gap: 12px;
  min-width: 0;
  padding-right: 32px;
}

.customer-plan-main {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: baseline;
}

.customer-plan-main strong {
  color: #f8fafc;
  font-size: 42px;
  line-height: 1;
}

.customer-plan-main span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.customer-plan-option small {
  width: fit-content;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid rgba(52, 211, 153, 0.28);
  border-radius: 999px;
  color: #bbf7d0;
  background: rgba(52, 211, 153, 0.1);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.customer-plan-months {
  display: grid;
  gap: 6px;
}

.customer-plan-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.customer-plan-upgrade-total strong {
  color: #bbf7d0;
}

.download-manager-panel.customer-service-confirm-panel {
  top: 50%;
  right: auto;
  bottom: auto;
  left: 50%;
  grid-template-rows: auto auto auto;
  width: min(540px, calc(100vw - 32px));
  max-height: min(620px, calc(100vh - 48px));
  transform: translate(-50%, -50%);
}

.customer-service-confirm-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.customer-service-confirm-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
}

.customer-service-confirm-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.customer-service-confirm-body {
  display: grid;
  gap: 14px;
  padding: 16px 0;
}

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

.customer-service-confirm-message strong {
  color: #bbf7d0;
}

.customer-service-confirm-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.customer-service-confirm-summary span {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.customer-service-confirm-summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.customer-service-confirm-summary strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-service-confirm-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.download-manager-panel.customer-plan-downgrade-panel {
  top: 50%;
  right: auto;
  bottom: auto;
  left: 50%;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(620px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 48px));
  transform: translate(-50%, -50%);
}

.customer-plan-downgrade-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.customer-plan-downgrade-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
}

.customer-plan-downgrade-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.customer-plan-downgrade-list {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding: 12px 2px;
}

.customer-plan-downgrade-device {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  text-transform: none;
}

.customer-plan-downgrade-device input {
  margin-top: 3px;
}

.customer-plan-downgrade-device strong,
.customer-plan-downgrade-device small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.customer-plan-downgrade-device small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.customer-plan-downgrade-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.customer-plan-downgrade-actions small {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
}

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

input[name^="device_link_code_"],
input[name^="app_device_link_code_slot"] {
  text-transform: uppercase;
}

.device-card.is-pending {
  border-color: rgba(245, 158, 11, 0.35);
}

.device-card.is-empty {
  border-style: dashed;
}

.recent-view-list,
.connection-summary {
  display: grid;
  gap: 10px;
}

.customer-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.customer-profile-card {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.customer-profile-card.is-new {
  border-style: dashed;
}

.customer-profile-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.customer-profile-avatar {
  display: block;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: #0b1118;
}

.customer-profile-head h3 {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 15px;
}

.customer-profile-head small {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.customer-profile-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 150px);
  gap: 10px;
}

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

.customer-profile-stats div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.customer-profile-stats span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.customer-profile-stats strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 12px;
}

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

.customer-access-block-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.customer-access-block-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.customer-access-block-card strong,
.customer-access-block-card small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.customer-access-block-card strong {
  color: var(--text);
  font-size: 13px;
}

.customer-access-block-card small {
  color: var(--muted);
  font-size: 12px;
}

.customer-access-block-card > small {
  grid-column: 1 / -1;
}

.customer-access-block-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: center;
  width: 100%;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.42);
}

.customer-access-block-inline > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.customer-access-block-inline span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.customer-access-block-inline strong,
.customer-access-block-inline small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-access-block-inline strong {
  color: var(--text);
  font-size: 13px;
}

.customer-access-block-inline small {
  color: var(--muted);
  font-size: 12px;
}

.customer-access-block-inline > small {
  grid-column: 1 / -1;
}

.customer-controls-body {
  gap: 14px;
}

.customer-control-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.customer-control-overview div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.customer-control-overview span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.customer-control-overview strong {
  color: var(--text);
  font-size: 22px;
  line-height: 1;
}

.customer-control-overview small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.customer-controls-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(380px, 0.65fr);
  gap: 14px;
  align-items: start;
}

.customer-control-column {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.customer-control-panel {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.customer-control-group {
  display: grid;
  gap: 10px;
}

.customer-control-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding-bottom: 2px;
}

.customer-control-group-head > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.customer-control-group-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
}

.customer-control-group-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.customer-control-group-head span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-control-grid,
.customer-message-history {
  display: grid;
  gap: 8px;
}

.customer-control-grid {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.customer-control-side .customer-control-grid {
  grid-template-columns: 1fr;
}

.customer-control-row,
.customer-message-row {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.customer-control-row {
  grid-template-columns: minmax(0, 1fr);
}

.customer-global-message-card {
  display: grid;
  gap: 0;
  overflow: hidden;
  margin-bottom: 0;
  padding: 0;
}

.customer-global-message-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.customer-global-message-summary::-webkit-details-marker {
  display: none;
}

.customer-global-message-summary::marker {
  content: "";
}

.customer-global-message-summary h2 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
}

.customer-global-message-summary p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.customer-global-message-summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.customer-global-message-body {
  display: grid;
  gap: 14px;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line);
}

.customer-global-message-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 170px);
  gap: 12px;
  align-items: end;
}

.customer-global-message-form label,
.customer-chat-compose label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.customer-global-message-form input,
.customer-global-message-form textarea,
.customer-chat-compose input,
.customer-chat-compose textarea {
  width: 100%;
}

.customer-global-message-form textarea,
.customer-chat-compose textarea {
  resize: vertical;
}

.customer-global-message-form .wide-field,
.customer-global-message-actions {
  grid-column: 1 / -1;
}

.customer-global-message-actions,
.customer-chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.customer-global-message-actions small,
.customer-chat-actions small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.customer-global-message-actions small:last-child,
.customer-chat-actions small:last-child {
  flex-basis: 100%;
}

.customer-global-message-history {
  display: grid;
  gap: 8px;
}

.customer-global-message-row {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.customer-global-message-row strong,
.customer-global-message-row small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.customer-global-message-row strong {
  color: var(--text);
  font-size: 13px;
}

.customer-global-message-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.customer-global-message-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.customer-chat-compose {
  display: grid;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.customer-chat-panel .customer-chat-compose {
  grid-template-columns: minmax(170px, 0.48fr) minmax(0, 1fr);
  align-items: start;
}

.customer-chat-panel .customer-chat-compose label:nth-of-type(2) {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.customer-chat-panel .customer-chat-actions {
  grid-column: 1;
  align-self: end;
}

.customer-control-row {
  align-items: start;
}

.customer-control-main {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
}

.customer-control-icon,
.customer-control-avatar {
  flex: 0 0 auto;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--primary);
  font-size: 15px;
  font-weight: 900;
}

.customer-control-avatar {
  display: block;
  object-fit: cover;
}

.customer-control-copy {
  display: grid;
  gap: 3px;
  flex: 1 1 auto;
  min-width: 0;
}

.customer-control-copy strong,
.customer-control-copy small,
.customer-message-row strong,
.customer-message-row small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-control-copy strong,
.customer-message-row strong {
  color: var(--text);
  font-size: 13px;
}

.customer-control-copy small,
.customer-message-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.customer-control-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
}

.customer-control-actions .button,
.customer-control-actions button {
  white-space: nowrap;
}

.customer-control-actions > .customer-access-block-inline {
  flex-basis: 100%;
}

.customer-control-actions .device-access-block-actions {
  flex-basis: 100%;
  gap: 8px;
  margin-top: 0;
}

.customer-control-actions .device-message-actions {
  gap: 8px;
  margin-top: 0;
}

.customer-control-actions .device-access-block-actions .button {
  margin: 0;
}

.customer-control-actions > small {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.customer-message-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.customer-chat-message p {
  margin: 5px 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

@media (min-width: 920px) {
  .customer-global-message-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
}

.recent-view-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
}

.recent-view-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.recent-view-main strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 14px;
}

.recent-view-main span,
.recent-view-time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.connection-summary .service-controls {
  grid-template-columns: minmax(170px, 220px);
}

.connection-summary .readonly-field strong {
  justify-content: flex-start;
}

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

.connection-file-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
}

.connection-file-index {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  color: #06111a;
  background: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.connection-file-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.connection-file-main strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
}

.connection-file-main small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.customer-connection-actions {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.customer-connection-actions small {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

@media (min-width: 860px) {
  .connection-file-row {
    grid-template-columns: 28px minmax(0, 1fr) auto;
  }

  .customer-connection-actions {
    grid-column: auto;
    justify-content: flex-end;
  }

  .customer-connection-actions small {
    text-align: right;
  }
}

.check-tile {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: var(--surface-strong);
  font-size: 14px;
  font-weight: 700;
  text-transform: none;
}

.check-tile input {
  width: auto;
}

.source-grid,
.category-list,
.download-grid,
.remote-download-grid,
.menu-section-grid,
.tool-grid {
  display: grid;
  gap: 14px;
}

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

.source-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.source-card h3,
.episode-season h3 {
  font-size: 15px;
}

.thumb,
.channel-thumb,
.menu-logo-preview,
.menu-background-preview {
  display: block;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.channel-thumb {
  width: 38px;
  height: 38px;
  border-radius: 6px;
}

.thumb.placeholder,
.channel-thumb.placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.inline-edit-form {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.inline-edit-form[data-autosave],
.stack-form[data-autosave] {
  grid-template-columns: minmax(72px, 1fr);
}

.inline-edit-form.narrow {
  grid-template-columns: minmax(76px, 96px) auto;
}

.inline-edit-form.narrow[data-autosave] {
  grid-template-columns: minmax(66px, 90px);
}

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

.stack-form:last-child {
  margin-bottom: 0;
}

.stack-form label {
  text-transform: none;
}

.source-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 7px;
}

.source-dot-form {
  display: inline-flex;
  margin: 0;
}

.source-dot {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
}

.source-dot:hover {
  border-color: var(--primary);
  color: var(--text);
}

.source-dot.ok {
  color: var(--ok);
  border-color: rgba(52, 211, 153, 0.38);
}

.source-dot.active {
  color: #06111a;
  background: var(--primary);
}

.source-dot.disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.source-select-form select {
  min-width: 126px;
}

.category-list {
  margin-top: 18px;
}

.live-category-page {
  gap: 16px;
}

.live-category-page .category-create-card {
  margin: 0;
}

.live-category-list {
  display: grid;
  gap: 8px;
  margin-top: 0;
}

.live-category-row {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.live-category-row.is-dragging {
  opacity: 0.58;
}

.live-category-summary {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px;
}

.live-category-drag {
  width: 46px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 12px;
  font-weight: 800;
  cursor: grab;
}

.live-category-drag:active {
  cursor: grabbing;
}

.live-category-logo-wrap {
  width: 46px;
  min-height: 36px;
  display: grid;
  place-items: center;
}

.live-category-logo {
  width: 46px;
  height: 36px;
  display: block;
  object-fit: contain;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
  box-sizing: border-box;
}

.live-category-logo.placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.05;
  text-align: center;
}

.live-category-summary-main {
  min-width: 0;
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.live-category-summary-main:hover,
.live-category-summary-main[aria-expanded="true"] {
  border-color: var(--line);
  background: var(--surface-strong);
}

.live-category-title,
.live-category-title small {
  min-width: 0;
}

.live-category-title {
  display: grid;
  gap: 2px;
}

.live-category-title strong,
.live-category-title small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-category-title small {
  color: var(--muted);
  font-size: 12px;
}

.live-category-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.live-category-meta .badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface-strong);
  white-space: nowrap;
}

.live-category-meta .badge.ok {
  color: #04130d;
  border-color: rgba(52, 211, 153, 0.64);
  background: var(--ok);
}

.live-category-meta .badge.danger {
  color: #1f0606;
  border-color: rgba(248, 113, 113, 0.64);
  background: var(--danger);
}

.live-category-add-button {
  white-space: nowrap;
}

.live-category-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--surface-strong);
}

.live-category-panel[hidden] {
  display: none;
}

.live-category-editor {
  display: grid;
  gap: 12px;
}

.live-category-order-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.live-category-order-status[data-state="saving"] {
  color: var(--warn);
}

.live-category-order-status[data-state="saved"] {
  color: var(--ok);
}

.live-category-order-status[data-state="error"] {
  color: var(--danger);
}

.live-category-channel-panel {
  width: min(920px, calc(100vw - 24px));
  max-height: min(860px, calc(100vh - 24px));
  overflow: auto;
}

.live-category-channel-panel form {
  display: grid;
  gap: 12px;
}

.live-category-channel-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.live-category-channel-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.live-category-channel-status {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.live-category-channel-list {
  max-height: min(58vh, 560px);
  overflow: auto;
  display: grid;
  gap: 7px;
  padding-right: 4px;
}

.live-category-channel-option {
  display: grid;
  grid-template-columns: auto 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: var(--surface);
  text-transform: none;
}

.live-category-channel-option:hover {
  border-color: var(--primary);
}

.live-category-channel-option[data-filtered="1"] {
  display: none;
}

.live-category-channel-option.is-assigned {
  opacity: 0.72;
}

.live-category-channel-option input {
  width: auto;
}

.live-category-channel-option span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.live-category-channel-option strong,
.live-category-channel-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-category-channel-option small {
  color: var(--muted);
  font-size: 12px;
}

.live-category-channel-option em {
  color: var(--ok);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .live-category-summary {
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  .live-category-summary-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .live-category-add-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .live-category-meta {
    justify-content: flex-start;
  }

  .live-category-channel-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .live-category-channel-tools {
    justify-content: stretch;
  }

  .live-category-channel-tools .button {
    flex: 1 1 130px;
  }

  .live-category-channel-option {
    grid-template-columns: auto 38px minmax(0, 1fr);
  }

  .live-category-channel-option em {
    grid-column: 3;
  }
}

.category-section {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.category-section > .section-head {
  margin-bottom: -4px;
}

.category-item {
  display: grid;
  gap: 8px;
}

.category-usage-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.category-delete {
  display: flex;
  justify-content: flex-end;
}

.episodes-panel {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.season-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.season-chip {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface-strong);
}

.season-chip span,
.season-chip small {
  color: var(--muted);
}

.episode-season {
  display: grid;
  gap: 10px;
}

.credits-cell {
  white-space: nowrap;
}

.episode-credits-inline {
  display: grid;
  grid-template-columns: minmax(74px, auto) minmax(150px, 190px);
  gap: 6px 8px;
  align-items: center;
}

.episode-credits-inline-row {
  display: grid;
  grid-template-columns: minmax(82px, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.episode-credits-inline input {
  min-width: 0;
}

.episode-credits-inline [data-episode-credits-status] {
  grid-column: 1 / -1;
}

.episode-credits-inline [data-state="saved"] {
  color: var(--success);
}

.episode-credits-inline [data-state="error"] {
  color: var(--danger);
}

.season-actions {
  align-items: end;
}

.season-credits-form {
  display: grid;
  grid-template-columns: minmax(130px, 160px) auto auto;
  gap: 8px;
  align-items: end;
}

.season-credits-form input {
  min-width: 0;
}

.credits-review {
  border-color: rgba(245, 158, 11, 0.35);
}

.downloaded-episodes-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.quick-episode {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.quick-episode summary {
  cursor: pointer;
  padding: 11px 13px;
  color: var(--text);
  font-weight: 700;
}

.quick-episode-form {
  display: grid;
  gap: 12px;
  padding: 0 13px 13px;
}

.credits-marker {
  display: grid;
  gap: 12px;
  padding: 14px;
  margin: 8px 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.credits-marker video {
  width: 100%;
  max-height: 420px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: #000;
}

.credits-marker-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.credits-marker-controls [data-credits-time] {
  margin-left: auto;
}

.inline-add-form {
  display: grid;
  grid-template-columns: minmax(110px, 140px) auto;
  gap: 8px;
  align-items: end;
}

.form-grid.compact {
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  margin-bottom: 0;
}

.download-grid,
.remote-download-grid,
.menu-section-grid,
.tool-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.tool-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.tool-card > strong {
  font-size: 15px;
}

.tool-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.dailymotion-form {
  display: grid;
  gap: 14px;
}

.dailymotion-url-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
}

.dailymotion-metadata-grid {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.dailymotion-fields {
  display: grid;
  gap: 12px;
}

.dailymotion-poster-preview {
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 2 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.dailymotion-poster-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reelshort-manual-panel {
  grid-template-rows: auto minmax(0, 1fr);
  width: min(940px, calc(100vw - 48px));
}

.reelshort-manual-panel .dailymotion-form {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.reelshort-provider-browser {
  display: grid;
  gap: 14px;
  margin-bottom: 24px;
}

.reelshort-queue-summary {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.reelshort-queue-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.reelshort-queue-table-wrap {
  max-height: 280px;
}

.reelshort-queue-table {
  min-width: 820px;
}

.reelshort-queue-table td strong,
.reelshort-queue-table td small {
  display: block;
}

.reelshort-queue-table td small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.reelshort-provider-filters {
  align-items: end;
}

.reelshort-provider-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.reelshort-provider-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--text);
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.reelshort-provider-tabs a.active {
  border-color: var(--primary);
  color: #fff;
  background: var(--primary);
}

.reelshort-provider-section {
  display: grid;
  gap: 12px;
}

.reelshort-provider-section + .reelshort-provider-section {
  margin-top: 16px;
}

.reelshort-provider-section-head {
  margin-bottom: 0;
}

.reelshort-provider-pager {
  margin: 0;
}

.reelshort-provider-card.is-downloaded {
  border-color: rgba(52, 211, 153, 0.45);
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.08), var(--surface) 34%);
}

.reelshort-provider-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reelshort-provider-card .remote-download-body small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.reelshort-provider-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.reelshort-provider-tags span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 11px;
}

.reelshorts-table {
  min-width: 1040px;
}

.reelshort-thumb {
  display: block;
  width: 54px;
  height: 78px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
}

.reelshort-thumb.placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.reelshort-title-cell,
.reelshort-media-cell {
  min-width: 0;
}

.reelshort-title-cell strong,
.reelshort-title-cell small,
.reelshort-media-cell small {
  display: block;
  margin-top: 4px;
}

.reelshort-title-cell small,
.reelshort-media-cell small {
  max-width: 320px;
  overflow-wrap: anywhere;
  color: var(--muted);
}

.reelshort-artwork-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.reelshort-artwork-grid .media-asset-field {
  min-width: 0;
}

.channel-logos-page {
  display: grid;
  gap: 18px;
}

.channel-logo-upload-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1fr) minmax(170px, auto) auto;
  gap: 12px;
  align-items: end;
}

.channel-logo-file-field,
.channel-logo-url-field {
  display: grid;
  gap: 6px;
}

.channel-logo-file-count {
  color: var(--muted);
  font-size: 12px;
}

.channel-logo-library-head,
.channel-logo-actions {
  align-items: center;
}

.channel-logo-title-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

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

.channel-logo-filters {
  grid-template-columns: minmax(240px, 420px) auto auto;
  justify-content: start;
}

.channel-logo-results-bar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0 14px;
  color: var(--muted);
  font-size: 12px;
}

.channel-logo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.channel-logo-card {
  position: relative;
  display: grid;
  grid-template-rows: 108px auto 34px;
  gap: 8px;
  align-content: start;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111821;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.channel-logo-card:hover {
  border-color: rgba(56, 189, 248, 0.48);
  background: #141d28;
  transform: translateY(-1px);
}

.channel-logo-card[hidden] {
  display: none;
}

.channel-logo-select {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(11, 15, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.channel-logo-select input {
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--primary);
}

.channel-logo-preview {
  display: grid;
  place-items: center;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0b1118;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.channel-logo-preview img {
  display: block;
  max-width: 92%;
  max-height: 88px;
  object-fit: contain;
}

.channel-logo-meta {
  display: grid;
  gap: 3px;
  text-align: center;
  min-width: 0;
}

.channel-logo-meta strong,
.channel-logo-usage {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-logo-meta strong {
  color: var(--text);
  font-size: 13px;
}

.channel-logo-meta span {
  color: var(--muted);
  font-size: 12px;
}

.channel-logo-detail {
  display: flex;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.channel-logo-detail span {
  min-width: 0;
}

.channel-logo-toolbar {
  display: grid;
  grid-template-columns: repeat(3, 30px);
  gap: 3px;
  justify-content: center;
  align-items: center;
}

.channel-logo-toolbar form {
  margin: 0;
}

.channel-logo-icon-button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0;
  color: var(--text);
  background: var(--surface-soft);
  cursor: pointer;
}

.channel-logo-icon-button:hover {
  border-color: rgba(56, 189, 248, 0.56);
  color: var(--primary);
  background: rgba(56, 189, 248, 0.12);
}

.channel-logo-icon-button.danger {
  color: var(--danger);
  background: rgba(248, 113, 113, 0.09);
}

.channel-logo-icon-button.danger:hover {
  border-color: rgba(248, 113, 113, 0.62);
  background: rgba(248, 113, 113, 0.16);
}

.channel-logo-icon-button.is-copied {
  border-color: rgba(52, 211, 153, 0.72);
  color: var(--ok);
  background: rgba(52, 211, 153, 0.12);
}

.channel-logo-icon-button svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.channel-logo-rename {
  position: relative;
  min-width: 0;
}

.channel-logo-rename summary {
  list-style: none;
}

.channel-logo-rename summary::-webkit-details-marker {
  display: none;
}

.channel-logo-rename summary::marker {
  content: "";
}

.channel-logo-rename-form {
  position: absolute;
  z-index: 8;
  top: 36px;
  right: -34px;
  width: 242px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.channel-logo-rename-form input {
  min-width: 0;
}

.device-grid {
  display: grid;
  gap: 12px;
}

.device-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.device-card h3 {
  margin: 0;
  font-size: 15px;
}

.download-card {
  display: grid;
  gap: 12px;
  align-content: space-between;
  min-height: 155px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.download-card-poster {
  width: 86px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
}

.bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.download-select {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.download-card strong {
  display: block;
  font-size: 16px;
}

.download-card p,
.download-card small {
  color: var(--muted);
}

.download-card small {
  word-break: break-all;
}

.remote-download-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 220px));
  align-items: start;
  justify-content: start;
}

.remote-download-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.remote-download-card img,
.remote-download-poster {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: var(--surface-strong);
}

.remote-download-poster.placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.remote-download-body,
.remote-download-actions {
  padding: 13px;
}

.remote-download-body {
  display: grid;
  gap: 7px;
}

.remote-download-body strong {
  font-size: 15px;
}

.remote-download-actions {
  padding-top: 0;
}

.remote-download-actions .button {
  width: 100%;
}

.metadata-assistant {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.metadata-search-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.metadata-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.metadata-result {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 74px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.metadata-result img,
.metadata-poster {
  width: 54px;
  height: 58px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-soft);
}

.metadata-result small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.metadata-poster.placeholder {
  display: grid;
  place-items: center;
  font-size: 11px;
  color: var(--muted);
}

.menu-section-card,
.settings-card {
  display: grid;
  gap: 14px;
}

.menu-sections-form {
  display: grid;
  gap: 14px;
}

.menu-sections-savebar {
  position: sticky;
  top: 12px;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.menu-sections-savebar strong,
.menu-sections-savebar span {
  display: block;
}

.menu-sections-savebar span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.menu-sections-guide {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.menu-sections-guide strong,
.menu-sections-guide span {
  display: block;
}

.menu-sections-guide > div:first-child span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

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

.menu-guide-grid div,
.menu-type-reference-list div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.menu-guide-grid b,
.menu-type-reference-list b {
  color: var(--text);
  font-size: 12px;
}

.menu-guide-grid span,
.menu-type-reference-list span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.menu-section-type-reference summary {
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.menu-type-reference-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.menu-sections-list {
  display: grid;
  gap: 12px;
}

.menu-section-item {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.menu-section-new {
  grid-template-columns: minmax(0, 1fr);
  background: var(--surface-strong);
}

.menu-section-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.menu-section-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.menu-section-item-head h3 {
  margin: 6px 0 0;
  font-size: 17px;
}

.menu-section-item-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.menu-section-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.menu-section-summary span {
  min-width: 0;
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.menu-section-delete {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: auto;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(248, 113, 113, 0.45);
  border-radius: 6px;
  color: var(--danger);
  background: rgba(248, 113, 113, 0.08);
  font-size: 12px;
  font-weight: 800;
  text-transform: none;
}

.menu-section-delete input {
  width: auto;
}

.menu-section-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.menu-section-field-group {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.menu-section-field-group h4 {
  margin: 0;
  color: var(--text);
  font-size: 13px;
}

.field-help {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  text-transform: none;
}

.field-help.error {
  color: var(--danger);
}

.field-help code,
.menu-sections-guide code {
  color: var(--text);
  font-size: 11px;
}

.check-row small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  text-transform: none;
}

.menu-preview {
  position: relative;
  min-height: 132px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-strong);
}

.menu-background-preview {
  width: 100%;
  height: 132px;
  border-radius: 8px;
}

.menu-logo-preview {
  position: absolute;
  left: 14px;
  bottom: 14px;
  width: 70px;
  height: 70px;
  border-radius: 8px;
  background: rgba(8, 11, 16, 0.78);
}

.menu-logo-preview.placeholder,
.menu-background-preview.placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.menu-section-form {
  display: grid;
  gap: 12px;
}

.menu-section-form [hidden] {
  display: none !important;
}

.menu-sections-form [hidden] {
  display: none !important;
}

.menu-section-form .form-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.menu-section-field-group .form-grid.compact .wide-field {
  grid-column: 1 / -1;
}

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

.settings-card .button,
.menu-section-card .button,
.menu-sections-savebar .button {
  justify-self: start;
  max-width: 100%;
}

.settings-info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
}

.settings-info-grid .readonly-field.wide {
  grid-column: span 2;
}

.settings-info-grid .readonly-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.settings-info-grid .readonly-field strong {
  min-width: 0;
  word-break: break-word;
}

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

.settings-info-list .readonly-field.wide {
  grid-column: 1 / -1;
}

.settings-status-card {
  display: grid;
  gap: 14px;
}

.app-error-code-page {
  display: grid;
  gap: 18px;
}

.app-error-scope-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.app-error-scope-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.app-error-scope-card code,
.app-error-code {
  font-family: Consolas, Monaco, monospace;
  font-weight: 800;
  color: var(--primary);
}

.app-error-scope-card strong {
  color: var(--text);
}

.app-error-scope-card span,
.app-error-scope-card small {
  color: var(--muted);
}

.app-error-table td:nth-child(3) {
  min-width: 260px;
}

.app-error-table td:nth-child(5) {
  min-width: 220px;
}

.app-error-source-list {
  display: grid;
  gap: 4px;
}

.app-error-source-list code {
  color: var(--muted);
  font-family: Consolas, Monaco, monospace;
  font-size: 12px;
  white-space: nowrap;
}

.cli-page {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
}

.cli-page > .section-head {
  margin-bottom: 0;
}

.cli-chat {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1219;
  box-shadow: var(--shadow);
}

.cli-chat.is-dragging {
  outline: 2px solid var(--primary);
  outline-offset: -3px;
}

.cli-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.cli-chat-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
}

.cli-chat-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.cli-location,
.cli-chat-tools input {
  grid-column: span 2;
}

.cli-chat-tools input,
.cli-chat-tools select {
  min-width: 0;
}

.cli-permissions {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.cli-permissions span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.cli-location,
.cli-usage {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0d1219;
}

.cli-location span,
.cli-usage span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.cli-location strong,
.cli-usage strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cli-chat-messages {
  overflow: auto;
  min-height: 0;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cli-empty {
  margin: auto;
  color: var(--muted);
}

.cli-load-older {
  align-self: center;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.cli-load-older span {
  white-space: nowrap;
}

.cli-message {
  display: flex;
}

.cli-message-event {
  align-self: center;
  max-width: min(720px, 92%);
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.cli-message-event span {
  display: inline-block;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.1);
}

.cli-message-event time {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
}

.cli-message-user {
  justify-content: flex-end;
}

.cli-message-assistant {
  justify-content: flex-start;
}

.cli-bubble {
  max-width: min(860px, 86%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--surface);
}

.cli-message-user .cli-bubble {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.14);
}

.cli-message-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
}

.cli-message-meta strong {
  color: var(--text);
}

.cli-message-status {
  color: var(--warn);
}

.cli-message-work {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.cli-message-content {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.cli-bubble > .cli-attachment-list {
  margin-top: 10px;
}

.cli-attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  white-space: normal;
}

.cli-attachment-card {
  width: 132px;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 6px;
  background: rgba(15, 20, 27, 0.88);
}

.cli-message-assistant .cli-attachment-list-response {
  gap: 10px;
}

.cli-message-assistant .cli-attachment-list-response .cli-attachment-card {
  flex: 1 1 280px;
  width: min(100%, 360px);
  max-width: 420px;
}

.cli-message-assistant .cli-attachment-list-response .cli-attachment-card figcaption {
  padding: 8px 9px;
}

.cli-message-assistant .cli-attachment-list-response .cli-attachment-card strong {
  font-size: 13px;
}

.cli-attachment-thumb {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  background: #080d13;
}

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

.cli-attachment-viewer-trigger,
.cli-attachment-file-trigger {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: zoom-in;
  text-decoration: none;
}

.cli-attachment-file-trigger {
  cursor: pointer;
}

.cli-attachment-viewer-trigger:focus-visible,
.cli-attachment-file-trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.cli-attachment-file-icon,
.cli-attachment-thumb > span {
  display: inline-grid;
  place-items: center;
  min-width: 54px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 6px;
  color: #fecaca;
  background: rgba(127, 29, 29, 0.24);
  font-size: 11px;
  font-weight: 800;
}

.cli-attachment-card figcaption {
  display: grid;
  gap: 2px;
  padding: 7px;
}

.cli-attachment-card strong,
.cli-attachment-card small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cli-attachment-card strong {
  color: var(--text);
  font-size: 12px;
}

.cli-attachment-card small {
  color: var(--muted);
  font-size: 11px;
}

.cli-attachment-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(248, 113, 113, 0.55);
  border-radius: 999px;
  color: #fee2e2;
  background: rgba(127, 29, 29, 0.84);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.cli-progress-log {
  max-height: 280px;
  overflow: auto;
  margin: 10px 0 0;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 6px;
  color: #cbd5e1;
  background: #070b11;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.cli-typing {
  color: var(--muted);
}

.cli-chat-compose {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: end;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.cli-chat-compose.running {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.cli-chat-compose:not(.running) [data-cli-cancel] {
  display: none;
}

.cli-chat-queue {
  display: grid;
  grid-column: 1 / -1;
  gap: 8px;
  max-height: 170px;
  overflow: auto;
}

.cli-chat-queue[hidden] {
  display: none;
}

.cli-chat-attachments {
  display: grid;
  grid-column: 1 / -1;
  gap: 8px;
}

.cli-chat-attachments[hidden] {
  display: none;
}

.cli-attachment-label,
.cli-attachment-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.cli-attachment-status {
  grid-column: 1 / -1;
}

.cli-attachment-status[hidden] {
  display: none;
}

.cli-attachment-status.error {
  color: var(--danger);
}

.cli-attach-button {
  align-self: stretch;
  min-width: 68px;
}

.cli-attach-button input {
  display: none;
}

.cli-queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.1);
}

.cli-queue-item.editing {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.12);
}

.cli-queue-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.cli-queue-copy span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.cli-queue-copy p {
  max-height: 72px;
  margin: 0;
  overflow: auto;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.cli-queue-copy .cli-attachment-list {
  margin-top: 4px;
}

.cli-queue-copy .cli-attachment-card {
  width: 104px;
}

.cli-queue-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.cli-chat-compose textarea {
  min-width: 0;
  min-height: 58px;
  max-height: 160px;
}

.home-content-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.upcoming-events-page {
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.upcoming-event-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: min(100%, 760px);
  margin: 0 0 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.app-section-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 560px);
}

.tabs.upcoming-event-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  min-width: 0;
}

.tabs.compact.upcoming-event-tabs a {
  padding: 7px 12px;
}

.tabs.upcoming-event-tabs a:hover {
  border-color: rgba(96, 165, 250, 0.35);
  background: rgba(96, 165, 250, 0.08);
  color: var(--text);
}

.tabs.upcoming-event-tabs a.active {
  border-color: rgba(96, 165, 250, 0.58);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.36), rgba(29, 78, 216, 0.22));
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.upcoming-event-tab-label {
  white-space: nowrap;
}

.upcoming-event-tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  min-height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: inherit;
  font-size: 12px;
  font-weight: 800;
}

.tabs.upcoming-event-tabs a.active .upcoming-event-tab-count {
  background: var(--primary);
  color: #fff;
}

.app-fifa-stream-manager {
  gap: 16px;
}

.app-fifa-date-groups {
  display: grid;
  gap: 12px;
}

.app-fifa-date-group > .app-fifa-stream-list {
  padding: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.app-fifa-stream-list {
  grid-template-columns: minmax(0, 1fr);
}

.app-fifa-stream-card {
  grid-template-columns: 104px minmax(0, 1fr);
}

.app-fifa-stream-card .upcoming-event-media {
  align-self: start;
}

.app-fifa-stream-form {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  padding-top: 2px;
}

.app-fifa-stream-primary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.app-fifa-stream-primary label {
  min-width: 0;
}

.app-fifa-stream-form .upcoming-stream-fields {
  padding: 9px;
}

.fifa-channel-stream-list {
  display: grid;
  gap: 8px;
}

.fifa-channel-stream-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(120px, 0.32fr) auto;
  gap: 8px;
  align-items: end;
  min-width: 0;
}

.fifa-channel-stream-row label,
.fifa-channel-stream-row select,
.fifa-channel-stream-row input {
  min-width: 0;
}

.fifa-channel-stream-remove {
  align-self: end;
  white-space: nowrap;
}

.app-fifa-stream-save-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.app-fifa-stream-save-row .button {
  flex: 0 0 auto;
}

.upcoming-events-column,
.upcoming-events-block,
.upcoming-event-list {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.upcoming-events-block {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.upcoming-events-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.upcoming-events-block-head h3 {
  margin: 0;
  font-size: 17px;
}

.upcoming-event-card {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.upcoming-event-card.active {
  border-color: rgba(52, 211, 153, 0.45);
}

.upcoming-event-card.past {
  opacity: 0.86;
}

.upcoming-event-card.inactive {
  grid-template-columns: 96px minmax(0, 1fr);
}

.upcoming-event-card.inactive.inactive-event-card {
  border-left: 3px solid rgba(56, 189, 248, 0.45);
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.08), rgba(15, 23, 42, 0.2) 34%, var(--surface-strong));
}

.inactive-event-card .upcoming-event-title-line {
  align-items: flex-start;
}

.inactive-event-card .upcoming-event-title-line h3 {
  white-space: normal;
  line-height: 1.3;
}

.upcoming-event-img {
  width: 110px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-soft);
}

.upcoming-event-img.placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.upcoming-event-matchup-art {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 110px;
  height: 72px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(30, 41, 59, 0.72));
}

.matchup-logo-wrap {
  display: grid;
  place-items: center;
  min-width: 0;
  height: 46px;
}

.matchup-logo-wrap img {
  max-width: 100%;
  max-height: 46px;
  object-fit: contain;
}

.matchup-vs {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
}

.upcoming-event-body {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.upcoming-event-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.upcoming-event-title-line h3 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upcoming-event-schedule-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  align-items: end;
}

.upcoming-event-schedule-form .wide-field {
  grid-column: 1 / -1;
}

.upcoming-event-edit-form {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.upcoming-stream-fields {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.24);
}

.upcoming-stream-fields-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.upcoming-stream-fields-head.compact {
  align-items: center;
}

.upcoming-primary-stream-fields {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(130px, 0.35fr);
  gap: 8px;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.2);
}

.upcoming-primary-stream-fields label,
.upcoming-primary-stream-fields select,
.upcoming-primary-stream-fields input,
.upcoming-stream-source-field {
  min-width: 0;
}

.upcoming-primary-stream-hint,
.upcoming-primary-stream-status {
  grid-column: 1 / -1;
  margin: 0;
}

.upcoming-stream-source-field {
  display: grid;
  gap: 6px;
}

.upcoming-channel-stream-fields {
  display: grid;
  gap: 8px;
  padding: 9px;
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.2);
}

.upcoming-channel-stream-fields strong {
  display: block;
  color: var(--text);
  font-size: 12px;
}

.upcoming-event-schedule-form .button {
  justify-self: start;
}

.inactive-event-list {
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
}

.inactive-event-groups {
  display: grid;
  gap: 10px;
}

.inactive-event-coverage {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
  max-width: 980px;
}

.inactive-event-coverage-pill,
.inactive-event-coverage-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.32);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.inactive-event-coverage-pill strong {
  color: var(--text);
  font-size: 11px;
}

.inactive-event-coverage-pill span {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inactive-event-coverage-pill em {
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
  font-style: normal;
  text-align: center;
}

.inactive-event-group {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.inactive-event-group[open] {
  gap: 12px;
  padding-bottom: 12px;
}

.inactive-event-date-group[open] > .inactive-event-group-head {
  border-bottom: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.24);
}

.inactive-event-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.inactive-event-group-head::-webkit-details-marker {
  display: none;
}

.inactive-event-group-head h4 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
}

.inactive-event-group-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.inactive-event-group-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.inactive-event-group-chevron {
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.18s ease;
}

.inactive-event-group[open] > .inactive-event-group-head .inactive-event-group-chevron {
  transform: rotate(45deg);
}

.inactive-event-group .inactive-event-list {
  padding: 0 12px;
}

.inactive-event-sport-groups {
  display: grid;
  gap: 12px;
  padding: 0 12px;
}

.inactive-event-sport-groups.is-loading {
  padding-bottom: 0;
}

.inactive-event-date-group[open] > .inactive-event-sport-groups {
  margin-left: 24px;
  padding: 0 12px 0 20px;
  border-left: 2px solid rgba(56, 189, 248, 0.34);
}

.inactive-event-load-state {
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.18);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.inactive-event-sport-group {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.inactive-event-sport-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  cursor: pointer;
  list-style: none;
}

.inactive-event-sport-group-head::-webkit-details-marker {
  display: none;
}

.inactive-event-sport-group[open] > .inactive-event-sport-group-head {
  border-bottom: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.2);
}

.inactive-event-sport-group[open] > .inactive-event-sport-group-head .inactive-event-group-chevron {
  transform: rotate(45deg);
}

.inactive-event-sport-group:not([open]) > .inactive-event-list {
  display: none;
}

.inactive-event-sport-group-head h5 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.inactive-event-sport-group-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.inactive-event-sport-group .inactive-event-list {
  margin: 10px 12px 12px;
  padding: 0 0 0 14px;
  border-left: 1px solid var(--line);
}

.inactive-event-activate-form {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  padding-top: 4px;
}

.inactive-event-activate-details {
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.2);
}

.inactive-event-activate-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  color: #93c5fd;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  list-style: none;
}

.inactive-event-activate-details > summary::-webkit-details-marker {
  display: none;
}

.inactive-event-activate-details[open] > summary {
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(37, 99, 235, 0.09);
}

.inactive-event-activate-details[open] > summary .inactive-event-group-chevron {
  transform: rotate(45deg);
}

.inactive-event-activate-details .inactive-event-activate-form {
  padding: 10px;
}

.inactive-event-activate-form .wide-field {
  grid-column: 1 / -1;
}

.inactive-promo-image-picker {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(96, 165, 250, 0.24);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.28);
}

.inactive-promo-image-head,
.inactive-promo-search-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.inactive-promo-image-head > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.inactive-promo-search-row input {
  min-width: 0;
  flex: 1 1 auto;
}

.inactive-promo-selected {
  display: grid;
  min-height: 38px;
  align-items: center;
  padding: 8px 10px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 12px;
  font-weight: 700;
}

.inactive-promo-selected.has-image {
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 9px;
  color: var(--text);
}

.inactive-promo-selected img {
  width: 84px;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-soft);
}

.inactive-promo-selected span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.inactive-promo-selected strong,
.inactive-promo-selected small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inactive-promo-selected small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.inactive-promo-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
  gap: 8px;
  max-height: 300px;
  overflow: auto;
}

.inactive-promo-results[hidden] {
  display: none;
}

.inactive-promo-option {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface-strong);
  text-align: left;
  cursor: pointer;
}

.inactive-promo-option.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.inactive-promo-option img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-soft);
}

.inactive-promo-option span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.inactive-promo-option strong,
.inactive-promo-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inactive-promo-option small {
  color: var(--muted);
  font-size: 11px;
}

.inactive-promo-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.inactive-channel-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
}

.inactive-channel-hint[data-inactive-stream-status] {
  width: fit-content;
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
}

.inactive-channel-hint[data-inactive-stream-status][data-state="saving"] {
  border-color: rgba(96, 165, 250, 0.24);
  background: rgba(96, 165, 250, 0.11);
  color: #bfdbfe;
}

.inactive-channel-hint[data-inactive-stream-status][data-state="saved"] {
  border-color: rgba(52, 211, 153, 0.28);
  background: rgba(52, 211, 153, 0.13);
  color: var(--ok);
}

.inactive-channel-hint[data-inactive-stream-status][data-state="error"] {
  border-color: rgba(248, 113, 113, 0.28);
  background: rgba(248, 113, 113, 0.13);
  color: var(--danger);
}

.inactive-event-activate-form .button {
  min-height: 40px;
}

.manual-upcoming-event-panel {
  overflow: hidden;
  border: 1px solid rgba(96, 165, 250, 0.28);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.24);
}

.manual-upcoming-event-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  color: #bfdbfe;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  list-style: none;
}

.manual-upcoming-event-panel > summary::-webkit-details-marker {
  display: none;
}

.manual-upcoming-event-panel[open] > summary {
  border-bottom: 1px solid rgba(96, 165, 250, 0.2);
  background: rgba(37, 99, 235, 0.1);
}

.manual-upcoming-event-panel[open] > summary .inactive-event-group-chevron {
  transform: rotate(45deg);
}

.manual-upcoming-event-form {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  padding: 12px;
}

.manual-upcoming-event-form .wide-field {
  grid-column: 1 / -1;
}

.upcoming-event-actions {
  display: flex;
  justify-content: flex-end;
}

.upcoming-schedule-fields {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.upcoming-schedule-fields .wide-field {
  grid-column: 1 / -1;
}

.home-content-preview {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 0;
  overflow: hidden;
  padding: 0;
}

.home-content-preview-media {
  position: relative;
  min-height: 260px;
  background: var(--surface-strong);
}

.home-content-hero-img {
  display: block;
  width: 100%;
  height: 280px;
  object-fit: cover;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface-strong);
}

.home-content-hero-img.placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.home-content-logo {
  position: absolute;
  left: 18px;
  bottom: 18px;
  max-width: 175px;
  max-height: 74px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.64));
}

.home-content-current {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.home-content-current h3 {
  margin: 0;
  font-size: 22px;
}

.home-content-current p {
  margin: 0;
  color: var(--muted);
}

.home-content-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 4px 0 0;
}

.home-content-meta div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.home-content-meta dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.home-content-meta dd {
  margin: 3px 0 0;
  color: var(--text);
  font-weight: 700;
  word-break: break-word;
}

.home-content-actions {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
}

.home-content-json {
  margin: 0 18px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.home-content-json summary {
  cursor: pointer;
  padding: 10px 12px;
  color: var(--text);
  font-weight: 700;
}

.home-content-json pre {
  max-height: 260px;
  overflow: auto;
  margin: 0;
  padding: 0 12px 12px;
  color: var(--muted);
  font-size: 12px;
  white-space: pre-wrap;
}

.home-content-browser {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.home-content-filters {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.home-content-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 14px;
}

.home-content-result-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.home-content-result-img {
  width: 82px;
  height: 62px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-strong);
}

.home-content-result-img.placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.home-content-result-body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.home-content-result-body strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-content-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.home-content-result-meta span {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 12px;
}

.home-content-result-action {
  display: grid;
  gap: 8px;
  justify-self: end;
  min-width: 180px;
}

.home-dashboard-add-form {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.home-dashboard-add-form select {
  min-width: 0;
  min-height: 34px;
  font-size: 12px;
}

.home-dashboard-manager {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.home-dashboard-manager-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.home-dashboard-manager-head h3 {
  margin: 0 0 4px;
  font-size: 19px;
}

.home-dashboard-row-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.home-dashboard-row-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.home-dashboard-row-card > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.home-dashboard-row-card h4 {
  margin: 0 0 3px;
  font-size: 16px;
}

.home-dashboard-item-list {
  display: grid;
  gap: 9px;
}

.home-dashboard-item-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.home-dashboard-item-img {
  width: 82px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 7px;
  object-fit: cover;
  background: var(--surface-soft);
}

.home-dashboard-item-img.placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.home-dashboard-item-card > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.home-dashboard-item-card strong,
.home-dashboard-item-card span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-dashboard-item-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.home-content-promo-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
}

.home-content-promo-modal[hidden] {
  display: none;
}

.home-content-promo-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 12, 0.78);
  backdrop-filter: blur(5px);
}

.home-content-promo-dialog {
  position: relative;
  width: min(1380px, calc(100vw - 32px));
  height: min(900px, calc(100vh - 32px));
  height: min(900px, calc(100dvh - 32px));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.58);
}

.home-content-promo-dialog form {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
}

.media-asset-dialog-inner {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
}

.home-content-promo-head,
.home-content-promo-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.home-content-promo-footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
  background: var(--surface);
  box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.24);
  position: relative;
  z-index: 2;
}

.home-content-promo-footer .button {
  min-width: 160px;
}

.home-content-promo-footer .button[type="submit"] {
  border-color: rgba(43, 108, 255, 0.7);
  min-height: 44px;
  min-width: 210px;
  box-shadow: 0 0 0 1px rgba(43, 108, 255, 0.22), 0 12px 28px rgba(43, 108, 255, 0.28);
  font-size: 15px;
}

.home-content-promo-head h3 {
  margin: 8px 0 4px;
  font-size: 22px;
}

.home-content-promo-head p {
  margin: 0;
}

.home-content-promo-status {
  min-height: 18px;
}

.home-content-promo-search {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-strong);
  position: relative;
  z-index: 2;
}

.home-content-promo-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
  gap: 16px;
  min-height: 0;
  padding: 16px 18px;
  overflow: hidden;
}

.home-content-promo-dialog form[data-home-promo-schedule-enabled="1"][data-home-promo-image-selected="1"] .home-content-promo-results {
  display: none;
}

.home-content-promo-dialog form[data-home-promo-schedule-enabled="1"][data-home-promo-image-selected="1"] .home-content-promo-body {
  grid-template-columns: minmax(0, 720px);
  align-content: start;
  justify-content: center;
  overflow: auto;
}

.home-content-promo-dialog form[data-home-promo-schedule-enabled="1"][data-home-promo-image-selected="1"] .home-content-promo-side {
  display: grid;
  gap: 12px;
  overflow: visible;
}

.home-content-promo-dialog form[data-home-promo-schedule-enabled="1"][data-home-promo-image-selected="1"] .home-content-promo-selected-preview.has-image {
  grid-template-columns: 160px minmax(0, 1fr);
  align-items: center;
  justify-items: stretch;
  min-height: 0;
  overflow: hidden;
  text-align: left;
}

.home-content-promo-dialog form[data-home-promo-schedule-enabled="1"][data-home-promo-image-selected="1"] .home-content-promo-selected-preview.has-image img {
  width: 160px;
  height: 90px;
  aspect-ratio: auto;
  object-fit: cover;
}

.home-content-promo-dialog form[data-home-promo-schedule-enabled="1"][data-home-promo-image-selected="1"] .home-content-promo-selected-preview.has-image span {
  align-self: center;
  min-width: 0;
}

.home-content-promo-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  align-content: start;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.home-content-promo-results:empty {
  display: none;
}

.home-content-promo-option {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface-strong);
  text-align: left;
  cursor: pointer;
}

.home-content-promo-option.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.home-content-promo-option img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-soft);
}

.home-content-promo-option span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 0 2px 2px;
}

.home-content-promo-option strong,
.home-content-promo-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-content-promo-option small {
  color: var(--muted);
  font-size: 11px;
}

.home-content-promo-side {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

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

.home-content-promo-fields .wide-field,
.home-content-player-toggle {
  grid-column: 1 / -1;
}

.home-content-player-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: var(--surface-strong);
  text-transform: none;
}

.home-content-player-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.home-content-player-checkbox span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-content-player-toggle input {
  width: auto;
}

.home-content-promo-selected-preview {
  display: grid;
  gap: 10px;
  min-height: 150px;
  place-items: center;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-strong);
  text-align: center;
}

.home-content-promo-selected-preview img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-soft);
}

.home-content-promo-selected-preview span {
  display: grid;
  gap: 3px;
  max-width: 100%;
  text-align: left;
}

.home-content-promo-selected-preview small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-content-promo-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.modal-open {
  overflow: hidden;
}

.stacked-badges {
  display: grid;
  gap: 4px;
  min-width: 130px;
}

.stacked-badges span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.duplicate-group-list {
  display: grid;
  gap: 16px;
}

.duplicate-bulk-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.duplicate-bulk-panel h2 {
  margin: 0;
}

.duplicate-bulk-panel p {
  margin: 4px 0 0;
  color: var(--muted);
}

.duplicate-bulk-form {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin: 0;
}

.duplicate-bulk-form label {
  display: grid;
  gap: 6px;
  min-width: 150px;
}

.duplicate-group {
  overflow: hidden;
}

.duplicate-group-head {
  margin: 0;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

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

.duplicate-keep-choice {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
  white-space: nowrap;
}

.duplicate-keep-choice input {
  width: auto;
}

.duplicate-table td {
  vertical-align: top;
}

.duplicate-meta {
  display: grid;
  gap: 5px;
  min-width: 180px;
}

.duplicate-meta > span {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.duplicate-meta > .duplicate-path {
  display: block;
  max-width: 260px;
  overflow-wrap: anywhere;
}

.form-actions,
.actions,
.check-row,
.tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.check-row label,
.check-list label,
.inline-check {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  text-transform: none;
  font-size: 14px;
  font-weight: 500;
}

.check-row input,
.check-list input {
  width: auto;
}

input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 42px;
  min-width: 42px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
  background: #303846;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}

input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 140ms ease;
}

input[type="checkbox"]:checked {
  border-color: rgba(52, 211, 153, 0.72);
  background: var(--ok);
}

input[type="checkbox"]:checked::after {
  transform: translateX(18px);
}

.check-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.check-list legend {
  color: var(--muted);
  font-weight: 700;
}

.media-category-list {
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 0;
  max-height: calc(100vh - 130px);
  overflow: auto;
}

.media-category-list label {
  justify-content: flex-start;
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.device-presence-page .section-head p {
  margin-top: 4px;
}

.device-presence-filters {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(160px, 220px) auto;
  gap: 12px;
  align-items: end;
  margin: 0 0 16px;
}

.device-presence-filters label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.device-presence-filters label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.device-presence-table td {
  min-width: 118px;
}

.device-presence-table td:nth-child(4) {
  min-width: 260px;
}

.device-presence-table strong,
.device-presence-table small {
  display: block;
}

.device-presence-table small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.device-presence-table .device-profile-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.device-profile-line span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.device-profile-avatar {
  flex: 0 0 auto;
  display: block;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 5px;
  object-fit: cover;
  background: var(--surface-strong);
}

.device-presence-table .device-nickname {
  color: var(--text);
  font-weight: 800;
}

.device-presence-table td.device-presence-actions {
  min-width: 58px;
  width: 58px;
  text-align: right;
}

.device-presence-actions {
  position: relative;
}

.device-presence-action-menu {
  position: relative;
  display: inline-flex;
  justify-content: flex-end;
}

.device-presence-action-toggle {
  display: inline-grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: var(--surface-soft);
  cursor: pointer;
}

.device-presence-action-toggle:hover,
.device-presence-action-toggle[aria-expanded="true"] {
  border-color: rgba(56, 189, 248, 0.45);
  color: #fff;
  background: #172033;
}

.device-presence-action-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.device-presence-action-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 80;
  display: grid;
  gap: 8px;
  width: 230px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1219;
  box-shadow: var(--shadow);
  text-align: left;
  -webkit-overflow-scrolling: touch;
}

.device-presence-action-popover[hidden] {
  display: none;
}

.device-presence-action-group {
  display: grid;
  gap: 5px;
  padding-top: 8px;
  border-top: 1px solid rgba(42, 52, 67, 0.72);
}

.device-presence-action-group:first-child {
  padding-top: 0;
  border-top: 0;
}

.device-presence-action-heading {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: uppercase;
}

.device-presence-action-popover .button {
  justify-content: flex-start;
  width: 100%;
  margin: 0;
  text-align: left;
}

.device-presence-action-popover .button.danger {
  justify-content: flex-start;
}

.device-presence-action-popover [data-device-command-status] {
  margin: 1px 0 0;
}

.device-presence-action-popover .device-message-actions,
.device-presence-action-popover .device-access-block-actions {
  display: grid;
  gap: 5px;
  margin: 0;
}

.device-access-block-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 4px;
}

.device-message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 4px;
}

.device-presence-actions .button {
  margin: 0 6px 6px 0;
}

.device-presence-actions .device-presence-action-popover .button {
  margin: 0;
}

.device-presence-actions .button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.device-access-block-panel,
.device-message-panel {
  grid-template-rows: auto minmax(0, 1fr);
  max-width: 520px;
}

.device-access-block-form,
.device-message-form {
  display: grid;
  gap: 14px;
  align-content: start;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
}

.device-access-block-form label,
.device-message-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.85rem;
}

.device-access-block-form select,
.device-access-block-form textarea,
.device-message-form input,
.device-message-form textarea {
  width: 100%;
}

.device-access-block-form textarea,
.device-message-form textarea {
  min-height: 110px;
  resize: vertical;
}

.device-access-block-form-actions,
.device-message-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.access-block-filters {
  grid-template-columns: minmax(140px, 180px) minmax(140px, 180px) minmax(220px, 1fr) auto;
}

.access-block-table td {
  vertical-align: top;
}

.access-block-table small,
.access-block-target small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.access-block-target strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.watch-analytics-controls {
  display: grid;
  gap: 16px;
}

.watch-analytics-controls-head {
  align-items: flex-start;
}

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

.watch-filter-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.watch-filter-group {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.watch-filter-copy strong,
.watch-analytics-current strong {
  display: block;
  color: var(--text);
  line-height: 1.2;
}

.watch-filter-copy span,
.watch-analytics-current small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.watch-filter-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 12px;
}

.watch-date-tools {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
}

.watch-date-field {
  min-width: 0;
}

.watch-date-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.watch-date-shortcuts .button.is-active {
  border-color: rgba(56, 189, 248, 0.62);
  color: #e0f2fe;
  background: rgba(56, 189, 248, 0.14);
}

.watch-analytics-current {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.watch-analytics-current span {
  min-width: 0;
  padding-left: 10px;
  border-left: 2px solid rgba(56, 189, 248, 0.35);
}

.watch-analytics-summary {
  margin-top: 18px;
}

.watch-analytics-page {
  margin-top: 18px;
}

.watch-analytics-page .section-head p {
  margin-top: 4px;
}

.watch-analytics-table td {
  min-width: 112px;
}

.watch-analytics-table td:first-child {
  min-width: 240px;
}

.watch-analytics-table tr.watch-type-row > td:first-child {
  border-left: 4px solid var(--watch-type-color);
  background: linear-gradient(90deg, var(--watch-type-bg), transparent 62%);
}

.watch-analytics-table strong,
.watch-analytics-table small {
  display: block;
}

.watch-analytics-table small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.watch-actionable-panel {
  display: grid;
  gap: 18px;
  overflow: hidden;
}

.watch-action-card-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 10px;
}

.watch-action-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  min-height: 144px;
  padding: 12px;
  border: 1px solid var(--line);
  border-top: 3px solid #64748b;
  border-radius: 8px;
  background: var(--surface-strong);
}

.watch-action-card.is-ok {
  border-top-color: #22c55e;
}

.watch-action-card.is-warn {
  border-top-color: #f59e0b;
}

.watch-action-card.is-info {
  border-top-color: #38bdf8;
}

.watch-action-card span,
.watch-action-card small,
.watch-action-card p {
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.watch-action-card span {
  font-weight: 800;
  text-transform: uppercase;
}

.watch-action-card strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 18px;
  line-height: 1.15;
}

.watch-action-card p {
  color: var(--text);
}

.watch-action-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.watch-action-split section,
.watch-platform-panel {
  min-width: 0;
}

.watch-action-split h3,
.watch-platform-panel h3 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.2;
}

.watch-action-table td {
  vertical-align: top;
}

.watch-action-table td:first-child {
  min-width: 220px;
}

.watch-strategy-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px 0 10px;
}

.watch-strategy-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 12px;
  font-weight: 800;
}

.watch-peak-panel {
  overflow: hidden;
}

.watch-peak-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.42fr);
  gap: 18px;
  align-items: start;
}

.watch-peak-chart-area,
.watch-peak-side {
  min-width: 0;
}

.watch-peak-side,
.watch-peak-overview {
  display: grid;
  gap: 12px;
}

.watch-peak-overview > div {
  min-width: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.watch-peak-overview > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.watch-peak-overview span,
.watch-peak-overview small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.watch-peak-overview strong {
  display: block;
  margin: 5px 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 20px;
  line-height: 1.15;
}

.watch-peak-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 0 12px;
}

.watch-peak-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.watch-peak-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--watch-peak-color, #64748b);
}

.watch-peak-chart {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.watch-peak-chart-row {
  display: grid;
  grid-template-columns: 70px minmax(160px, 1fr) 70px;
  gap: 10px;
  align-items: center;
  min-height: 32px;
}

.watch-peak-hour strong,
.watch-peak-total strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  line-height: 1.2;
}

.watch-peak-hour span,
.watch-peak-total span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.watch-peak-total {
  text-align: right;
}

.watch-peak-bar-track {
  position: relative;
  overflow: hidden;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
}

.watch-peak-bar {
  display: flex;
  overflow: hidden;
  min-width: 0;
  height: 100%;
  border-radius: inherit;
}

.watch-peak-segment {
  flex: 0 0 auto;
  min-width: 3px;
  height: 100%;
  background: var(--watch-peak-color, #64748b);
}

.watch-peak-badge {
  color: #fff;
  background: var(--watch-peak-color, #64748b);
}

.watch-type-badge,
.watch-type-row,
.watch-top-tab {
  --watch-type-color: #64748b;
  --watch-type-bg: rgba(100, 116, 139, 0.16);
  --watch-type-border: rgba(100, 116, 139, 0.55);
}

.badge.watch-type-badge {
  border: 1px solid var(--watch-type-border);
  color: #fff;
  background: var(--watch-type-color, #64748b);
}

.watch-type-badge.is-live,
.watch-type-row.is-live,
.watch-top-tab.is-live {
  --watch-type-color: #0ea5e9;
  --watch-type-bg: rgba(14, 165, 233, 0.15);
  --watch-type-border: rgba(14, 165, 233, 0.56);
}

.watch-type-badge.is-movie,
.watch-type-row.is-movie,
.watch-top-tab.is-movie {
  --watch-type-color: #22c55e;
  --watch-type-bg: rgba(34, 197, 94, 0.15);
  --watch-type-border: rgba(34, 197, 94, 0.56);
}

.watch-type-badge.is-series,
.watch-type-row.is-series,
.watch-top-tab.is-series {
  --watch-type-color: #f59e0b;
  --watch-type-bg: rgba(245, 158, 11, 0.16);
  --watch-type-border: rgba(245, 158, 11, 0.58);
}

.watch-type-badge.is-sports,
.watch-type-row.is-sports,
.watch-top-tab.is-sports {
  --watch-type-color: #ef4444;
  --watch-type-bg: rgba(239, 68, 68, 0.15);
  --watch-type-border: rgba(239, 68, 68, 0.58);
}

.watch-type-badge.is-gaming,
.watch-type-row.is-gaming,
.watch-top-tab.is-gaming {
  --watch-type-color: #8b5cf6;
  --watch-type-bg: rgba(139, 92, 246, 0.18);
  --watch-type-border: rgba(139, 92, 246, 0.62);
}

.watch-type-badge.is-showcase,
.watch-type-row.is-showcase,
.watch-top-tab.is-showcase {
  --watch-type-color: #14b8a6;
  --watch-type-bg: rgba(20, 184, 166, 0.15);
  --watch-type-border: rgba(20, 184, 166, 0.56);
}

.watch-type-badge.is-kids,
.watch-type-row.is-kids,
.watch-top-tab.is-kids {
  --watch-type-color: #06b6d4;
  --watch-type-bg: rgba(6, 182, 212, 0.15);
  --watch-type-border: rgba(6, 182, 212, 0.56);
}

.watch-type-badge.is-music,
.watch-type-row.is-music,
.watch-top-tab.is-music {
  --watch-type-color: #a855f7;
  --watch-type-bg: rgba(168, 85, 247, 0.18);
  --watch-type-border: rgba(168, 85, 247, 0.62);
}

.watch-type-badge.is-reelshort,
.watch-type-row.is-reelshort,
.watch-top-tab.is-reelshort {
  --watch-type-color: #f43f5e;
  --watch-type-bg: rgba(244, 63, 94, 0.16);
  --watch-type-border: rgba(244, 63, 94, 0.58);
}

.watch-type-badge.is-trailer,
.watch-type-row.is-trailer,
.watch-top-tab.is-trailer {
  --watch-type-color: #ec4899;
  --watch-type-bg: rgba(236, 72, 153, 0.16);
  --watch-type-border: rgba(236, 72, 153, 0.58);
}

.watch-type-badge.is-other,
.watch-type-row.is-other,
.watch-top-tab.is-other {
  --watch-type-color: #64748b;
  --watch-type-bg: rgba(100, 116, 139, 0.16);
  --watch-type-border: rgba(100, 116, 139, 0.55);
}

.watch-peak-dot.is-live,
.watch-peak-segment.is-live,
.watch-peak-badge.is-live {
  --watch-peak-color: #0ea5e9;
}

.watch-peak-dot.is-movie,
.watch-peak-segment.is-movie,
.watch-peak-badge.is-movie {
  --watch-peak-color: #22c55e;
}

.watch-peak-dot.is-series,
.watch-peak-segment.is-series,
.watch-peak-badge.is-series {
  --watch-peak-color: #f59e0b;
}

.watch-peak-dot.is-sports,
.watch-peak-segment.is-sports,
.watch-peak-badge.is-sports {
  --watch-peak-color: #ef4444;
}

.watch-peak-dot.is-gaming,
.watch-peak-segment.is-gaming,
.watch-peak-badge.is-gaming {
  --watch-peak-color: #8b5cf6;
}

.watch-peak-dot.is-showcase,
.watch-peak-segment.is-showcase,
.watch-peak-badge.is-showcase {
  --watch-peak-color: #14b8a6;
}

.watch-peak-dot.is-kids,
.watch-peak-segment.is-kids,
.watch-peak-badge.is-kids {
  --watch-peak-color: #06b6d4;
}

.watch-peak-dot.is-music,
.watch-peak-segment.is-music,
.watch-peak-badge.is-music {
  --watch-peak-color: #a855f7;
}

.watch-peak-dot.is-reelshort,
.watch-peak-segment.is-reelshort,
.watch-peak-badge.is-reelshort {
  --watch-peak-color: #f43f5e;
}

.watch-peak-dot.is-trailer,
.watch-peak-segment.is-trailer,
.watch-peak-badge.is-trailer {
  --watch-peak-color: #ec4899;
}

.watch-peak-dot.is-other,
.watch-peak-segment.is-other,
.watch-peak-badge.is-other {
  --watch-peak-color: #64748b;
}

.watch-peak-insights {
  display: grid;
  gap: 8px;
  margin: 0;
}

.watch-peak-insights span {
  display: block;
  border-left: 3px solid var(--primary);
  padding: 8px 10px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  background: rgba(56, 189, 248, 0.08);
}

.watch-peak-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 16px;
}

.watch-peak-split h3 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.2;
}

.watch-top-content-panel {
  overflow: hidden;
}

.watch-top-content-panel .section-head {
  gap: 14px;
  align-items: flex-start;
}

.watch-top-content-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  justify-content: flex-end;
  min-width: min(100%, 460px);
}

.watch-top-content-filters label {
  display: grid;
  gap: 5px;
  min-width: 150px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.watch-top-content-filters select {
  min-width: 150px;
}

.watch-top-content-current {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
}

.watch-top-content-current span {
  min-width: 0;
  padding-left: 10px;
  border-left: 2px solid rgba(34, 197, 94, 0.38);
}

.watch-top-content-current strong,
.watch-top-content-current small {
  display: block;
}

.watch-top-content-current strong {
  overflow-wrap: anywhere;
  color: var(--text);
  line-height: 1.2;
}

.watch-top-content-current small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.watch-top-content-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.watch-top-tab {
  display: inline-grid;
  gap: 3px;
  min-width: 132px;
  max-width: 190px;
  padding: 9px 11px;
  border: 1px solid var(--watch-type-border);
  border-left: 4px solid var(--watch-type-color);
  border-radius: 8px;
  color: var(--muted);
  background: var(--watch-type-bg);
  text-decoration: none;
}

.watch-top-tab:hover,
.watch-top-tab.is-active {
  border-color: var(--watch-type-color);
  border-left-color: var(--watch-type-color);
  color: var(--text);
  background: var(--watch-type-bg);
}

.watch-top-tab strong,
.watch-top-tab span,
.watch-top-tab small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watch-top-tab strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
}

.watch-top-tab span {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.watch-top-tab small,
.watch-content-badges {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.watch-content-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.watch-top-score strong {
  color: var(--text);
}

.watch-analytics-report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.watch-analytics-report-grid .watch-analytics-page {
  margin-top: 0;
}

.watch-analytics-wide {
  grid-column: 1 / -1;
}

@media (max-width: 960px) {
  .watch-filter-layout,
  .watch-peak-layout,
  .watch-peak-split,
  .watch-action-split,
  .watch-analytics-report-grid {
    grid-template-columns: 1fr;
  }

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

  .watch-analytics-wide {
    grid-column: auto;
  }

  .watch-top-content-panel .section-head,
  .watch-top-content-filters {
    display: grid;
    justify-content: stretch;
  }

  .watch-top-content-filters {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .watch-top-content-filters label,
  .watch-top-content-filters select {
    min-width: 0;
    width: 100%;
  }

  .watch-top-content-current {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .watch-date-tools {
    grid-template-columns: 1fr;
  }

  .watch-analytics-controls-head {
    align-items: stretch;
    flex-direction: column;
  }

  .watch-filter-fields,
  .watch-analytics-current,
  .watch-top-content-current {
    grid-template-columns: 1fr;
  }

  .watch-action-card-grid {
    grid-template-columns: 1fr;
  }

  .watch-action-card {
    min-height: 0;
  }

  .watch-top-tab {
    flex: 1 1 150px;
    max-width: none;
  }

  .watch-date-shortcuts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .watch-date-shortcuts .button,
  .watch-date-tools > .button,
  .watch-analytics-controls-head .button {
    width: 100%;
  }

  .watch-peak-chart-row {
    grid-template-columns: 54px minmax(96px, 1fr) 56px;
    gap: 7px;
  }

  .watch-peak-overview strong {
    font-size: 18px;
  }

  .watch-peak-hour strong,
  .watch-peak-total strong {
    font-size: 11px;
  }

  .watch-peak-hour span,
  .watch-peak-total span {
    font-size: 10px;
  }
}

.dashboard-watch-analytics {
  margin: 4px 0 18px;
}

.dashboard-watch-head {
  margin-bottom: 12px;
}

.dashboard-watch-head p {
  margin-top: 4px;
}

.dashboard-watch-filters {
  display: grid;
  grid-template-columns: minmax(150px, 220px) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.dashboard-watch-filters label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.dashboard-watch-filters label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.dashboard-watch-summary {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.dashboard-watch-insights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.dashboard-watch-insight {
  min-height: 136px;
}

.dashboard-watch-insight strong {
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.dashboard-watch-insight small {
  display: block;
  line-height: 1.35;
}

.dashboard-watch-insight small + small {
  margin-top: 4px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 9px 14px;
  color: #06111a;
  background: var(--primary);
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

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

.button:disabled,
input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.balance-number {
  display: block;
  font-size: 32px;
  line-height: 1;
}

.button.secondary {
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.button.mini {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 12px;
}

.button.danger {
  background: var(--danger);
  color: #1b0808;
}

.button.danger:hover {
  background: #ef4444;
  color: #fff;
}

.inline-form {
  display: inline;
}

.channel-status-toggle-form {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.channel-status-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-transform: none;
}

.channel-status-toggle span {
  min-width: 48px;
}

.download-manager-button {
  gap: 8px;
}

.signout-button {
  gap: 8px;
}

.topbar-actions .button svg,
.credit-pill svg {
  display: none;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notification-bell-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
}

.notification-bell-button:hover {
  border-color: rgba(56, 189, 248, 0.42);
  background: var(--surface-strong);
}

.notification-bell-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notification-count {
  position: absolute;
  top: -7px;
  right: -7px;
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid #0b0f14;
  border-radius: 999px;
  color: #fff;
  background: #ef4444;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.notification-count[hidden] {
  display: none;
}

.notification-item[role="link"] {
  cursor: pointer;
}

.notification-item[role="link"]:hover {
  border-color: rgba(56, 189, 248, 0.42);
}

.pwa-settings-open-button {
  gap: 8px;
}

.download-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  min-height: 20px;
  border-radius: 999px;
  padding: 0 6px;
  color: #06111a;
  background: var(--primary);
  font-size: 12px;
}

.download-count[hidden] {
  display: none;
}

.xcore-streams-modal[hidden],
.xcore-streams-setup[hidden],
.xcore-streams-frame-wrap[hidden],
.xcore-streams-actions [hidden] {
  display: none;
}

.xcore-streams-message {
  margin: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.12);
  color: #f8fafc;
  font-weight: 700;
}

.xcore-streams-modal {
  position: fixed;
  inset: 0;
  z-index: 96;
  display: grid;
  place-items: center;
  padding: 16px;
}

.xcore-streams-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(6px);
}

.xcore-streams-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1520px, calc(100vw - 32px));
  height: min(920px, calc(100dvh - 32px));
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 8px;
  background: #020617;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.58);
}

.xcore-streams-modal.is-fullscreen {
  padding: 8px;
}

.xcore-streams-modal.is-fullscreen .xcore-streams-panel {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
}

.xcore-streams-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.24);
  padding: 9px 11px;
  background: linear-gradient(180deg, #111827, #090d14);
}

.xcore-streams-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.xcore-streams-title > svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--primary);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.xcore-streams-title div {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.xcore-streams-title strong,
.xcore-streams-title span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xcore-streams-title strong {
  color: var(--text);
  font-size: 14px;
}

.xcore-streams-title span {
  color: var(--muted);
  font-size: 11px;
}

.xcore-streams-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  flex: 0 0 auto;
}

.xcore-streams-actions .button {
  gap: 6px;
  min-height: 30px;
  padding: 6px 8px;
}

.xcore-streams-actions .button svg {
  display: block;
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.xcore-streams-frame-wrap {
  min-width: 0;
  min-height: 0;
  background: #000;
}

.xcore-streams-frame-wrap iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.xcore-streams-setup {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 20px;
  background: radial-gradient(circle at top, rgba(56, 189, 248, 0.12), transparent 40%), #020617;
}

.xcore-streams-form {
  display: grid;
  gap: 14px;
  width: min(620px, 100%);
  padding: 18px;
}

.xcore-streams-form h2 {
  margin: 0 0 4px;
}

.xcore-streams-form p {
  margin: 0;
}

.download-manager-modal[hidden] {
  display: none;
}

.download-manager-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.download-manager-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 23, 0.62);
}

.download-manager-panel {
  position: absolute;
  top: 24px;
  right: 24px;
  bottom: 24px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  width: min(880px, calc(100vw - 48px));
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.pwa-settings-panel {
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(720px, calc(100vw - 48px));
}

.pwa-settings-state {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.pwa-settings-state span {
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 700;
}

.pwa-settings-state [data-pwa-save-state]:empty {
  display: none;
}

.pwa-push-guide {
  display: grid;
  gap: 4px;
  margin: 0 0 12px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(56, 189, 248, 0.1);
}

.pwa-push-guide[hidden] {
  display: none;
}

.pwa-push-guide strong {
  font-size: 13px;
}

.pwa-push-guide span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.pwa-notification-options {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.pwa-notification-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface-soft);
}

.pwa-notification-toggle strong,
.pwa-notification-toggle small {
  display: block;
}

.pwa-notification-toggle strong {
  color: var(--text);
  font-size: 13px;
}

.pwa-notification-toggle small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.dashboard-added-today-panel {
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(980px, calc(100vw - 48px));
}

.dashboard-added-today-head {
  margin-bottom: 12px;
}

.dashboard-added-today-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.dashboard-added-today-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 7px 11px;
  color: var(--text);
  background: var(--surface-soft);
  font-weight: 700;
  cursor: pointer;
}

.dashboard-added-today-tabs button.active {
  color: #fff;
  background: var(--primary);
}

.dashboard-added-today-tabs span {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  min-height: 20px;
  border-radius: 999px;
  padding: 2px 7px;
  color: inherit;
  background: rgba(255, 255, 255, 0.16);
  font-size: 12px;
}

.dashboard-added-today-body {
  display: grid;
  min-height: 0;
  overflow: hidden;
}

.dashboard-added-today-view {
  min-height: 0;
}

.dashboard-added-today-view.active {
  display: grid;
  overflow: hidden;
}

.dashboard-added-today-view[hidden] {
  display: none;
}

.dashboard-added-today-table-wrap {
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.dashboard-added-today-table th,
.dashboard-added-today-table td {
  vertical-align: middle;
}

.cli-global-modal {
  z-index: 60;
}

.cli-global-modal-panel {
  top: 14px;
  right: 14px;
  bottom: 14px;
  left: 14px;
  grid-template-rows: minmax(0, 1fr);
  width: auto;
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.cli-global-modal .cli-page {
  height: 100%;
}

.cli-image-viewer-panel {
  position: absolute;
  inset: 24px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.cli-image-viewer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.cli-image-viewer-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
}

.cli-image-viewer-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.cli-image-viewer-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cli-image-viewer-body {
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: auto;
  border-radius: 6px;
  background: #050910;
}

.cli-image-viewer-body img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 150px);
  object-fit: contain;
}

.download-manager-actions,
.download-job-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.download-manager-tabs {
  display: inline-flex;
  gap: 4px;
  width: max-content;
  margin: 0 0 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.download-manager-tabs button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 7px 12px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

.download-manager-tabs button.active {
  color: var(--text);
  background: var(--surface);
}

.download-manager-tabs button span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  min-height: 20px;
  margin-left: 6px;
  border-radius: 999px;
  padding: 0 6px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
}

.download-manager-tabs button.active span {
  color: var(--text);
  background: var(--surface-soft);
}

.download-manager-view {
  display: none;
  min-height: 0;
}

.download-manager-view.active {
  display: grid;
  gap: 12px;
  min-height: 0;
}

.download-manager-jobs {
  display: grid;
  gap: 12px;
  align-content: start;
  overflow: auto;
  padding-right: 4px;
}

.device-presence-modal-panel {
  left: 24px;
  right: 24px;
  width: auto;
  max-width: 1380px;
  margin: 0 auto;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
}

.device-presence-modal-summary {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  margin-bottom: 12px;
}

.device-presence-modal-body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.device-presence-modal-body .table-wrap {
  min-height: 0;
  overflow: auto;
}

.device-presence-modal-body .device-presence-table {
  min-width: 1080px;
}

.cli-manager-panel {
  grid-template-rows: auto auto 1fr;
}

.cli-project-move-panel {
  top: 92px;
  right: auto;
  bottom: auto;
  left: 50%;
  grid-template-rows: auto auto;
  width: min(430px, calc(100vw - 32px));
  max-height: calc(100vh - 120px);
  transform: translateX(-50%);
}

.cli-project-move-form {
  display: grid;
  gap: 14px;
}

.cli-project-move-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.cli-project-move-field select {
  width: 100%;
}

.cli-project-move-status {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.cli-project-move-actions {
  justify-content: end;
}

.cli-global-search-bar {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 12px;
}

.cli-global-search-bar input,
.cli-global-search-bar select {
  min-width: 0;
}

.cli-modal-list {
  display: grid;
  gap: 10px;
  align-content: start;
  overflow: auto;
  padding-right: 4px;
}

.cli-modal-empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-strong);
}

.cli-modal-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.cli-modal-item-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.cli-modal-item h3 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.cli-modal-item p {
  margin: 0;
  color: #d8e2ef;
  font-size: 13px;
  line-height: 1.45;
}

.cli-modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.download-job {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.download-job-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.download-job-head strong,
.download-job-head small {
  display: block;
}

.download-job-head small,
.download-job p,
.download-items small {
  color: var(--muted);
}

.download-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.download-progress span {
  display: block;
  height: 100%;
  background: var(--primary);
}

.download-items {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.download-items li {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 6px;
  background: var(--surface);
}

.download-status {
  font-size: 12px;
  color: var(--muted);
}

.download-status.completed {
  color: var(--ok);
}

.download-status.failed,
.download-status.canceled,
.download-status.cancel_requested,
.download-error {
  color: var(--danger);
}

.download-file-toolbar {
  display: grid;
  grid-template-columns: 150px minmax(180px, 1fr) auto auto;
  gap: 8px;
}

.download-file-path {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  overflow: auto;
}

.download-file-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  white-space: nowrap;
}

.download-file-breadcrumb button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
}

.download-file-breadcrumb span:last-child {
  color: var(--text);
  font-weight: 700;
}

.download-file-list {
  display: grid;
  gap: 8px;
  align-content: start;
  overflow: auto;
  padding-right: 4px;
}

.download-file-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.download-file-item-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

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

.download-file-item small {
  color: var(--muted);
}

@media (max-width: 760px) {
  .download-manager-panel {
    top: 12px;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
  }

  .cli-project-move-panel {
    top: 64px;
    right: 12px;
    bottom: auto;
    left: 12px;
    width: auto;
    max-height: calc(100vh - 88px);
    transform: none;
  }

  .download-file-toolbar {
    grid-template-columns: 1fr;
  }

  .download-file-path {
    align-items: flex-start;
    flex-direction: column;
  }

  .download-file-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .download-file-item-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .device-presence-modal-panel {
    top: 12px;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .device-presence-modal-panel .download-manager-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .cli-global-modal-panel {
    top: 8px;
    right: 8px;
    bottom: 8px;
    left: 8px;
  }

  .device-presence-modal-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .device-presence-modal-body {
    min-height: 340px;
    overflow: visible;
  }

  .device-presence-modal-body .table-wrap {
    max-height: 60vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cli-global-search-bar {
    grid-template-columns: 1fr;
  }

}

.row-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-soft);
  color: var(--muted);
}

.badge.ok {
  background: rgba(52, 211, 153, 0.16);
  color: var(--ok);
}

.badge.warn {
  background: rgba(245, 158, 11, 0.16);
  color: var(--warn);
}

.badge.unlimited {
  background: rgba(56, 189, 248, 0.18);
  color: var(--primary);
}

.badge.off,
.alert.error {
  background: rgba(248, 113, 113, 0.16);
  color: var(--danger);
}

.badge.muted {
  background: var(--surface-soft);
  color: var(--muted);
}

.alert {
  margin: 16px 22px 0;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.alert.success {
  background: rgba(52, 211, 153, 0.16);
  color: var(--ok);
}

.empty {
  margin-top: 12px;
  padding: 20px;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
}

.pagination a,
.tabs a {
  padding: 8px 11px;
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--text);
}

.pagination-gap {
  padding: 8px 2px;
  color: var(--muted);
}

.tabs.compact a {
  padding: 6px 10px;
}

.pagination a.active,
.tabs a.active {
  background: var(--primary);
  color: #fff;
}

.menu-button {
  display: none;
}

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

.login-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.login-brand {
  color: var(--text);
  margin-bottom: 22px;
}

.login-brand small {
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-remember {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

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

  .customer-editor-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .customer-editor-tabs::-webkit-scrollbar {
    display: none;
  }

  .customer-editor-tab {
    flex: 0 0 132px;
  }

  .customer-editor-summary {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .customer-editor-summary-meta {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .customer-controls-layout {
    grid-template-columns: 1fr;
  }

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

  .filters,
  .device-presence-filters,
  .form-grid,
	  .form-grid.compact,
	  .menu-section-form .form-grid.compact,
	  .menu-section-field-group .form-grid.compact,
	  .menu-guide-grid,
	  .menu-section-fields,
	  .menu-section-item,
	  .menu-type-reference-list,
	  .settings-card .form-grid.compact,
	  .settings-update-layout,
  .settings-update-form-grid,
  .settings-info-grid,
  .service-controls,
  .source-grid,
  .device-grid,
  .download-grid,
  .remote-download-grid,
  .dailymotion-url-row,
  .dailymotion-metadata-grid,
  .menu-section-grid,
  .channel-logo-upload-form,
  .channel-logo-filters,
  .home-content-layout,
  .upcoming-events-page,
  .app-error-scope-grid,
  .tool-grid,
  .tool-form,
  .grid.two {
    grid-template-columns: 1fr;
  }

  .remote-download-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 220px));
  }

  .dailymotion-poster-preview {
    max-width: 220px;
  }

  .upcoming-event-card,
  .upcoming-event-card.inactive {
    grid-template-columns: 1fr;
  }

  .upcoming-event-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .tabs.upcoming-event-tabs a {
    min-width: 0;
  }

  .upcoming-event-tab-label {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .upcoming-event-img,
  .upcoming-event-matchup-art {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .matchup-logo-wrap {
    height: 70%;
  }

  .matchup-logo-wrap img {
    max-height: 100%;
  }

  .inactive-event-list {
    grid-template-columns: 1fr;
  }

  .inactive-event-date-group[open] > .inactive-event-sport-groups {
    margin-left: 12px;
    padding-left: 12px;
  }

  .inactive-event-sport-group .inactive-event-list {
    padding-left: 10px;
  }

  .inactive-event-group-head {
    align-items: flex-start;
  }

  .inactive-promo-image-head,
  .inactive-promo-search-row {
    align-items: stretch;
    flex-direction: column;
  }

  .inactive-promo-selected.has-image {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .inactive-promo-selected img {
    width: 72px;
  }

  .home-content-preview {
    position: static;
  }

  .home-content-filters {
    grid-template-columns: minmax(160px, 220px) minmax(220px, 1fr) auto;
  }

  .cli-chat-head {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .cli-chat-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .cli-location,
  .cli-chat-tools input {
    grid-column: 1 / -1;
  }

  .home-content-promo-body {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .home-content-promo-side {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
    align-items: start;
  }

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

  .script-account-grid .script-account-credential,
  .script-account-grid .script-account-url-field {
    grid-column: auto;
  }

  .script-account-grid > .button {
    min-width: 0;
  }

  .media-artwork-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(150px, 0.55fr);
    grid-template-areas:
      "backdrop poster"
      "logo logo-spa";
  }

  .media-artwork-grid .media-asset-field-backdrop {
    grid-area: backdrop;
  }

  .media-artwork-grid .media-asset-field-poster {
    grid-area: poster;
  }

  .media-artwork-grid .media-asset-field-logo {
    grid-area: logo;
  }

  .media-artwork-grid .media-asset-field-logo-spa {
    grid-area: logo-spa;
  }

  .media-artwork-grid .media-asset-field-poster .media-asset-preview {
    min-height: 198px;
  }

  .settings-info-grid .readonly-field.wide {
    grid-column: auto;
  }

  .menu-section-item {
    grid-template-columns: 1fr;
  }

  .menu-sections-savebar {
    align-items: stretch;
    flex-direction: column;
    position: static;
  }
}

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

  .dashboard-watch-head,
  .dashboard-watch-filters {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-watch-filters,
  .dashboard-watch-insights {
    grid-template-columns: 1fr;
  }

  .dashboard-watch-head .button,
  .dashboard-watch-filters .button {
    width: 100%;
  }

  .dashboard-added-today-panel {
    top: 12px;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
  }

  .dashboard-added-today-head {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-added-today-head .button,
  .dashboard-added-today-tabs button {
    justify-content: center;
    width: 100%;
  }

  .dashboard-added-today-tabs {
    display: grid;
    grid-template-columns: 1fr;
  }

  .customer-plan-options {
    grid-template-columns: 1fr;
  }

  .download-manager-panel.customer-plan-downgrade-panel {
    top: 16px;
    bottom: 16px;
    transform: translateX(-50%);
    max-height: none;
  }

  .customer-service-confirm-summary {
    grid-template-columns: 1fr;
  }

  .customer-service-confirm-head,
  .customer-service-confirm-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .customers-head,
  .customers-head-actions,
  .customer-global-message-summary,
  .customer-control-group-head {
    align-items: stretch;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .customers-head,
  .customer-control-group-head {
    flex-direction: column;
  }

  .duplicate-bulk-panel,
  .duplicate-bulk-form {
    align-items: stretch;
    flex-direction: column;
  }

  .duplicate-bulk-form .button {
    width: 100%;
  }

  .customers-head-actions,
  .customer-global-message-summary-meta {
    justify-content: flex-start;
  }

  .customer-control-overview {
    grid-template-columns: 1fr;
  }

  .customer-control-grid,
  .customer-access-block-inline {
    grid-template-columns: 1fr;
  }

  .customer-chat-panel .customer-chat-compose,
  .customer-global-message-form {
    grid-template-columns: 1fr;
  }

  .customer-chat-panel .customer-chat-compose label:nth-of-type(2),
  .customer-chat-panel .customer-chat-actions {
    grid-column: auto;
    grid-row: auto;
  }

  .customer-message-row {
    grid-template-columns: 1fr;
  }

  .customer-plan-downgrade-head,
  .customer-plan-downgrade-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .customer-plan-downgrade-actions small {
    margin-right: 0;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 232px;
    transform: translateX(-100%);
    transition: transform 160ms ease;
    z-index: 20;
  }

  .sidebar-open .sidebar {
    transform: translateX(0);
  }

  .menu-button {
    display: inline-grid;
    place-items: center;
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    padding: 0;
    cursor: pointer;
    font-weight: 700;
  }

  .menu-button svg {
    display: block;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .menu-button-label {
    display: none;
  }

  .topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px 8px;
    padding: 8px 9px;
  }

  .menu-button {
    grid-column: 1;
    grid-row: 1;
  }

  .topbar-title {
    grid-column: 2;
    grid-row: 1;
  }

  .topbar h1 {
    overflow: hidden;
    font-size: 15px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar p {
    display: none;
  }

  .topbar-utility {
    display: contents;
  }

  .server-metrics {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    min-width: 0;
    margin-left: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .topbar-actions {
    grid-column: 3;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    min-width: 0;
    flex-wrap: nowrap;
  }

  .server-metrics::-webkit-scrollbar {
    display: none;
  }

  .server-meter {
    flex: 0 0 auto;
    width: auto;
    min-width: 68px;
    gap: 2px;
    padding: 5px 7px;
  }

  .server-meter-down,
  .server-meter-up,
  .server-meter-devices-online {
    width: auto;
    min-width: 94px;
  }

  .server-meter-head {
    display: grid;
    gap: 1px;
  }

  .server-meter-head b,
  .server-meter-head span {
    text-align: left;
  }

  .server-meter-head b {
    font-size: 10px;
  }

  .server-meter-head span {
    font-size: 12px;
  }

  .server-meter-track {
    display: none;
  }

  .download-manager-button,
  .signout-button {
    position: relative;
    flex: 0 0 auto;
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    font-size: 0;
    gap: 0;
  }

  .topbar-actions .button svg,
  .credit-pill svg {
    display: block;
  }

  .topbar-action-label,
  .credit-label {
    display: none;
  }

  .download-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    min-height: 18px;
    margin-left: 0;
    padding: 0 5px;
    border: 2px solid #0b0f14;
    font-size: 10px;
    line-height: 1;
  }

  .notification-bell-button {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
  }

  .credit-pill {
    flex: 0 0 auto;
    gap: 4px;
    min-height: 32px;
    padding: 0 8px;
    font-size: 11px;
    white-space: nowrap;
  }

  .credit-value {
    max-width: 34px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .credit-pill.is-unlimited {
    justify-content: center;
    min-width: 58px;
    padding: 0 7px;
  }

  .credit-pill.is-unlimited svg {
    display: none;
  }

  .credit-pill.is-unlimited .credit-label {
    display: inline;
    font-size: 8px;
    font-weight: 700;
    line-height: 1;
  }

  .credit-pill.is-unlimited .credit-value-text {
    display: none;
  }

  .credit-pill.is-unlimited .credit-value-infinity {
    display: inline;
    max-width: none;
    font-size: 17px;
    line-height: 1;
  }

  .xcore-streams-modal {
    padding: 6px;
  }

  .xcore-streams-panel {
    width: 100%;
    height: 100%;
  }

  .xcore-streams-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 7px;
    padding: 8px;
  }

  .xcore-streams-title span {
    display: none;
  }

  .xcore-streams-actions {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
  }

  .xcore-streams-actions .button {
    justify-content: center;
    min-width: 0;
    padding: 6px;
    font-size: 0;
  }

  .xcore-streams-actions .button svg {
    width: 16px;
    height: 16px;
  }

  .content {
    padding: 16px;
  }

  .content-cli {
    padding: 12px;
  }

  .cli-chat-head {
    gap: 7px;
    padding: 8px;
  }

  .cli-chat-head > div:first-child {
    min-width: 0;
  }

  .cli-chat-tools {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: flex-end;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .cli-chat-tools::-webkit-scrollbar {
    display: none;
  }

  .cli-chat-tools > * {
    flex: 0 0 auto;
  }

  .cli-location {
    flex-basis: 178px;
    padding: 5px 8px;
  }

  .cli-usage {
    flex-basis: 142px;
    padding: 5px 8px;
  }

  .cli-permissions {
    flex-basis: 126px;
    gap: 2px;
  }

  .cli-location span,
  .cli-usage span,
  .cli-permissions span {
    font-size: 9px;
  }

  .cli-location strong,
  .cli-usage strong {
    font-size: 11px;
    line-height: 1.15;
  }

  .cli-chat-tools input,
  .cli-chat-tools select {
    min-height: 34px;
    padding: 7px 8px;
    font-size: 12px;
  }

  .cli-chat-tools input {
    flex-basis: 170px;
  }

  .cli-chat-tools .button {
    width: auto;
    min-height: 34px;
    padding: 7px 10px;
    white-space: nowrap;
  }

  .cli-chat-messages {
    padding: 12px;
    gap: 10px;
  }

  .cli-bubble {
    max-width: 94%;
  }

  .cli-progress-log {
    max-height: 220px;
  }

  .cli-chat-compose {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 6px;
    align-items: end;
    padding: 8px;
  }

  .cli-chat-compose.running {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
  }

  .cli-queue-item {
    align-items: stretch;
    flex-direction: column;
  }

  .cli-queue-actions .button {
    flex: 1 1 86px;
    width: auto;
  }

  .cli-chat-compose .button {
    width: auto;
    min-height: 38px;
    padding: 7px 9px;
  }

  .cli-attach-button {
    width: auto;
    min-width: 0;
  }

  .cli-chat-compose textarea {
    min-height: 44px;
    max-height: 120px;
    padding: 8px 9px;
  }

  .cli-attachment-card {
    width: calc(50% - 4px);
    min-width: 116px;
  }

  .cli-image-viewer-panel {
    inset: 10px;
    padding: 10px;
  }

  .cli-image-viewer-head {
    align-items: stretch;
    flex-direction: column;
  }

  .cli-image-viewer-actions {
    justify-content: stretch;
  }

  .cli-image-viewer-actions .button {
    flex: 1 1 86px;
    width: auto;
  }

  .cli-image-viewer-body img {
    max-height: calc(100vh - 190px);
  }

  .cli-chat-compose .cli-queue-actions .button {
    width: auto;
  }

  .metric-grid,
  .check-list,
  .settings-info-list,
  .settings-info-grid,
  .inline-add-form {
    grid-template-columns: 1fr;
  }

  .settings-info-grid .readonly-field.wide {
    grid-column: auto;
  }

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

  .home-content-filters,
  .home-content-results,
  .home-content-result-card,
  .upcoming-primary-stream-fields,
  .fifa-channel-stream-row,
  .upcoming-event-card,
  .upcoming-event-schedule-form {
    grid-template-columns: 1fr;
  }

  .home-content-result-action,
  .upcoming-event-actions {
    justify-self: stretch;
    min-width: 0;
  }

  .home-content-result-action .button,
  .home-dashboard-add-form select,
  .home-dashboard-add-form .button,
  .home-content-filters .button,
  .channel-logo-actions .button,
  .channel-logo-actions a.button,
  .channel-logo-upload-form .button,
  .channel-logo-filters .button,
  .channel-logo-filters a.button,
  .upcoming-event-actions .button,
  .upcoming-event-schedule-form .button {
    width: 100%;
  }

  .home-dashboard-row-list,
  .home-dashboard-item-card {
    grid-template-columns: 1fr;
  }

  .home-dashboard-item-card .inline-form {
    justify-self: stretch;
  }

  .upcoming-event-img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .channel-logo-library-head,
  .channel-logo-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .channel-logo-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }

  .channel-logo-card {
    grid-template-rows: 96px auto 32px;
    padding: 8px;
  }

  .channel-logo-preview img {
    max-height: 76px;
  }

  .channel-logo-rename-form {
    right: -36px;
    width: min(230px, calc(100vw - 40px));
  }

  .home-content-result-body strong {
    white-space: normal;
  }

  .home-content-promo-modal {
    padding: 10px;
  }

  .home-content-promo-dialog,
  .home-content-promo-dialog form,
  .media-asset-dialog-inner {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
    height: calc(100dvh - 16px);
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
  }

  .home-content-promo-head,
  .home-content-promo-footer {
    padding: 12px;
  }

  .home-content-promo-head {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .home-content-promo-head h3 {
    margin: 5px 0 3px;
    font-size: 18px;
    line-height: 1.2;
  }

  .home-content-promo-head p {
    font-size: 12px;
    line-height: 1.3;
  }

  .home-content-promo-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--surface);
    box-shadow: 0 -12px 22px rgba(0, 0, 0, 0.28);
  }

  .home-content-promo-head .actions,
  .home-content-promo-footer .button {
    min-width: 0;
    width: 100%;
  }

  .home-content-promo-body {
    display: grid;
    align-content: start;
    grid-template-columns: 1fr;
    gap: 12px;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 12px;
  }

  .home-content-promo-dialog form[data-home-promo-schedule-enabled="1"] .home-content-promo-body {
    display: grid;
    grid-template-columns: 1fr;
    align-content: start;
  }

  .home-content-promo-search {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .home-content-promo-search .button {
    width: 100%;
  }

  .home-content-promo-results {
    grid-template-columns: 1fr;
    min-height: 0;
    overflow: visible;
  }

  .home-content-promo-side {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .home-content-promo-dialog form[data-home-promo-schedule-enabled="1"] .home-content-promo-side {
    display: grid;
    gap: 12px;
    min-height: auto;
    order: 0;
  }

  .home-content-promo-dialog form[data-home-promo-schedule-enabled="1"] .home-content-promo-results {
    order: 1;
    padding-top: 12px;
    border-top: 1px solid var(--line);
  }

  .home-content-promo-dialog form[data-home-promo-schedule-enabled="1"] .home-content-promo-selected-preview {
    min-height: 0;
  }

  .home-content-promo-dialog form[data-home-promo-schedule-enabled="1"] .home-content-promo-selected-preview.has-image {
    grid-template-columns: 86px minmax(0, 1fr);
    align-items: center;
    justify-items: stretch;
    overflow: hidden;
    text-align: left;
  }

  .home-content-promo-dialog form[data-home-promo-schedule-enabled="1"] .home-content-promo-selected-preview.has-image img {
    width: 86px;
    height: 52px;
    max-height: none;
    aspect-ratio: auto;
    object-fit: cover;
  }

  .home-content-promo-dialog form[data-home-promo-schedule-enabled="1"] .home-content-promo-selected-preview.has-image span {
    align-self: center;
    min-width: 0;
  }

  .home-content-promo-fields {
    grid-template-columns: 1fr;
  }

  .media-editor-side {
    position: static;
  }

  .media-artwork-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "backdrop"
      "poster"
      "logo"
      "logo-spa";
  }

  .media-asset-control {
    grid-template-columns: 1fr;
  }

  .media-asset-field .button {
    width: 100%;
  }

  .media-artwork-grid .media-asset-field-backdrop .media-asset-preview {
    min-height: 138px;
  }

  .media-artwork-grid .media-asset-field-poster .media-asset-preview {
    min-height: 210px;
  }

  .media-artwork-grid .media-asset-field-logo .media-asset-preview,
  .media-artwork-grid .media-asset-field-logo-spa .media-asset-preview {
    min-height: 72px;
  }

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

  .expiry-alert {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* CLI workspace final overrides. Kept after responsive rules so the new layout wins. */
.page-cli .content-cli {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  min-height: 0;
  overflow: hidden;
  padding: 14px;
  background: rgba(3, 7, 12, 0.68);
}

.cli-page {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 10px;
  background: #0b0f14;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.52);
}

.cli-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background: #101722;
}

.cli-modal-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.cli-modal-head span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.cli-modal-head h2 {
  overflow: hidden;
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cli-workspace {
  position: relative;
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr) minmax(280px, 340px);
  gap: 12px;
  height: auto;
  min-height: 0;
  overflow: hidden;
  padding: 12px;
}

.cli-workspace.is-home {
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
}

.cli-workspace.is-home .cli-side-drawer {
  display: none;
}

.cli-workspace-backdrop {
  display: none;
}

.cli-workspace-nav,
.cli-side-drawer {
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101722;
}

.cli-workspace-nav {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.cli-workspace-nav-head,
.cli-side-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.cli-workspace-nav-head span,
.cli-side-drawer-head span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.cli-workspace-nav-head strong,
.cli-side-drawer-head strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  margin-top: 4px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cli-workspace-nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.cli-workspace-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  padding: 10px 12px 8px;
}

.cli-workspace-search input {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 12px;
}

.cli-workspace-search .button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.cli-workspace-search .button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cli-workspace-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  padding: 0 12px 10px;
}

.cli-workspace-filters button {
  min-width: 0;
  min-height: 30px;
  padding: 5px 7px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 6px;
  color: var(--muted);
  background: #0b111b;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
}

.cli-workspace-filters button.active {
  border-color: rgba(56, 189, 248, 0.5);
  color: #e0f2fe;
  background: rgba(14, 165, 233, 0.18);
}

.cli-workspace-filters span {
  display: inline-block;
  margin-left: 3px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.cli-workspace-thread-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding: 0 10px 12px 12px;
}

.cli-workspace-empty,
.cli-side-empty {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px dashed rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(15, 20, 27, 0.72);
  font-size: 12px;
  line-height: 1.35;
}

.cli-workspace-empty strong {
  color: var(--text);
}

.cli-workspace-project {
  gap: 5px;
}

.cli-workspace-project-head {
  padding-right: 2px;
}

.cli-workspace-thread-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.cli-workspace-thread {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #d8e2ef;
}

.cli-workspace-thread:hover {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(148, 163, 184, 0.08);
  color: #fff;
}

.cli-workspace-thread.active {
  border-color: rgba(56, 189, 248, 0.38);
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.28), rgba(56, 189, 248, 0.1));
  box-shadow: inset 3px 0 0 var(--primary);
  color: #fff;
}

.cli-workspace-thread.unread {
  color: #e0f2fe;
}

.cli-workspace-thread.running {
  color: #dbeafe;
}

.cli-workspace-thread-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.cli-workspace-thread-copy strong,
.cli-workspace-thread-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cli-workspace-thread-copy strong {
  font-size: 13px;
  line-height: 1.2;
}

.cli-workspace-thread-copy small {
  color: var(--muted);
  font-size: 11px;
}

.cli-workspace-thread-row .nav-thread-actions {
  opacity: 0;
  transition: opacity 120ms ease;
}

.cli-workspace-thread-row:hover .nav-thread-actions,
.cli-workspace-thread-row:focus-within .nav-thread-actions {
  opacity: 1;
}

.cli-chat.is-home {
  grid-template-rows: minmax(0, 1fr);
}

.cli-chat-home {
  display: none;
}

.cli-chat.is-home .cli-chat-head,
.cli-chat.is-home .cli-chat-messages,
.cli-chat.is-home .cli-chat-compose {
  display: none;
}

.cli-chat.is-home .cli-chat-home {
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

.cli-home-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.cli-home-head > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.cli-home-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.cli-home-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  line-height: 1.1;
}

.cli-home-head .button,
.cli-home-project-actions .button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.cli-home-head .button svg,
.cli-home-project-actions .button svg,
.cli-home-project-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cli-home-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  min-width: 0;
}

.cli-home-project-card {
  display: grid;
  align-content: start;
  gap: 9px;
  min-width: 0;
  min-height: 176px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: #101722;
}

.cli-home-project-card.unread {
  border-color: rgba(56, 189, 248, 0.35);
}

.cli-home-project-card.running {
  border-color: rgba(250, 204, 21, 0.32);
}

.cli-home-project-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cli-home-project-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  color: #d8e2ef;
  background: rgba(15, 20, 27, 0.8);
}

.cli-home-project-card h3,
.cli-home-project-card p,
.cli-home-project-card small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cli-home-project-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.2;
  white-space: nowrap;
}

.cli-home-project-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.cli-home-project-card small {
  color: #b7c3d4;
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
}

.cli-home-project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
}

.cli-home-project-create {
  border-style: dashed;
}

.cli-chat-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 11px 12px;
}

.cli-chat-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.cli-mobile-actions {
  display: none;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.cli-chat-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.cli-chat-title h2 {
  min-width: 0;
  overflow: hidden;
  margin: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cli-chat-status-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.cli-chat-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.cli-location {
  flex: 1 1 220px;
  grid-column: auto;
  max-width: 420px;
  min-height: 35px;
  padding: 6px 9px;
}

.cli-setting-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  max-width: 170px;
  min-width: 0;
  overflow: hidden;
  padding: 6px 9px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 6px;
  color: #d8e2ef;
  background: rgba(15, 20, 27, 0.82);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cli-chat-tools input[data-cli-search] {
  flex: 1 1 180px;
  grid-column: auto;
  min-height: 34px;
  padding: 7px 9px;
  font-size: 12px;
}

.cli-chat-tools .button,
.cli-mobile-panel-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  white-space: nowrap;
}

.cli-mobile-panel-button {
  display: none;
}

.cli-side-close-button {
  display: none;
}

.cli-chat-tools .button svg,
.cli-mobile-panel-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cli-chat-compose {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.cli-chat-compose .cli-chat-attachments {
  min-width: 0;
  padding: 0 0 2px;
}

.cli-chat-compose .cli-attachment-list {
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 1px 0 3px;
  scrollbar-width: thin;
}

.cli-chat-compose .cli-attachment-card {
  flex: 0 0 112px;
  width: 112px;
}

.cli-chat-compose .cli-attachment-thumb {
  aspect-ratio: 1 / 1;
}

.cli-chat-compose .cli-attachment-status {
  min-height: 0;
  padding: 0 2px 2px;
}

.cli-side-drawer {
  display: grid;
  align-content: start;
  overflow: auto;
}

.cli-side-section {
  display: grid;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.13);
}

.cli-side-section h3 {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
}

.cli-side-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.cli-side-section-toggle::-webkit-details-marker {
  display: none;
}

.cli-side-section-toggle:hover {
  background: rgba(148, 163, 184, 0.06);
}

.cli-side-section-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.cli-side-section-chevron {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin-right: 3px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 140ms ease;
}

.cli-side-section[open] .cli-side-section-chevron {
  transform: rotate(225deg) translate(-2px, -2px);
}

.cli-side-section-body {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 0 12px 12px;
}

.cli-settings-grid {
  display: grid;
  gap: 9px;
}

.cli-provider-accounts {
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.32);
}

.cli-provider-accounts > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  list-style: none;
  cursor: pointer;
}

.cli-provider-accounts > summary::-webkit-details-marker {
  display: none;
}

.cli-provider-accounts > summary > span:first-child {
  display: grid;
  gap: 2px;
}

.cli-provider-accounts > summary strong {
  color: #d8e2ef;
  font-size: 12px;
}

.cli-provider-accounts > summary small {
  color: var(--muted);
  font-size: 10px;
}

.cli-provider-accounts[open] > summary {
  border-bottom: 1px solid rgba(148, 163, 184, 0.13);
}

.cli-provider-accounts .cli-provider-credential {
  margin: 10px;
}

.cli-provider-credential {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 9px;
  background: rgba(14, 165, 233, 0.06);
}

.cli-provider-credential-head,
.cli-provider-credential-actions,
.cli-provider-credential-input {
  display: flex;
  align-items: center;
  gap: 7px;
}

.cli-provider-credential-head {
  justify-content: space-between;
}

.cli-provider-credential-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.cli-provider-credential-head strong {
  color: #d8e2ef;
  font-size: 12px;
}

.cli-provider-credential-head > div > span,
.cli-provider-credential > small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.cli-provider-credential-input input {
  min-width: 0;
  flex: 1 1 auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.cli-provider-credential-status {
  min-height: 14px;
  margin: 0;
  color: #86efac;
  font-size: 10px;
}

.cli-provider-credential-status.error {
  color: #fca5a5;
}

.cli-provider-credential-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.cli-provider-credential [hidden] {
  display: none !important;
}

.cli-settings-presets {
  display: grid;
  gap: 7px;
}

.cli-settings-presets-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.cli-settings-presets-head strong {
  color: #d8e2ef;
  font-size: 12px;
}

.cli-settings-presets-head span {
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

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

.cli-settings-preset {
  position: relative;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 4px 7px;
  min-width: 0;
  min-height: 72px;
  padding: 9px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  color: #d8e2ef;
  background: rgba(15, 20, 27, 0.72);
  cursor: pointer;
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.cli-settings-preset:hover:not(:disabled) {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(14, 165, 233, 0.11);
  transform: translateY(-1px);
}

.cli-settings-preset.active {
  border-color: rgba(56, 189, 248, 0.72);
  color: #f0f9ff;
  background: rgba(14, 165, 233, 0.18);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.12);
}

.cli-settings-preset.recommended:not(.active) {
  border-color: rgba(45, 212, 191, 0.36);
}

.cli-settings-preset:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
}

.cli-settings-preset.is-applying {
  cursor: wait;
}

.cli-settings-preset-icon {
  display: inline-flex;
  grid-row: 1 / span 2;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: rgba(148, 163, 184, 0.1);
  font-size: 15px;
  line-height: 1;
}

.cli-settings-preset-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.cli-settings-preset-copy strong,
.cli-settings-preset-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cli-settings-preset-copy strong {
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.cli-settings-preset-copy small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.25;
  white-space: normal;
}

.cli-settings-preset-state {
  grid-column: 2;
  color: #7dd3fc;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.cli-settings-preset.recommended:not(.active) .cli-settings-preset-state {
  color: #5eead4;
}

.cli-settings-warning {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid rgba(251, 146, 60, 0.42);
  border-radius: 8px;
  color: #fed7aa;
  background: rgba(154, 52, 18, 0.18);
}

.cli-settings-warning[hidden] {
  display: none;
}

.cli-settings-warning strong {
  color: #ffedd5;
  font-size: 11px;
}

.cli-settings-warning span {
  font-size: 10px;
  line-height: 1.35;
}

.cli-setting-chip.high-usage {
  border-color: rgba(251, 146, 60, 0.52);
  color: #ffedd5;
  background: rgba(154, 52, 18, 0.22);
}

.cli-setting-chip.provider {
  border-color: rgba(56, 189, 248, 0.35);
  color: #bae6fd;
  background: rgba(14, 165, 233, 0.1);
}

.cli-side-section .cli-usage {
  max-width: none;
}

.cli-side-section .cli-chat-queue,
.cli-side-section .cli-chat-attachments {
  grid-column: auto;
  max-height: none;
  overflow: visible;
}

.cli-side-section .cli-attachment-status {
  grid-column: auto;
  min-height: 16px;
}

.cli-related-list {
  display: grid;
  gap: 7px;
}

.cli-related-item {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  color: #d8e2ef;
  background: rgba(15, 20, 27, 0.62);
}

.cli-related-item:hover,
.cli-related-item.unread {
  border-color: rgba(56, 189, 248, 0.3);
  color: #fff;
  background: rgba(56, 189, 248, 0.1);
}

.cli-related-item strong,
.cli-related-item small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cli-related-item strong {
  font-size: 12px;
}

.cli-related-item small {
  color: var(--muted);
  font-size: 11px;
}

.cli-activity-list {
  display: grid;
  gap: 7px;
}

.cli-activity-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  background: rgba(15, 20, 27, 0.62);
}

.cli-activity-item.status-running {
  border-color: rgba(250, 204, 21, 0.34);
}

.cli-activity-item.status-error {
  border-color: rgba(248, 113, 113, 0.42);
}

.cli-activity-item.status-unread {
  border-color: rgba(56, 189, 248, 0.34);
}

.cli-activity-item strong,
.cli-activity-item small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cli-activity-item strong {
  color: var(--text);
  font-size: 12px;
}

.cli-activity-item small {
  color: var(--muted);
  font-size: 11px;
}

.cli-activity-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.cli-project-settings-form {
  display: grid;
  gap: 9px;
}

.cli-project-settings-field {
  display: grid;
  gap: 4px;
}

.cli-project-settings-field span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.cli-project-settings-field input,
.cli-project-settings-field select,
.cli-project-settings-field textarea {
  width: 100%;
  min-width: 0;
  border-radius: 6px;
  font-size: 12px;
}

.cli-project-settings-field textarea {
  resize: vertical;
  min-height: 86px;
}

.cli-project-defaults-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.cli-project-settings-status {
  min-height: 16px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.cli-pdf-viewer-panel {
  width: min(1180px, calc(100vw - 28px));
  max-width: none;
}

.cli-pdf-viewer-body {
  min-height: 0;
  height: min(76vh, 820px);
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background: #0b0f14;
}

.cli-pdf-viewer-body iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.cli-mobile-tabs {
  display: none;
}

@media (max-width: 1180px) {
  .cli-workspace {
    grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
  }

  .cli-side-drawer {
    position: fixed;
    top: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 35;
    width: min(360px, calc(100vw - 20px));
    transform: translateX(calc(100% + 14px));
    transition: transform 160ms ease;
    box-shadow: var(--shadow);
  }

  .cli-workspace.show-drawer .cli-side-drawer {
    transform: translateX(0);
  }

  .cli-side-close-button {
    display: inline-flex;
  }

  .cli-workspace.show-drawer .cli-workspace-backdrop,
  .cli-workspace.show-list .cli-workspace-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: block;
    border: 0;
    background: rgba(5, 8, 13, 0.56);
    cursor: default;
  }
}

@media (max-width: 860px) {
  .content-cli {
    padding: 8px;
  }

  .cli-workspace {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 8px 8px calc(64px + env(safe-area-inset-bottom, 0px));
  }

  .cli-workspace-nav {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 45;
    width: min(340px, 100vw);
    border-radius: 0 8px 8px 0;
    transform: translateX(calc(-100% - 14px));
    transition: transform 160ms ease;
    box-shadow: var(--shadow);
  }

  .cli-workspace.show-list .cli-workspace-nav {
    transform: translateX(0);
  }

  .cli-mobile-panel-button {
    display: inline-flex;
    width: auto;
  }

  .cli-chat-head {
    gap: 8px;
    padding: 8px;
  }

  .cli-chat-titlebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .cli-mobile-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cli-mobile-actions .button {
    justify-content: center;
    min-width: 0;
  }

  .cli-chat-title {
    width: 100%;
  }

  .cli-chat-title h2 {
    font-size: 15px;
  }

  .cli-chat-tools {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .cli-chat-tools::-webkit-scrollbar {
    display: none;
  }

  .cli-chat-tools > * {
    flex: 0 0 auto;
  }

  .cli-location {
    flex-basis: 190px;
  }

  .cli-setting-chip {
    max-width: 136px;
  }

  .cli-chat-tools input[data-cli-search] {
    flex-basis: 170px;
  }

  .cli-chat-tools [data-cli-drawer-toggle] {
    display: none;
  }

  .cli-side-drawer {
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    width: 100vw;
    max-width: none;
    border-radius: 0;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
  }

  .cli-side-drawer-head {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #101722;
  }

  .cli-workspace.show-drawer .cli-workspace-backdrop,
  .cli-workspace.show-list .cli-workspace-backdrop {
    z-index: 40;
  }

  .cli-chat-messages {
    padding: 10px;
  }

  .cli-chat-compose {
    gap: 6px;
    padding: 8px;
  }

  .cli-chat-compose textarea {
    min-height: 44px;
    max-height: 120px;
  }

  .cli-mobile-tabs {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
    z-index: 34;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 6px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 8px;
    background: rgba(16, 23, 34, 0.96);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.36);
  }

  .cli-mobile-tabs button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    min-height: 38px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
  }

  .cli-mobile-tabs button.active {
    border-color: rgba(56, 189, 248, 0.4);
    color: #e0f2fe;
    background: rgba(14, 165, 233, 0.18);
  }

  .cli-mobile-tabs svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .cli-workspace.show-list .cli-mobile-tabs,
  .cli-workspace.show-drawer .cli-mobile-tabs {
    z-index: 46;
  }

  .cli-pdf-viewer-panel {
    inset: 8px;
    width: auto;
  }

  .cli-pdf-viewer-body {
    height: calc(100vh - 182px);
    height: calc(100dvh - 182px);
  }
}

@media (max-width: 400px) {
  .cli-settings-preset-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .cli-settings-preset {
    min-height: 64px;
  }
}

@media (max-width: 760px) {
  .app-section-tabs,
  .app-fifa-stream-primary {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-fifa-stream-save-row {
    align-items: stretch;
    flex-direction: column;
  }

  .app-fifa-stream-save-row .button {
    width: 100%;
  }
}

.nav-cli-parent .nav-label,
.nav-cli-launch-link .nav-label {
  min-width: 0;
}

.nav-cli-sub-state {
  margin-left: auto;
}

.server-manager-modal {
  z-index: 61;
}

.server-manager-panel {
  top: 16px;
  right: 16px;
  bottom: 16px;
  left: 16px;
  grid-template-rows: minmax(0, 1fr);
  width: auto;
  max-width: none;
  padding: 0;
}

.server-manager-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  height: 100%;
  color: var(--text);
}

.server-manager-head {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.server-manager-head h2,
.server-manager-head p {
  margin: 0;
}

.server-manager-head span {
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.server-manager-head h2 {
  font-size: 19px;
}

.server-manager-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

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

.server-manager-head-actions .button {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.server-manager-head-actions svg {
  width: 15px;
  height: 15px;
}

.server-manager-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 0;
  background: var(--bg);
}

.server-manager-sidebar {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
  border-right: 1px solid var(--line);
  background: rgba(8, 11, 16, 0.72);
}

.server-manager-sidebar-head {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.server-manager-sidebar-head strong {
  font-size: 13px;
}

.server-manager-sidebar-head .button {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.server-manager-sidebar-head svg {
  width: 14px;
  height: 14px;
}

.server-group-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.server-group-form input,
.server-transfer-form input,
.server-transfer-form select,
.server-settings-form select {
  min-width: 0;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--text);
}

.server-manager-list {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 0;
  padding: 10px;
  overflow: auto;
}

.server-group-block {
  display: grid;
  gap: 5px;
  padding: 6px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.35);
}

.server-group-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 7px;
  align-items: center;
  min-height: 28px;
  padding: 0 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.server-group-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-group-title span {
  color: var(--primary);
}

.server-group-actions {
  display: inline-flex;
  gap: 4px;
  justify-content: flex-end;
}

.server-group-actions button {
  min-height: 24px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.65);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.server-group-actions button:hover {
  color: var(--text);
  border-color: rgba(56, 189, 248, 0.28);
}

.server-group-empty {
  padding: 8px 4px;
  color: var(--muted);
  font-size: 12px;
}

.server-manager-list > button,
.server-group-block > button {
  display: grid;
  gap: 3px;
  width: 100%;
  min-width: 0;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.server-manager-list > button:hover,
.server-manager-list > button.active,
.server-group-block > button:hover,
.server-group-block > button.active {
  border-color: rgba(56, 189, 248, 0.28);
  background: rgba(56, 189, 248, 0.09);
}

.server-manager-list strong,
.server-manager-list small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-manager-list small {
  color: var(--muted);
  font-size: 12px;
}

.server-mini-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-top: 3px;
  color: #9fb3c8;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
}

.server-mini-stats span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-mini-stats .error {
  grid-column: 1 / -1;
  color: #fecaca;
}

.server-manager-main {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  padding: 12px;
}

.server-manager-tabs {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 10px;
}

.server-manager-tabs button {
  min-height: 32px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.server-manager-tabs button.active,
.server-manager-tabs button:hover {
  border-color: rgba(56, 189, 248, 0.3);
  color: var(--text);
  background: rgba(56, 189, 248, 0.1);
}

.server-manager-status {
  min-height: 32px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.server-manager-status.error {
  border-color: rgba(248, 113, 113, 0.36);
  color: #fecaca;
  background: rgba(127, 29, 29, 0.18);
}

.server-manager-view {
  display: none;
  min-height: 0;
}

.server-manager-view.active {
  display: grid;
  align-content: start;
  gap: 10px;
}

.server-dual-files {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-height: 0;
}

.server-file-pane {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  min-height: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.42);
}

.server-file-pane.active {
  border-color: rgba(56, 189, 248, 0.34);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.08);
}

.server-file-pane-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.server-file-pane-head strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.server-file-pane-head select {
  min-width: 0;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--text);
}

.server-file-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.server-file-toolbar input,
.server-mkdir-form input,
.server-terminal-form input {
  min-width: 0;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--text);
}

.server-mkdir-form {
  display: grid;
  grid-template-columns: minmax(180px, 280px) auto;
  gap: 8px;
  align-items: center;
}

.server-file-drop-zone {
  display: grid;
  min-height: 0;
  border-radius: 8px;
}

.server-file-drop-zone.is-drop-target {
  outline: 1px dashed rgba(56, 189, 248, 0.36);
  outline-offset: 3px;
}

.server-file-drop-zone.is-drop-over {
  outline-color: rgba(34, 197, 94, 0.72);
  background: rgba(34, 197, 94, 0.08);
}

.server-file-list {
  display: grid;
  align-content: start;
  min-height: 0;
  max-height: calc(100vh - 245px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.server-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px auto;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.server-file-row[draggable="true"] {
  cursor: grab;
}

.server-file-row.is-dragging {
  opacity: 0.48;
}

.server-file-row.is-folder-drop-over {
  background: rgba(34, 197, 94, 0.12);
  box-shadow: inset 3px 0 0 rgba(34, 197, 94, 0.72);
}

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

.server-file-name {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.server-file-name strong,
.server-file-name small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-file-name small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.server-file-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 28px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 6px;
  color: var(--primary);
  background: rgba(56, 189, 248, 0.08);
  font-size: 10px;
  font-weight: 900;
}

.server-file-size {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.server-file-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.server-manager-view[data-server-view="terminal"].active {
  align-content: stretch;
}

.server-terminal-console {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
}

.server-terminal-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.server-terminal-head > div:first-child {
  display: grid;
  min-width: 0;
}

.server-terminal-head span,
.server-terminal-head code,
.server-terminal-actions span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-terminal-head code {
  color: var(--primary);
  font-size: 12px;
}

.server-terminal-actions {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
}

.server-terminal-actions span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.server-terminal-actions span.active {
  color: #22c55e;
}

.server-terminal-screen {
  display: block;
  min-height: 460px;
  max-height: calc(100vh - 225px);
  overflow: hidden;
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 8px;
  background: #05070b;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.65);
  cursor: text;
}

.server-terminal-live {
  width: 100%;
  height: min(62vh, 620px);
  min-height: 460px;
  padding: 10px;
}

.server-terminal-live .xterm {
  height: 100%;
}

.server-terminal-live .xterm-viewport,
.server-terminal-live .xterm-screen {
  border-radius: 6px;
}

.server-transfer-form {
  display: grid;
  gap: 10px;
  max-width: 1100px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

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

.server-transfer-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.server-transfer-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  max-height: calc(100vh - 365px);
  overflow: auto;
}

.server-transfer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.server-transfer-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.server-transfer-main strong,
.server-transfer-main small,
.server-transfer-main em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-transfer-main small {
  color: var(--muted);
  font-size: 12px;
}

.server-transfer-main em {
  color: #fecaca;
  font-size: 12px;
  font-style: normal;
}

.server-transfer-main pre {
  max-height: 120px;
  margin: 4px 0 0;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 7px;
  background: #06080d;
  color: #d7fbe8;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.server-transfer-meta {
  display: grid;
  align-content: start;
  justify-items: end;
  gap: 8px;
}

.server-transfer-meta span {
  padding: 4px 8px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.server-transfer-row.status-running .server-transfer-meta span,
.server-transfer-row.status-queued .server-transfer-meta span,
.server-transfer-row.status-canceling .server-transfer-meta span {
  border-color: rgba(56, 189, 248, 0.3);
  color: #bae6fd;
  background: rgba(56, 189, 248, 0.1);
}

.server-transfer-row.status-completed .server-transfer-meta span {
  border-color: rgba(34, 197, 94, 0.3);
  color: #bbf7d0;
  background: rgba(22, 101, 52, 0.16);
}

.server-transfer-row.status-failed .server-transfer-meta span,
.server-transfer-row.status-canceled .server-transfer-meta span {
  border-color: rgba(248, 113, 113, 0.32);
  color: #fecaca;
  background: rgba(127, 29, 29, 0.16);
}

.server-settings-form {
  max-width: 900px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.server-settings-grid {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
}

.server-manager-empty {
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 960px) {
  .server-manager-panel {
    inset: 8px;
  }

  .server-manager-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .server-manager-sidebar {
    max-height: 190px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .server-manager-list {
    grid-auto-flow: column;
    grid-auto-columns: minmax(210px, 260px);
    overflow-x: auto;
    overflow-y: hidden;
  }

  .server-file-toolbar,
  .server-mkdir-form,
  .server-transfer-grid,
  .server-settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .server-terminal-head,
  .server-terminal-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .server-terminal-screen {
    min-height: 320px;
    max-height: calc(100vh - 280px);
  }

  .server-terminal-live {
    height: 420px;
    min-height: 320px;
  }

  .server-dual-files {
    grid-template-columns: minmax(0, 1fr);
  }

  .server-file-pane-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .server-file-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .server-file-size,
  .server-file-actions,
  .server-transfer-meta {
    justify-content: flex-start;
    justify-items: start;
    text-align: left;
  }

  .server-transfer-row {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* TopMediaTV identity: fuchsia, violet and electric blue. */
:root {
  --bg:#090a14; --surface:#141425; --surface-soft:#22203a; --surface-strong:#10111e;
  --text:#f3f1fa; --muted:#b3aec5; --line:#33304c;
  --primary:#c18aff; --primary-strong:#8747ed;
  --tm-gradient:linear-gradient(115deg,#ce0068 0%,#8735d5 52%,#155ad6 100%);
}
body { accent-color:#c04bff; }
.sidebar { background:linear-gradient(180deg,#191326,#10111e); }
.topbar { background:linear-gradient(100deg,#20122b,#111b32); border-bottom-color:#47305e; }
.nav-link.active, .nav-link.is-active { background:var(--tm-gradient); color:#fff; border-color:#a15bea; }
.button:not(.secondary):not(.danger), button[type=submit]:not(.secondary):not(.danger) { background:var(--tm-gradient); color:#fff; border-color:#8747ed; }
.button.secondary { color:#e1d0fa; background:#252039; border-color:#57406b; }
input,select,textarea { background:#10111e; }
input:focus,select:focus,textarea:focus { outline-color:#b6baff; border-color:#a871ef; box-shadow:0 0 0 3px rgba(135,71,237,.18); }
.nav-link:focus-visible,.button:focus-visible { outline:2px solid #b6baff; outline-offset:3px; }
.login-page { background:radial-gradient(ellipse at 20% 10%,rgba(206,0,104,.16),transparent 50%),radial-gradient(ellipse at 80% 90%,rgba(22,116,245,.2),transparent 55%),#090a14; }
