:root {
  --bg: #f4f6f8;
  --sidebar: #111827;
  --sidebar-muted: #9ca3af;
  --panel: #ffffff;
  --text: #1e242c;
  --muted: #687385;
  --line: #dfe3ea;
  --accent: #1769aa;
  --accent-dark: #0f4f82;
  --ok: #0f766e;
  --ok-bg: #e6fffb;
  --warn: #8a4b00;
  --warn-bg: #fff4dc;
  --pending: #6d4aff;
  --pending-bg: #f1edff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

[hidden] {
  display: none !important;
}

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

.sidebar {
  background: var(--sidebar);
  bottom: 0;
  color: #fff;
  display: flex;
  flex-direction: column;
  left: 0;
  overflow-y: auto;
  padding: 22px 18px;
  position: fixed;
  top: 0;
  width: 245px;
}

.brand {
  color: #fff;
  display: block;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}

.language-switcher {
  display: grid;
  gap: 6px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 24px;
}

.language-switcher button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: #d8dee8;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 10px;
}

.language-switcher button.active {
  background: #fff;
  color: var(--sidebar);
}

.side-nav,
.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-nav a,
.sidebar-section a {
  border-radius: 6px;
  color: #d8dee8;
  padding: 9px 10px;
}

.side-nav a:hover,
.sidebar-section a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar-section {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 18px;
  padding-top: 18px;
}

.sidebar-section span {
  color: var(--sidebar-muted);
  font-size: 12px;
  font-weight: 700;
  margin: 0 10px 4px;
  text-transform: uppercase;
}

.media-switcher {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 18px;
  padding-top: 18px;
}

.media-switcher summary {
  align-items: center;
  border-radius: 8px;
  color: #d8dee8;
  cursor: pointer;
  display: flex;
  font-size: 13px;
  font-weight: 800;
  justify-content: space-between;
  list-style: none;
  padding: 9px 10px;
}

.media-switcher summary::-webkit-details-marker {
  display: none;
}

.media-switcher summary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.media-switcher summary strong {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  padding: 3px 7px;
}

.media-switcher-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.media-switcher-list a {
  align-items: center;
  border-radius: 8px;
  color: #d8dee8;
  display: grid;
  gap: 9px;
  grid-template-columns: 34px minmax(0, 1fr);
  padding: 8px 10px;
}

.media-switcher-list a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.media-switcher-list img,
.media-switcher-list span {
  align-items: center;
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #fff;
  display: flex;
  font-size: 11px;
  font-weight: 900;
  justify-content: center;
  object-fit: contain;
  padding: 5px;
  text-transform: uppercase;
  width: 34px;
}

.media-switcher-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-account {
  margin-top: auto;
}

.sidebar-account strong {
  color: #fff;
  display: block;
  font-size: 14px;
  margin: 6px 10px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-account form {
  margin: 0;
}

.sidebar-account button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #d8dee8;
  cursor: pointer;
  font: inherit;
  padding: 9px 10px;
  text-align: left;
  width: 100%;
}

.sidebar-account button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.page {
  margin-left: 245px;
  max-width: 1440px;
  padding: 28px;
}

.auth-body {
  background:
    radial-gradient(circle at 20% 20%, rgba(23, 105, 170, 0.16), transparent 28%),
    linear-gradient(135deg, #eef4fb 0%, #f7f8fb 42%, #edf7f5 100%);
  min-height: 100vh;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.05fr);
  min-height: 100vh;
}

.auth-panel {
  align-items: center;
  display: flex;
  justify-content: center;
  padding: 48px;
}

.auth-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(223, 227, 234, 0.9);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(17, 24, 39, 0.12);
  max-width: 460px;
  padding: 34px;
  width: 100%;
}

.auth-brand {
  color: var(--accent);
  display: block;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
  margin-bottom: 18px;
  text-transform: uppercase;
}

.auth-card h1 {
  font-size: 32px;
  line-height: 1.1;
  margin: 0 0 10px;
}

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

.auth-card .field {
  margin-bottom: 16px;
}

.auth-card input {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  padding: 13px 14px;
  width: 100%;
}

