:root {
  color-scheme: dark;
  --bg: #050508;
  --bg-soft: #0a0a10;
  --panel: rgba(17, 17, 23, 0.78);
  --panel-strong: rgba(24, 24, 31, 0.94);
  --surface: rgba(255, 255, 255, 0.045);
  --surface-strong: rgba(255, 255, 255, 0.075);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f7f7fb;
  --muted: #9aa0ad;
  --faint: #667085;
  --purple: #7c3aed;
  --purple-2: #a855f7;
  --cyan: #67e8f9;
  --green: #59d982;
  --gold: #f4c86b;
  --red: #ff6b6b;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(120deg, rgba(124, 58, 237, 0.16), transparent 34%, rgba(103, 232, 249, 0.035) 78%, transparent),
    linear-gradient(180deg, #050508 0%, #090911 54%, #060609 100%);
  background-size: 42px 42px, 42px 42px, auto, auto;
  color: var(--text);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0%, rgba(124, 58, 237, 0.12) 42%, rgba(124, 58, 237, 0.22) 58%, transparent 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 28%);
  content: "";
}

button,
textarea,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.beta-gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 52% 42%, rgba(124, 58, 237, 0.34), transparent 34%),
    rgba(5, 5, 8, 0.78);
  backdrop-filter: blur(16px);
}

.beta-gate-card {
  display: grid;
  width: min(440px, 100%);
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.082), rgba(255, 255, 255, 0.035)),
    rgba(13, 13, 20, 0.92);
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.58), 0 0 44px rgba(124, 58, 237, 0.22);
  padding: 26px;
}

.beta-gate-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(168, 85, 247, 0.42);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.88), rgba(168, 85, 247, 0.62));
  color: white;
  box-shadow: 0 18px 42px rgba(124, 58, 237, 0.28);
  padding: 11px;
}

.beta-gate-card h2 {
  margin: 0;
  font-size: clamp(26px, 5vw, 34px);
  line-height: 1.08;
  letter-spacing: 0;
}

.beta-gate-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.7;
}

.beta-gate-card label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.beta-gate-card input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  outline: none;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  padding: 13px 14px;
}

.beta-gate-card input:focus {
  border-color: rgba(168, 85, 247, 0.78);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.16);
}

.beta-login-error {
  min-height: 18px;
  color: #ffb4b4 !important;
}

.agent-workbench.is-beta-locked {
  pointer-events: none;
  user-select: none;
  filter: blur(3px) brightness(0.72);
}

.agent-workbench {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  gap: 18px;
  width: min(1880px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
}

.work-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.028)),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.input-panel {
  display: flex;
  max-height: calc(100vh - 48px);
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  padding: 20px;
}

.preview-panel {
  display: grid;
  max-height: calc(100vh - 48px);
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: 16px;
  overflow: hidden;
  padding: 20px;
}

.preview-panel.is-vr-manual {
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  overflow-y: auto;
  padding: 16px;
  scrollbar-width: thin;
}

.preview-panel.is-vr-results {
  grid-template-rows: auto minmax(280px, 1fr) minmax(178px, min(32vh, 320px));
  gap: 12px;
  min-height: 0;
}

.preview-panel.is-vr-manual .result-header {
  align-items: center;
  padding-bottom: 10px;
}

.preview-panel.is-vr-manual .result-header .eyebrow {
  display: none;
}

.preview-panel.is-vr-manual .result-header h2 {
  font-size: clamp(24px, 2vw, 32px);
}

.preview-panel.is-vr-manual .result-header p:last-child {
  line-height: 1.35;
}

.preview-panel.is-vr-manual .process-dock,
.preview-panel.is-vr-manual .result-actions,
.preview-panel.is-vr-results .process-dock,
.preview-panel.is-vr-results .result-actions {
  display: none;
}

.preview-panel.is-vr-results .result-gallery,
.preview-panel.is-vr-results .result-grid {
  min-height: 0;
}

.preview-panel.is-vr-results .result-grid {
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  max-height: 100%;
  overflow-y: auto;
  padding-bottom: 12px;
}

.preview-panel.is-vr-results .caption-panel {
  display: grid;
  min-height: 0;
  max-height: min(32vh, 320px);
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  padding: 12px;
}

.preview-panel.is-vr-results .caption-variants {
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}

.preview-panel.is-vr-results .caption-helper {
  font-size: 11px;
  line-height: 1.45;
}

.panel-header {
  display: grid;
  gap: 10px;
}

.hero-header {
  padding-bottom: 4px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.brand-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--purple), var(--purple-2));
  color: #fff;
  box-shadow: 0 14px 30px rgba(124, 58, 237, 0.36);
  padding: 7px;
}

.eyebrow {
  margin: 0;
  color: #b9a8ff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 9.4em;
  font-size: 42px;
  line-height: 1.06;
  letter-spacing: 0;
  background: linear-gradient(180deg, #fff, #b9bfce);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h2 {
  font-size: 24px;
  line-height: 1.18;
  letter-spacing: 0;
}

h3 {
  font-size: 16px;
  line-height: 1.25;
}

.panel-header p:last-child {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.result-header {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.task-form {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 14px;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  padding: 5px;
}

.mode-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
}

.mode-button.is-active {
  background: rgba(124, 58, 237, 0.28);
  color: #f4efff;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 12px 30px rgba(124, 58, 237, 0.18);
}

.mode-button.is-disabled {
  position: relative;
  cursor: not-allowed;
  opacity: 0.55;
}

.mode-button.is-disabled::after {
  content: "暂未开放";
  position: absolute;
  top: -7px;
  right: 8px;
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.12);
  color: var(--gold);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  padding: 4px 6px;
}

.mode-icon,
.button-icon {
  display: inline-grid;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  place-items: center;
}

.mode-fields {
  display: grid;
  gap: 14px;
}

.beta-notice {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(251, 191, 36, 0.24);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(124, 58, 237, 0.08)),
    rgba(255, 255, 255, 0.035);
  color: var(--muted);
  padding: 11px 12px;
}

