:root {
  color-scheme: light;
  --bg: #f4f6f4;
  --bg-band: #e8f0ec;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --surface-strong: #edf3f0;
  --ink: #17211e;
  --ink-soft: #34433f;
  --muted: #687571;
  --line: #d9e1dd;
  --blue: #2f5fd0;
  --blue-soft: #eaf0ff;
  --green: #0f7a55;
  --green-soft: #e9f7f1;
  --amber: #9b6400;
  --amber-soft: #fff5dd;
  --red: #b42318;
  --red-soft: #fff0ee;
  --shadow: 0 18px 45px rgba(31, 45, 40, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, var(--bg-band) 0, var(--bg) 320px),
    var(--bg);
  font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button,
select,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
}

button {
  min-height: 40px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

button:hover {
  border-color: #b7c5bf;
  box-shadow: 0 8px 18px rgba(23, 33, 30, 0.08);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.55;
}

button.primary {
  color: #ffffff;
  border-color: var(--blue);
  background: var(--blue);
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface-soft);
  outline: none;
}

textarea {
  min-height: 190px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 95, 208, 0.14);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  color: #10201b;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  font-size: 16px;
  line-height: 1.2;
}

h3 {
  margin-top: 8px;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.25;
}

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

.shell {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 0 22px;
}

.brand-block {
  display: grid;
  gap: 7px;
}

.eyebrow {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.headline-copy {
  max-width: 620px;
  color: var(--ink-soft);
  font-size: 15px;
}

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

.engine-card,
.status-pill {
  border: 1px solid rgba(23, 33, 30, 0.12);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 26px rgba(31, 45, 40, 0.07);
  backdrop-filter: blur(12px);
}

.engine-card {
  display: grid;
  grid-template-columns: 12px minmax(112px, auto);
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 9px 12px;
  border-radius: 8px;
}

.engine-card span:not(.engine-dot) {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.engine-card strong {
  display: block;
  margin-top: 1px;
  font-size: 16px;
  line-height: 1.1;
}

.engine-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--amber);
  box-shadow: 0 0 0 5px rgba(155, 100, 0, 0.12);
}

.engine-card.ready .engine-dot {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(15, 122, 85, 0.13);
}

.engine-card.ready strong {
  color: var(--green);
}

.engine-card.offline .engine-dot {
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(180, 35, 24, 0.12);
}

.engine-card.offline strong {
  color: var(--red);
}

.status-pill {
  min-width: 128px;
  padding: 10px 13px;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}

.status-pill.ok {
  color: var(--green);
  border-color: rgba(15, 122, 85, 0.26);
  background: var(--green-soft);
}

.status-pill.fail {
  color: var(--red);
  border-color: rgba(180, 35, 24, 0.24);
  background: var(--red-soft);
}

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

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric {
  position: relative;
  min-height: 96px;
  overflow: hidden;
  padding: 17px 16px 15px;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #b7c5bf;
}

.metric.ready::before {
  background: var(--green);
}

.metric.warn::before {
  background: var(--amber);
}

.metric.offline::before {
  background: var(--red);
}

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

.metric strong {
  display: block;
  margin-top: 12px;
  overflow-wrap: normal;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.15;
  white-space: normal;
}

.metric.ready strong {
  color: var(--green);
}

.metric.warn strong {
  color: var(--amber);
}

.metric.offline strong {
  color: var(--red);
}