.auth-card button[type="submit"] {
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  padding: 13px 16px;
  width: 100%;
}

.auth-error {
  background: #fff2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #9f1239;
  margin-bottom: 16px;
  padding: 12px 14px;
}

.auth-language {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 18px;
}

.auth-language button {
  background: #eef4fb;
  border: 1px solid #d8e2ef;
  border-radius: 999px;
  color: var(--accent-dark);
  cursor: pointer;
  font-weight: 800;
  padding: 7px 12px;
}

.auth-language button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.auth-visual {
  background: #111827;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 52px;
}

.auth-visual h2 {
  font-size: 42px;
  line-height: 1.05;
  margin: 0;
  max-width: 620px;
}

.auth-visual p {
  color: #cbd5e1;
  line-height: 1.6;
  max-width: 560px;
}

.auth-metrics {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, 1fr);
}

.auth-metrics article {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 16px;
}

.auth-metrics strong {
  display: block;
  font-size: 24px;
}

.auth-metrics span {
  color: #cbd5e1;
  display: block;
  font-size: 13px;
  margin-top: 6px;
}

.page-title {
  margin-bottom: 22px;
}

.page-title.with-actions {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.split-title {
  align-items: flex-end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.page-title h1 {
  font-size: 28px;
  margin: 0 0 8px;
}

.page-title p {
  color: var(--muted);
  margin: 0;
}

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

.connection-grid,
.credential-status-grid,
.bulk-help-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-bottom: 20px;
}

.bulk-help-grid code,
.info-panel code {
  background: #eef6ff;
  border: 1px solid #d8e9fb;
  border-radius: 6px;
  color: var(--accent-dark);
  display: inline-block;
  font-weight: 800;
  margin-top: 8px;
  padding: 7px 9px;
}

.compact-panel h2 {
  font-size: 18px;
  line-height: 1.25;
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

.compact-panel p {
  color: var(--muted);
  line-height: 1.45;
  margin: 0 0 12px;
}

.video-upload-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  margin-bottom: 20px;
}

.video-flow-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 12px;
}

.flow-step {
  background: #f1f3f5;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding: 8px 11px;
}

.flow-step.done {
  background: var(--ok-bg);
  border-color: #99f6e4;
  color: var(--ok);
}

.flow-step.active {
  background: var(--pending-bg);
  border-color: #c8bfff;
  color: var(--pending);
}

.bulk-wizard {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
}