.beta-notice[hidden] {
  display: none;
}

.beta-notice strong {
  color: #f8e6a8;
  font-size: 12px;
}

.beta-notice span {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.55;
}

.field {
  display: grid;
  gap: 8px;
}

label {
  color: #d9dce7;
  font-size: 13px;
  font-weight: 850;
}

textarea,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(5, 5, 8, 0.74);
  color: var(--text);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

textarea::placeholder,
input::placeholder {
  color: #5f6472;
}

textarea {
  min-height: 250px;
  resize: vertical;
  line-height: 1.65;
  padding: 14px 15px;
}

input {
  min-height: 46px;
  padding: 0 14px;
}

textarea:focus,
input:focus {
  border-color: rgba(168, 85, 247, 0.74);
  box-shadow:
    0 0 0 3px rgba(124, 58, 237, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.primary-button,
.secondary-button,
.ghost-button,
.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 850;
  text-decoration: none;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.primary-button {
  border: 0;
  background: linear-gradient(135deg, #7c3aed, #8b5cf6 58%, #a855f7);
  color: #fff;
  font-size: 15px;
  box-shadow: 0 18px 40px rgba(124, 58, 237, 0.32);
}

.primary-button.compact {
  min-height: 36px;
  padding: 0 14px;
  font-size: 12px;
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.052);
  color: var(--text);
  padding: 0 16px;
}

.secondary-button.compact {
  min-height: 36px;
  padding: 0 12px;
  font-size: 12px;
}

.ghost-button {
  min-height: 36px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.download-link:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: wait;
  opacity: 0.56;
  transform: none;
}

.knowledge-summary,
.workflow-card,
.template-section,
.retouch-section {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  padding: 11px 12px;
}

.knowledge-summary strong,
.workflow-card strong,
.template-section strong,
.retouch-section strong {
  color: var(--text);
  font-size: 14px;
}

.knowledge-summary span,
.workflow-card p,
.template-section small,
.retouch-section small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.knowledge-summary ul {
  display: grid;
  gap: 7px;
  max-height: 172px;
  overflow-y: auto;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.knowledge-summary li {
  display: grid;
  gap: 2px;
  border-left: 2px solid rgba(103, 232, 249, 0.55);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  padding-left: 8px;
}

.knowledge-summary li span {
  color: var(--muted);
  font-weight: 500;
}

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

.template-label {
  display: block;
  margin-bottom: 5px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

.template-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.retouch-options {
  display: grid;
  gap: 7px;
}

.template-card,
.retouch-card {
  display: grid;
  min-width: 0;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(5, 5, 8, 0.52);
  color: var(--text);
  cursor: pointer;
  padding: 9px 10px;
  text-align: left;
}

.retouch-card {
  grid-template-columns: auto 1fr;
  align-items: flex-start;
  cursor: pointer;
}

.retouch-card input {
  width: 16px;
  min-height: 16px;
  margin-top: 3px;
  accent-color: #8b5cf6;
}

.retouch-card span {
  display: grid;
  gap: 2px;
}

.template-card.is-selected,
.retouch-card.is-selected {
  border-color: rgba(168, 85, 247, 0.86);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.28), rgba(255, 255, 255, 0.04));
  box-shadow: 0 14px 32px rgba(124, 58, 237, 0.16);
}

.template-card span {
  color: #c4b5fd;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
}

.template-card strong {
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.25;
}

.template-card small,
.template-card b,
.template-card em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 650;
  line-height: 1.3;
}

.template-card b {
  display: none;
}

.template-card em {
  color: var(--gold);
}

.template-card b {
  color: var(--faint);
}

.mini-steps,
.config-strip,
.process-metrics,
.candidate-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-steps span,
.config-strip span,
.process-metrics span,
.candidate-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  padding: 0 9px;
}

.config-strip .ok {
  border-color: rgba(89, 217, 130, 0.34);
  color: var(--green);
}

.config-strip .warn {
  border-color: rgba(255, 107, 107, 0.34);
  color: var(--red);
}

.process-dock {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(5, 5, 8, 0.46);
  padding: 12px;
}

.process-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.process-metrics strong {
  max-width: 180px;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-left: 5px;
}

