:root {
  --brand-gradient: linear-gradient(135deg, #3a7bd5 0%, #6b3fa0 48%, #9333ea 100%);
  --brand-purple: #9333ea;
  --brand-blue: #3a7bd5;
  --brand-purple-dk: #6b21a8;
  --brand-purple-lt: rgba(147, 51, 234, 0.12);
  --sidebar-bg: #1e2a3e;
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-section: rgba(255, 255, 255, 0.05);
  --sidebar-text: #d4dcea;
  --sidebar-muted: #7e8fa8;
  --sidebar-line: rgba(255, 255, 255, 0.09);
  --sidebar-hover: rgba(147, 51, 234, 0.16);
  --ws-bg: #f0f2f8;
  --ws-panel: #ffffff;
  --line: #e2e8f0;
  --text: #1a202c;
  --muted: #718096;
  --danger: #e53e3e;
  --success: #1f9d74;
  --warning: #f5b849;
  --shadow-card: 0 24px 60px rgba(107, 63, 160, 0.16),
                 0 4px 14px rgba(30, 42, 62, 0.05);
  --shadow-float: 0 8px 40px rgba(0, 0, 0, 0.32),
                  0 0 0 1px rgba(147, 51, 234, 0.12);
  --shadow-btn: 0 4px 16px rgba(107, 63, 160, 0.40);
  --sp-xs: 6px;
  --sp-sm: 10px;
  --sp-md: 16px;
  --sp-lg: 24px;
  --sp-xl: 32px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
}

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html,
body { min-height: 100%; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--ws-bg);
  -webkit-font-smoothing: antialiased;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.topbar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--brand-gradient);
}

.topbar-inner {
  height: 60px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.brand-logo {
  display: block;
  height: 36px;
}

.topbar-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text);
}

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

.api-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.api-status span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--success);
}

.api-status strong {
  font: inherit;
}

.btn-topbar,
.btn-secondary,
.btn-icon {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: var(--r-md);
  font-weight: 600;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.btn-topbar,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-topbar:hover,
.btn-secondary:hover,
.btn-icon:hover {
  border-color: var(--brand-purple);
  background: var(--brand-purple-lt);
  color: var(--brand-purple-dk);
}

.btn-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 18px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--brand-purple);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: transform 180ms ease, box-shadow 180ms ease, background 220ms ease;
}

.btn-brand:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: 0 8px 24px rgba(107, 63, 160, 0.32),
              0 2px 6px rgba(147, 51, 234, 0.20);
}

.btn-brand:disabled,
.btn-secondary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.builder-layout {
  min-height: calc(100vh - 60px);
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
}

.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar::before {
  content: "";
  display: block;
  height: 2px;
  flex-shrink: 0;
  background: var(--brand-gradient);
}

.sidebar-scroll {
  overflow-y: auto;
  padding: 16px 18px 24px;
}

.sidebar-section {
  padding: 16px 0;
  border-bottom: 1px solid var(--sidebar-line);
}

.sidebar-section:last-child { border-bottom: 0; }

.sidebar-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--sidebar-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.form-label {
  display: block;
  margin: 0 0 6px;
  color: inherit;
  font-size: 12.5px;
  font-weight: 600;
}

.sidebar .form-control,
.sidebar .form-select {
  width: 100%;
  margin: 0 0 12px;
  min-height: 40px;
  border: 1px solid var(--sidebar-line);
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, 0.20);
  color: var(--sidebar-text);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.sidebar .form-control::placeholder { color: rgba(212, 220, 234, 0.45); }

.sidebar .color-input {
  height: 40px;
  padding: 4px;
  cursor: pointer;
}

.sidebar .form-select option {
  color: var(--text);
  background: #fff;
}

.sidebar .form-control:focus,
.sidebar .form-select:focus {
  border-color: var(--brand-purple);
  box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.18);
}

.code-input {
  min-height: 96px;
  resize: vertical;
  font-family: Consolas, "Fira Mono", monospace;
  font-size: 12px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  border: 1px solid var(--sidebar-line);
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, 0.16);
}