.bulk-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bulk-drop-zone {
  align-items: center;
  background: linear-gradient(180deg, #fbfdff, #f5f8fc);
  border: 1px dashed #b8cce4;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 10px;
  justify-items: center;
  min-height: 220px;
  padding: 30px;
  text-align: center;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.bulk-drop-zone:hover,
.bulk-drop-zone.is-dragging {
  background: #f0f7ff;
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(23, 105, 170, 0.12);
}

.bulk-drop-zone input {
  max-width: 440px;
}

.bulk-drop-zone strong {
  font-size: 21px;
}

.bulk-drop-zone span {
  color: var(--muted);
  line-height: 1.45;
}

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

.bulk-summary-grid article {
  background: #f7f9fc;
  border: 1px solid #edf1f6;
  border-radius: 8px;
  padding: 14px;
}

.bulk-summary-grid strong {
  display: block;
  font-size: 24px;
  line-height: 1;
  margin-bottom: 6px;
}

.bulk-summary-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.metric-warn {
  border-color: #f7c978 !important;
}

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

.bulk-actions button {
  min-width: 190px;
}

.bulk-match-table td {
  vertical-align: top;
}

.bulk-match-table td:first-child,
.bulk-match-table td:nth-child(3) {
  max-width: 360px;
  overflow-wrap: anywhere;
}

.bulk-upload-state {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  color: var(--muted);
  display: inline-block;
  font-size: 12px;
  font-weight: 850;
  padding: 6px 9px;
  white-space: nowrap;
}

.bulk-row-done .bulk-upload-state {
  background: var(--ok-bg);
  border-color: #99f6e4;
  color: var(--ok);
}

.bulk-row-error .bulk-upload-state {
  background: #fff2f2;
  border-color: #fecaca;
  color: #9f1239;
  white-space: normal;
}

.direct-upload-box {
  display: grid;
  gap: 14px;
}

.file-drop {
  align-items: center;
  background: #f7f9fc;
  border: 1px dashed #bfd0e5;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 8px;
  justify-items: center;
  min-height: 190px;
  padding: 26px;
  text-align: center;
}

.file-drop input {
  max-width: 360px;
}

.file-drop strong {
  font-size: 20px;
}

.file-drop span {
  color: var(--muted);
  line-height: 1.45;
  max-width: 520px;
}

.upload-meter {
  background: #e8eef6;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.upload-meter span {
  background: linear-gradient(90deg, var(--accent), var(--ok));
  display: block;
  height: 100%;
  transition: width 160ms ease;
  width: 0;
}

.upload-status {
  background: #f7f9fc;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  color: var(--muted);
  padding: 11px 12px;
}

.upload-status[data-state="ok"] {
  background: var(--ok-bg);
  border-color: #99f6e4;
  color: var(--ok);
}

.upload-status[data-state="error"] {
  background: #fff2f2;
  border-color: #fecaca;
  color: #9f1239;
}

.status-explainer {
  border-radius: 8px;
  display: grid;
  gap: 8px;
  margin: 14px 0;
  padding: 14px;
}

.status-explainer.warn {
  background: #fff8ed;
  border: 1px solid #ffd89a;
  color: #744500;
}

.status-explainer strong {
  color: var(--text);
}

.status-explainer p,
.status-explainer ul {
  margin: 0;
}

.video-asset-card {
  display: grid;
  gap: 9px;
  margin: 0 0 16px;
}

.video-asset-card div {
  background: #f7f9fc;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  min-width: 0;
  padding: 10px;
}

.video-asset-card dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.video-asset-card dd {
  font-weight: 750;
  margin: 0;
  overflow-wrap: anywhere;
}

.delete-video-form {
  display: grid;
  gap: 12px;
}

.encoding-card {
  background: #f7f9fc;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  margin-bottom: 16px;
  padding: 14px;
}

.encoding-card h3 {
  margin: 0;
}

.encoding-progress {
  background: #e8eef6;
  border-radius: 999px;
  height: 9px;
  margin-bottom: 12px;
  overflow: hidden;
}

.encoding-progress span {
  background: linear-gradient(90deg, var(--pending), var(--accent));
  display: block;
  height: 100%;
  transition: width 200ms ease;
}

.encoding-card dl {
  display: grid;
  gap: 9px;
  margin: 0 0 14px;
}

.encoding-card dl div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.encoding-card dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.encoding-card dd {
  font-weight: 750;
  margin: 0;
  overflow-wrap: anywhere;
}

.manual-ingestion summary {
  cursor: pointer;
  font-weight: 850;
}

.manual-ingestion-form {
  margin-top: 16px;
}

.test-result {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px 16px;
}

.test-result strong {
  font-weight: 850;
}

.test-result.ok {
  background: var(--ok-bg);
  border-color: #99f6e4;
  color: var(--ok);
}

.test-result.error {
  background: #fff2f2;
  border-color: #fecaca;
  color: #9f1239;
}

.metric-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.metric-grid small {
  color: var(--muted);
  display: block;
  line-height: 1.35;
  margin-top: 8px;
}

.metric-ok {
  border-color: #99f6e4 !important;
}

.metric-pending {
  border-color: #c8bfff !important;
}

.provider-hero {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 20px 56px rgba(17, 24, 39, 0.08);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 22px;
  overflow: hidden;
  padding: 24px;
  position: relative;
}

.provider-hero::before {
  background: linear-gradient(90deg, rgba(23, 105, 170, 0.14), rgba(15, 118, 110, 0.08));
  content: "";
  inset: 0 0 auto;
  height: 6px;
  position: absolute;
}

.provider-identity {
  align-items: center;
  display: grid;
  gap: 20px;
  grid-template-columns: auto minmax(0, 1fr);
  min-width: 0;
}

.provider-logo-tile {
  align-items: center;
  background: #f7f9fc;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  display: flex;
  height: 118px;
  justify-content: center;
  padding: 18px;
  width: 178px;
}

.provider-logo-tile img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.provider-logo-tile span {
  color: var(--accent);
  font-size: 34px;
  font-weight: 900;
  text-transform: uppercase;
}

.provider-hero h1 {
  font-size: 34px;
  line-height: 1.05;
  margin: 0 0 8px;
}

.provider-hero p {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.provider-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.provider-meta-row span,
.provider-meta-row a {
  background: #f1f5f9;
  border-radius: 999px;
  color: #526173;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
}

.metric-warn {
  border-color: #f0c36d !important;
}

.metric-grid article,
.panel,
.form-panel,
.warning,
.messages,
.toolbar-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric-grid article {
  padding: 18px;
}

.metric-grid strong {
  display: block;
  font-size: 30px;
  line-height: 1;
}

.metric-grid span {
  color: var(--muted);
  display: block;
  margin-top: 8px;
}

.media-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-bottom: 22px;
}

.media-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.06);
  display: flex;
  flex-direction: column;
  gap: 18px;
  justify-content: space-between;
  min-height: 230px;
  padding: 20px;
}