.progress-ring {
  display: grid;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #111118 55%, transparent 56%),
    conic-gradient(var(--purple-2) var(--progress, 0%), #2a2a35 0);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.stage-list {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  margin: 0;
  padding: 0 0 2px;
  list-style: none;
}

.stage-item {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  padding: 0 10px 0 5px;
}

.stage-index {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: #242432;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.stage-item.is-active {
  border-color: rgba(168, 85, 247, 0.58);
  background: rgba(124, 58, 237, 0.14);
}

.stage-item.is-active .stage-index {
  position: relative;
  background: var(--purple);
  color: #fff;
}

.stage-item.is-active .stage-index::after {
  position: absolute;
  inset: -4px;
  border: 2px solid rgba(192, 132, 252, 0.28);
  border-top-color: rgba(255, 255, 255, 0.88);
  border-radius: inherit;
  content: "";
  animation: spin 0.9s linear infinite;
}

.stage-item.is-done .stage-index {
  background: var(--green);
  color: #06110a;
}

.stage-item h3 {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.stage-item p {
  display: none;
}

.stage-state {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

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

@keyframes shimmer {
  0% {
    background-position: 180% 0, 0 0;
  }
  100% {
    background-position: -80% 0, 0 0;
  }
}

.log-drawer {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.log-drawer summary {
  width: fit-content;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.agent-log {
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding-top: 10px;
}

.log-entry {
  border-left: 3px solid rgba(168, 85, 247, 0.62);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  color: #d6dae4;
  font-size: 13px;
  line-height: 1.5;
  padding: 9px 10px;
}

.log-entry strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
}

.preview-grid {
  display: grid;
  min-height: 0;
  align-content: start;
  grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  gap: 13px;
  overflow-y: auto;
  padding-right: 2px;
}

.preview-grid.empty-state {
  min-height: 360px;
  grid-template-columns: 1fr;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.1), transparent 42%),
    rgba(255, 255, 255, 0.03);
}

.empty-copy {
  display: grid;
  gap: 9px;
  max-width: 350px;
  color: var(--muted);
  text-align: center;
}

.empty-copy strong {
  color: var(--text);
  font-size: 16px;
}

.page-card,
.candidate-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.032)),
    rgba(9, 9, 14, 0.78);
  color: var(--text);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
}

.page-card {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  cursor: zoom-in;
  padding: 9px;
  text-align: left;
}

.page-card img,
.candidate-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  object-fit: cover;
  background: #24242d;
}

.page-card .page-no {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.page-card strong {
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.35;
}

.page-card small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.page-status {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

.page-status span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-status.is-image2 {
  border-color: rgba(115, 240, 188, 0.2);
  background: rgba(83, 210, 149, 0.09);
  color: #9af1c8;
}

.page-status.is-fallback {
  border-color: rgba(247, 198, 100, 0.26);
  background: rgba(247, 198, 100, 0.1);
  color: #f4d28a;
}

.result-gallery {
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
}

.gallery-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(255, 255, 255, 0.035)),
    rgba(5, 5, 8, 0.46);
  padding: 11px 12px;
}

.gallery-summary > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.gallery-summary strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.gallery-summary span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid rgba(103, 232, 249, 0.28);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.13), rgba(124, 58, 237, 0.14)),
    rgba(255, 255, 255, 0.035);
  color: var(--text);
  padding: 0 12px;
  white-space: nowrap;
}

.live-badge .button-icon {
  width: 18px;
  height: 18px;
}

.live-badge span:last-child {
  color: rgba(240, 246, 255, 0.86);
  font-size: 12px;
  font-weight: 800;
}

.live-video-actions {
  display: flex;
  max-width: min(100%, 420px);
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.live-video-link {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(103, 232, 249, 0.24);
  border-radius: 999px;
  background: rgba(103, 232, 249, 0.09);
  color: #c9f7ff;
  font-size: 11px;
  font-weight: 900;
  padding: 0 10px;
  text-decoration: none;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
  white-space: nowrap;
}

.live-video-link:hover,
.live-video-link:focus-visible {
  border-color: rgba(103, 232, 249, 0.58);
  background: rgba(103, 232, 249, 0.18);
  transform: translateY(-1px);
}

.live-video-actions small {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  text-align: right;
}

.result-grid {
  display: grid;
  min-height: 0;
  align-content: start;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
  overflow-y: auto;
  padding: 1px 2px 6px 1px;
  scrollbar-width: thin;
}

.result-card {
  display: grid;
  min-width: 0;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.028)),
    rgba(8, 8, 13, 0.82);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
  padding: 8px;
}

.result-card.is-active {
  border-color: rgba(168, 85, 247, 0.66);
  box-shadow:
    0 0 0 2px rgba(168, 85, 247, 0.12),
    0 18px 44px rgba(0, 0, 0, 0.3);
}

.result-card-image {
  display: grid;
  width: 100%;
  aspect-ratio: 3 / 4;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 18%, rgba(124, 58, 237, 0.14), transparent 42%),
    rgba(2, 2, 5, 0.72);
  cursor: zoom-in;
  padding: 6px;
  overflow: hidden;
}

.result-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 9px;
  background: #050509;
  object-fit: contain;
}

.result-card-meta {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.result-card-meta > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.result-card-meta .page-no {
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
}

.result-card-meta strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.result-card-meta small {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.mini-kicker {
  color: #b69cff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.vr-manual-workbench {
  display: grid;
  height: auto;
  min-height: 0;
  grid-template-rows: auto;
  gap: 12px;
  overflow: visible;
  padding-right: 2px;
}

.vr-viewer-card,
.manual-queue {
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 20% 0%, rgba(124, 58, 237, 0.2), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025)),
    rgba(8, 8, 13, 0.86);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 12px;
}

.vr-viewer-card {
  display: grid;
  grid-template-areas:
    "head head"
    "viewer controls";
  grid-template-columns: minmax(260px, clamp(300px, 34%, 430px)) minmax(360px, 1fr);
  grid-template-rows: auto minmax(0, auto);
  gap: 12px 16px;
  align-items: stretch;
  min-height: 0;
  overflow: hidden;
}

