:root {
  --sidebar: #172231;
  --sidebar2: #223247;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #64748b;
  --line: #dbe3ee;
  --blue: #2563eb;
  --green: #16a34a;
  --orange: #f59e0b;
  --purple: #7c3aed;
  --red: #dc2626;
  --darkred: #991b1b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  background: var(--sidebar);
  color: white;
  padding: 18px 14px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 8px 22px;
}
.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #315070;
  font-weight: 800;
}
.brand span { display: block; color: #a7b4c5; font-size: 12px; margin-top: 4px; }
nav a {
  display: block;
  color: #d9e5f2;
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 6px;
  margin: 3px 0;
}
nav a.active, nav a:hover { background: var(--sidebar2); color: #fff; }
.nav-section {
  display: block;
  margin: 14px 10px 5px;
  color: #8fa4ba;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
}
.main { margin-left: 248px; min-height: 100vh; }
.topbar {
  height: 58px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 2;
}
.topbar span { color: var(--muted); margin-left: 18px; }
.topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.page-head { padding: 26px 28px 10px; }
.page-head h1 { margin: 0 0 6px; font-size: 26px; }
.page-head p { margin: 0; color: var(--muted); }
.factory-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
}
.factory-head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.factory-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
  padding: 12px 28px;
}
.factory-kpis article {
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.factory-kpis span,
.factory-kpis small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}
.factory-kpis strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 30px;
  line-height: 1.1;
}
.factory-kpis .ai-connected strong { color: var(--green); font-size: 24px; }
.factory-kpis .ai-offline strong,
.factory-kpis .ai-warning strong { color: var(--orange); font-size: 24px; }
.factory-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.4fr) minmax(320px, .9fr);
  gap: 14px;
  padding: 0 28px;
}
.factory-grid > .panel {
  margin: 14px 0 0;
}
.section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}
.section-title h2 {
  margin: 0;
  font-size: 18px;
}
.section-title span,
.section-title a {
  color: var(--muted);
  font-size: 13px;
}
.section-title a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}
.flow-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.flow-steps div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}
.flow-steps b {
  display: block;
  font-size: 24px;
}
.flow-steps span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}
.progress-track {
  height: 9px;
  margin-top: 14px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.progress-track span {
  display: block;
  height: 100%;
  background: var(--green);
}
.blocker-list {
  display: grid;
  gap: 8px;
}
.blocker-list a {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff7ed;
  color: var(--text);
  text-decoration: none;
}
.blocker-list strong {
  font-size: 22px;
  color: var(--orange);
}
.capability-bars {
  display: grid;
  gap: 10px;
}
.capability-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fbff;
  overflow: hidden;
}
.capability-row span,
.capability-row b {
  position: relative;
  z-index: 1;
}
.capability-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.capability-row i {
  position: absolute;
  inset: 0 auto 0 0;
  background: #dbeafe;
}
.legacy-panel summary {
  cursor: pointer;
  font-weight: 700;
}
.legacy-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(100px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.legacy-grid div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}
.legacy-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.legacy-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}
.muted-note { color: var(--muted); margin: 12px 0 0; }
.grid.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  padding: 12px 28px;
}
.card, .panel, .review-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.card { padding: 18px; }
.card span { display: block; color: var(--muted); font-size: 13px; }
.card strong { display: block; margin-top: 6px; font-size: 28px; }
.panel, .review-card { margin: 14px 28px; padding: 18px; }
.panel h2 { margin: 0 0 14px; font-size: 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions.inline { gap: 6px; flex-wrap: nowrap; }
.actions.small { margin-top: 16px; }
.btn {
  border: 0;
  border-radius: 6px;
  color: white;
  padding: 9px 13px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  font-size: 14px;
}
.btn.mini { padding: 5px 8px; font-size: 12px; }
.btn-blue { background: var(--blue); }
.btn-green { background: var(--green); }
.btn-orange { background: var(--orange); }
.btn-purple { background: var(--purple); }
.btn-red { background: var(--red); }
.btn-gray { background: #475569; }
.btn:disabled {
  cursor: not-allowed;
  opacity: .48;
}
.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
code {
  display: block;
  background: #eef3f8;
  padding: 8px;
  border-radius: 6px;
  color: #334155;
  overflow-wrap: anywhere;
}
.log-window {
  margin: 0;
  min-height: 180px;
  max-height: 360px;
  overflow: auto;
  background: #101827;
  color: #d1e7d4;
  padding: 14px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.6;
}
.log-window.tall { min-height: 300px; }
.flash-wrap { padding: 14px 28px 0; }
.flash { padding: 10px 12px; border-radius: 6px; margin-bottom: 8px; background: #e2e8f0; }
.flash.success { background: #dcfce7; color: #166534; }
.flash.error { background: #fee2e2; color: #991b1b; }
.flash.warning { background: #fef3c7; color: #92400e; }
.flash.info { background: #dbeafe; color: #1e40af; }
.empty {
  margin: 20px 28px;
  padding: 24px;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}
.empty.compact { margin: 0; padding: 14px; }
.table-panel { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; vertical-align: top; }
th { background: #edf4fb; color: #223247; position: sticky; top: 0; z-index: 1; }
tr.expand-row { cursor: pointer; }
.detail-row { display: none; background: #f8fbff; }
.detail-row.open { display: table-row; }
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
}
.detail-grid p { margin: 6px 0 0; line-height: 1.55; }
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #e2e8f0;
  color: #334155;
}
.status-pending { background: #e5e7eb; color: #374151; }
.status-generating_source_video, .status-generating_mask, .status-generating_target_video { background: #dbeafe; color: #1d4ed8; }
.status-source_generating, .status-condition_extracting, .status-condition_visualizing, .status-target_generating { background: #dbeafe; color: #1d4ed8; }
.status-quality_checking { background: #fef3c7; color: #b45309; }
.status-source_qc, .status-target_qc { background: #fef3c7; color: #b45309; }
.status-review_needed { background: #ede9fe; color: #6d28d9; }
.status-pending_visual_review { background: #e0f2fe; color: #075985; }
.status-condition_review_needed, .status-target_review_needed { background: #ede9fe; color: #6d28d9; }
.status-accepted { background: #dcfce7; color: #15803d; }
.status-source_accepted, .status-condition_accepted { background: #dcfce7; color: #15803d; }
.status-rejected { background: #fee2e2; color: #b91c1c; }
.status-source_rejected, .status-condition_rejected { background: #fee2e2; color: #b91c1c; }
.status-failed { background: #fecaca; color: #7f1d1d; }
.status-idle { background: #e5e7eb; color: #374151; }
.status-running { background: #dbeafe; color: #1d4ed8; }
.status-queued { background: #e2e8f0; color: #334155; }
.status-completed { background: #dcfce7; color: #15803d; }
.status-registered { background: #e2e8f0; color: #334155; }
.status-needs_no_watermark_source { background: #fef3c7; color: #92400e; }
.status-ready_for_factory { background: #dcfce7; color: #15803d; }
.status-needs_manual_review { background: #ede9fe; color: #6d28d9; }
.status-download_failed { background: #fee2e2; color: #991b1b; }
.status-annotated { background: #dbeafe; color: #1d4ed8; }
.status-unannotated { background: #f1f5f9; color: #64748b; }
.status-needs_review { background: #ede9fe; color: #6d28d9; }
.status-pending_review { background: #e0f2fe; color: #075985; }
.status-needs_revision { background: #ffedd5; color: #9a3412; }
.status-approved { background: #dcfce7; color: #15803d; }
.progress {
  width: 120px;
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 4px;
}
.progress.big { width: 100%; height: 14px; margin: 12px 0; }
.progress span { display: block; height: 100%; background: var(--blue); }
.progress-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.progress-head h2 { margin-bottom: 4px; }
.progress-head p,
.progress-meta,
.ingest-item p {
  margin: 0;
  color: var(--muted);
}
.progress-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
}
.ingest-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.ingest-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fbff;
}
.ingest-item .progress {
  width: 100%;
  margin: 8px 0 6px;
}
.ingest-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.error-text { color: var(--darkred) !important; }
.current-job { padding: 14px; border: 1px solid var(--line); border-radius: 8px; }
.review-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.review-head h2 { margin: 0 0 14px; }
.video-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111827;
  border-radius: 8px;
  margin-bottom: 8px;
}
.mini-video {
  width: 220px;
  max-width: 28vw;
  border-radius: 6px;
  background: #111827;
  display: block;
  margin-top: 8px;
}
.mini-video.vertical {
  width: 160px;
  max-width: 22vw;
  aspect-ratio: 9 / 16;
  object-fit: contain;
}
.mini-thumb {
  width: 180px;
  max-width: 24vw;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #111827;
}
.vertical-thumb {
  width: 96px;
  max-width: 16vw;
  margin-top: 8px;
}
.sheet-thumb {
  width: 220px;
  max-width: 28vw;
  margin-top: 8px;
  display: block;
}
.media-stack {
  display: grid;
  gap: 7px;
  max-width: 360px;
}
.file-label {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-size: 12px;
  font-weight: 700;
}
.file-label.warn {
  background: #fef3c7;
  color: #92400e;
}
.muted-line {
  color: var(--muted);
  font-size: 12px;
}
.material-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.material-ingest-panel {
  padding: 16px;
}
.material-paste-form {
  display: grid;
  gap: 12px;
}
.material-paste-form label span,
.material-paste-form .check-row span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}
.material-paste-form .check-row span { margin-bottom: 0; }
.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px 16px;
}
.material-submit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.material-board {
  display: grid;
  gap: 14px;
  margin: 14px 28px 28px;
}
.material-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.material-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}
.material-card-head h2 {
  margin: 0 0 6px;
  font-size: 18px;
}
.material-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.material-message {
  margin: 10px 0 14px;
  color: var(--muted);
  line-height: 1.5;
}
.material-main {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(360px, 1fr);
  gap: 16px;
  align-items: start;
}
.material-preview {
  display: grid;
  gap: 8px;
  align-content: start;
}
.material-source-video {
  width: 190px;
  max-width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  margin: 0;
}
.material-video-missing {
  width: 190px;
  aspect-ratio: 9 / 16;
}
.material-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
}
.material-facts > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fbff;
  min-width: 0;
}
.material-facts span,
.material-facts small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.material-facts b {
  display: block;
  margin: 4px 0;
  font-size: 14px;
}
.material-facts code {
  max-height: 80px;
  overflow: auto;
  font-size: 11px;
}
.material-sheet {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  object-position: left center;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111827;
}
.clean-clips {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.clean-clips-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.clean-clips-head h3 {
  margin: 0;
  font-size: 15px;
}
.clean-clips-head span {
  color: var(--muted);
  font-size: 12px;
}
.clip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.clip-card {
  border-left: 3px solid var(--green);
  padding-left: 9px;
}
.clip-card.clip-review { border-left-color: var(--orange); }
.clip-card video {
  width: 120px;
  max-width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  margin: 0 0 6px;
}
.clip-meta b,
.clip-meta span {
  display: block;
  font-size: 12px;
  line-height: 1.45;
}
.clip-meta span { color: var(--muted); }
.material-details {
  margin-top: 14px;
  color: var(--muted);
}
.material-details summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 700;
  margin-bottom: 8px;
}
.material-page {
  padding: 18px 20px 24px;
}
.material-strip {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}
.material-strip h1 {
  margin: 0 0 4px;
  font-size: 24px;
}
.material-strip p {
  margin: 0;
  color: var(--muted);
}
.material-drop,
.material-live {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 12px;
}
.material-drop summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
  list-style-position: inside;
}
.material-drop[open] summary {
  margin-bottom: 10px;
}
.material-drop form {
  display: grid;
  gap: 8px;
}
.material-drop textarea,
.material-drop input[type="text"] {
  margin: 0;
}
.material-drop-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 1.2fr) auto auto;
  gap: 8px;
  align-items: center;
}
.material-note-input {
  min-height: 42px;
}
.material-live-head,
.material-download-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.material-count-progress,
.material-download-progress {
  width: 100%;
  margin: 8px 0;
}
.material-download-progress.unknown span {
  width: 100% !important;
  background: repeating-linear-gradient(45deg, #93c5fd, #93c5fd 8px, #2563eb 8px, #2563eb 16px);
  opacity: .8;
}
.material-progress-items {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}
.material-progress-pill {
  display: flex;
  width: 100%;
  min-width: 0;
  gap: 6px;
  align-items: center;
  justify-content: space-between;
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 12px;
}
.material-progress-pill b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.material-progress-pill span {
  flex: 0 0 auto;
}
.material-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(380px, 42vw);
  gap: 12px;
  align-items: start;
}
.material-workbench {
  position: sticky;
  top: 72px;
  display: grid;
  gap: 10px;
  min-width: 0;
}
.workbench-stage {
  position: relative;
  min-height: 360px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #111827;
  border: 1px solid #0f172a;
  border-radius: 8px;
}
.workbench-stage video {
  width: 100%;
  height: min(62vh, 680px);
  max-height: 680px;
  aspect-ratio: auto;
  object-fit: contain;
  margin: 0;
  border-radius: 0;
}
.workbench-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #cbd5e1;
  background: #111827;
  font-weight: 700;
}
.workbench-empty.hidden {
  display: none;
}
.workbench-annotation {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.workbench-head {
  display: grid;
  gap: 6px;
}
.workbench-head strong {
  font-size: 18px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.workbench-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.workbench-annotation form {
  display: grid;
  gap: 10px;
}
.intent-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.classification-result {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.classification-result.ok {
  color: #166534;
}
.classification-result.warn {
  color: #92400e;
}
.classification-result.muted {
  color: var(--muted);
}
.annotation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 10px;
}
.workbench-annotation label span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}
.material-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 10px;
  align-items: start;
}
.asset-tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.asset-tile.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px #bfdbfe;
}
.asset-video {
  position: relative;
  aspect-ratio: 9 / 16;
  background: #111827;
  overflow: hidden;
  cursor: pointer;
}
.asset-video video,
.asset-video img,
.asset-empty {
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
  border-radius: 0;
  pointer-events: none;
}
.asset-empty {
  display: grid;
  place-items: center;
  color: #cbd5e1;
}
.asset-badges {
  position: absolute;
  inset: 6px 6px auto 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.asset-badges span:not(.badge) {
  display: inline-flex;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .72);
  color: white;
  font-size: 11px;
  backdrop-filter: blur(8px);
}
.asset-caption {
  position: absolute;
  inset: auto 0 0;
  padding: 32px 8px 8px;
  color: white;
  background: linear-gradient(transparent, rgba(15, 23, 42, .86));
}
.asset-caption b,
.asset-caption span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.asset-caption b {
  font-size: 12px;
  line-height: 1.35;
}
.asset-caption span {
  margin-top: 2px;
  color: #cbd5e1;
  font-size: 11px;
}
.asset-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
  padding: 6px;
}
.asset-foot details {
  flex: 1;
  min-width: 0;
  text-align: right;
}
.asset-foot summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  list-style-position: inside;
}
.asset-foot details[open] {
  text-align: left;
  flex-basis: 100%;
}
.asset-foot p {
  margin: 8px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.asset-foot code {
  font-size: 11px;
  max-height: 84px;
  overflow: auto;
  margin-top: 6px;
}
.asset-clip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.asset-clip-list span {
  padding: 3px 6px;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  font-size: 11px;
}
.asset-clip-list span.review {
  background: #fef3c7;
  color: #92400e;
}
.asset-slice-viewer {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  margin: 8px 0;
}
.asset-slice {
  min-width: 0;
  border-left: 3px solid var(--green);
  padding-left: 6px;
}
.asset-slice.review {
  border-left-color: var(--orange);
}
.asset-slice video {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 6px;
  margin: 0 0 4px;
  background: #111827;
}
.asset-slice span,
.asset-slice em {
  display: block;
  font-size: 10px;
  line-height: 1.35;
  color: var(--muted);
  font-style: normal;
  overflow-wrap: anywhere;
}
.asset-slice em {
  color: var(--darkred);
}
.warning-panel {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border-color: #fde68a;
  background: #fffbeb;
}
.warning-panel strong {
  color: #92400e;
}
.warning-panel span {
  color: #92400e;
  line-height: 1.45;
}
.source-clip-kpis strong {
  color: #1f2937;
}
.source-clip-live {
  margin: 0 28px 14px;
}
.source-clip-rules {
  align-items: stretch;
}
.source-clip-rules > .panel {
  height: 100%;
}
.source-rule-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
}
.source-rule-list span {
  display: grid;
  min-height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  color: #223247;
  font-weight: 800;
  font-size: 13px;
  text-align: center;
}
.source-clip-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}
.source-clip-board {
  margin-bottom: 28px;
}
.source-asset-list {
  display: grid;
  gap: 12px;
}
.source-asset-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}
.source-asset-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}
.source-asset-head strong,
.source-asset-head span {
  display: block;
}
.source-asset-head strong {
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.source-asset-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.source-asset-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.source-asset-stats b {
  font-size: 18px;
}
.source-clip-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
}
.source-clip-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-left: 3px solid var(--orange);
  border-radius: 8px;
  padding: 8px;
  background: #fff7ed;
}
.source-clip-card.ok {
  border-left-color: var(--green);
  background: #f0fdf4;
}
.source-clip-card.review {
  border-left-color: var(--orange);
  background: #fff7ed;
}
.source-clip-card video {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  border-radius: 6px;
  margin: 0 0 7px;
  background: #111827;
}
.source-clip-card span,
.source-clip-card em {
  display: block;
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.source-clip-card span {
  color: var(--muted);
}
.source-clip-card em {
  margin-top: 3px;
  color: var(--darkred);
  font-style: normal;
}
.source-library-search {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(110px, 140px) auto;
  gap: 8px;
  align-items: center;
}
.source-library-search input,
.source-library-search select {
  margin: 0;
}
.source-library-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 28px 14px;
}
.source-library-tabs a {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
}
.source-library-tabs a.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px #bfdbfe;
}
.source-library-tabs span {
  font-size: 13px;
  font-weight: 800;
}
.source-library-tabs b {
  color: var(--muted);
  font-size: 13px;
}
.source-library-pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 0 28px 14px;
}
.source-library-pager span {
  color: var(--muted);
  font-size: 13px;
}
.source-library-pager div {
  display: flex;
  gap: 8px;
  align-items: center;
}
.disabled-link {
  pointer-events: none;
  opacity: .42;
}
.source-library-grid {
  display: grid;
  gap: 14px;
  padding: 0 28px 28px;
}
.source-library-card {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.source-library-card.state-rejected {
  border-color: #fed7aa;
}
.source-library-card.state-approved {
  border-color: #bbf7d0;
}
.source-library-card.state-deleted {
  opacity: .72;
}
.source-library-media video,
.source-library-media img,
.source-library-media .video-missing {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  margin: 0;
  border-radius: 8px;
  background: #111827;
}
.source-library-body {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.source-library-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.source-library-head strong,
.source-library-head span:not(.badge) {
  display: block;
}
.source-library-head strong {
  font-size: 16px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.source-library-head span:not(.badge) {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.source-library-next {
  min-height: 28px;
  display: flex;
  align-items: center;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}
.source-library-facts,
.source-library-reasons,
.source-library-rejects {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.source-library-facts span,
.source-library-reasons span {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 12px;
}
.source-library-facts span {
  background: #eef3f8;
  color: #334155;
}
.source-library-reasons span {
  background: #fff7ed;
  color: #9a3412;
}
.source-library-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(118px, 1fr));
  gap: 8px;
  margin: 0;
}
.source-library-meta div {
  min-width: 0;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
}
.source-library-meta dt {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.source-library-meta dd {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.source-library-meta small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.source-library-annotation {
  display: grid;
  gap: 6px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.source-library-annotation p {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  margin: 0;
  line-height: 1.45;
}
.source-library-annotation b {
  color: var(--muted);
  font-size: 12px;
}
.source-library-annotation span {
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.source-library-reason-block {
  display: grid;
  gap: 6px;
}
.source-library-reason-block strong {
  color: var(--muted);
  font-size: 12px;
}
.source-library-reason-block div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.source-library-reason-block span {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 12px;
}
.source-library-reason-block.rejected span {
  background: #fee2e2;
  color: #991b1b;
}
.source-library-reason-block.machine span {
  background: #fff7ed;
  color: #9a3412;
}
.source-library-paths {
  display: grid;
  gap: 5px;
}
.source-library-paths span,
.source-library-note {
  color: var(--muted);
  font-size: 12px;
}
.source-library-paths code {
  font-size: 11px;
  padding: 7px;
}
.source-library-note {
  margin: 0;
  line-height: 1.5;
}
.source-library-actions {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.source-library-actions form {
  display: grid;
  grid-template-columns: minmax(100px, .55fr) minmax(140px, 1fr) minmax(76px, auto);
  gap: 8px;
  align-items: center;
}
.source-library-actions form:nth-child(2) {
  grid-template-columns: minmax(220px, 1.1fr) minmax(100px, .55fr) minmax(130px, .8fr) minmax(130px, .8fr) minmax(76px, auto);
}
.source-library-actions input[type="text"] {
  margin: 0;
}
.source-library-rejects label {
  color: var(--muted);
  font-size: 12px;
}
.source-clip-list-limit {
  margin-top: 14px;
}
.source-clip-list-limit a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}
.status-machine_ready { background: #dbeafe; color: #1d4ed8; }
.status-approved { background: #dcfce7; color: #15803d; }
.status-rejected { background: #fee2e2; color: #b91c1c; }
.status-deleted { background: #e5e7eb; color: #374151; }
.review-actions { display: flex; gap: 10px; margin: 14px 0; }
.reject-box {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.checks {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 8px;
  margin: 10px 0;
}
input[type="text"] {
  width: 100%;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 10px;
}
select {
  width: 100%;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
}
textarea {
  width: 100%;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  resize: vertical;
  font: inherit;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px 16px;
}
.form-grid label span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}
.form-grid .wide { grid-column: 1 / -1; }
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.check-row input { margin: 0; }
.check-row span { margin: 0 !important; }
.danger-panel { border-color: #fecaca; }
.criteria-grid, .condition-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px;
}
.criteria-grid p { margin: 6px 0 0; line-height: 1.55; color: var(--muted); }
.condition-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 14px 28px;
  padding: 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.condition-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.condition-head h2 { margin: 0 0 6px; font-size: 18px; }
.condition-head p { margin: 0; color: var(--muted); }
.condition-videos {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 14px;
  margin: 16px 0;
}
.video-cell {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fbff;
}
.video-cell b { display: block; margin-bottom: 8px; }
.video-missing {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  background: #111827;
  color: #cbd5e1;
  border-radius: 8px;
  margin-bottom: 8px;
}
.condition-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}
.annotator-page {
  padding: 16px 18px 22px;
}
.annotator-only-body {
  background: #eef3f8;
}
.annotator-only-page {
  width: min(1720px, 100%);
  margin: 0 auto;
}
.annotator-only-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 12px;
}
.annotator-only-head h1 {
  margin: 0 0 4px;
  font-size: 24px;
}
.annotator-workbench-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 10px;
}
.annotator-workbench-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.annotator-workbench-tab.active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}
.annotator-workbench-tab b {
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #1d4ed8;
  color: #fff;
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
}
.annotator-workbench-tab:not(.active):hover {
  border-color: #93c5fd;
  color: #1d4ed8;
}
.annotator-only-head p {
  margin: 0;
  color: var(--muted);
}
.annotator-session {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.annotator-session strong {
  display: block;
  font-weight: 700;
  color: var(--text);
}
.annotator-session span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.annotator-auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #eef3f8;
}
.annotator-login-panel {
  width: min(420px, calc(100vw - 28px));
}
.annotator-login-card {
  display: grid;
  gap: 18px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .08);
}
.annotator-login-card h1 {
  margin: 4px 0 6px;
  font-size: 26px;
}
.annotator-login-card p {
  margin: 0;
  color: var(--muted);
}
.login-kicker {
  display: inline-block;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.login-form {
  display: grid;
  gap: 12px;
}
.login-form label span,
.admin-create-grid label span,
.inline-form label span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}
.admin-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.admin-head h2 {
  margin: 0 0 6px;
}
.admin-head p {
  margin: 0;
  color: var(--muted);
}
.admin-head a {
  color: var(--blue);
  font-weight: 700;
}
.admin-create-grid {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(120px, .8fr) auto;
  gap: 10px;
  align-items: end;
}
.workflow-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}
.workflow-stats div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.workflow-stats b {
  display: block;
  font-size: 26px;
  line-height: 1.1;
}
.workflow-stats span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.workflow-kpis strong {
  color: #1f2937;
}
.workflow-main-grid {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(320px, 380px);
  gap: 14px;
  padding: 0 28px;
  align-items: start;
}
.workflow-main-grid > .panel,
.workflow-side > .panel {
  margin: 14px 0 0;
}
.workflow-side {
  display: grid;
  gap: 14px;
}
.workflow-map-panel {
  overflow: hidden;
}
.workflow-stage-list {
  display: grid;
  gap: 12px;
}
.workflow-stage {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: #fff;
}
.workflow-stage.status-warning {
  border-left-color: var(--orange);
  background: #fffaf0;
}
.workflow-stage.status-running {
  border-left-color: var(--blue);
  background: #f8fbff;
}
.workflow-stage.status-gap {
  border-left-color: var(--red);
  background: #fff7f7;
}
.workflow-stage-index {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e2e8f0;
  color: #334155;
  font-weight: 900;
}
.workflow-stage-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.workflow-stage-head strong,
.workflow-stage-head span {
  display: block;
}
.workflow-stage-head strong {
  font-size: 16px;
  line-height: 1.35;
}
.workflow-stage-head span:not(.badge) {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.workflow-status-ok { background: #dcfce7; color: #15803d; }
.workflow-status-warning { background: #fef3c7; color: #92400e; }
.workflow-status-running { background: #dbeafe; color: #1d4ed8; }
.workflow-status-gap { background: #fee2e2; color: #991b1b; }
.workflow-stage-metric {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-top: 10px;
}
.workflow-stage-metric b {
  font-size: 26px;
  line-height: 1;
}
.workflow-stage-metric span {
  color: var(--muted);
  font-size: 13px;
}
.workflow-io {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 0;
}
.workflow-io div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 250, 252, .85);
}
.workflow-io dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.workflow-io dd {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.45;
}
.workflow-rule {
  margin: 10px 0 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.55;
}
.workflow-stage-link {
  display: inline-flex;
  margin-top: 10px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}
.workflow-stage-gap-note {
  color: var(--darkred);
}
.workflow-blockers {
  display: grid;
  gap: 8px;
}
.workflow-blockers a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff7ed;
  color: var(--text);
  text-decoration: none;
}
.workflow-blockers strong {
  color: var(--orange);
  font-size: 22px;
}
.workflow-blockers span {
  color: #475569;
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}
.workflow-principles {
  display: grid;
  gap: 10px;
}
.workflow-principles p {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}
.workflow-principles b {
  color: #223247;
}
.workflow-principles span {
  color: #475569;
  font-size: 13px;
  line-height: 1.5;
}
.workflow-runtime {
  display: grid;
  gap: 10px;
}
.workflow-runtime div {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}
.workflow-runtime span,
.workflow-runtime small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.workflow-runtime b {
  display: block;
  margin: 5px 0 3px;
  font-size: 20px;
}
.workflow-legacy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.workflow-legacy-grid a {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text);
  text-decoration: none;
}
.workflow-legacy-grid strong,
.workflow-legacy-grid span {
  display: block;
}
.workflow-legacy-grid strong {
  font-size: 14px;
}
.workflow-legacy-grid span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.annotator-metric-cards {
  padding-top: 0;
}
.operator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}
.operator-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}
.operator-card.risk-high {
  border-color: #fecaca;
  background: #fff7f7;
}
.operator-card.risk-medium {
  border-color: #fed7aa;
  background: #fffbf4;
}
.operator-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.operator-card-head strong,
.operator-card-head span {
  display: block;
}
.operator-card-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.operator-state,
.risk-label {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}
.state-online,
.risk-low {
  background: #dcfce7;
  color: #166534;
}
.state-idle,
.risk-medium {
  background: #fef3c7;
  color: #92400e;
}
.state-offline,
.state-never,
.risk-none {
  background: #e5e7eb;
  color: #475569;
}
.risk-high {
  background: #fee2e2;
  color: #991b1b;
}
.operator-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}
.operator-stats span {
  min-width: 0;
  padding: 8px;
  border-radius: 7px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.operator-stats b {
  display: block;
  color: var(--text);
  font-size: 15px;
  line-height: 1.15;
}
.operator-pulse {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 12px;
  align-items: center;
  margin: 0 0 14px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #f8fafc;
}
.operator-pulse span,
.operator-pulse small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.operator-pulse strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.2;
}
.operator-pulse small {
  margin-top: 3px;
  font-weight: 700;
}
.operator-wave {
  display: flex;
  height: 36px;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}
.operator-wave span {
  display: block;
  width: 5px;
  height: 6px;
  border-radius: 999px;
  background: #cbd5e1;
  opacity: .72;
  transform-origin: center;
}
.pulse-active {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.pulse-active .operator-wave span {
  height: 18px;
  background: linear-gradient(180deg, #22c55e, #2563eb);
  opacity: 1;
  animation: operator-wave 900ms ease-in-out infinite;
  animation-delay: calc(var(--i) * -70ms);
}
.pulse-active.pulse-l3 .operator-wave span,
.pulse-active.pulse-l4 .operator-wave span {
  animation-duration: 680ms;
}
.pulse-active.pulse-l4 {
  border-color: #86efac;
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, .18);
}
.pulse-still .operator-wave span {
  height: 5px;
}
.pulse-still strong {
  color: #64748b;
}
@keyframes operator-wave {
  0%, 100% {
    transform: scaleY(.45);
  }
  45% {
    transform: scaleY(1.35);
  }
}
.operator-bars {
  display: grid;
  gap: 8px;
}
.operator-bars label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.operator-bars i {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}
.operator-bars em {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: var(--blue);
}
.operator-bars em.focus {
  background: var(--green);
}
.operator-bars em.idle {
  background: var(--orange);
}
.operator-bars em.risk {
  background: var(--red);
}
.operator-heat {
  display: grid;
  grid-template-columns: repeat(24, minmax(4px, 1fr));
  gap: 3px;
  margin-top: 12px;
}
.operator-heat span {
  height: 18px;
  border-radius: 3px;
  background: #e2e8f0;
}
.operator-heat .heat-l1 { background: #bfdbfe; }
.operator-heat .heat-l2 { background: #60a5fa; }
.operator-heat .heat-l3 { background: #2563eb; }
.operator-heat .heat-l4 { background: #1d4ed8; }
.operator-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}
.operator-foot span {
  min-width: 0;
}
.admin-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.annotator-user-link {
  color: var(--ink);
  text-decoration: none;
}
.annotator-user-link:hover {
  color: var(--blue);
  text-decoration: underline;
}
.reset-form {
  display: flex;
  gap: 6px;
  align-items: center;
}
.reset-form input {
  width: 112px;
  padding: 6px 8px;
}
.muted {
  color: var(--muted);
  font-size: 12px;
}
.annotator-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 12px;
}
.annotator-head h1 {
  margin: 0 0 4px;
  font-size: 24px;
}
.annotator-head p,
.annotator-current p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.annotator-name {
  width: min(260px, 100%);
}
.annotator-name span,
.annotator-form label span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}
.annotator-shell {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(520px, 1fr);
  gap: 12px;
  align-items: start;
}
.annotator-queue,
.annotator-work {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.annotator-queue {
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 92px);
  display: grid;
  grid-template-rows: auto auto 1fr;
  padding: 10px;
}
.annotator-filter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}
.annotator-filter button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbff;
  color: var(--muted);
  padding: 7px 4px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}
.annotator-filter button.active {
  border-color: var(--blue);
  background: #dbeafe;
  color: #1d4ed8;
}
.annotator-list {
  display: grid;
  gap: 8px;
  overflow: auto;
  padding-right: 2px;
}
.annotator-task {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 9px;
  width: 100%;
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.annotator-task.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px #bfdbfe;
}
.annotator-thumb {
  width: 54px;
  aspect-ratio: 9 / 16;
  display: block;
  overflow: hidden;
  border-radius: 6px;
  background: #111827;
}
.annotator-thumb img,
.annotator-thumb-empty {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.annotator-thumb-empty {
  display: grid;
  place-items: center;
  color: #cbd5e1;
  font-size: 11px;
}
.annotator-task-body {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 4px;
}
.annotator-task-body strong,
.annotator-task-body span:not(.badge) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.annotator-task-body strong {
  font-size: 13px;
  line-height: 1.3;
  color: var(--text);
}
.annotator-task-body span:not(.badge) {
  color: var(--muted);
  font-size: 12px;
}
.annotator-list-empty {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}
.annotator-work {
  display: grid;
  gap: 12px;
  padding: 12px;
}
.annotator-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 430px;
  background: #111827;
  border: 1px solid #0f172a;
  border-radius: 8px;
  overflow: hidden;
}
.annotator-stage video {
  width: 100%;
  height: min(62vh, 720px);
  object-fit: contain;
  margin: 0;
  border-radius: 0;
}
.annotator-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #111827;
  color: #cbd5e1;
  font-weight: 700;
}
.annotator-empty.hidden {
  display: none;
}
.stage-nav {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 46px;
  height: 70px;
  transform: translateY(-50%);
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 8px;
  background: rgba(15, 23, 42, .38);
  color: rgba(255, 255, 255, .92);
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background .15s ease, transform .15s ease, opacity .15s ease;
}
.stage-nav:hover {
  background: rgba(15, 23, 42, .62);
  transform: translateY(-50%) scale(1.03);
}
.stage-nav:active {
  transform: translateY(-50%) scale(.98);
}
.stage-nav-prev {
  left: 14px;
}
.stage-nav-next {
  right: 14px;
}
.stage-trim {
  position: absolute;
  left: 50%;
  right: auto;
  bottom: 16px;
  z-index: 5;
  width: min(620px, calc(100% - 112px));
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 8px;
  background: rgba(15, 23, 42, .62);
  color: #fff;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
}
.stage-trim-head,
.stage-trim-foot {
  display: grid;
  grid-template-columns: minmax(52px, 1fr) auto minmax(52px, 1fr);
  gap: 8px;
  align-items: center;
}
.stage-trim-head span,
.stage-trim-head strong {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.stage-trim-head strong {
  justify-self: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, .92);
  font-weight: 800;
}
.stage-trim-head span:last-child {
  justify-self: end;
}
.stage-trim-track {
  position: relative;
  height: 28px;
  cursor: pointer;
  touch-action: none;
}
.stage-trim-track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 6px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: rgba(226, 232, 240, .34);
}
.stage-trim-window {
  position: absolute;
  top: 50%;
  left: 0;
  width: 0;
  height: 8px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: #60a5fa;
}
.stage-trim-playhead {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 2px;
  transform: translateX(-1px);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, .25), 0 0 10px rgba(255, 255, 255, .55);
  pointer-events: none;
}
.stage-trim-playhead::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -2px;
  width: 8px;
  height: 8px;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 2px;
  background: #fff;
}
.stage-trim-handle {
  position: absolute;
  top: 50%;
  width: 26px;
  height: 26px;
  padding: 0;
  transform: translate(-50%, -50%);
  border: 2px solid #fff;
  border-radius: 999px;
  background: #2563eb;
  cursor: grab;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .32);
}
.stage-trim-handle:active {
  cursor: grabbing;
}
.stage-trim-handle::after {
  content: "";
  position: absolute;
  inset: 7px 10px;
  border-left: 2px solid rgba(255, 255, 255, .9);
  border-right: 2px solid rgba(255, 255, 255, .9);
}
.stage-trim-foot {
  grid-template-columns: minmax(0, 1fr) auto;
}
.stage-trim-foot span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #dbeafe;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.stage-trim-foot b,
.stage-trim-foot em {
  font: inherit;
}
.stage-trim-foot em.ok {
  color: #bbf7d0;
}
.stage-trim-foot em.warn {
  color: #fde68a;
}
.stage-trim-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}
.stage-trim-controls button {
  min-height: 28px;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 7px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}
.stage-trim-controls button:hover {
  background: rgba(255, 255, 255, .2);
}
.annotator-current {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.annotator-current h2 {
  margin: 6px 0 4px;
  font-size: 20px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.annotator-clips,
.annotator-quality,
.annotator-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.annotator-clips span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  font-size: 12px;
}
.annotator-clips span.review {
  background: #fef3c7;
  color: #92400e;
}
.annotator-clips em {
  margin-left: 4px;
  font-style: normal;
  color: var(--darkred);
}
.annotator-quality {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}
.annotator-review-gate,
.annotator-edit-flow {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.annotator-review-gate.approved {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.annotator-review-gate strong,
.edit-flow-head strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}
.annotator-review-gate span,
.edit-flow-head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.review-gate-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.review-gate-actions .btn {
  width: 100%;
  text-align: center;
  font-weight: 800;
}
.annotator-edit-flow[hidden] {
  display: none;
}
.source-clip-trim-summary {
  width: min(420px, calc(100% - 112px));
}
.source-clip-trim-summary .stage-trim-head,
.source-clip-trim-summary .stage-trim-track {
  display: none;
}
.source-clip-trim-summary .stage-trim-foot {
  grid-template-columns: minmax(0, 1fr) auto;
}
.annotator-form {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.annotator-wide {
  min-width: 0;
}
.annotator-actions {
  align-items: center;
}
body.annotator-only-body {
  height: 100vh;
  overflow: hidden;
  background: #f6f8fb;
}
.annotator-only-body .annotator-page {
  padding: 14px;
}
.annotator-only-page {
  max-width: none;
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}
.annotator-only-head {
  margin: 0;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.annotator-only-head h1 {
  font-size: 21px;
  line-height: 1.2;
}
.annotator-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.annotator-counts span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}
.annotator-only-body .annotator-session {
  min-width: 310px;
  justify-content: space-between;
  box-shadow: none;
}
.annotator-only-body .annotator-shell {
  grid-template-columns: 304px minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
  height: 100%;
}
.annotator-only-body .annotator-queue {
  position: static;
  max-height: none;
  height: 100%;
  padding: 0;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  overflow: hidden;
}
.annotator-queue-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}
.annotator-queue-head strong {
  font-size: 14px;
}
.annotator-queue-head span {
  color: var(--muted);
  font-size: 12px;
}
.annotator-only-body .annotator-filter {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 2px;
  margin: 10px 10px 8px;
  padding: 3px;
  border-radius: 8px;
  background: #eef2f7;
}
.annotator-only-body .annotator-filter button {
  border: 0;
  background: transparent;
  border-radius: 6px;
  padding: 7px 2px;
  color: #64748b;
  font-weight: 700;
}
.annotator-only-body .annotator-filter button.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
}
.annotator-only-body [data-annotator-search] {
  width: calc(100% - 20px);
  margin: 0 10px 10px;
  background: #f8fafc;
}
.annotator-only-body .annotator-list {
  gap: 0;
  padding: 0 8px 8px;
}
.annotator-only-body .annotator-task {
  grid-template-columns: 48px 1fr;
  gap: 10px;
  padding: 8px;
  border: 0;
  border-bottom: 1px solid #edf2f7;
  border-radius: 0;
  box-shadow: none;
}
.annotator-only-body .annotator-task:hover {
  background: #f8fafc;
}
.annotator-only-body .annotator-task.active {
  border-color: #edf2f7;
  background: #eff6ff;
  box-shadow: inset 3px 0 0 var(--blue);
}
.annotator-only-body .annotator-thumb {
  width: 48px;
  border-radius: 7px;
}
.annotator-only-body .annotator-work {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.annotator-main-column {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.annotator-only-body .annotator-stage {
  min-height: 0;
  height: 100%;
  border: 0;
  border-radius: 8px 8px 0 0;
  background: #0f172a;
}
.annotator-only-body .annotator-stage video {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
}
.annotator-only-body .annotator-current {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.annotator-only-body .annotator-current h2 {
  margin: 6px 0 5px;
  font-size: 18px;
}
.annotator-only-body .annotator-current p {
  font-size: 12px;
}
.annotator-only-body .annotator-clips {
  padding: 0 14px 12px;
  max-height: 88px;
  overflow: auto;
}
.annotator-decision-panel {
  min-height: 0;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.decision-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.decision-title strong {
  font-size: 16px;
}
.decision-title span {
  color: var(--muted);
  font-size: 12px;
}
.annotator-source-chat {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}
.source-chat-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.source-chat-head strong {
  font-size: 14px;
}
.source-chat-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.source-chat-log {
  display: grid;
  gap: 6px;
  max-height: 112px;
  overflow: auto;
}
.source-chat-log p {
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 7px 9px;
  border-radius: 8px;
  background: #e2e8f0;
  color: #334155;
  font-size: 12px;
  line-height: 1.45;
}
.source-chat-log p.user {
  justify-self: end;
  background: #dbeafe;
  color: #1d4ed8;
}
.source-chat-log p.ok {
  background: #dcfce7;
  color: #166534;
}
.source-chat-log p.warn {
  background: #fee2e2;
  color: #991b1b;
}
.source-chat-form {
  display: grid;
  gap: 8px;
}
.source-chat-form div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.annotator-only-body .annotator-form {
  gap: 12px;
  border-top: 0;
  padding-top: 0;
}
.annotator-only-body .annotator-form label span {
  color: #475569;
  font-weight: 700;
}
.annotator-only-body textarea,
.annotator-only-body select,
.annotator-only-body input[type="text"],
.annotator-only-body input[type="password"] {
  border-radius: 7px;
  background: #f8fafc;
}
.annotator-only-body textarea:focus,
.annotator-only-body select:focus,
.annotator-only-body input:focus {
  outline: 2px solid #bfdbfe;
  border-color: var(--blue);
  background: #fff;
}
.annotator-only-body .intent-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}
.annotator-qc-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.annotator-qc-strip span {
  min-width: 0;
  padding: 8px;
  border-radius: 7px;
  background: #eef2f7;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.submit-guard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.submit-guard span {
  min-width: 0;
  padding: 8px;
  border-radius: 7px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.submit-guard span.done {
  background: #dcfce7;
  color: #166534;
}
.submit-guard span.active {
  background: #dbeafe;
  color: #1d4ed8;
}
.annotator-only-body .annotation-grid {
  grid-template-columns: 1fr;
  gap: 10px;
}
.annotator-only-body .annotator-quality {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 10px;
  background: #f8fafc;
}
.annotator-only-body .check-row {
  min-height: 30px;
}
.annotator-only-body .annotator-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.annotator-only-body .annotator-actions .btn {
  width: 100%;
  text-align: center;
  font-weight: 800;
}
.annotator-only-body [data-annotator-save-result] {
  min-height: 18px;
}
.annotator-auth-body {
  background: #f6f8fb;
}
.annotator-login-card {
  box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
}
.ai-review-page {
  gap: 14px;
}
.ai-review-shell {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
}
.ai-review-queue {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  min-height: 0;
  max-height: calc(100vh - 112px);
  overflow: auto;
}
.ai-review-work {
  display: grid;
  grid-template-columns: minmax(420px, 1.35fr) minmax(360px, .9fr);
  gap: 14px;
  min-width: 0;
}
.ai-review-video-panel {
  position: relative;
  min-height: 520px;
  background: #05070b;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.ai-review-video-panel video {
  width: 100%;
  height: 100%;
  min-height: 520px;
  object-fit: contain;
  background: #05070b;
}
.ai-review-detail {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.ai-review-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.ai-review-title h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}
.ai-review-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.ai-review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ai-review-grid article {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  min-width: 0;
}
.ai-review-grid article.wide {
  grid-column: 1 / -1;
}
.ai-review-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}
.ai-review-grid p {
  margin: 0;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ai-review-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
@media (max-width: 1180px) {
  .ai-review-shell,
  .ai-review-work {
    grid-template-columns: 1fr;
  }
  .ai-review-queue {
    max-height: 320px;
  }
}
@media (max-width: 1100px) {
  .grid.cards,
  .factory-kpis { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
  .detail-grid, .video-compare, .meta-grid, .criteria-grid, .condition-meta, .condition-videos, .ingest-items, .form-grid, .form-row, .material-main, .material-facts, .material-workspace, .annotation-grid, .annotator-shell { grid-template-columns: 1fr; }
  .factory-grid,
  .workflow-main-grid,
  .workflow-io,
  .workflow-stats,
  .flow-steps,
  .legacy-grid,
  .source-rule-list { grid-template-columns: 1fr; }
  .factory-head,
  .factory-head-actions { align-items: stretch; }
  .source-asset-head,
  .source-library-head,
  .warning-panel {
    flex-direction: column;
    align-items: stretch;
  }
  .source-library-card,
  .source-library-meta,
  .source-library-actions form,
  .source-library-actions form:nth-child(2),
  .source-library-search,
  .source-library-pager {
    grid-template-columns: 1fr;
  }
  .source-library-pager {
    display: grid;
  }
  .material-head, .material-card-head, .material-submit-row { flex-direction: column; align-items: stretch; }
  .material-source-video, .material-video-missing { width: min(220px, 100%); }
  .material-page { padding: 12px 10px 18px; }
  .material-strip { flex-direction: column; }
  .material-drop-row { grid-template-columns: 1fr; }
  .material-workbench { position: static; order: -1; }
  .workbench-stage { min-height: 300px; }
  .workbench-stage video { height: min(62vh, 640px); }
  .material-wall {
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 8px;
  }
  .asset-caption b { font-size: 11px; }
  .asset-foot .btn.mini { padding: 4px 6px; }
  .annotator-queue {
    position: static;
    max-height: 380px;
  }
  .annotator-stage {
    min-height: 320px;
  }
  body.annotator-only-body {
    height: auto;
    overflow: auto;
  }
  .annotator-only-page {
    height: auto;
    min-height: 100vh;
  }
  .annotator-only-body .annotator-shell,
  .annotator-only-body .annotator-work {
    height: auto;
    grid-template-columns: 1fr;
  }
  .annotator-only-body .annotator-stage {
    min-height: 420px;
  }
  .annotator-only-body .annotator-queue {
    max-height: 360px;
  }
  .annotator-head,
  .annotator-only-head,
  .admin-head,
  .factory-head,
  .annotator-current {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-create-grid {
    grid-template-columns: 1fr;
  }
  .workflow-side {
    gap: 0;
  }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .material-workspace {
    grid-template-columns: minmax(220px, 1fr) minmax(320px, 42vw);
  }
  .material-workbench {
    position: sticky;
    top: 72px;
    order: 0;
  }
  .annotation-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .material-workspace,
  .annotation-grid {
    grid-template-columns: 1fr;
  }
  .material-workbench {
    position: static;
    order: -1;
  }
  .annotator-only-body .annotator-page {
    padding: 8px;
  }
  .annotator-only-head,
  .annotator-only-body .annotator-session {
    min-width: 0;
  }
  .annotator-only-body .annotator-stage {
    min-height: 300px;
  }
  .stage-nav {
    width: 38px;
    height: 58px;
    font-size: 28px;
  }
  .stage-nav-prev {
    left: 8px;
  }
  .stage-nav-next {
    right: 8px;
  }
  .stage-trim {
    bottom: 10px;
    width: calc(100% - 58px);
    padding: 8px;
  }
  .stage-trim-head,
  .stage-trim-foot span,
  .stage-trim-controls button {
    font-size: 11px;
  }
  .annotator-only-body .annotator-filter,
  .annotator-qc-strip,
  .submit-guard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .workflow-stage {
    grid-template-columns: 1fr;
  }
  .workflow-stage-index {
    width: 30px;
    height: 30px;
  }
  .workflow-principles p {
    grid-template-columns: 1fr;
  }
}