.tabs {
  display: inline-flex;
  gap: 4px;
  margin: 0 0 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.tab {
  min-width: 118px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.tab:hover {
  box-shadow: none;
}

.tab.active {
  color: #ffffff;
  border-color: var(--ink);
  background: var(--ink);
}

.tab-view {
  display: none;
}

.tab-view.active {
  display: block;
}

.youtube-ops {
  display: grid;
  gap: 14px;
}

.youtube-work-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.youtube-work-tab {
  min-height: 42px;
  font-weight: 800;
}

.youtube-work-tab.active {
  color: #ffffff;
  border-color: var(--ink);
  background: var(--ink);
}

.youtube-work-panel {
  display: none;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.youtube-work-panel.active {
  display: grid;
}

.ops-panel {
  min-width: 0;
  overflow: hidden;
}

.ops-workbench,
.ops-control,
.ops-mined-videos,
.ops-ready-videos {
  grid-column: 1 / -1;
}

.ops-title-backlog,
.ops-official-queue,
.ops-channel-control,
.ops-downloads,
.ops-models,
.ops-diag-storage,
.ops-diag-checklist {
  grid-column: span 6;
}

.ops-summary {
  grid-column: span 8;
}

.ops-thumbnail,
.ops-upload,
.ops-qa {
  grid-column: span 4;
}

.ops-copy {
  grid-column: span 8;
}

.ops-tracks,
.ops-agents {
  grid-column: 1 / -1;
}

.workbench-body,
.ops-summary-body,
.upload-form,
.copy-grid,
.asset-list,
.qa-list,
.model-list,
.agent-list,
.storage-log-list,
.funnel-grid,
.title-backlog,
.official-queue,
.ready-video-list,
.channel-control-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

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

.funnel-item {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.funnel-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.funnel-item strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  line-height: 1.1;
}

.workbench-body {
  grid-template-columns: minmax(0, 1fr);
}

.workbench-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.workbench-main > .status-tag {
  justify-self: start;
}

.workbench-main h3 {
  margin: 0;
  font-size: 28px;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.workbench-main p {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.workbench-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.workbench-status-grid div,
.storage-log-row {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.workbench-status-grid span,
.storage-log-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.workbench-status-grid strong,
.storage-log-row strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.workbench-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.workbench-actions button,
.workbench-actions .button-link {
  width: 100%;
}

.url-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  align-items: end;
}

.url-flow label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.url-flow label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.url-flow output {
  grid-column: span 1;
}

.title-row,
.official-row,
.channel-row {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.title-row:first-child,
.official-row:first-child,
.channel-row:first-child {
  border-top: 0;
}

.title-row {
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: start;
}

.title-row > span:first-child {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 12px;
  font-weight: 900;
}

.title-row strong,
.official-row strong,
.channel-row strong {
  overflow-wrap: anywhere;
}

.title-row p,
.official-row p,
.channel-row p {
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
}

.official-row,
.channel-row {
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.35fr);
}

.official-meta,
.channel-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
  align-content: start;
}

.official-meta span,
.channel-meta span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
}

.production-job-list {
  display: grid;
  gap: 12px;
}

.production-job-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.production-job-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 0.24fr);
  gap: 12px;
  align-items: start;
}

.production-job-head strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.production-job-head p,
.production-log,
.production-error {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
}

.production-job-meta {
  display: grid;
  gap: 4px;
  justify-items: end;
  color: var(--muted);
  font-size: 12px;
}

.production-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.production-step {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(155, 100, 0, 0.2);
  border-radius: 8px;
  background: var(--surface);
}

.production-step span,
.production-step strong {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.production-step.ready {
  border-color: rgba(15, 122, 85, 0.24);
  background: var(--green-soft);
}

.production-step.offline {
  border-color: rgba(180, 35, 24, 0.24);
  background: var(--red-soft);
}

.production-error {
  color: var(--red);
  font-weight: 800;
}

.ready-video-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.ready-video-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 0.32fr);
  gap: 16px;
  align-items: start;
}

.ready-video-head strong {
  display: block;
  margin-top: 8px;
  overflow-wrap: anywhere;
  font-size: 18px;
}

.ready-video-head p {
  margin: 5px 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.ready-video-meta {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.ready-copy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ready-copy-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.ready-copy-grid label.wide {
  grid-column: 1 / -1;
}

.ready-copy-grid label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.ready-copy-grid textarea {
  min-height: auto;
  resize: vertical;
}

.scraper-inline,
.ready-url-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.ready-url-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.ready-url-grid label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.ops-title-block {
  display: grid;
  gap: 8px;
}

.ops-title-block .status-tag {
  justify-self: start;
}

.ops-title-block h3 {
  margin: 0;
  font-size: 20px;
}

.ops-title-block p,
.asset-meta p,
.model-row p,
.agent-row p {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
}

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

.ops-stat-grid div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.ops-stat-grid span,
.asset-meta span,
.model-stats span,
.agent-meta span {
  display: block;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
}

.agent-skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.agent-skill-list span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--surface);
  font-size: 12px;
  font-weight: 800;
}

.agent-flow-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.agent-flow-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.agent-flow-head span {
  color: var(--muted);
  font-size: 12px;
}