.segmented label {
  margin: 0;
  min-width: 0;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  color: var(--sidebar-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.segmented input:checked + span {
  background: var(--brand-gradient);
  color: #fff;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 0;
  color: var(--sidebar-text);
  font-size: 13px;
}

.form-check-input {
  width: 18px;
  height: 18px;
  border-color: rgba(255, 255, 255, 0.35);
}

.form-check-input:checked {
  border-color: var(--brand-purple);
  background-color: var(--brand-purple);
}

.workspace {
  padding: 28px clamp(18px, 3vw, 36px) 44px;
  overflow: auto;
}

.workspace-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--brand-purple);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.workspace h2 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--brand-gradient);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 1px 6px rgba(147, 51, 234, 0.35);
}

.preview-shell {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  background: #0f172a;
  box-shadow: var(--shadow-card);
  aspect-ratio: 16 / 9;
}

.preview-shell::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 2;
  height: 3px;
  background: var(--brand-gradient);
}

.preview-shell iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.snippet-panel,
.adapter-notes {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--ws-panel);
  box-shadow: 0 2px 8px rgba(30, 42, 62, 0.04);
}

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

.snippet-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--brand-purple);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.snippet-panel pre {
  min-height: 82px;
  margin: 0;
  padding: 14px;
  overflow-x: auto;
  border: 1px solid rgba(147, 51, 234, 0.14);
  border-radius: var(--r-md);
  background: #f8fafc;
  color: #40516c;
  font-family: Consolas, "Fira Mono", monospace;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

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

.adapter-notes strong { color: var(--text); }

.toast {
  position: fixed;
  top: 76px;
  right: 20px;
  z-index: 1000;
  max-width: min(360px, calc(100vw - 40px));
  padding: 11px 14px;
  border: 1px solid rgba(147, 51, 234, 0.18);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-card);
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Admin */
.admin-token {
  min-height: 34px;
  width: min(180px, 24vw);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0 10px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.api-status.is-error {
  background: #fee2e2;
  color: #991b1b;
}

.api-status.is-error span {
  background: var(--danger);
}

.admin-layout {
  min-height: calc(100vh - 62px);
  display: grid;
  grid-template-columns: 300px minmax(420px, 1fr) minmax(360px, 520px);
  gap: 18px;
  padding: 18px;
  background: var(--ws-bg);
}

.admin-list-panel,
.admin-editor,
.admin-preview {
  min-width: 0;
}

.admin-list-panel {
  border-right: 1px solid var(--line);
  padding-right: 18px;
}

.admin-panel-head,
.admin-section-head,
.admin-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-panel-head {
  margin-bottom: 12px;
}

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

.player-list-tools {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.player-search {
  min-height: 38px;
  border-radius: var(--r-sm);
}

.player-count {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.player-row {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 10px 1fr 18px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--text);
  padding: 10px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(30, 42, 62, 0.04);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.player-row:hover,
.player-row.is-active {
  border-color: rgba(147, 51, 234, 0.36);
  box-shadow: 0 12px 28px rgba(107, 63, 160, 0.13);
}

.player-row-color {
  width: 10px;
  height: 38px;
  border-radius: 999px;
}

.player-row-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.player-row-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.player-row-main small {
  color: var(--muted);
  font-size: 11.5px;
  text-transform: uppercase;
}

.player-row-tags {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
}

.player-tag {
  min-width: 0;
  max-width: 150px;
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(58, 123, 213, 0.12);
  color: #1d4f92;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-tag.is-muted {
  background: #f1f5f9;
  color: var(--muted);
}

.admin-section {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
  padding: 16px;
  box-shadow: 0 12px 34px rgba(30, 42, 62, 0.05);
}

.admin-section-head {
  margin-bottom: 14px;
}

.admin-section-head strong {
  font-size: 14px;
}

.admin-form .form-control,
.admin-form .form-select,
.admin-token {
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.admin-form .form-control,
.admin-form .form-select {
  min-height: 40px;
}

.admin-form .form-control:focus,
.admin-form .form-select:focus,
.admin-token:focus {
  border-color: var(--brand-purple);
  box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.16);
}

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

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

.check-stack {
  min-height: 40px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding-top: 22px;
}

.admin-form .check-row {
  margin-top: 0;
  color: var(--text);
}

.admin-form .form-check-input {
  border-color: #cbd5e1;
}

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

.caption-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #f8fafc;
}

.caption-row-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.caption-row strong {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 12.5px;
}

.caption-row span,
.caption-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.caption-row small {
  text-transform: none;
}

.caption-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.caption-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-caption-action {
  width: 32px;
  height: 32px;
  text-decoration: none;
}

.btn-caption-action.is-danger:hover {
  border-color: rgba(229, 62, 62, 0.45);
  background: #fee2e2;
  color: #991b1b;
}

.btn-secondary.is-danger {
  border-color: rgba(229, 62, 62, 0.28);
  color: #991b1b;
}

.btn-secondary.is-danger:hover:not(:disabled) {
  border-color: rgba(229, 62, 62, 0.48);
  background: #fee2e2;
  color: #991b1b;
}

.watermark-admin {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 12px;
  margin-top: 12px;
}

.watermark-state {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #f8fafc;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.watermark-state img {
  max-width: 96px;
  max-height: 22px;
  object-fit: contain;
}

.live-caption-tuner {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.live-caption-manual {
  justify-content: flex-start;
  gap: 8px;
}

.live-caption-grid .form-label {
  font-size: 11px;
}

.generation-status,
.live-status,
.spalla-status,
.admin-snippet,
.admin-event-log {
  margin: 0;
  min-height: 90px;
  overflow: auto;
  border: 1px solid #d8dff0;
  border-radius: var(--r-md);
  background: #f8fafc;
  color: #233047;
  padding: 12px;
  font-family: Consolas, "Fira Mono", monospace;
  font-size: 11.5px;
  white-space: pre-wrap;
}

.compact-row {
  justify-content: flex-start;
  margin: 12px 0 10px;
}

.generation-status {
  min-height: 76px;
}

.live-status {
  min-height: 76px;
}

.admin-event-log {
  min-height: 118px;
}

.embed-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  margin: 0 0 10px;
  border: 1px solid #d8dff0;
  border-radius: var(--r-md);
  background: #f8fafc;
}

.embed-mode-switch label {
  margin: 0;
  min-width: 0;
}

.embed-mode-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.embed-mode-switch span {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  color: #475569;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.embed-mode-switch input:checked + span {
  background: #111827;
  color: #fff;
}

.generation-status.is-running {
  border-color: rgba(147, 51, 234, 0.3);
  background: #faf5ff;
}

.generation-status.is-done {
  border-color: rgba(22, 163, 74, 0.28);
  background: #f0fdf4;
}

.generation-status.is-error {
  border-color: rgba(220, 38, 38, 0.32);
  background: #fef2f2;
  color: #991b1b;
}

.live-status.is-running {
  border-color: rgba(37, 99, 235, 0.3);
  background: #eff6ff;
}

.live-status.is-done {
  border-color: rgba(22, 163, 74, 0.28);
  background: #f0fdf4;
}

.live-status.is-error {
  border-color: rgba(220, 38, 38, 0.32);
  background: #fef2f2;
  color: #991b1b;
}

.btn-compact {
  min-height: 30px;
  padding: 0 10px;
  font-size: 11px;
}

.admin-preview-shell {
  overflow: hidden;
  border-radius: var(--r-lg);
  border: 1px solid #d8dff0;
  background: #050816;
  aspect-ratio: 16 / 9;
}

.admin-preview-shell iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.empty-state {
  min-height: 48px;
  display: grid;
  place-items: center;
  border: 1px dashed #cbd5e1;
  border-radius: var(--r-md);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.6);
  font-size: 12.5px;
}

.admin-ops-body {
  min-height: 100vh;
  background: #eef2f7;
  color: #172033;
}

.admin-ops-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.topbar-copy {
  display: grid;
  gap: 1px;
}

.topbar-copy small {
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.admin-ops-layout {
  min-height: calc(100vh - 62px);
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 0;
}

.admin-ops-sidebar {
  position: sticky;
  top: 62px;
  height: calc(100vh - 62px);
  overflow: auto;
  padding: 18px 14px;
  border-right: 1px solid #dbe3ef;
  background: #f8fafc;
}

.admin-ops-side-title,
.admin-ops-head h1 {
  margin: 0;
  letter-spacing: 0;
}

.admin-ops-side-title {
  color: #334155;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-view-nav {
  display: grid;
  gap: 6px;
}

.admin-view-btn {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #475569;
  padding: 8px 10px;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
}

.admin-view-btn small {
  min-width: 24px;
  min-height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
}

.admin-view-btn:hover,
.admin-view-btn.is-active {
  border-color: #c8d5ea;
  background: #fff;
  color: #172033;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.admin-view-btn.is-active small {
  background: #1f3a5f;
  color: #fff;
}

.admin-ops-filters {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.admin-ops-main {
  min-width: 0;
  padding: 22px;
}

.admin-ops-head,
.admin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-ops-head {
  margin-bottom: 16px;
}

.admin-ops-head h1 {
  color: #111827;
  font-size: 26px;
  font-weight: 800;
}

.admin-ops-head p {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
}

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

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.admin-metric {
  min-height: 104px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.04);
}

.admin-metric span,
.kicker {
  color: #64748b;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-metric strong {
  color: #172033;
  font-size: 28px;
  line-height: 1;
}

.admin-metric small {
  color: #64748b;
  font-size: 11.5px;
}

.admin-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: start;
}

.admin-table-card {
  min-width: 0;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.admin-card-head {
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
}

.admin-card-head strong {
  display: block;
  margin-top: 2px;
  font-size: 15px;
}

.admin-player-table-wrap {
  min-width: 0;
}

.admin-player-row {
  display: grid;
  grid-template-columns: 12px minmax(190px, 1.35fr) minmax(96px, 0.55fr) minmax(140px, 0.75fr) minmax(104px, 0.55fr) minmax(104px, 0.55fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 10px 14px;
  border-bottom: 1px solid #edf2f7;
}

.admin-player-row:hover,
.admin-player-row.is-active {
  background: #f8fbff;
}

.admin-player-row.is-active {
  box-shadow: inset 3px 0 0 #3a7bd5;
}

.admin-player-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.admin-player-main strong,
.admin-player-main small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-player-main strong {
  color: #172033;
  font-size: 13.5px;
}

.admin-player-main small {
  color: #64748b;
  font-size: 11.5px;
}

.admin-player-cell {
  min-width: 0;
  display: flex;
  align-items: center;
}

.soft-badge {
  max-width: 100%;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  padding: 0 9px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.soft-badge.is-ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.soft-badge.is-info,
.soft-badge.is-eadx {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.soft-badge.is-warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.soft-badge.is-danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.soft-badge.is-muted,
.soft-badge.is-neutral {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #64748b;
}

.admin-quick-panel {
  display: grid;
  gap: 14px;
}

.admin-quick-actions {
  display: grid;
  gap: 8px;
}

.quick-action {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  padding: 9px 10px;
  text-align: left;
}

.quick-action:hover {
  border-color: #b9c7dd;
  background: #f8fbff;
}

.quick-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: #eef6ff;
  color: #1d4ed8;
  font-size: 16px;
}

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

.quick-action strong {
  font-size: 12.5px;
}

.quick-action small {
  color: #64748b;
  font-size: 11px;
}

.quick-action em {
  color: #1d4ed8;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.service-row {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #edf2f7;
}

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

.service-row span:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.service-row strong,
.service-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-row strong {
  font-size: 12.5px;
}

.service-row small {
  color: #64748b;
  font-size: 11px;
}

.admin-detail-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 45;
  width: min(1120px, 96vw);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #f8fafc;
  border-left: 1px solid #cbd5e1;
  box-shadow: -28px 0 70px rgba(15, 23, 42, 0.18);
  transform: translateX(110%);
  transition: transform 180ms ease;
}

.admin-detail-drawer.is-open {
  transform: translateX(0);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 44;
  background: rgba(15, 23, 42, 0.34);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.admin-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid #dbe3ef;
  background: #fff;
}

.admin-detail-head h2 {
  margin: 2px 0 8px;
  color: #111827;
  font-size: 22px;
  letter-spacing: 0;
}

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

.admin-detail-body {
  min-height: 0;
  overflow: auto;
  padding: 0 20px 20px;
}

.admin-detail-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-top: 12px;
  background: #f8fafc;
}

.admin-detail-tabs .nav-link {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.admin-detail-tabs .nav-link.active {
  color: #1d4ed8;
}

.detail-pane {
  display: none;
  padding-top: 14px;
}

.detail-pane.is-active {
  display: block;
}

.drawer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
  gap: 14px;
  align-items: start;
}

.admin-switch-stack {
  padding-top: 0;
}

.form-switch-row {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #edf2f7;
}

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

.form-switch-row .form-check-input {
  flex: 0 0 auto;
  margin: 0;
}

.drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

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

.caption-preset {
  min-height: 68px;
  display: grid;
  align-content: center;
  gap: 3px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  padding: 10px;
  text-align: left;
}

.caption-preset:hover,
.caption-preset.is-active {
  border-color: #93c5fd;
  background: #eff6ff;
}

.caption-preset strong {
  font-size: 12px;
}

.caption-preset span {
  color: #64748b;
  font-size: 11px;
}

.debug-help {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #64748b;
  padding: 12px;
  font-size: 12px;
}

@media (max-width: 1180px) {
  .admin-content-grid,
  .drawer-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 980px) {
  .admin-ops-layout {
    grid-template-columns: 1fr;
  }

  .admin-ops-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid #dbe3ef;
  }

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

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

  .admin-player-row {
    grid-template-columns: 12px minmax(0, 1fr) auto;
  }

  .admin-player-cell {
    grid-column: 2 / -1;
  }
}

@media (max-width: 640px) {
  .topbar-actions,
  .admin-ops-head {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-ops-main {
    padding: 14px;
  }

  .admin-metrics,
  .admin-quick-panel,
  .admin-view-nav,
  .caption-preset-grid {
    grid-template-columns: 1fr;
  }

  .admin-detail-drawer {
    width: 100vw;
  }

  .admin-detail-head {
    flex-direction: column;
  }
}

/* Embed runtime */
.embed-body {
  min-height: 100vh;
  background: #050816;
  overflow: hidden;
}

.np-player-root {
  width: 100vw;
  height: 100vh;
  min-height: 220px;
  background: #050816;
}

.np-player {
  --np-accent: #9333ea;
  --np-accent-rgb: 147, 51, 234;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 70% at 80% 0%, rgba(147, 51, 234, 0.18) 0%, transparent 60%),
    #050816;
  color: #fff;
}

.np-player[data-theme="minimal"] {
  background: #000;
}

.np-player[data-theme="dark"] {
  background:
    radial-gradient(ellipse 62% 52% at 12% 0%, rgba(58, 123, 213, 0.18) 0%, transparent 64%),
    #0b1020;
}

.np-media,
.np-media iframe,
.np-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.np-media video {
  object-fit: contain;
  background: #000;
}

.np-media iframe {
  border: 0;
  display: block;
  background: #000;
}

.np-player[data-adapter="youtube"] .np-media iframe,
.np-player[data-adapter="vimeo"] .np-media iframe {
  pointer-events: none;
}

.np-vimeo-mount {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.np-media video::cue {
  font-family: "Segoe UI", Arial, sans-serif;
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.np-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  background: linear-gradient(180deg, rgba(5, 8, 22, 0.42) 0%, transparent 28%);
}

.np-player:hover .np-overlay,
.np-player.is-paused .np-overlay { opacity: 1; }

.np-player:not(:hover):not(.is-paused) .np-overlay { opacity: 0.82; }

.np-topline {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 14px;
}

.np-brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  padding: 0;
  background: transparent;
  color: #fff;
  opacity: 0.68;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.42));
}

