.vg-studio-shell {
  --header-h: 52px;
  --footer-h: 40px;
  --nav-h: 36px;
}

.movie-runner {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: white;
  color: #0f172a;
}

.movie-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  cursor: pointer;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  background: #f8fafc;
  display: grid;
  gap: 4px;
}

:where(.movie-stage.panes-1) {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

:where(.movie-stage.panes-2) {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
}

:where(.movie-stage.panes-3, .movie-stage.panes-4) {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.movie-stage.arrange-split-h {
  grid-template-columns: 1fr;
  grid-template-rows: none;
  grid-auto-rows: 1fr;
  grid-auto-flow: row;
}

.movie-stage.arrange-split-v {
  grid-template-rows: 1fr;
  grid-template-columns: none;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
}

.movie-stage.arrange-grid-2x2 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.movie-stage.panes-1.arrange-grid-2x2,
.movie-stage.panes-1.arrange-split-h,
.movie-stage.panes-1.arrange-split-v {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  grid-auto-rows: auto;
  grid-auto-columns: auto;
}

.movie-stage.arrange-pip {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

.movie-stage.arrange-pip > .movie-pane:nth-child(n + 2) {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 28%;
  aspect-ratio: 4/3;
  z-index: 30;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.movie-pane {
  position: relative;
  overflow: hidden;
  min-height: 0;
  min-width: 0;
  background: white;
}

.movie-bg-layer {
  position: absolute;
  inset: 0;
  transform-origin: 50% 50%;
  transition: transform 0.05s linear;
}

.movie-bg-img {
  width: 100%;
  height: 100%;
  -o-object-fit: contain;
  object-fit: contain;
  pointer-events: none;
}

.movie-annotations {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.movie-annotations ellipse.is-highlight {
  stroke-width: 1.1;
  filter: drop-shadow(0 0 6px currentColor);
  animation: movieDash 2s linear infinite;
}

@keyframes movieDash {
  to {
    stroke-dashoffset: -20;
  }
}

.movie-attention {
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  transform: translate(-50%, -50%);
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.22), 0 0 12px rgba(255, 255, 255, 0.36);
  animation: movieAttention 1.15s ease-in-out infinite;
}

@keyframes movieAttention {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(0.92);
    opacity: 0.78;
  }

  50% {
    transform: translate(-50%, -50%) scale(1.08);
    opacity: 1;
  }
}

.movie-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  background: radial-gradient(ellipse at center, #ffffff 0%, #f1f5f9 70%);
}

.movie-text-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  line-height: 1.3;
}

.movie-text-sub {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0.5rem 0 0;
}

.movie-overlay {
  position: absolute;
  z-index: 25;
  margin: 0;
  background: white;
  padding: 4px 4px 2px;
  border-radius: 4px;
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.movie-overlay img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
  aspect-ratio: 4/3;
  -o-object-fit: cover;
  object-fit: cover;
}

.movie-overlay figcaption {
  font-size: 9px;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
  padding: 4px 4px 2px;
}

.movie-narration {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  max-width: 85%;
  width: -moz-max-content;
  width: max-content;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  z-index: 25;
  text-align: center;
}

.movie-narration p {
  margin: 0;
  font-size: 0.8rem;
  color: #0f172a;
}

.movie-pause-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(2px);
  z-index: 40;
  font-size: 0.95rem;
  color: #0f172a;
  pointer-events: none;
}

.movie-form-backdrop {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.movie-form-card {
  background: white;
  border-radius: 0.75rem;
  padding: 1rem;
  max-width: 24rem;
  width: 100%;
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.4);
}

.movie-form-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0284c7;
  margin: 0 0 0.4rem;
}

.movie-form-prompt {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 0.75rem;
}

.movie-form-options {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.movie-form-btn {
  padding: 0.55rem 0.85rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  text-align: left;
}

.movie-form-btn.primary {
  background: #0284c7;
  color: white;
  border-color: #0284c7;
}

.movie-form-btn.secondary {
  background: white;
  color: #334155;
  border-color: #cbd5e1;
}

.movie-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: white;
  border-top: 1px solid #e6ebf2;
}

.movie-nav-btn {
  height: 28px;
  width: 28px;
  border-radius: 999px;
  background: #f4f6fa;
  color: #1e293b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  border: 1px solid #e6ebf2;
  cursor: pointer;
}

.movie-nav-btn:hover:not(:disabled) {
  background: #e7ecf3;
}

.movie-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.movie-progress {
  flex: 1;
  height: 12px;
  padding: 4px 0;
  min-width: 0;
  cursor: pointer;
  touch-action: none;
  position: relative;
}

.movie-progress::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  background: #e2e8f0;
  border-radius: 999px;
}