.vr-viewer-header {
  grid-area: head;
}

.vr-viewer-header,
.manual-queue-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.vr-viewer-header > div,
.manual-queue-header > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.vr-viewer-header strong,
.manual-queue-header strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
}

.vr-viewer-header span,
.manual-queue-header span,
.manual-queue-header small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.vr-capture-meter {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  min-width: 92px;
  gap: 2px;
  border: 1px solid rgba(168, 85, 247, 0.42);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(124, 58, 237, 0.3) var(--queue-progress), rgba(255, 255, 255, 0.045) var(--queue-progress)),
    rgba(8, 8, 13, 0.82);
  color: #e7d9ff;
  padding: 9px 11px;
  text-align: right;
}

.vr-capture-meter span {
  color: var(--text);
  font-size: 15px;
  font-weight: 950;
  line-height: 1;
}

.vr-capture-meter small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.vr-viewfinder-panel {
  display: grid;
  grid-area: viewer;
  grid-template-rows: auto auto auto;
  gap: 8px;
  min-height: 0;
  align-self: stretch;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 0%, rgba(168, 85, 247, 0.16), transparent 46%),
    rgba(2, 2, 6, 0.52);
  padding: 10px;
  contain: layout paint;
  overflow: hidden;
}

.vr-viewfinder-top,
.vr-viewfinder-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.vr-viewfinder-top span {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.vr-viewfinder-footer {
  justify-content: center;
  flex-wrap: wrap;
}

.vr-viewfinder-footer span {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  padding: 5px 8px;
}

.vr-canvas-shell {
  position: relative;
  display: grid;
  width: min(100%, clamp(240px, 32vh, 380px));
  aspect-ratio: 3 / 4;
  place-self: center;
  align-self: center;
  justify-self: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  background: #040407;
  box-shadow:
    0 26px 70px rgba(0, 0, 0, 0.5),
    0 0 0 7px rgba(255, 255, 255, 0.025),
    0 0 0 1px rgba(124, 58, 237, 0.16);
  overflow: hidden;
}

.vr-canvas {
  width: 100%;
  aspect-ratio: 3 / 4;
  min-height: 0;
  touch-action: none;
  cursor: grab;
}

.vr-canvas:active {
  cursor: grabbing;
}

.vr-canvas canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  transition: opacity 0.18s ease, filter 0.18s ease;
}

.vr-canvas-shell.is-loading .vr-canvas canvas {
  opacity: 0.24;
  filter: blur(1px);
}

.vr-canvas-loading {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  background:
    radial-gradient(circle at 50% 38%, rgba(124, 58, 237, 0.22), transparent 42%),
    rgba(3, 3, 8, 0.72);
  color: var(--text);
  pointer-events: none;
  opacity: 0;
  text-align: center;
  transition: opacity 0.18s ease;
}

.vr-canvas-shell.is-loading .vr-canvas-loading {
  opacity: 1;
}

.vr-canvas-loading span {
  width: 30px;
  height: 30px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: #a855f7;
  border-radius: 50%;
  box-shadow: 0 0 24px rgba(168, 85, 247, 0.36);
  animation: spin 0.85s linear infinite;
}

.vr-canvas-loading strong {
  font-size: 12px;
  font-weight: 900;
}

.vr-canvas-loading small {
  max-width: 170px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.vr-crosshair {
  position: absolute;
  inset: 12px;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
}

.vr-crosshair::before,
.vr-crosshair::after {
  position: absolute;
  content: "";
  background: rgba(255, 255, 255, 0.18);
}

.vr-crosshair::before {
  top: 50%;
  left: 44%;
  width: 12%;
  height: 1px;
}

.vr-crosshair::after {
  top: 46%;
  left: 50%;
  width: 1px;
  height: 8%;
}

.vr-angle-readout {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  pointer-events: none;
}

.vr-angle-readout span {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.54);
  color: rgba(255, 255, 255, 0.88);
  font-size: 11px;
  font-weight: 800;
  padding: 5px 8px;
  backdrop-filter: blur(10px);
}

.vr-side-controls {
  display: grid;
  grid-area: controls;
  align-self: stretch;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(112px, auto) auto;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 8px;
  padding-bottom: 12px;
  scrollbar-width: thin;
}

.vr-side-controls > * {
  min-width: 0;
}

.vr-side-controls::-webkit-scrollbar,
.vr-pano-strip::-webkit-scrollbar {
  width: 8px;
}

.vr-side-controls::-webkit-scrollbar-thumb,
.vr-pano-strip::-webkit-scrollbar-thumb {
  border: 2px solid rgba(8, 8, 13, 0.88);
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.55);
}

.vr-control-card {
  display: grid;
  gap: 9px;
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.026)),
    rgba(6, 6, 10, 0.62);
  padding: 11px;
}