.media-card-top {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
}

.media-card-logo {
  align-items: center;
  background: #f7f9fc;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  display: flex;
  height: 72px;
  justify-content: center;
  padding: 12px;
  width: 112px;
}

.media-card-logo img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.media-card-logo span {
  color: var(--accent);
  font-size: 22px;
  font-weight: 900;
  text-transform: uppercase;
}

.media-card h2 {
  font-size: 22px;
  margin: 14px 0 8px;
}

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

.media-stats {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.media-stats div {
  background: #f7f9fc;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  min-width: 0;
  padding: 12px;
}

.media-stats dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  margin-bottom: 6px;
}

.media-stats dd {
  font-size: 18px;
  font-weight: 800;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workbench-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
}

.endpoint-list {
  display: grid;
  gap: 10px;
}

.endpoint-list a {
  align-items: center;
  background: #f7f9fc;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 13px 14px;
}

.endpoint-list span {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.content-gallery {
  margin-bottom: 20px;
}

.poster-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.poster-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.poster-frame {
  align-items: center;
  aspect-ratio: 3 / 4;
  background: #e9eef5;
  color: var(--muted);
  display: flex;
  font-weight: 800;
  justify-content: center;
  overflow: hidden;
  text-align: center;
}

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

.poster-card-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.poster-card-title a {
  color: var(--text);
  display: block;
  font-weight: 800;
  line-height: 1.25;
}

.poster-card-title span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 4px;
}

.card-actions {
  border-top: 1px solid #eef2f7;
  display: flex;
  gap: 12px;
  padding-top: 10px;
}

.card-actions a {
  font-size: 13px;
  font-weight: 750;
}

.mini-poster-row {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.mini-poster {
  color: var(--text);
  display: grid;
  gap: 8px;
}

.mini-poster img,
.mini-poster > span:first-child {
  align-items: center;
  aspect-ratio: 3 / 4;
  background: #e9eef5;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  font-weight: 800;
  justify-content: center;
  object-fit: cover;
  overflow: hidden;
  text-align: center;
  width: 100%;
}

.mini-poster strong {
  font-size: 14px;
  line-height: 1.25;
}

.mini-poster small {
  color: var(--muted);
}

.panel,
.form-panel,
.warning,
.messages,
.toolbar-panel {
  margin-bottom: 20px;
  padding: 20px;
}

.section-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-heading h2 {
  margin: 0;
}

.section-heading span {
  color: var(--muted);
}

.operations-section {
  margin-bottom: 22px;
}

.operations-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.operation-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(17, 24, 39, 0.05);
  display: grid;
  gap: 16px;
  padding: 18px;
}

.operation-card header {
  align-items: center;
  display: grid;
  gap: 14px;
  grid-template-columns: 64px minmax(0, 1fr) auto;
}

