:root {
  --bg-dark: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f8fafc;
  --bg-surface-hover: #f1f5f9;
  
  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-medium: rgba(15, 23, 42, 0.15);
  --border-focus: #4f46e5;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --accent-primary: #4f46e5;
  --accent-primary-hover: #4338ca;
  --accent-glow: rgba(79, 70, 229, 0.15);
  
  --accent-cyan: #0284c7;
  --accent-green: #059669;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-elevated: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --header-height: 54px;
  --sidebar-width: 290px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

.studio-root {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* Header */
.studio-header {
  height: var(--header-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 50;
  box-shadow: var(--shadow-subtle);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-icon {
  width: 20px;
  height: 20px;
  color: var(--accent-primary);
}

.brand-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.hardware-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent-green);
  background: rgba(5, 150, 105, 0.08);
  border: 1px solid rgba(5, 150, 105, 0.2);
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-green);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: var(--shadow-subtle);
}

.action-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.action-btn.primary {
  background: var(--accent-primary);
  color: #fff;
  border-color: transparent;
}

.action-btn.primary:hover {
  background: var(--accent-primary-hover);
}

/* 3-Column Layout */
.studio-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr 300px;
  height: calc(100vh - var(--header-height));
  overflow: hidden;
}

.panel {
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  gap: 1.25rem;
  padding: 1rem;
}

.left-panel { border-right: 1px solid var(--border-subtle); }
.right-panel { border-left: 1px solid var(--border-subtle); }

.panel-section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.count-badge {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  background: var(--bg-surface-hover);
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

/* Media Item */
.media-list, .output-media-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.media-item-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.media-item-card:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-medium);
}

.media-item-card.active {
  border-color: var(--accent-primary);
  background: rgba(79, 70, 229, 0.05);
}

.media-thumbnail-placeholder {
  width: 36px;
  height: 36px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
}

.media-meta-wrap {
  flex: 1;
  min-width: 0;
}

.media-name {
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-sub-meta {
  font-size: 0.68rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.4rem;
}

.media-delete-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  flex-shrink: 0;
  opacity: 0.6;
}

.media-item-card:hover .media-delete-btn {
  opacity: 1;
}

.media-delete-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

/* Presets */
.btn-icon-text {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon-text:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.preset-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.preset-card {
  padding: 0.55rem 0.7rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s ease;
}

.preset-card:hover { background: var(--bg-surface-hover); }
.preset-card.active {
  border-color: var(--accent-primary);
  background: rgba(79, 70, 229, 0.05);
}

.preset-card-title {
  font-size: 0.78rem;
  font-weight: 600;
}

.preset-card-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.preset-delete-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-sm);
  opacity: 0;
  transition: all 0.15s ease;
}

.preset-card:hover .preset-delete-btn {
  opacity: 0.7;
}

.preset-delete-btn:hover {
  opacity: 1 !important;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* Center Stage */
.stage-section {
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  overflow: hidden;
  position: relative;
}

.stage-toolbar {
  height: 44px;
  min-height: 44px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  background: var(--bg-surface);
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.view-mode-toggle {
  display: flex;
  background: var(--bg-surface-hover);
  padding: 2px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.view-toggle-btn {
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.view-toggle-btn.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-subtle);
}

.video-meta-badge {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  background: var(--bg-surface-hover);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
}

.curtain-hint {
  font-size: 0.72rem;
  color: var(--accent-primary);
  font-weight: 500;
}

/* Viewport */
.video-viewport {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f8fafc;
  user-select: none;
  padding: 1.5rem;
}

.canvas-wrapper {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-elevated);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #020617;
}

#mainVideo, #compareCleanVideo {
  max-width: 100%;
  max-height: calc(100vh - var(--header-height) - 44px - 56px - 3rem);
  object-fit: contain;
  display: block;
  transition: opacity 0.15s ease;
}

#compareCleanVideo {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: none;
  z-index: 10;
}

/* Floating Before/After Split Indicator Badges */
.split-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 28;
}

.split-badge {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.split-badge.before {
  background: rgba(15, 23, 42, 0.85);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.split-badge.after {
  background: rgba(16, 185, 129, 0.9);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Split Divider */
.split-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 40px;
  margin-left: -20px;
  cursor: ew-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  pointer-events: auto;
}

.split-divider-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #ffffff;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
  transform: translateX(-50%);
}

.split-divider-handle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--accent-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  z-index: 31;
}

/* AI Neural Target & Sparkle Mask Overlay */
.roi-box {
  position: absolute;
  border: 1.5px dashed rgba(79, 70, 229, 0.75);
  background: rgba(79, 70, 229, 0.08);
  border-radius: var(--radius-sm);
  z-index: 25;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: move;
  pointer-events: auto;
}

.roi-box:hover {
  border-color: #4f46e5;
  background: rgba(79, 70, 229, 0.14);
}

.roi-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #ffffff;
  border: 2px solid var(--accent-primary);
  border-radius: 50%;
  display: block;
  z-index: 28;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.roi-handle:hover {
  transform: scale(1.3);
  background: var(--accent-primary);
}

.roi-handle.nw { top: -5px; left: -5px; cursor: nwse-resize; }
.roi-handle.ne { top: -5px; right: -5px; cursor: nesw-resize; }
.roi-handle.sw { bottom: -5px; left: -5px; cursor: nesw-resize; }
.roi-handle.se { bottom: -5px; right: -5px; cursor: nwse-resize; }