.vr-control-card.is-primary {
  overflow: hidden;
  border-color: rgba(168, 85, 247, 0.24);
  background:
    radial-gradient(circle at 0% 0%, rgba(124, 58, 237, 0.18), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    rgba(8, 8, 13, 0.74);
}

.vr-control-card > strong {
  min-width: 0;
  color: var(--text);
  font-size: clamp(15px, 1.3vw, 18px);
  font-weight: 950;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.vr-control-card > small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.vr-control-group {
  display: grid;
  gap: 9px;
  min-height: 0;
}

.vr-control-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.vr-control-title strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.vr-control-title small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  overflow-wrap: anywhere;
  text-align: right;
}

.vr-pano-panel {
  padding: 10px;
  min-height: 0;
}

.vr-pano-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 6px;
  max-height: min(210px, 26vh);
  overflow-y: auto;
  align-content: start;
  padding-right: 4px;
  scrollbar-width: thin;
}

.vr-pano-chip {
  display: flex;
  min-width: 0;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  font-weight: 850;
  padding: 7px 8px;
  text-align: left;
}

.vr-pano-chip.is-active {
  border-color: rgba(168, 85, 247, 0.72);
  background: rgba(124, 58, 237, 0.2);
  color: var(--text);
  box-shadow: 0 10px 28px rgba(124, 58, 237, 0.18);
}

.vr-pano-chip span {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.vr-pano-chip small {
  color: rgba(255, 255, 255, 0.42);
  font-size: 9px;
  font-weight: 900;
}

.vr-fov-control {
  display: grid;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.vr-fov-control span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.vr-fov-control strong {
  color: var(--text);
  font-size: 12px;
}

.vr-fov-control input {
  width: 100%;
  accent-color: var(--purple);
}

.vr-action-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.35fr) repeat(2, minmax(82px, 0.85fr));
  gap: 8px;
  min-width: 0;
}

.vr-action-row .primary-button,
.vr-action-row .secondary-button {
  min-width: 0;
  min-height: 38px;
  padding-inline: 12px;
  font-size: 12px;
  white-space: nowrap;
}

.manual-queue {
  display: grid;
  grid-template-areas:
    "head"
    "progress"
    "grid";
  grid-template-columns: 1fr;
  grid-template-rows: auto 4px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  min-height: 0;
  align-self: start;
  overflow: visible;
  padding: 10px 10px 14px;
}

.manual-queue-header {
  grid-area: head;
}

.manual-queue-progress {
  grid-area: progress;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.manual-queue-progress span {
  display: block;
  width: var(--queue-progress);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7c3aed, #c084fc);
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.48);
}

.manual-latest-preview {
  display: grid;
  grid-area: latest;
  grid-template-rows: auto auto;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  height: fit-content;
  min-width: 0;
  align-self: start;
  border: 1px solid rgba(168, 85, 247, 0.34);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.17), rgba(255, 255, 255, 0.035)),
    rgba(6, 6, 10, 0.74);
  color: inherit;
  cursor: zoom-in;
  padding: 8px;
  text-align: left;
}

.manual-latest-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  height: auto;
  max-height: min(34vh, 330px);
  min-height: 0;
  border-radius: 12px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.44);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.manual-latest-preview span {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.manual-latest-preview strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.manual-latest-preview small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-queue-grid {
  display: grid;
  grid-area: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  align-content: start;
  gap: 10px;
  min-height: 0;
  max-height: none;
  overflow: visible;
  padding: 0 0 8px;
}

.manual-candidate-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  border: 1px solid rgba(168, 85, 247, 0.24);
  border-radius: 13px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025)),
    rgba(5, 5, 8, 0.72);
  padding: 6px;
  overflow: hidden;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.manual-candidate-card:hover {
  border-color: rgba(192, 132, 252, 0.58);
  background:
    linear-gradient(180deg, rgba(124, 58, 237, 0.16), rgba(255, 255, 255, 0.032)),
    rgba(5, 5, 8, 0.78);
  box-shadow: 0 14px 34px rgba(124, 58, 237, 0.18);
}

.manual-candidate-card.is-active {
  border-color: rgba(192, 132, 252, 0.74);
  background:
    linear-gradient(180deg, rgba(124, 58, 237, 0.2), rgba(255, 255, 255, 0.035)),
    rgba(5, 5, 8, 0.78);
  box-shadow: 0 18px 44px rgba(124, 58, 237, 0.2);
}

.manual-candidate-image {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 3 / 4;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.5);
  cursor: zoom-in;
  padding: 4px;
  overflow: hidden;
}

.manual-candidate-image::before {
  position: absolute;
  inset: 4px;
  border-radius: 8px;
  background:
    linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.12) 42%, transparent 72%),
    rgba(255, 255, 255, 0.05);
  background-size: 220% 100%, 100% 100%;
  content: "";
  opacity: 0;
  pointer-events: none;
}

.manual-candidate-card.is-pending .manual-candidate-image::before,
.manual-candidate-image.is-loading::before {
  opacity: 1;
  animation: shimmer 1.15s ease-in-out infinite;
}

.manual-candidate-image.is-loading span {
  position: relative;
  z-index: 1;
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-top-color: #c084fc;
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

.manual-candidate-image img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  object-fit: contain;
}

.manual-candidate-card.is-pending {
  border-style: dashed;
  border-color: rgba(192, 132, 252, 0.44);
}

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

.manual-candidate-meta strong {
  color: var(--text);
  font-size: 10px;
  font-weight: 900;
}

