:root {
  --ink: #1f2933;
  --accent: #0f7a67;
  --accent-soft: #eef8f6;
  --line: #e0e6eb;
}

.ce-standalone .controls,
.multiplexed-streams-explorer .controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem 1rem;
}

.ce-standalone .controls {
  margin-top: 1.25rem;
}

.multiplexed-streams-explorer {
  margin-top: 1.25rem;
}

.multiplexed-streams-explorer .controls {
  margin-bottom: 1rem;
}

.ce-standalone .protocol-picker,
.ce-standalone .codec-picker,
.ce-standalone .frame-rate-picker,
.multiplexed-streams-explorer .protocol-picker,
.multiplexed-streams-explorer .codec-picker,
.multiplexed-streams-explorer .frame-rate-picker {
  display: flex;
  flex-wrap: wrap;
  flex: 1 1 18rem;
  gap: 0.5rem;
}

.ce-standalone .protocol-picker,
.multiplexed-streams-explorer .protocol-picker {
  justify-content: flex-start;
}

.ce-standalone .codec-picker,
.multiplexed-streams-explorer .codec-picker {
  justify-content: center;
}

.ce-standalone .frame-rate-picker,
.multiplexed-streams-explorer .frame-rate-picker {
  justify-content: flex-end;
}

.ce-standalone .is-hidden,
.multiplexed-streams-explorer .is-hidden {
  display: none !important;
}

.ce-standalone .protocol-picker label,
.ce-standalone .codec-picker label,
.ce-standalone .frame-rate-picker label,
.multiplexed-streams-explorer label {
  position: relative;
  margin: 0;
}

.multiplexed-streams-explorer .control-group-label {
  display: inline-flex;
  align-items: center;
  color: #2a3a48;
  font-size: 0.9rem;
  font-weight: 600;
  margin-right: 0.15rem;
}