.np-brand img {
  height: 28px;
  max-width: 150px;
  display: block;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.np-brand--custom img {
  max-height: 32px;
  filter: none;
}

.np-controls {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 14px;
  background: linear-gradient(180deg, transparent 0%, rgba(5, 8, 22, 0.72) 78%);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.np-player:hover .np-controls,
.np-player.is-paused .np-controls,
.np-player:focus-within .np-controls {
  opacity: 1;
  transform: translateY(0);
}

.np-center-play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 6;
  width: 76px;
  height: 76px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(var(--np-accent-rgb), 0.94);
  color: #fff;
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.38);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: opacity 180ms ease, transform 180ms ease, background 180ms ease;
}

.np-center-play i {
  margin-left: 4px;
  font-size: 34px;
}

.np-center-play:hover {
  background: rgba(var(--np-accent-rgb), 0.98);
  transform: translate(-50%, -50%) scale(1.04);
}

.np-player:not(.is-paused) .np-center-play {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.94);
}

.np-ctrl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  transition: color 160ms ease, background 160ms ease;
}

.np-ctrl:hover {
  color: var(--np-accent);
}

.np-ctrl--icon {
  width: 34px;
  height: 34px;
  border-radius: 6px;
}

.np-ctrl--icon:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.np-time {
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.86);
  font-variant-numeric: tabular-nums;
  min-width: 42px;
  text-align: center;
}