.manual-candidate-meta span {
  overflow: visible;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.manual-remove {
  width: 100%;
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255, 255, 255, 0.72);
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.manual-remove:hover,
.manual-remove:focus-visible {
  border-color: rgba(255, 107, 107, 0.68);
  background: rgba(255, 107, 107, 0.16);
  color: #ffd6d6;
  transform: translateY(-1px);
}

.manual-empty {
  display: grid;
  min-height: 118px;
  place-content: center;
  gap: 6px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

.manual-empty strong {
  color: var(--text);
  font-size: 13px;
}

.manual-empty span {
  font-size: 11px;
  line-height: 1.45;
}

.vr-loading-state {
  display: grid;
  min-height: min(56vh, 560px);
  place-items: center;
  padding: 18px;
}

.vr-loading-card {
  display: grid;
  width: min(100%, 620px);
  gap: 16px;
  border: 1px solid rgba(168, 85, 247, 0.24);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 0%, rgba(124, 58, 237, 0.28), transparent 46%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.025)),
    rgba(5, 5, 10, 0.84);
  box-shadow:
    0 26px 80px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  padding: 28px;
  text-align: center;
}

.loading-orbit {
  display: grid;
  width: 72px;
  height: 72px;
  place-self: center;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.1) 0 38%, transparent 39%),
    conic-gradient(from 90deg, rgba(168, 85, 247, 1), rgba(96, 165, 250, 0.32), rgba(168, 85, 247, 1));
  animation: spin 1.1s linear infinite;
}

.loading-orbit span {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #08080e;
  box-shadow: inset 0 0 22px rgba(168, 85, 247, 0.2);
}

.vr-loading-copy {
  display: grid;
  gap: 8px;
}

.vr-loading-copy strong {
  color: var(--text);
  font-size: 22px;
  font-weight: 950;
  letter-spacing: 0;
}

.vr-loading-copy p {
  max-width: 520px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.loading-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.065);
}

.loading-bar span {
  display: block;
  width: var(--loading-progress);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7c3aed, #c084fc, #60a5fa);
  box-shadow: 0 0 26px rgba(168, 85, 247, 0.5);
  transition: width 240ms ease;
}

.loading-status-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.loading-status-row span {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  padding: 7px 10px;
}

.main-preview {
  display: grid;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 18%, rgba(124, 58, 237, 0.12), transparent 42%),
    rgba(5, 5, 8, 0.46);
  padding: 12px;
  overflow: hidden;
}

.main-preview-button {
  display: grid;
  min-height: 0;
  width: 100%;
  height: 100%;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)),
    rgba(2, 2, 5, 0.72);
  cursor: zoom-in;
  padding: 10px;
  overflow: hidden;
}

.main-preview-button img {
  display: block;
  width: auto;
  height: 100%;
  max-width: 100%;
  max-height: min(72vh, 760px);
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
}

.main-preview-meta {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.main-preview-meta > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.main-preview-meta .page-no {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.main-preview-meta strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
}

.main-preview-meta small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.thumb-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 8px;
  scrollbar-width: thin;
}

.thumb-card {
  position: relative;
  flex: 0 0 76px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  padding: 5px;
}

.thumb-card.is-active {
  border-color: rgba(168, 85, 247, 0.8);
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.18), 0 14px 32px rgba(124, 58, 237, 0.24);
}

.thumb-card img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  object-fit: contain;
  background: #24242d;
}

.thumb-card span {
  position: absolute;
  left: 8px;
  bottom: 8px;
  border-radius: 999px;
  background: rgba(5, 5, 8, 0.78);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  padding: 3px 6px;
}

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

.candidate-card {
  display: grid;
  gap: 9px;
  padding: 9px;
}

.candidate-card.is-selected {
  border-color: rgba(89, 217, 130, 0.74);
  background:
    linear-gradient(180deg, rgba(89, 217, 130, 0.1), rgba(255, 255, 255, 0.035)),
    rgba(9, 9, 14, 0.82);
}

.candidate-thumb {
  position: relative;
  display: block;
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: #24242d;
  cursor: zoom-in;
  padding: 0;
  overflow: hidden;
}

.candidate-thumb span {
  position: absolute;
  left: 8px;
  top: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(5, 5, 8, 0.78);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  padding: 4px 7px;
}

.candidate-check {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

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

.candidate-card strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.candidate-card p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

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

.download-link {
  min-width: 128px;
  border: 1px solid rgba(168, 85, 247, 0.58);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.72), rgba(168, 85, 247, 0.86));
  color: #fff;
  padding: 0 18px;
  box-shadow: 0 16px 34px rgba(124, 58, 237, 0.24);
}

.download-link.is-disabled {
  pointer-events: none;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--faint);
  box-shadow: none;
}

.live-button {
  border-color: rgba(103, 232, 249, 0.28);
}

.live-download-link {
  border-color: rgba(103, 232, 249, 0.5);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.52), rgba(124, 58, 237, 0.74));
}

.caption-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(5, 5, 8, 0.52);
  padding: 14px;
}

.caption-panel.is-collapsed {
  gap: 8px;
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.09), transparent 46%),
    rgba(5, 5, 8, 0.5);
}

.caption-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.caption-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.caption-variants {
  display: grid;
  gap: 12px;
}

.caption-panel.is-collapsed #caption-editor,
.caption-panel.is-collapsed #caption-variants,
.caption-panel.is-collapsed #restore-caption-button {
  display: none;
}

.caption-panel.is-collapsed .caption-header {
  align-items: center;
}

.caption-panel.is-collapsed .caption-helper {
  margin: 0;
}