.operation-logo {
  align-items: center;
  background: #f7f9fc;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  display: flex;
  height: 54px;
  justify-content: center;
  padding: 8px;
  width: 64px;
}

.operation-logo img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.operation-logo span {
  color: var(--accent);
  font-weight: 900;
  text-transform: uppercase;
}

.operation-card h3 {
  font-size: 18px;
  margin: 0 0 4px;
}

.operation-card p {
  color: var(--muted);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operation-meta {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(74px, 0.45fr));
  margin: 0;
}

.operation-meta div {
  background: #f7f9fc;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  min-width: 0;
  padding: 10px;
}

.operation-meta dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.operation-meta dd {
  font-weight: 800;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.export-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.export-chip-row a {
  background: #eef6ff;
  border: 1px solid #d8e9fb;
  border-radius: 999px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  padding: 7px 10px;
}

.operation-card footer {
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 14px;
}

.operation-card footer a {
  font-weight: 750;
}

.tabbar {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
  padding: 8px;
}

.tabbar a {
  border-radius: 6px;
  color: var(--text);
  font-weight: 650;
  padding: 9px 12px;
}

.tabbar a:hover {
  background: #eef2f7;
}

.filter-grid {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(240px, 1.7fr) repeat(3, minmax(150px, 1fr)) auto;
}

.filter-grid label,
.video-filter-grid label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 650;
  gap: 6px;
}

.filter-actions {
  display: flex;
  gap: 8px;
}

.video-filter-grid {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(240px, 1.6fr) repeat(3, minmax(145px, 0.8fr)) auto;
}

.warning {
  background: var(--warn-bg);
  border-color: #f0c36d;
  color: var(--warn);
}

table {
  border-collapse: collapse;
  width: 100%;
}

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

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.content-table td {
  vertical-align: middle;
}

.strong-link {
  color: var(--text);
  display: inline-block;
  font-weight: 700;
}

.muted-line {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 3px;
}

.status {
  background: #eef3f8;
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  padding: 5px 9px;
}

.requirement-badge {
  border-radius: 999px;
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  margin-left: 6px;
  padding: 3px 7px;
  text-transform: uppercase;
}

.requirement-badge.required {
  background: #fff3cd;
  color: #8a5a00;
}

.requirement-badge.optional {
  background: #eef2f7;
  color: var(--muted);
}

.form-panel p {
  display: grid;
  gap: 6px;
  margin: 0 0 16px;
}

.secret-form fieldset {
  margin-bottom: 18px;
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.secondary-button {
  background: #eef2f7;
  color: var(--text);
}

.secondary-button:hover {
  background: #dbe4ef;
  color: var(--text);
}

.stats-filter-bar {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(180px, 1fr) repeat(2, minmax(150px, 0.8fr)) minmax(140px, 0.6fr) auto;
}

.stats-filter-bar label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 6px;
}

.checkbox-card {
  align-items: center;
  background: #f7f9fc;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  display: flex !important;
  gap: 9px !important;
  min-height: 42px;
  padding: 10px 12px;
}

.checkbox-card input[type="checkbox"] {
  width: auto;
}

.responsive-table {
  overflow-x: auto;
}

.empty-state {
  color: var(--muted);
  margin: 10px 0 0;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  padding: 10px 12px;
  width: 100%;
}

button {
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  padding: 10px 14px;
}

button:hover,
.button-link:hover {
  background: var(--accent-dark);
  color: #fff;
}

.button-link {
  background: var(--accent);
  border-radius: 6px;
  color: #fff;
  display: inline-block;
  font-weight: 650;
  padding: 10px 14px;
}

.button-link.secondary {
  background: #536173;
}

.button-link.ghost {
  background: #eef2f7;
  color: var(--text);
}

.button-link.danger,
.danger-button {
  background: #b42318;
  color: #fff;
}

.button-link.danger:hover,
.danger-button:hover {
  background: #8f1b13;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.row-actions {
  white-space: nowrap;
}

.row-actions a {
  font-weight: 650;
  margin-left: 10px;
}

.inline-delete-form {
  display: inline;
  margin-left: 10px;
}

.link-button {
  background: transparent;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  padding: 0;
}