.np-scrubber {
  flex: 1 1 auto;
  min-width: 80px;
  display: flex;
  align-items: center;
}

.np-volume {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.np-volume input[type="range"] {
  width: 72px;
}

.np-scrubber input[type="range"],
.np-volume input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  outline: none;
  cursor: pointer;
}

.np-scrubber input[type="range"] {
  width: 100%;
}

.np-scrubber input[type="range"]::-webkit-slider-thumb,
.np-volume input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--np-accent);
  border: 2px solid #fff;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.np-scrubber input[type="range"]::-moz-range-thumb,
.np-volume input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--np-accent);
  border: 2px solid #fff;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.np-captions-group {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.np-caption-btn {
  min-height: 26px;
  padding: 3px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.30);
  color: rgba(255, 255, 255, 0.82);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.np-caption-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.np-caption-btn.is-active {
  border-color: rgba(var(--np-accent-rgb), 0.92);
  background: rgba(var(--np-accent-rgb), 0.32);
  color: #fff;
}

.np-caption-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.np-caption-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  min-width: 150px;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(5, 8, 22, 0.92);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.36);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.np-captions-group.is-open .np-caption-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.np-caption-option {
  min-height: 30px;
  padding: 5px 9px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}

.np-caption-option:hover,
.np-caption-option.is-active {
  background: rgba(var(--np-accent-rgb), 0.26);
  color: #fff;
}