.caption-panel.is-simple {
  gap: 12px;
  border-color: rgba(168, 85, 247, 0.22);
  background:
    radial-gradient(circle at 0% 0%, rgba(124, 58, 237, 0.12), transparent 40%),
    rgba(5, 5, 8, 0.58);
}

.caption-panel.is-simple .caption-header {
  align-items: center;
}

.caption-panel.is-simple .caption-actions {
  align-items: center;
}

.caption-publish-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.024)),
    rgba(4, 4, 8, 0.64);
  padding: 16px;
}

.caption-loading-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 16px;
  background:
    radial-gradient(circle at 12% 20%, rgba(124, 58, 237, 0.22), transparent 42%),
    rgba(4, 4, 8, 0.68);
  padding: 16px;
}

.caption-loading-card strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 950;
}

.caption-loading-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.caption-loader {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.12);
}

.caption-loader span {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a78bfa;
  animation: captionPulse 1s ease-in-out infinite;
}

.caption-loader span:nth-child(1) {
  transform: translateX(-12px);
}

.caption-loader span:nth-child(2) {
  animation-delay: 0.14s;
}

.caption-loader span:nth-child(3) {
  animation-delay: 0.28s;
  transform: translateX(12px);
}

@keyframes captionPulse {
  0%,
  100% {
    opacity: 0.35;
    scale: 0.72;
  }

  50% {
    opacity: 1;
    scale: 1;
  }
}

.copy-style-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.copy-style-switch button {
  display: grid;
  min-width: 0;
  gap: 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  padding: 9px 10px;
  text-align: left;
}

.copy-style-switch button.is-active {
  border-color: rgba(168, 85, 247, 0.55);
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.28), rgba(255, 255, 255, 0.045)),
    rgba(10, 9, 18, 0.8);
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.08);
  color: #f4eeff;
}

.copy-style-switch button.is-blocked,
.copy-style-switch button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.copy-style-switch strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-style-switch span {
  overflow: hidden;
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.caption-publish-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.caption-publish-topline span,
.caption-publish-topline em {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  padding: 7px 10px;
}

.caption-publish-topline em {
  border-color: rgba(89, 217, 130, 0.26);
  color: var(--green);
}

.caption-publish-card h4 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 950;
  letter-spacing: 0;
}

