:root {
  --bg-main: #090b10;
  --bg-card: rgba(18, 22, 32, 0.85);
  --bg-card-hover: rgba(24, 30, 44, 0.95);
  --bg-input: #0d1018;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.65);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-primary: #6366f1;
  --accent-secondary: #06b6d4;
  --accent-success: #10b981;
  --accent-danger: #ef4444;
  --accent-warning: #f59e0b;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
}

.bg-glow {
  position: fixed;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  filter: blur(135px);
  opacity: 0.16;
  pointer-events: none;
  z-index: 0;
}

.bg-glow-1 {
  top: -160px;
  left: -120px;
  background: radial-gradient(circle, #6366f1, transparent 70%);
}

.bg-glow-2 {
  bottom: -180px;
  right: -120px;
  background: radial-gradient(circle, #06b6d4, transparent 70%);
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.hidden {
  display: none !important;
}

/* Topbar */
.topbar {
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(9, 11, 16, 0.8);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-inner {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.brand-logo svg {
  width: 20px;
  height: 20px;
  margin-left: 2px;
}

.brand-title {
  display: block;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand-accent {
  background: linear-gradient(90deg, #818cf8, #22d3ee);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  display: block;
  font-size: 0.76rem;
  color: var(--text-secondary);
}

/* Main Content */
.main-content {
  padding-top: 28px;
  padding-bottom: 64px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

/* Hero Card */
.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 30px 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(20px);
}

.hero-header {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 20px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34d399;
  font-size: 0.76rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.hero-header h1 {
  font-size: 1.95rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.22;
  margin-bottom: 8px;
}

.gradient-text {
  background: linear-gradient(90deg, #818cf8 0%, #38bdf8 50%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  color: var(--text-secondary);
  font-size: 0.94rem;
}

.hero-desc strong {
  color: #e2e8f0;
  font-weight: 600;
}

/* Platform Pills */
.platforms-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

.platform-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.77rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.platform-chip.active {
  background: rgba(99, 102, 241, 0.16);
  border-color: rgba(99, 102, 241, 0.55);
  color: #fff;
  transform: translateY(-1px);
}

.chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* URL Input Box */
.url-box-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.url-input-container {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 6px 8px 6px 12px;
  gap: 8px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.url-input-container:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.detected-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  color: #e2e8f0;
}

.detected-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6366f1;
}

.url-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.96rem;
  font-family: inherit;
  padding: 10px 4px;
  min-width: 0;
}

.url-input::placeholder {
  color: var(--text-muted);
}

/* ============================================================================
   STUDIO WORKSPACE (CONTROLS + LIVE PREVIEW MONITOR)
   ============================================================================ */
.studio-workspace {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 16px;
  background: rgba(11, 14, 22, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 16px;
}

.studio-controls-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.studio-top-Grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.studio-box {
  background: rgba(18, 23, 35, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.studio-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.studio-box-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.81rem;
  font-weight: 700;
  color: #e2e8f0;
}

.studio-box-title svg {
  color: #818cf8;
  flex-shrink: 0;
}

.studio-mini-badge {
  font-size: 0.69rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  white-space: nowrap;
}

.studio-mini-badge.active-edit {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

.segmented-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #080a0f;
  padding: 3px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  gap: 4px;
}

.seg-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.77rem;
  font-weight: 600;
  padding: 7px 8px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.seg-btn.active {
  background: linear-gradient(135deg, #6366f1, #0ea5e9);
  color: #fff;
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.35);
}

.segment-inputs {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.time-field {
  flex: 1;
  min-width: 76px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.time-field label,
.tiny-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.time-arrow {
  padding-bottom: 7px;
  color: var(--text-muted);
  font-weight: 700;
}

.input-mono {
  width: 100%;
  background: #080a0f;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f8fafc;
  border-radius: 7px;
  padding: 6px 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.79rem;
  outline: none;
}

.input-mono:focus,
.studio-select:focus {
  border-color: #6366f1;
}

.quick-time-chips,
.quick-size-pills {
  width: 100%;
  display: flex;
  gap: 5px;
  margin-top: 3px;
}

.chip-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #cbd5e1;
  font-size: 0.69rem;
  font-family: inherit;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip-btn:hover {
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(99, 102, 241, 0.5);
  color: #fff;
}

.studio-fields-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.studio-select {
  width: 100%;
  background: #080a0f;
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 0.79rem;
  font-family: inherit;
  outline: none;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.tiny-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: #38bdf8;
}

.studio-range {
  width: 100%;
  accent-color: #6366f1;
  cursor: pointer;
}

.crop-custom-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

/* Subtitle Typography & Color Designer */
.sub-top-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 10px;
}

.sub-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sub-style-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.style-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.style-field-full {
  grid-column: 1 / -1;
}

.color-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-input-native {
  width: 34px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.color-swatches {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.swatch-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.swatch-btn:hover,
.swatch-btn.active {
  transform: scale(1.16);
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

/* ============================================================================
   RIGHT COLUMN: LIVE INTERACTIVE PREVIEW MONITOR
   ============================================================================ */
.studio-preview-col {
  display: flex;
  flex-direction: column;
}

.preview-monitor-card {
  background: rgba(14, 18, 28, 0.96);
  border: 1px solid rgba(99, 102, 241, 0.32);
  border-radius: 13px;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.preview-monitor-header {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.preview-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
}

.preview-monitor-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #f1f5f9;
}

.preview-mode-tabs {
  display: inline-flex;
  background: #07090e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  padding: 2px;
  gap: 3px;
}

.preview-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
}

.preview-tab.active {
  background: rgba(99, 102, 241, 0.25);
  color: #fff;
}

.preview-stage-outer {
  flex: 1;
  min-height: 255px;
  background: #040609;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  position: relative;
  overflow: hidden;
}

.preview-canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 260px;
  background: linear-gradient(135deg, #131b2e 0%, #0b1322 50%, #162035 100%);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
  transition: all 0.22s ease;
}

/* When in "Resultado Recortado" isolated view mode */
.preview-canvas-wrap.isolated-crop-9-16 {
  width: auto;
  height: 250px;
  aspect-ratio: 9 / 16;
}

.preview-canvas-wrap.isolated-crop-1-1 {
  width: auto;
  height: 245px;
  aspect-ratio: 1 / 1;
}

.preview-canvas-wrap.isolated-crop-4-5 {
  width: auto;
  height: 250px;
  aspect-ratio: 4 / 5;
}

.preview-stage-img,
.preview-stage-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-stage-video {
  position: relative;
  z-index: 6;
}

.preview-demo-scene {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  background:
    radial-gradient(circle at 25% 30%, rgba(99, 102, 241, 0.25), transparent 55%),
    radial-gradient(circle at 75% 70%, rgba(6, 182, 212, 0.22), transparent 55%),
    linear-gradient(160deg, #0f172a 0%, #1e1b4b 52%, #090d16 100%);
}

.demo-grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
}

.demo-scene-label {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: rgba(255, 255, 255, 0.72);
  max-width: 280px;
}

.demo-scene-label span {
  font-size: 0.82rem;
  font-weight: 700;
  color: #e2e8f0;
}

.demo-scene-label small {
  font-size: 0.71rem;
  color: #94a3b8;
  line-height: 1.35;
}

/* Interactive Crop & Subtitle Overlay on Monitor */
.live-crop-mask {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.live-crop-box {
  position: absolute;
  inset: 0;
  border: 2px solid #38bdf8;
  box-shadow: 0 0 0 9999px rgba(2, 4, 10, 0.68);
  transition: top 0.08s ease, bottom 0.08s ease, left 0.08s ease, right 0.08s ease;
  pointer-events: auto;
  cursor: grab;
  overflow: hidden;
}

.live-crop-box:active {
  cursor: grabbing;
}

.crop-corner {
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: #38bdf8;
  border-style: solid;
}

.crop-corner.tl {
  top: -1px;
  left: -1px;
  border-width: 3px 0 0 3px;
}
.crop-corner.tr {
  top: -1px;
  right: -1px;
  border-width: 3px 3px 0 0;
}
.crop-corner.bl {
  bottom: -1px;
  left: -1px;
  border-width: 0 0 3px 3px;
}
.crop-corner.br {
  bottom: -1px;
  right: -1px;
  border-width: 0 3px 3px 0;
}

.live-crop-tag {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(2, 6, 18, 0.82);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.45);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  pointer-events: none;
}

/* Live Styled Subtitles inside the Crop Box */
.live-sub-container {
  position: absolute;
  left: 6%;
  right: 6%;
  display: flex;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  z-index: 5;
}

.live-sub-container.pos-bottom {
  bottom: 7%;
}

.live-sub-container.pos-lower_third {
  bottom: 22%;
}

.live-sub-container.pos-center {
  top: 50%;
  transform: translateY(-50%);
}

.live-sub-container.pos-top {
  top: 9%;
}

.live-sub-text {
  display: inline-block;
  font-weight: 700;
  line-height: 1.25;
  padding: 2px 7px;
  border-radius: 4px;
  word-break: break-word;
  transition: all 0.1s ease;
}

.preview-monitor-footer {
  padding: 10px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.preview-meta-info {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.action-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.action-buttons .btn-primary {
  width: 100%;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: 11px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-lg {
  padding: 14px 22px;
  font-size: 0.98rem;
  border-radius: 12px;
}

.btn-sm {
  padding: 7px 13px;
  font-size: 0.8rem;
  border-radius: 9px;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #0ea5e9 100%);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.32);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.12);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
}

.btn-outline {
  background: rgba(99, 102, 241, 0.1);
  color: #c7d2fe;
  border-color: rgba(99, 102, 241, 0.4);
}

.btn-outline:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.65);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

/* Options Bar */
.options-bar {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.checkbox-label input {
  accent-color: var(--accent-primary);
  width: 15px;
  height: 15px;
}

.cookie-selector {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cookie-selector label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.select-sm {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.8rem;
  font-family: inherit;
  outline: none;
}

/* Alert Banner */
.alert-banner {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 11px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.88rem;
}

.alert-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Analysis Loading */
.analysis-loading {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.analysis-loading h3 {
  font-size: 1rem;
  margin-bottom: 3px;
}

.analysis-loading p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

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

/* Section Headers */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.section-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

.section-sub {
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.counter-badge {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Detected Videos Grid */
.analysis-section {
  background: var(--bg-card);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.detected-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.detected-card {
  background: rgba(13, 16, 24, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease;
}

.detected-card:hover {
  border-color: rgba(99, 102, 241, 0.45);
}

.detected-thumb-wrap {
  position: relative;
  height: 175px;
  background: #05070b;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detected-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-placeholder {
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
}

.badge-overlay-top {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 3;
}

.platform-tag {
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.duration-tag {
  position: absolute;
  bottom: 10px;
  right: 10px;
  padding: 2px 8px;
  border-radius: 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.73rem;
  background: rgba(0, 0, 0, 0.82);
  color: #f8fafc;
  z-index: 3;
}

.detected-body {
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  flex: 1;
}

.detected-title {
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.38;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.detected-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.edit-summary-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.edit-pill {
  font-size: 0.71rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.13);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.detected-controls {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quality-select {
  width: 100%;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-family: inherit;
  outline: none;
}

/* Jobs List */
.jobs-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.empty-state {
  background: var(--bg-card);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 44px 24px;
  text-align: center;
  color: var(--text-secondary);
}

.empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(99, 102, 241, 0.1);
  color: #818cf8;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.empty-state h3 {
  color: var(--text-primary);
  font-size: 1.02rem;
  margin-bottom: 4px;
}

.empty-state p {
  font-size: 0.86rem;
}

.job-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color 0.2s ease;
}

.job-card.completed {
  border-color: rgba(16, 185, 129, 0.3);
}

.job-card.error {
  border-color: rgba(239, 68, 68, 0.35);
}

.job-thumb {
  width: 112px;
  height: 66px;
  border-radius: 9px;
  background: #06080d;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
}

.job-info {
  flex: 1;
  min-width: 0;
}

.job-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.job-title {
  font-weight: 600;
  font-size: 0.94rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 7px;
  gap: 10px;
}

.job-metrics {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #cbd5e1;
}

.progress-track {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6366f1, #06b6d4);
  transition: width 0.25s ease;
}

.job-card.completed .progress-fill {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.job-card.error .progress-fill {
  background: #ef4444;
}

.job-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* Modal Video Player */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 9, 0.82);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-card {
  background: #0f131d;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 820px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
}

.modal-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 0.96rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-body {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-player {
  width: 100%;
  max-height: 70vh;
  display: block;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 1020px) {
  .studio-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .hero-card {
    padding: 22px 16px;
  }
  .hero-header h1 {
    font-size: 1.5rem;
  }
  .studio-top-Grid,
  .sub-top-row,
  .sub-style-grid {
    grid-template-columns: 1fr;
  }
  .url-input-container {
    flex-wrap: wrap;
  }
  .job-card {
    flex-direction: column;
    align-items: stretch;
  }
  .job-thumb {
    width: 100%;
    height: 140px;
  }
  .job-actions {
    justify-content: flex-end;
  }
}