.movie-progress-fill {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  background: linear-gradient(90deg, #10b981, #34d399);
  border-radius: 999px;
  pointer-events: none;
}

.movie-progress-thumb {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: white;
  box-shadow: 0 0 0 2px #10b981, 0 1px 4px rgba(15, 23, 42, 0.18);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.movie-dots {
  display: flex;
  gap: 4px;
}

.movie-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #cbd5e1;
  border: none;
  padding: 0;
  cursor: pointer;
}

.movie-dot.done {
  background: #059669;
}

.movie-dot.active {
  background: #10b981;
  width: 18px;
}

.movie-counter {
  font-size: 10.5px;
  color: #64748b;
}

.movie-doctor-video {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22%;
  max-width: 220px;
  min-width: 120px;
  aspect-ratio: 16/9;
  z-index: 35;
  border-radius: 10px;
  overflow: hidden;
  background: #0b1220;
  -o-object-fit: cover;
  object-fit: cover;
  display: block;
  box-shadow: 0 12px 30px -8px rgba(15, 23, 42, 0.4);
}

.vg-studio-track-overlay {
  left: calc(118px + 0.875rem);
  right: 0;
}

.lesion-trigger {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 6px 8px 6px 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.lesion-trigger:hover {
  border-color: #bae6fd;
  background: #f8fbff;
}

.lesion-trigger:focus-visible {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}

.lesion-trigger.is-open {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
  background: #fff;
}

.lesion-trigger.is-empty {
  border-style: dashed;
}

.lesion-trigger__selected {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.lesion-trigger__placeholder {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  color: #94a3b8;
  font-size: 12px;
}

.lesion-trigger__placeholder i {
  color: rgba(56, 189, 248, 0.7);
  font-size: 11px;
}

.lesion-trigger__actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.lesion-chip {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: #0369a1;
  background: linear-gradient(180deg, #e0f2fe, #bae6fd);
  border: 1px solid rgba(14, 165, 233, 0.25);
  flex-shrink: 0;
}

.lesion-chip--sm {
  height: 18px;
  padding: 0 6px;
  font-size: 10px;
}

.lesion-chip--warn {
  color: #b45309;
  background: linear-gradient(180deg, #fef3c7, #fde68a);
  border-color: rgba(217, 119, 6, 0.3);
}

.lesion-name {
  font-size: 12.5px;
  color: #0f172a;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

.lesion-name--muted {
  color: #94a3b8;
  font-style: italic;
  font-weight: 400;
}

.lesion-modality {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  padding: 2px 5px;
  background: #f1f5f9;
  border-radius: 3px;
  flex-shrink: 0;
}

.lesion-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: #94a3b8;
  border-radius: 5px;
  cursor: pointer;
  padding: 0;
  font-size: 10px;
  transition: background 0.12s, color 0.12s;
}

.lesion-clear:hover {
  background: #fee2e2;
  color: #dc2626;
}

.lesion-caret {
  font-size: 9px;
  color: #94a3b8;
  padding: 0 4px;
  transition: transform 0.18s;
}

.lesion-caret.is-flipped {
  transform: rotate(180deg);
  color: #0284c7;
}

.lesion-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 16px 40px -12px rgba(15, 23, 42, 0.18),
    0 4px 10px -4px rgba(15, 23, 42, 0.08);
  max-height: 380px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lesion-panel__search {
  position: relative;
  padding: 8px;
  border-bottom: 1px solid #f1f5f9;
}

.lesion-panel__search i {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: #94a3b8;
  pointer-events: none;
}

.lesion-panel__search input {
  width: 100%;
  height: 30px;
  padding: 0 10px 0 28px;
  font-size: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  color: #0f172a;
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.lesion-panel__search input:focus {
  border-color: #38bdf8;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16);
}

.lesion-panel__list {
  overflow: auto;
  flex: 1;
  padding: 4px 0;
}

.lesion-panel__hint {
  margin: 0;
  padding: 12px;
  font-size: 11px;
  color: #94a3b8;
  font-style: italic;
  text-align: center;
}

.lesion-group + .lesion-group {
  margin-top: 2px;
}

.lesion-group__header {
  position: sticky;
  top: 0;
  padding: 4px 12px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  background: linear-gradient(180deg, #f8fafc 80%, rgba(248, 250, 252, 0.95));
  border-bottom: 1px solid #f1f5f9;
  backdrop-filter: blur(4px);
}

.lesion-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 12px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-size: 12px;
  color: #0f172a;
  transition: background 0.12s;
}

.lesion-option:hover {
  background: #f0f9ff;
}

.lesion-option.is-active {
  background: #e0f2fe;
}

.lesion-option__name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.lesion-option__layer {
  font-size: 9px;
  color: #94a3b8;
  flex-shrink: 0;
  padding: 2px 5px;
  background: #f1f5f9;
  border-radius: 3px;
}

.lesion-option.is-active .lesion-option__layer {
  background: #fff;
  color: #0284c7;
}

.lesion-option__check {
  font-size: 10px;
  color: #0284c7;
  flex-shrink: 0;
}