.roi-box.highlight {
  animation: roiPulse 1.6s ease-in-out infinite alternate;
}

@keyframes roiPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.3);
    border-color: rgba(79, 70, 229, 0.65);
  }
  100% {
    box-shadow: 0 0 14px 2px rgba(79, 70, 229, 0.2);
    border-color: #6366f1;
  }
}

.roi-spark-mask-svg {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  overflow: visible;
}

.roi-spark-mask-svg path {
  fill: rgba(99, 102, 241, 0.5);
  stroke: #ffffff;
  stroke-width: 1.8px;
  filter: drop-shadow(0 0 8px rgba(79, 70, 229, 0.9)) drop-shadow(0 0 2px rgba(255, 255, 255, 0.8));
}

.roi-tag {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-primary);
  font-size: 0.65rem;
  font-family: var(--font-sans);
  font-weight: 600;
  color: #fff;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
  letter-spacing: 0.02em;
  pointer-events: none;
}

/* Floating Mask Editor Pill on Video Canvas */
.mask-editor-bar {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  padding: 0.28rem 0.45rem 0.28rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  z-index: 35;
  pointer-events: auto;
  animation: fadeInDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.mask-editor-hint {
  font-size: 0.72rem;
  font-weight: 500;
  color: #f1f5f9;
}

.btn-xs {
  border: none;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.22rem 0.65rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-xs.primary {
  background: var(--accent-primary);
  color: #ffffff;
}

.btn-xs.primary:hover {
  background: #4338ca;
}

.btn-xs.secondary {
  background: #ffffff;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.btn-xs.secondary:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

/* Preset Creation Modal */
.preset-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: modalFadeIn 0.18s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.preset-modal-card {
  width: 300px;
  max-width: 90vw;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  padding: 1rem;
}

.preset-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.preset-modal-header h3 {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

.preset-modal-body input {
  width: 100%;
  padding: 0.5rem 0.65rem;
  font-size: 0.8rem;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease;
}

.preset-modal-body input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
}

.preset-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-top: 0.85rem;
}

.modal-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.modal-btn.secondary {
  background: var(--bg-surface-elevated);
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

.modal-btn.secondary:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.modal-btn.primary {
  background: var(--accent-primary);
  color: #fff;
}

.modal-btn.primary:hover {
  background: var(--accent-hover);
}

/* Apple-Grade Clean Drop Area */
.empty-stage-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.dropzone-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  max-width: 520px;
  height: 320px;
  background: #ffffff;
  border: 2px dashed rgba(79, 70, 229, 0.25);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
  cursor: pointer;
}

.dropzone-card:hover, .video-viewport.drag-over .dropzone-card {
  border-color: var(--accent-primary);
  background: #fdfdfe;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(79, 70, 229, 0.08);
}

.empty-icon-wrap {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(79, 70, 229, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  margin-bottom: 1.25rem;
}

.empty-icon-wrap svg {
  width: 26px;
  height: 26px;
}

.dropzone-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.dropzone-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.dropzone-browse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.25rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent-primary);
  background: rgba(79, 70, 229, 0.08);
  border: 1px solid rgba(79, 70, 229, 0.2);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.dropzone-browse-btn:hover {
  background: var(--accent-primary);
  color: #ffffff;
}

/* Player Controls */
.player-controls-bar {
  height: 56px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.25rem;
}

.ctrl-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
}

.ctrl-btn:hover { background: var(--bg-surface-hover); color: var(--text-primary); }

.timeline-container { flex: 1; }

.timeline-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 5px;
  background: var(--bg-surface-hover);
  border-radius: 3px;
  cursor: pointer;
}

.timeline-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
}

.timecode-display {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Right Panel */
.execution-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.target-file-label {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.primary-execute-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.7rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent-primary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.primary-execute-btn:hover { background: var(--accent-primary-hover); }
.primary-execute-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Progress Card */
.progress-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.progress-pct {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-primary);
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: var(--bg-surface-hover);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background: var(--accent-primary);
  transition: width 0.2s ease;
}

.progress-log-message {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.icon-xs { width: 14px; height: 14px; }
.icon-sm { width: 16px; height: 16px; }
.icon-md { width: 20px; height: 20px; }

.studio-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translate(-50%, -20px) scale(0.96);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 12px 32px -4px rgba(15, 23, 42, 0.12), 0 4px 12px -2px rgba(15, 23, 42, 0.06);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  min-width: 320px;
  max-width: 460px;
  overflow: hidden;
}

.studio-toast.visible {
  transform: translate(-50%, 0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
}

.toast-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f1f5f9;
  flex-shrink: 0;
}

.toast-spinner {
  color: #4f46e5;
  animation: toastSpin 1s linear infinite;
}

@keyframes toastSpin {
  100% { transform: rotate(360deg); }
}

.toast-success-icon {
  color: #059669;
}

.toast-info-icon {
  color: #64748b;
}

.toast-text-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex: 1;
  font-size: 0.85rem;
  font-weight: 500;
  color: #0f172a;
}

.toast-msg {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
  color: #1e293b;
}

.toast-badge {
  background: #eef2ff;
  color: #4f46e5;
  border: 1px solid #c7d2fe;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  flex-shrink: 0;
}

.toast-progress-track {
  width: 100%;
  height: 3px;
  background: #f1f5f9;
  position: relative;
  overflow: hidden;
}

.toast-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
  transition: width 0.15s ease-out;
}