.ce-standalone .protocol-picker input,
.ce-standalone .codec-picker input,
.ce-standalone .frame-rate-picker input,
.multiplexed-streams-explorer input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ce-standalone .protocol-picker span,
.ce-standalone .codec-picker span,
.ce-standalone .frame-rate-picker span,
.multiplexed-streams-explorer input[type="radio"] + span {
  display: inline-block;
  padding: 0.38rem 0.78rem;
  border-radius: 999px;
  border: 1px solid #aebdca;
  color: #233747;
  background: #ffffff;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.ce-standalone .protocol-picker input + span:hover,
.ce-standalone .codec-picker input + span:hover,
.ce-standalone .frame-rate-picker input + span:hover,
.multiplexed-streams-explorer input[type="radio"] + span:hover {
  background: #eef4f9;
  border-color: #8da3b7;
}

.ce-standalone .protocol-picker input:checked + span,
.ce-standalone .codec-picker input:checked + span,
.ce-standalone .frame-rate-picker input:checked + span,
.multiplexed-streams-explorer input[type="radio"]:checked + span {
  border-color: var(--accent);
  color: #0c5f52;
  background: var(--accent-soft);
}

.ce-standalone .protocol-picker input:focus + span,
.ce-standalone .protocol-picker input:focus-visible + span,
.ce-standalone .codec-picker input:focus + span,
.ce-standalone .codec-picker input:focus-visible + span,
.ce-standalone .frame-rate-picker input:focus + span,
.ce-standalone .frame-rate-picker input:focus-visible + span,
.multiplexed-streams-explorer input[type="radio"]:focus + span,
.multiplexed-streams-explorer input[type="radio"]:focus-visible + span {
  outline: 2px solid #2f6f9a;
  outline-offset: 1px;
}

.ce-standalone .table-wrap,
.multiplexed-streams-explorer .table-wrap {
  overflow-x: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.ce-standalone .table-wrap {
  margin-top: 1rem;
}

.ce-standalone table,
.multiplexed-streams-explorer table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  color: var(--ink);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

.ce-standalone th,
.ce-standalone td,
.multiplexed-streams-explorer th,
.multiplexed-streams-explorer td {
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
  padding: 0.65rem 0.45rem;
  font-size: 0.96rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ce-standalone th:nth-child(1),
.ce-standalone td:nth-child(1),
.multiplexed-streams-explorer th:nth-child(1),
.multiplexed-streams-explorer td:nth-child(1) {
  width: 18%;
}

.ce-standalone th:nth-child(2),
.ce-standalone td:nth-child(2),
.multiplexed-streams-explorer th:nth-child(2),
.multiplexed-streams-explorer td:nth-child(2) {
  width: 12%;
}

.ce-standalone th:nth-child(3),
.ce-standalone td:nth-child(3),
.multiplexed-streams-explorer th:nth-child(3),
.multiplexed-streams-explorer td:nth-child(3) {
  width: 13%;
}

.ce-standalone th:nth-child(4),
.ce-standalone td:nth-child(4),
.multiplexed-streams-explorer th:nth-child(4),
.multiplexed-streams-explorer td:nth-child(4) {
  width: 33%;
}

.ce-standalone th:nth-child(5),
.ce-standalone td:nth-child(5),
.ce-standalone th:nth-child(6),
.ce-standalone td:nth-child(6),
.multiplexed-streams-explorer th:nth-child(5),
.multiplexed-streams-explorer td:nth-child(5),
.multiplexed-streams-explorer th:nth-child(6),
.multiplexed-streams-explorer td:nth-child(6) {
  width: 12%;
}

.ce-standalone th:nth-child(5),
.ce-standalone td:nth-child(5),
.multiplexed-streams-explorer th:nth-child(5),
.multiplexed-streams-explorer td:nth-child(5) {
  padding-left: 1rem;
}

.ce-standalone th,
.multiplexed-streams-explorer th {
  background: #f2f5f8;
  color: #22313f;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.ce-standalone th.sort-asc::after,
.ce-standalone th.sort-desc::after,
.multiplexed-streams-explorer th.sort-asc::after,
.multiplexed-streams-explorer th.sort-desc::after {
  margin-left: 0.35rem;
}

.ce-standalone th.sort-asc::after,
.multiplexed-streams-explorer th.sort-asc::after {
  content: "▲";
}

.ce-standalone th.sort-desc::after,
.multiplexed-streams-explorer th.sort-desc::after {
  content: "▼";
}

.ce-standalone tbody tr:nth-child(even) td,
.ce-standalone tbody tr:nth-child(even) th,
.multiplexed-streams-explorer tbody tr:nth-child(even) td,
.multiplexed-streams-explorer tbody tr:nth-child(even) th {
  background-color: #f0f4f8;
}

.ce-standalone tbody tr:hover td,
.ce-standalone tbody tr:hover th,
.multiplexed-streams-explorer tbody tr:hover td,
.multiplexed-streams-explorer tbody tr:hover th {
  background-color: #e8f0f7;
}

.ce-standalone .summary-meta,
.multiplexed-streams-explorer .summary-meta {
  display: block;
  margin-top: 0.2rem;
  color: #4b5a67;
  font-size: 0.84rem;
  line-height: 1.4;
}

.ce-standalone .cell-actions,
.multiplexed-streams-explorer .cell-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.ce-standalone td.cell-na-centered,
.multiplexed-streams-explorer td.cell-na-centered {
  text-align: center;
  vertical-align: middle;
}

.ce-standalone .manifest-button,
.ce-standalone .spott-button,
.ce-standalone .copy-link-button,
.ce-standalone .stream-link-button,
.multiplexed-streams-explorer .manifest-button,
.multiplexed-streams-explorer .spott-button,
.multiplexed-streams-explorer .copy-link-button,
.multiplexed-streams-explorer .stream-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 7.8rem;
  padding: 0.28rem 0.52rem;
  border: 1px solid #7dd3c0;
  border-radius: 4px;
  background: #7dd3c0;
  color: #1f2933;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
}

.ce-standalone .copy-link-button,
.multiplexed-streams-explorer .copy-link-button {
  -webkit-appearance: none;
  appearance: none;
  font-family: inherit;
}

.ce-standalone .manifest-button:hover,
.ce-standalone .spott-button:hover,
.ce-standalone .copy-link-button:hover,
.ce-standalone .stream-link-button:hover,
.multiplexed-streams-explorer .manifest-button:hover,
.multiplexed-streams-explorer .spott-button:hover,
.multiplexed-streams-explorer .copy-link-button:hover,
.multiplexed-streams-explorer .stream-link-button:hover {
  background: #5aa88e;
  border-color: #5aa88e;
}

.ce-standalone .manifest-button:focus,
.ce-standalone .spott-button:focus,
.ce-standalone .copy-link-button:focus,
.ce-standalone .stream-link-button:focus,
.multiplexed-streams-explorer .manifest-button:focus,
.multiplexed-streams-explorer .spott-button:focus,
.multiplexed-streams-explorer .copy-link-button:focus,
.multiplexed-streams-explorer .stream-link-button:focus {
  outline: 2px solid #1f2933;
  outline-offset: 2px;
}

.ce-standalone .meta,
.multiplexed-streams-explorer .meta {
  color: #5b6773;
  font-size: 0.86rem;
}

.ce-standalone .meta {
  margin-top: 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: space-between;
}

.multiplexed-streams-explorer .meta {
  margin-top: 0.55rem;
}

@media (max-width: 991px) {
  .multiplexed-streams-explorer .protocol-picker,
  .multiplexed-streams-explorer .codec-picker,
  .multiplexed-streams-explorer .frame-rate-picker {
    flex: 1 1 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 700px) {
  .ce-standalone .protocol-picker,
  .ce-standalone .codec-picker,
  .ce-standalone .frame-rate-picker {
    flex: 1 1 100%;
    justify-content: flex-start;
  }

  .ce-standalone th,
  .ce-standalone td {
    padding: 0.55rem 0.4rem;
    font-size: 0.88rem;
  }
}

/* ── DRM Info button ─────────────────────────────────────────── */
.ce-standalone .drm-info-button,
.multiplexed-streams-explorer .drm-info-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 7.8rem;
  padding: 0.28rem 0.52rem;
  border: 1px solid #a0b4c8;
  border-radius: 4px;
  background: #e8f0f7;
  color: #1f2933;
  font-size: 0.86rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.3;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.ce-standalone .drm-info-button:hover,
.multiplexed-streams-explorer .drm-info-button:hover {
  background: #c6d8ea;
  border-color: #7a9ab5;
}

.ce-standalone .drm-info-button:focus,
.multiplexed-streams-explorer .drm-info-button:focus {
  outline: 2px solid #1f2933;
  outline-offset: 2px;
}

/* ── DRM Info modal ──────────────────────────────────────────── */
#drm-info-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  align-items: center;
  justify-content: center;
}

#drm-info-modal.is-open {
  display: flex;
}

.drm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.drm-modal-box {
  position: relative;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
  width: min(560px, 94vw);
  padding: 1.5rem 1.75rem 1.75rem;
}

.drm-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.drm-modal-header h2 {
  margin: 0;
  font-size: 1.62rem;
  font-weight: 700;
  color: var(--ink);
}

.drm-modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: #5b6773;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

.drm-modal-close:hover {
  color: var(--ink);
  background: #f0f3f6;
}

.drm-modal-close:focus {
  outline: 2px solid #2f6f9a;
  outline-offset: 2px;
}

.drm-field {
  margin-bottom: 1rem;
}

.drm-field:last-child {
  margin-bottom: 0;
}

.drm-field label {
  display: block;
  font-size: 1.14rem;
  font-weight: 600;
  color: #5b6773;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.drm-url-row {
  display: flex;
  gap: 0.5rem;
}

.drm-url-input {
  flex: 1;
  padding: 0.4rem 0.6rem;
  border: 1px solid #c8d4de;
  border-radius: 4px;
  font-size: 1.2rem;
  font-family: "Consolas", "Menlo", monospace;
  color: var(--ink);
  background: #f7f9fb;
  min-width: 0;
}

.drm-copy-button {
  flex-shrink: 0;
  padding: 0.4rem 0.9rem;
  border: 1px solid #7dd3c0;
  border-radius: 4px;
  background: #7dd3c0;
  color: #1f2933;
  font-size: 1.2rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.drm-copy-button:hover {
  background: #5aa88e;
  border-color: #5aa88e;
}

.drm-copy-button:focus {
  outline: 2px solid #1f2933;
  outline-offset: 2px;
}