.np-caption-option:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.np-center-state {
  margin: auto;
  max-width: 560px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r-xl);
  background: rgba(15, 23, 42, 0.82);
  text-align: center;
  box-shadow: var(--shadow-float);
}

.np-center-state i {
  display: block;
  margin-bottom: 10px;
  color: var(--np-accent);
  font-size: 34px;
}

.np-center-state strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

.np-center-state span {
  color: #cbd5e1;
  font-size: 12.5px;
}

.np-caption {
  position: absolute;
  left: 50%;
  bottom: 78px;
  z-index: 4;
  width: max-content;
  max-width: min(90%, 920px);
  padding: 7px 16px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: clamp(15px, 2.35vw, 28px);
  font-weight: 600;
  line-height: 1.34;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: translate3d(-50%, 8px, 0);
  transition: opacity 180ms ease, transform 180ms ease;
  white-space: pre-wrap;
  word-break: break-word;
  pointer-events: none;
}

.np-caption.is-visible {
  opacity: 1;
  transform: translate3d(-50%, 0, 0);
}

.np-player.is-caption-menu-open .np-caption {
  bottom: 154px;
}

.np-player:fullscreen .np-caption {
  bottom: 110px;
  max-width: min(86%, 1280px);
  padding: 14px 28px;
  font-size: clamp(24px, 3.2vw, 42px);
  line-height: 1.28;
}