.link-button:hover {
  background: transparent;
  color: var(--accent-dark);
}

.danger-link {
  color: #b42318;
}

.danger-link:hover {
  color: #8f1b13;
}

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

.video-state-guide {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.video-state-guide span {
  background: #f7f9fc;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  color: var(--muted);
  line-height: 1.4;
  padding: 12px;
}

.video-state-guide strong {
  color: var(--text);
  display: block;
  margin-bottom: 4px;
}

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

.provider-video-card {
  background: #f7f9fc;
  border: 1px solid #e8eef6;
  border-radius: 8px;
  color: var(--text);
  display: grid;
  gap: 5px;
  padding: 13px;
  text-decoration: none;
}

.provider-video-card:hover {
  border-color: #b8c7da;
  color: var(--text);
}

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

.pill {
  background: #eef2f7;
  border-radius: 999px;
  color: var(--muted);
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  min-width: 32px;
  padding: 5px 9px;
  text-align: center;
}

.pill.ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.pill.warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.pill.pending {
  background: var(--pending-bg);
  color: var(--pending);
}

.pill.neutral {
  background: #f1f3f5;
  color: #8a94a6;
}

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

.card-issues {
  background: #fff8ed;
  border: 1px solid #ffe0ad;
  border-radius: 8px;
  color: #7a4a00;
  display: grid;
  gap: 5px;
  font-size: 12px;
  margin-top: 10px;
  padding: 9px 10px;
}

.card-issues strong {
  color: #5f3900;
}

.card-issues ul,
.inline-issue-list {
  margin: 0;
  padding-left: 18px;
}

.inline-issue-list {
  color: var(--muted);
  font-size: 12px;
  margin-top: 5px;
}

.form-guidance-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-bottom: 16px;
}

.form-guidance-grid > div {
  background: #f7f9fc;
  border: 1px solid #e7edf5;
  border-radius: 8px;
  padding: 12px;
}

.form-guidance-grid strong {
  display: block;
  margin-bottom: 4px;
}

.completion-meter {
  align-items: center;
  background: #eef2f7;
  border-radius: 999px;
  display: flex;
  height: 18px;
  margin: 10px 0 8px;
  overflow: hidden;
  position: relative;
}