.title-candidate-row {
  display: flex;
  min-width: 0;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.title-candidate-row button {
  display: grid;
  flex: 0 0 auto;
  max-width: 235px;
  min-width: 132px;
  gap: 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  cursor: pointer;
  padding: 7px 9px;
  text-align: left;
}

.title-candidate-row button.is-selected {
  border-color: rgba(168, 85, 247, 0.55);
  background: rgba(124, 58, 237, 0.18);
  color: #eadfff;
}

.title-candidate-row button span {
  flex: 0 0 auto;
  overflow: hidden;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title-candidate-row button small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.caption-story-body {
  display: grid;
  gap: 10px;
}

.caption-story-body p {
  margin: 0;
  color: rgba(245, 243, 255, 0.88);
  font-size: 13px;
  line-height: 1.8;
}

.caption-tag-row {
  overflow-wrap: anywhere;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #d8c8ff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.7;
  padding-top: 12px;
}

.caption-note,
.caption-warning {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.caption-warning {
  color: #f5d082;
}

#caption-editor {
  min-height: 230px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 13px;
}

.caption-helper {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.caption-quality-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.caption-quality-strip span,
.variant-meta span {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  padding: 7px 9px;
}

.caption-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.caption-section-title strong {
  color: var(--text);
  font-size: 13px;
}

.caption-section-title span {
  color: var(--muted);
  font-size: 11px;
}

.page-copy-list,
.copy-variant-list {
  display: grid;
  gap: 10px;
}

.page-copy-card,
.copy-variant-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(6, 6, 10, 0.48);
  padding: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.page-copy-card {
  display: grid;
  gap: 7px;
}

.page-copy-card span {
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.page-copy-card strong,
.copy-variant-card h4 {
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
}

.page-copy-card p,
.copy-variant-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  margin: 0;
}

.copy-variant-card {
  display: grid;
  gap: 10px;
}

.copy-variant-card.is-ready {
  border-color: rgba(116, 255, 174, 0.22);
}

.copy-variant-card.is-blocked {
  border-color: rgba(255, 198, 93, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 198, 93, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(6, 6, 10, 0.48);
}

.variant-topline,
.variant-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.variant-topline span {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 900;
}

.variant-topline em {
  border-radius: 999px;
  background: rgba(116, 255, 174, 0.12);
  color: #a6ffc9;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  padding: 6px 9px;
}

.copy-variant-card.is-blocked .variant-topline em {
  background: rgba(255, 198, 93, 0.12);
  color: #ffe0a3;
}

.variant-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.variant-hook,
.variant-ending {
  color: var(--text) !important;
}

.variant-tags,
.variant-note,
.variant-warning {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.variant-tags {
  color: #d8ccff;
}

.variant-warning {
  border-radius: 10px;
  background: rgba(255, 198, 93, 0.1);
  color: #ffe0a3;
  padding: 8px 10px;
}

.variant-actions {
  justify-content: flex-end;
}

.preview-dialog {
  width: min(900px, 92vw);
  max-height: 92vh;
  border: 0;
  border-radius: 14px;
  background: transparent;
  padding: 0;
}

.preview-dialog::backdrop {
  background: rgba(0, 0, 0, 0.82);
}

.preview-dialog img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 92vh;
  margin: auto;
  border-radius: 14px;
  object-fit: contain;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.52);
}

.icon-button {
  position: fixed;
  top: 20px;
  right: 24px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(20, 21, 27, 0.95);
  color: var(--text);
  cursor: pointer;
  font-size: 28px;
  font-weight: 700;
}

@media (max-width: 1180px) {
  .agent-workbench {
    grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
    padding: 18px;
  }

  h1 {
    font-size: 34px;
  }

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

@media (max-width: 920px) {
  .agent-workbench {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 14px;
  }

  .input-panel,
  .preview-panel {
    max-height: none;
    overflow: visible;
  }

  .preview-panel {
    grid-template-rows: auto;
    overflow: visible;
  }

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

  .result-gallery {
    overflow: visible;
    grid-template-rows: auto auto;
  }

  .gallery-summary {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

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

  .live-video-actions {
    max-width: none;
    justify-content: flex-start;
  }

  .live-video-actions small {
    text-align: left;
  }

  .preview-panel.is-vr-results {
    grid-template-rows: auto auto auto;
  }

  .preview-panel.is-vr-results .caption-panel {
    max-height: none;
    overflow: visible;
  }

  .preview-panel.is-vr-results .caption-variants {
    overflow: visible;
  }

  .copy-style-switch {
    grid-template-columns: 1fr;
  }

  .vr-manual-workbench {
    height: auto;
    grid-template-rows: auto;
    overflow: visible;
  }

  .vr-viewer-card {
    grid-template-areas:
      "head"
      "viewer"
      "controls";
    grid-template-columns: 1fr;
  }

  .vr-canvas-shell {
    width: min(100%, 270px);
    height: auto;
  }

  .vr-side-controls {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    max-height: none;
    overflow: visible;
  }

  .vr-pano-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    max-height: min(320px, 42vh);
    overflow-y: auto;
  }

  .vr-action-row {
    grid-template-columns: 1fr;
  }

  .manual-queue {
    grid-template-areas:
      "head"
      "progress"
      "grid";
    grid-template-columns: 1fr;
    grid-template-rows: auto 4px auto;
  }

  .manual-latest-preview {
    grid-template-columns: 82px minmax(0, 1fr);
    grid-template-rows: auto;
    height: auto;
  }

  .manual-latest-preview img {
    width: 82px;
    height: 110px;
    min-height: 0;
  }

  .result-grid {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    overflow: visible;
  }

  .main-preview-button {
    height: min(70vh, 620px);
    min-height: 420px;
  }

  .stage-list {
    flex-wrap: wrap;
    overflow-x: visible;
  }
}

@media (max-height: 820px) and (min-width: 921px) {
  .preview-panel.is-vr-manual {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .vr-manual-workbench {
    grid-template-rows: auto;
  }

  .vr-canvas-shell {
    width: min(100%, 210px);
    height: auto;
  }

  .vr-viewer-header span {
    display: none;
  }

  .vr-pano-chip {
    padding: 6px 8px;
  }

  .vr-pano-strip {
    max-height: min(190px, 28vh);
    overflow-y: auto;
  }

  .vr-action-row .primary-button,
  .vr-action-row .secondary-button {
    min-height: 32px;
  }

  .manual-latest-preview img {
    min-height: 128px;
  }
}

@media (max-width: 640px) {
  .agent-workbench {
    padding: 10px;
  }

  .input-panel,
  .preview-panel {
    padding: 14px;
  }

  h1 {
    max-width: none;
    font-size: 28px;
  }

  h2 {
    font-size: 21px;
  }

  textarea {
    min-height: 210px;
  }

  .result-header,
  .section-head,
  .caption-header {
    display: grid;
    grid-template-columns: 1fr;
  }

  .preview-grid,
  .candidate-grid {
    grid-template-columns: 1fr;
  }

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

  .vr-viewer-card,
  .manual-queue {
    padding: 10px;
  }

  .vr-canvas-shell {
    width: min(78vw, 250px);
    border-radius: 18px;
  }

  .vr-viewer-header,
  .manual-queue-header {
    display: grid;
  }

  .vr-viewer-header > div:first-child > span:last-child {
    font-size: 11px;
    line-height: 1.45;
  }

  .vr-action-row {
    grid-template-columns: 1fr 1fr;
  }

  .vr-action-row .primary-button {
    grid-column: 1 / -1;
    min-height: 48px;
  }

  .vr-pano-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 44vh;
  }

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

  .vr-angle-readout span {
    font-size: 10px;
    padding: 4px 7px;
  }

  .gallery-summary {
    padding: 10px;
  }

  .live-video-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .live-video-link {
    min-width: 0;
    padding: 0 8px;
  }

  .live-video-actions small {
    grid-column: 1 / -1;
  }

  .result-card {
    padding: 7px;
  }

  .main-preview {
    padding: 9px;
  }

  .main-preview-button {
    height: min(68vh, 560px);
    min-height: 360px;
    padding: 8px;
  }

  .main-preview-meta {
    display: grid;
    gap: 8px;
  }

  .thumb-card {
    flex-basis: 68px;
  }

  .process-summary,
  .caption-actions,
  .gallery-actions,
  .result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .process-summary {
    gap: 10px;
  }

  .progress-ring {
    width: 42px;
    height: 42px;
  }

  .primary-button,
  .secondary-button,
  .ghost-button,
  .download-link {
    width: 100%;
  }
}