.np-player:fullscreen .np-controls {
  padding: 16px 26px 22px;
}

.np-player:fullscreen .np-caption-btn {
  min-height: 30px;
  padding: 4px 13px;
  font-size: 11.5px;
}

.np-player:fullscreen .np-ctrl--icon {
  width: 40px;
  height: 40px;
  font-size: 18px;
}

.np-player:fullscreen .np-time {
  font-size: 13px;
}

.np-error {
  position: absolute;
  right: 16px;
  bottom: 16px;
  left: 16px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: rgba(229, 62, 62, 0.90);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  pointer-events: none;
}

.np-unmute {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--np-accent, #9333ea);
  color: #fff;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  animation: np-unmute-pulse 1.4s ease-in-out infinite;
}

.np-unmute i {
  font-size: 15px;
}

.np-unmute:hover {
  filter: brightness(1.1);
}

@keyframes np-unmute-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}

/* Tela de carregamento (boot) — spinner centralizado enquanto a config nao chegou */
.np-boot {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.np-spinner {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--np-accent, #9333ea);
  animation: np-spin 0.8s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .np-spinner { animation-duration: 2.4s; }
}

@media (max-width: 960px) {
  .builder-layout {
    grid-template-columns: 1fr;
  }

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

  .admin-list-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding-right: 0;
    padding-bottom: 16px;
  }

  .sidebar {
    max-height: none;
  }

  .workspace {
    padding: 22px 16px 36px;
  }
}