.completion-meter span {
  background: linear-gradient(90deg, #2e6fb4, #23a094);
  display: block;
  height: 100%;
}

.completion-meter strong {
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  position: absolute;
  right: 8px;
}

.access-pill {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  text-decoration: none;
}

.access-pill small {
  color: inherit;
  font-size: 10px;
  font-weight: 800;
  opacity: 0.72;
  text-transform: uppercase;
}

.scope-note {
  background: #eef6ff;
  border: 1px solid #cfe4ff;
  border-radius: 8px;
  color: #1d5f99;
  display: inline-block;
  font-weight: 700;
  margin-top: 8px;
  padding: 8px 11px;
}

.fieldset-help {
  color: var(--muted);
  margin: 0 0 14px;
}

.access-matrix {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.access-matrix-head,
.access-matrix-row {
  align-items: center;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px);
}

.access-matrix-head {
  background: #f7f9fc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 11px 14px;
  text-transform: uppercase;
}

.access-matrix-row {
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 14px;
}

.access-toggle {
  align-items: center;
  display: flex;
  gap: 12px;
}

.access-toggle input {
  flex: 0 0 auto;
  height: 18px;
  width: 18px;
}

.access-toggle span {
  display: grid;
  gap: 3px;
}

.access-toggle strong {
  color: var(--text);
}

.access-toggle small,
.access-toggle em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.logo-field-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.logo-field-grid > div {
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.logo-preview-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.logo-preview-grid figure {
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  padding: 14px;
}

.logo-preview-grid img,
.logo-preview-grid span {
  align-items: center;
  aspect-ratio: 16 / 9;
  background: #e9eef5;
  border-radius: 6px;
  display: flex;
  justify-content: center;
  object-fit: contain;
  width: 100%;
}

.logo-preview-grid figcaption {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-top: 8px;
}

@media (max-width: 720px) {
  .access-matrix-head {
    display: none;
  }

  .access-matrix-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

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

  .operation-card header,
  .operation-meta {
    grid-template-columns: 1fr;
  }
}

.image-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 16px;
}

.image-grid figure {
  margin: 0;
}

.image-grid img {
  aspect-ratio: 16 / 9;
  background: #eef2f7;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  width: 100%;
}

.image-grid figcaption {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

.image-preview-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.image-preview-card {
  background: #f7f9fc;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  overflow: hidden;
}

.image-preview-card > a {
  align-items: center;
  aspect-ratio: 16 / 9;
  background: #e9eef5;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.image-preview-card.poster-preview > a {
  aspect-ratio: 3 / 4;
}

.image-preview-card img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.image-preview-card div {
  display: grid;
  gap: 5px;
  padding: 12px;
}

.image-preview-card strong {
  color: var(--text);
}

.image-preview-card span {
  color: var(--muted);
  font-size: 13px;
}

.image-preview-card div a {
  font-size: 13px;
  font-weight: 750;
}

.empty-state {
  background: #f7f9fc;
  border: 1px dashed #cfd8e3;
  border-radius: 8px;
  color: var(--muted);
  padding: 22px;
}

.empty-state strong {
  color: var(--text);
  display: block;
  margin-bottom: 6px;
}

.empty-state p {
  margin: 0;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0 0 18px;
  padding: 16px;
}

legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding: 0 8px;
}

select[multiple] {
  min-height: 180px;
}

.helptext {
  color: var(--muted);
  font-size: 13px;
}

.field-error {
  color: #b42318;
  font-size: 13px;
}

.info-panel {
  background: #f8fbff;
}

.checklist {
  margin: 0;
  padding-left: 20px;
}

.validation-list {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.validation-list li {
  background: #fff8eb;
  border: 1px solid #f5d08a;
  border-radius: 8px;
  color: var(--warn);
  font-weight: 700;
  padding: 12px 14px;
}

.detail-hero {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(170px, 220px) minmax(0, 1fr);
  margin-bottom: 24px;
  padding: 22px;
}

.detail-poster {
  align-items: center;
  aspect-ratio: 3 / 4;
  background: #e9eef5;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  font-weight: 800;
  justify-content: center;
  overflow: hidden;
  text-align: center;
}

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

.detail-copy {
  align-self: center;
}

.detail-copy h1 {
  font-size: 34px;
  line-height: 1.08;
  margin: 0 0 10px;
}

.detail-copy p {
  color: var(--muted);
  margin: 0;
}

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

.inline-form.image-propagation-form {
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 260px) auto;
}

.compact-inline-form {
  align-items: end;
  grid-template-columns: minmax(130px, 180px) auto;
}

.inline-form .field-row {
  margin: 0;
}

.inline-form input[type="checkbox"] {
  width: auto;
}

.season-management-card {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
  margin-top: 20px;
  padding-top: 20px;
}

.season-management-card:first-of-type {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.season-heading {
  align-items: flex-start;
  border-top: 0;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-top: 0;
  padding-top: 0;
}

.season-heading h2 {
  margin: 0;
}

.season-heading span {
  color: var(--muted);
}

.season-health-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

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

.episode-bulk-form {
  display: grid;
  gap: 12px;
}

.episode-bulk-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
}

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

.table-actions a {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  padding: 5px 8px;
}

@media (max-width: 860px) {
  .sidebar {
    position: static;
    width: auto;
  }

  .sidebar-account {
    position: static;
  }

  .page {
    margin-left: 0;
    padding: 20px;
  }

  .auth-shell {
    grid-template-columns: 1fr;
  }

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

  .video-upload-grid {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    display: none;
  }

  .auth-panel {
    padding: 24px;
  }

  .split-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .provider-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .provider-identity {
    grid-template-columns: 1fr;
  }

  .provider-logo-tile {
    width: min(100%, 220px);
  }

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

  .poster-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .detail-hero,
  .inline-form {
    grid-template-columns: 1fr;
  }

  table {
    display: block;
    overflow-x: auto;
  }
}