.agent-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
}

.agent-flow-node {
  position: relative;
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.agent-flow-node span {
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
}

.agent-flow-node strong,
.agent-flow-node p,
.agent-flow-node small {
  overflow-wrap: anywhere;
}

.agent-flow-node p,
.agent-flow-node small {
  color: var(--muted);
  font-size: 11px;
}

.ops-stat-grid strong {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-row,
.qa-row,
.model-row,
.agent-row {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.asset-row:first-child,
.qa-row:first-child,
.model-row:first-child,
.agent-row:first-child {
  border-top: 0;
}

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

.asset-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.asset-meta strong,
.model-row strong,
.agent-row strong {
  overflow-wrap: anywhere;
}

.asset-actions {
  display: flex;
  justify-content: end;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
}

.button-link.primary {
  color: #ffffff;
  border-color: var(--blue);
  background: var(--blue);
}

.disabled-link {
  pointer-events: none;
  opacity: 0.45;
}

.thumbnail-frame {
  padding: 16px;
}

.thumbnail-frame img {
  display: block;
  width: 100%;
  min-height: 160px;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-soft);
}

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

.copy-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.copy-field.wide {
  grid-column: 1 / -1;
}

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

.copy-field textarea {
  min-height: auto;
}

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

.qa-row strong.ok {
  color: var(--green);
}

.qa-row strong.warn {
  color: var(--amber);
}

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

.model-stats,
.agent-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.table-wrap {
  max-height: 720px;
  overflow: auto;
}

.ops-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  font-size: 13px;
}

.ops-table th,
.ops-table td {
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.ops-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 12px;
  text-transform: uppercase;
}

.ops-table td {
  background: #ffffff;
}

.ops-table td strong,
.ops-table td span {
  display: block;
  overflow-wrap: anywhere;
}

.ops-table td span {
  color: var(--muted);
  font-size: 12px;
}

.workspace,
.suno-workspace {
  display: grid;
  grid-template-columns: minmax(360px, 500px) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.composer {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.compact-grid {
  grid-template-columns: minmax(110px, 0.82fr) minmax(130px, 1fr) minmax(110px, 0.85fr);
  align-items: end;
}

.form-row {
  display: grid;
  gap: 6px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.check-row input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--blue);
}

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

.session-line {
  min-height: 24px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-panel {
  display: grid;
  grid-template-rows: auto minmax(480px, 1fr);
  min-height: 100%;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-strong);
  border-radius: 8px 8px 0 0;
}

.panel-head span {
  color: var(--muted);
  font-size: 13px;
}

.task-list {
  display: grid;
  align-content: start;
  gap: 12px;
  max-height: 760px;
  overflow: auto;
  padding: 16px;
}

.task-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

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

.task-head p {
  margin-top: 5px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.status-tag {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid rgba(155, 100, 0, 0.25);
  border-radius: 999px;
  color: var(--amber);
  background: var(--amber-soft);
  font-size: 12px;
  font-weight: 900;
}

.status-tag.ready {
  color: var(--green);
  border-color: rgba(15, 122, 85, 0.24);
  background: var(--green-soft);
}

.status-tag.offline {
  color: var(--red);
  border-color: rgba(180, 35, 24, 0.24);
  background: var(--red-soft);
}

.track-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.track-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.track-card img {
  width: 82px;
  height: 82px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-strong);
}

.track-body {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.track-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.track-title strong,
.track-body p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-title span,
.track-body p,
.empty {
  color: var(--muted);
  font-size: 13px;
}

audio {
  width: 100%;
  min-height: 36px;
}

.track-links {
  display: flex;
  gap: 12px;
  font-size: 13px;
}

.empty {
  padding: 14px;
}

.empty.compact {
  padding: 4px 0 0;
}

.events {
  margin-top: 14px;
}

.events pre {
  min-height: 150px;
  max-height: 240px;
  margin: 0;
  overflow: auto;
  padding: 16px;
  color: #25322e;
  background: var(--surface-soft);
  border-radius: 0 0 8px 8px;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
}

@media (max-width: 1080px) {
  .status-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .youtube-work-panel {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .ops-workbench,
  .ops-summary,
  .ops-downloads,
  .ops-thumbnail,
  .ops-upload,
  .ops-qa,
  .ops-models,
  .ops-agents,
  .ops-diag-storage,
  .ops-diag-checklist,
  .ops-title-backlog,
  .ops-official-queue,
  .ops-ready-videos,
  .ops-channel-control,
  .ops-copy,
  .ops-tracks {
    grid-column: 1 / -1;
  }

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

  .workbench-status-grid,
  .workbench-actions,
  .url-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .url-flow output {
    grid-column: 1 / -1;
  }

  .workspace,
  .suno-workspace {
    grid-template-columns: 1fr;
  }

  .task-panel {
    grid-template-rows: auto minmax(340px, 1fr);
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1320px);
    padding-top: 16px;
  }

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

  .topbar-actions,
  .engine-card,
  .status-pill {
    width: 100%;
  }

  .topbar-actions {
    justify-content: stretch;
  }

  .form-grid,
  .compact-grid,
  .ops-stat-grid,
  .copy-grid {
    grid-template-columns: 1fr;
  }

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

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

  .workbench-status-grid,
  .workbench-actions,
  .url-flow {
    grid-template-columns: 1fr;
  }

  .workbench-main h3 {
    font-size: 22px;
  }

  .tabs,
  .actions {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
  }

  .actions button,
  .tab {
    flex: 1 1 140px;
  }

  .asset-row,
  .copy-inline,
  .qa-row,
  .title-row,
  .official-row,
  .ready-video-head,
  .ready-copy-grid,
  .scraper-inline,
  .storage-log-row,
  .channel-row {
    grid-template-columns: 1fr;
  }

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

  .asset-actions,
  .copy-inline button {
    justify-content: stretch;
    width: 100%;
  }

  .button-link,
  .copy-inline button {
    width: 100%;
  }

  .track-card {
    grid-template-columns: 1fr;
  }

  .track-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
  }
}

/* YouTube Ops redesign: studio control-room layout */
:root {
  --bg: #edf3ef;
  --bg-band: #dfeae3;
  --surface: #fbfdf9;
  --surface-soft: #f3f7f2;
  --surface-strong: #e7efe8;
  --ink: #0f241e;
  --ink-soft: #314640;
  --muted: #61736b;
  --line: #c8d6cd;
  --blue: #245d88;
  --blue-soft: #e3eef6;
  --green: #08724e;
  --green-soft: #e0f3e9;
  --amber: #9c6500;
  --amber-soft: #fff0c9;
  --red: #b42318;
  --red-soft: #fde7e3;
  --action: #0d6f4f;
  --action-hover: #0a5f43;
  --shadow: 0 12px 32px rgba(18, 38, 31, 0.08);
  --shadow-soft: 0 6px 18px rgba(18, 38, 31, 0.06);
}

html {
  scrollbar-gutter: stable;
}

body {
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(15, 36, 30, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 36, 30, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, var(--bg-band) 0, var(--bg) 360px);
  background-size: 44px 44px, 44px 44px, 100% 100%;
  font: 16px/1.48 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

::selection {
  color: #ffffff;
  background: var(--green);
}

.shell {
  width: min(1480px, calc(100% - 36px));
  max-width: 100%;
  padding: 20px 0 44px;
}

.topbar {
  align-items: center;
  margin-bottom: 14px;
  padding: 18px 20px;
  border: 1px solid rgba(15, 36, 30, 0.13);
  border-radius: 8px;
  background: rgba(251, 253, 249, 0.92);
  box-shadow: var(--shadow-soft);
}

.brand-block {
  gap: 4px;
}

.eyebrow {
  color: var(--green);
  font-size: 11px;
}

h1 {
  font-size: clamp(30px, 3.2vw, 44px);
  line-height: 1.04;
}

.headline-copy {
  max-width: 760px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.engine-card,
.status-pill,
.panel,
.button-link,
button,
input,
select,
textarea {
  border-radius: 8px;
}

.engine-card,
.status-pill {
  background: var(--surface);
  box-shadow: none;
  backdrop-filter: none;
}

.engine-card {
  min-height: 50px;
}

.status-pill {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

button,
.button-link {
  min-height: 44px;
  border-color: #bdccc4;
  background: #ffffff;
  box-shadow: none;
  font-weight: 800;
}

button:hover,
.button-link:hover {
  border-color: #90a79b;
  box-shadow: 0 8px 18px rgba(15, 36, 30, 0.08);
}

button.primary,
.button-link.primary {
  color: #ffffff;
  border-color: var(--action);
  background: var(--action);
}

button.primary:hover,
.button-link.primary:hover {
  border-color: var(--action-hover);
  background: var(--action-hover);
}

input,
select,
textarea {
  min-height: 44px;
  border-color: #c4d2ca;
  background: #ffffff;
}

textarea {
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
.button-link:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(36, 93, 136, 0.18);
  outline: none;
}

.status-grid {
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.panel {
  border-color: rgba(15, 36, 30, 0.14);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric {
  min-height: 82px;
  padding: 13px 14px 12px;
  background: rgba(251, 253, 249, 0.96);
  box-shadow: none;
}

.metric::before {
  width: 5px;
  background: #9fb2a8;
}

.metric span,
label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0;
}

.metric strong {
  margin-top: 8px;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.tabs {
  display: flex;
  width: fit-content;
  margin-bottom: 16px;
  padding: 5px;
  border-color: rgba(15, 36, 30, 0.14);
  background: rgba(251, 253, 249, 0.92);
  box-shadow: var(--shadow-soft);
}

.tab {
  min-width: 126px;
  min-height: 42px;
  color: var(--ink-soft);
  font-weight: 900;
}

.tab.active {
  color: #ffffff;
  border-color: var(--ink);
  background: var(--ink);
}

.youtube-ops {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.youtube-work-tabs {
  position: sticky;
  top: 14px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  grid-column: 1;
  padding: 8px;
  border-color: rgba(15, 36, 30, 0.14);
  background: rgba(251, 253, 249, 0.94);
  box-shadow: var(--shadow-soft);
}

.youtube-work-tabs::before {
  content: "Fluxo";
  padding: 7px 9px 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.youtube-work-tab {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 12px;
  border-color: transparent;
  color: var(--ink-soft);
  background: transparent;
  text-align: left;
}

.youtube-work-tab::before {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid #c2d0c7;
  border-radius: 7px;
  color: var(--muted);
  background: #ffffff;
  font: 800 11px/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.youtube-work-tab:nth-child(1)::before {
  content: "01";
}

.youtube-work-tab:nth-child(2)::before {
  content: "02";
}

.youtube-work-tab:nth-child(3)::before {
  content: "03";
}

.youtube-work-tab:nth-child(4)::before {
  content: "04";
}

.youtube-work-tab.active {
  color: #ffffff;
  border-color: var(--ink);
  background: var(--ink);
}

.youtube-work-tab.active::before {
  color: var(--ink);
  border-color: #ffffff;
  background: #ffffff;
}

.youtube-work-panel {
  grid-column: 2;
  min-width: 0;
  max-width: 100%;
}

.youtube-work-panel.active {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.ops-workbench {
  grid-column: span 9;
}

.ops-thumbnail {
  grid-column: span 3;
}

.ops-copy,
.ops-control,
.ops-mined-videos,
.ops-production-jobs,
.ops-tracks,
.ops-agents {
  grid-column: 1 / -1;
}

.ops-title-backlog,
.ops-official-queue {
  grid-column: span 5;
}

.ops-channel-control {
  grid-column: span 7;
}

.ops-ready-videos {
  grid-column: span 7;
}

.ops-summary {
  grid-column: span 8;
}

.ops-qa {
  grid-column: span 4;
}

.ops-downloads,
.ops-diag-storage,
.ops-models,
.ops-diag-checklist {
  grid-column: span 6;
}

.panel-head {
  min-height: 56px;
  padding: 13px 16px;
  border-bottom-color: rgba(15, 36, 30, 0.12);
  background: #f8fbf7;
}

.panel-head h2 {
  color: var(--ink);
  font-size: 15px;
}

.panel-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ops-workbench {
  border-color: rgba(8, 114, 78, 0.36);
}

.ops-workbench .panel-head {
  color: #ffffff;
  border-bottom-color: rgba(255, 255, 255, 0.13);
  background: var(--ink);
}

.ops-workbench .panel-head h2,
.ops-workbench .panel-head span {
  color: #ffffff;
}

.ops-workbench .panel-head button {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.1);
}

.workbench-body,
.ops-summary-body,
.upload-form,
.copy-grid,
.asset-list,
.qa-list,
.model-list,
.agent-list,
.storage-log-list,
.funnel-grid,
.title-backlog,
.official-queue,
.ready-video-list,
.channel-control-list,
.production-job-list {
  gap: 14px;
  padding: 16px;
}

.workbench-body {
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-areas:
    "main actions"
    "url url";
}

.workbench-main {
  grid-area: main;
  padding: 18px;
  border: 1px solid rgba(8, 114, 78, 0.18);
  border-radius: 8px;
  background: #f7fbf6;
}

.workbench-main h3 {
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.08;
}

.workbench-main p {
  color: var(--ink-soft);
  font-size: 15px;
}

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

.workbench-status-grid div,
.storage-log-row,
.ops-stat-grid div,
.funnel-item {
  border-color: rgba(15, 36, 30, 0.12);
  background: #ffffff;
  box-shadow: none;
}

.workbench-status-grid strong,
.storage-log-row strong,
.ops-stat-grid strong,
.funnel-item strong {
  font-variant-numeric: tabular-nums;
}

.workbench-status-grid strong {
  overflow-wrap: break-word;
  word-break: normal;
}

.workbench-actions {
  grid-area: actions;
  grid-template-columns: 1fr;
  align-content: start;
  padding: 12px;
  border: 1px solid rgba(15, 36, 30, 0.12);
  border-radius: 8px;
  background: var(--surface-soft);
}

.workbench-actions button,
.workbench-actions .button-link {
  justify-content: center;
  min-height: 46px;
}

.url-flow {
  grid-area: url;
  grid-template-columns: minmax(0, 1fr) max-content max-content;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid rgba(15, 36, 30, 0.12);
  border-radius: 8px;
  background: #ffffff;
}

.url-flow output {
  grid-column: span 3;
  align-self: center;
  min-height: 20px;
}

.thumbnail-frame {
  padding: 14px;
}

.thumbnail-frame img {
  min-height: 190px;
  border-color: rgba(15, 36, 30, 0.14);
  background:
    linear-gradient(90deg, rgba(15, 36, 30, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(15, 36, 30, 0.06) 1px, transparent 1px),
    var(--surface-soft);
  background-size: 28px 28px;
}

.copy-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
}

.copy-field textarea,
.ready-copy-grid textarea {
  min-height: 112px;
}

.copy-field.wide {
  grid-column: 1 / -1;
}

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

.funnel-item {
  min-height: 86px;
}

.funnel-item strong {
  font-size: 24px;
}

.title-row,
.official-row,
.channel-row,
.asset-row,
.qa-row,
.model-row,
.agent-row {
  border-top: 0;
  border: 1px solid rgba(15, 36, 30, 0.11);
  border-radius: 8px;
  background: #ffffff;
}

.title-row {
  grid-template-columns: 34px minmax(0, 1fr) auto;
}

.title-row > span:first-child {
  width: 30px;
  height: 30px;
  background: var(--surface-strong);
}

.official-row,
.channel-row {
  grid-template-columns: minmax(0, 1fr) minmax(210px, 0.36fr);
  align-items: start;
}

.production-job-list {
  display: grid;
  gap: 14px;
}

.production-job-card,
.ready-video-card,
.task-card,
.track-card {
  border-color: rgba(15, 36, 30, 0.12);
  background: #ffffff;
  box-shadow: none;
}

.production-job-head {
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.22fr);
}

.production-job-meta {
  padding: 10px;
  border: 1px solid rgba(15, 36, 30, 0.1);
  border-radius: 8px;
  background: var(--surface-soft);
}

.production-steps {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.production-step {
  border-color: rgba(156, 101, 0, 0.2);
}

.ready-video-card {
  padding: 16px;
}

.ready-video-head {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.32fr);
}

.ready-video-head strong {
  font-size: 20px;
}

.ready-video-meta {
  padding: 12px;
  border: 1px solid rgba(15, 36, 30, 0.11);
  border-radius: 8px;
  background: var(--surface-soft);
}

.ready-copy-grid {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.8fr);
}

.ready-url-grid,
.scraper-inline {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  padding: 12px;
  border: 1px solid rgba(15, 36, 30, 0.1);
  border-radius: 8px;
  background: var(--surface-soft);
}

.ops-stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.asset-row {
  grid-template-columns: minmax(0, 1fr) minmax(118px, auto);
}

.model-row,
.agent-row {
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.26fr);
  align-items: start;
}

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

.agent-row {
  align-content: start;
}

.agent-skill-list span,
.status-tag {
  border-radius: 7px;
}

.agent-skill-list span {
  border-color: rgba(36, 93, 136, 0.18);
  color: var(--blue);
  background: var(--blue-soft);
}

.agent-flow-card {
  grid-column: 1 / -1;
  padding: 16px;
  border: 1px solid rgba(15, 36, 30, 0.12);
  border-radius: 8px;
  background: #ffffff;
}

.agent-flow {
  grid-template-columns: repeat(auto-fit, minmax(156px, 1fr));
  gap: 10px;
}

.agent-flow-node {
  min-height: 128px;
  align-content: start;
  border-color: rgba(15, 36, 30, 0.12);
  border-left: 4px solid var(--green);
  background: var(--surface-soft);
}

.agent-flow-node span {
  color: var(--green);
}

.table-wrap {
  max-height: 680px;
  border-top: 1px solid rgba(15, 36, 30, 0.1);
}

.ops-table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.ops-table th {
  color: var(--ink-soft);
  background: #edf4ee;
  font-size: 11px;
  letter-spacing: 0;
}

.ops-table td {
  background: #ffffff;
}

.ops-table tr:nth-child(even) td {
  background: #f8fbf7;
}

.ops-table th,
.ops-table td {
  border-top-color: rgba(15, 36, 30, 0.09);
}

.status-tag {
  min-height: 26px;
  padding: 3px 8px;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.session-line {
  color: var(--muted);
  font-size: 12px;
}

.events {
  margin-top: 18px;
  box-shadow: var(--shadow-soft);
}

.events pre {
  max-height: 190px;
  background: #f5f8f3;
}

@media (max-width: 1280px) {
  .youtube-ops {
    grid-template-columns: 1fr;
  }

  .youtube-work-tabs {
    position: static;
    grid-column: 1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .youtube-work-tabs::before {
    display: none;
  }

  .youtube-work-panel {
    grid-column: 1;
  }

  .ops-workbench,
  .ops-thumbnail,
  .ops-copy,
  .ops-control,
  .ops-title-backlog,
  .ops-channel-control,
  .ops-production-jobs,
  .ops-official-queue,
  .ops-ready-videos,
  .ops-summary,
  .ops-qa,
  .ops-tracks,
  .ops-downloads,
  .ops-diag-storage,
  .ops-models,
  .ops-diag-checklist,
  .ops-agents {
    grid-column: 1 / -1;
  }

  .workbench-body {
    grid-template-columns: 1fr;
    grid-template-areas:
      "main"
      "actions"
      "url";
  }

  .workbench-actions {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .url-flow {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

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

@media (max-width: 820px) {
  body {
    background-size: 36px 36px, 36px 36px, 100% 100%;
  }

  .shell {
    width: min(100%, calc(100% - 20px));
    padding-top: 12px;
  }

  .topbar {
    align-items: stretch;
    padding: 14px;
  }

  .tabs,
  .youtube-work-tabs {
    width: 100%;
  }

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

  .youtube-work-tab {
    min-height: 46px;
  }

  .youtube-work-panel.active {
    grid-template-columns: 1fr;
  }

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

  .workbench-status-grid,
  .workbench-actions,
  .url-flow,
  .copy-grid,
  .ready-copy-grid,
  .ready-video-head,
  .ready-url-grid,
  .scraper-inline,
  .official-row,
  .channel-row,
  .asset-row,
  .model-row,
  .agent-row,
  .ops-stat-grid,
  .production-job-head,
  .agent-list {
    grid-template-columns: 1fr;
  }

  .panel-head {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .panel-head button {
    width: 100%;
  }

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

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

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

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

  .tab {
    min-width: 0;
    padding: 0 8px;
    font-size: 15px;
  }

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

  .tabs .tab:first-child {
    grid-column: 1 / -1;
  }

  .youtube-work-tab {
    min-width: 0;
    padding: 0 8px;
    font-size: 15px;
  }

  .workbench-main {
    padding: 14px;
  }

  h1 {
    font-size: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}