@media (max-width: 640px) {
  .topbar-inner {
    height: auto;
    min-height: 60px;
    flex-wrap: wrap;
    padding: 12px 16px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .admin-token {
    width: 100%;
    order: 4;
  }

  .builder-layout {
    min-height: auto;
  }

  .admin-layout {
    padding: 14px;
  }

  .field-grid.two,
  .field-grid.three {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .watermark-admin {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .watermark-state {
    justify-content: center;
  }

  .check-stack {
    padding-top: 0;
  }

  .sidebar-scroll {
    padding: 14px 16px 18px;
  }

  .workspace-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace h2 {
    font-size: 21px;
  }

  .field-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .preview-shell {
    border-radius: var(--r-lg);
  }

  .np-overlay {
    padding: 12px;
  }

  .np-brand {
    max-width: 72%;
  }

  .np-brand img {
    height: 24px;
  }

  .np-caption {
    max-width: 96%;
    bottom: 70px;
    padding: 6px 12px;
    font-size: clamp(14px, 4vw, 20px);
  }

  .np-player.is-caption-menu-open .np-caption {
    bottom: 170px;
  }

  .np-controls {
    gap: 6px;
    padding: 10px 12px 12px;
  }

  .np-volume input[type="range"] {
    width: 56px;
  }

  .np-time {
    min-width: 36px;
    font-size: 11px;
  }

  .np-caption-btn {
    min-height: 26px;
    padding: 4px 9px;
    font-size: 9.5px;
  }
}

@media (max-width: 480px) {
  .np-controls {
    gap: 6px;
    padding: 10px 8px 12px;
  }

  .np-ctrl--icon {
    width: 30px;
    height: 30px;
  }

  .np-time {
    min-width: 34px;
    font-size: 11px;
  }

  .np-scrubber {
    min-width: 44px;
  }

  .np-captions-group {
    gap: 4px;
    margin-left: 0;
  }

  .np-caption-btn {
    min-height: 27px;
    padding: 3px 7px;
    font-size: 8.8px;
  }

  .np-center-play {
    width: 64px;
    height: 64px;
  }

  .np-center-play i {
    font-size: 29px;
  }

  .np-volume input[type="range"] {
    display: none;
  }
}

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

.summary-meta-grid > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  min-width: 0;
}

.summary-meta-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.summary-meta-grid strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.summary-output-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.summary-output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.summary-output {
  min-height: 180px;
  resize: vertical;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}
