/* ═══════════════════════════════════════════════════════════════
   Swiss Post Banner Campaign Manager
   Premium Design System
   ═══════════════════════════════════════════════════════════════ */

/* ── Fonts ───────────────────────────────────────────────────── */
@font-face {
  font-family: 'Swiss Post Sans';
  src: url('../fonts/SwissPostSans-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Swiss Post Sans';
  src: url('../fonts/SwissPostSans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Swiss Post Sans';
  src: url('../fonts/SwissPostSans-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Swiss Post Sans';
  src: url('../fonts/SwissPostSans-Black.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Swiss Post Sans';
  src: url('../fonts/SwissPostSans-ExtraBlack.woff2') format('woff2');
  font-weight: 950;
  font-style: normal;
  font-display: swap;
}

/* ── Reset & Base ────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --post-yellow: #FFCC00;
  --post-yellow-light: #FFF3B0;
  --post-yellow-dark: #E5B800;
  --post-red: #E8001C;
  --post-teal: #00968F;
  --post-teal-light: #E6F5F4;

  --bg-app: #F5F5F7;
  --bg-sidebar: #0C0C1D;
  --bg-sidebar-hover: #1A1A35;
  --bg-card: #FFFFFF;
  --bg-input: #F8F8FA;

  --text-primary: #1A1A2E;
  --text-secondary: #6B7280;
  --text-tertiary: #9CA3AF;
  --text-sidebar: #A0A3B1;
  --text-sidebar-active: #FFFFFF;

  --border: #E8E8ED;
  --border-focus: #FFCC00;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.1);

  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
  height: 100%;
  font-family: 'Swiss Post Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

/* ── App Layout ──────────────────────────────────────────────── */
.app-layout {
  display: flex;
  height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-header {
  padding: 28px 24px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

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

.sidebar-logo-icon {
  width: 48px;
  height: auto;
  object-fit: contain;
}

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
}

.sidebar-logo-title {
  font-weight: 700;
  font-size: 15px;
  color: white;
  letter-spacing: -0.2px;
}

.sidebar-logo-subtitle {
  font-weight: 400;
  font-size: 11px;
  color: var(--text-sidebar);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-top: 1px;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  padding: 12px 12px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-sidebar);
  cursor: pointer;
  transition: all var(--transition);
  font-weight: 500;
  font-size: 13.5px;
  margin-bottom: 2px;
  user-select: none;
}

.nav-item:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text-sidebar-active);
}

.nav-item.active {
  background: rgba(255, 204, 0, 0.12);
  color: var(--post-yellow);
}

.nav-item.active svg {
  color: var(--post-yellow);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  flex-shrink: 0;
}

.nav-item.active svg {
  opacity: 1;
}

.nav-lang-toggle {
  display: flex;
  gap: 4px;
  padding: 4px 12px;
}

.nav-lang-btn {
  flex: 1;
  padding: 6px;
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  background: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sidebar);
  cursor: pointer;
  transition: all var(--transition);
}

.nav-lang-btn:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text-sidebar-active);
}

.nav-lang-btn.active {
  background: rgba(255,204,0,0.15);
  border-color: var(--post-yellow);
  color: var(--post-yellow);
}

.sidebar-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-footer-text {
  font-size: 11px;
  color: rgba(255,255,255,0.25);
  line-height: 1.5;
}

.sidebar-footer-text a {
  color: var(--post-yellow);
  text-decoration: none;
  opacity: 0.7;
}

.sidebar-footer-text a:hover {
  opacity: 1;
}

/* ── Main Content ────────────────────────────────────────────── */
.main-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

#main-content {
  padding: 32px 40px 60px;
  max-width: 1400px;
  margin: 0 auto;
}

/* ── View Header ─────────────────────────────────────────────── */
.view-header {
  margin-bottom: 32px;
}

.view-title {
  font-size: 28px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.view-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 400;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  margin-bottom: 8px;
  transition: color var(--transition);
}

.btn-back:hover {
  color: var(--text-primary);
}

/* ── Stats Grid ──────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
}

.stat-number {
  font-size: 26px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Campaign Cards ──────────────────────────────────────────── */
.campaigns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 20px;
}

.campaign-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.campaign-card:hover {
  border-color: var(--post-yellow);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--post-yellow);
  transform: translateY(-2px);
}

.campaign-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.status-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 100px;
}

.status-active {
  background: #DCFCE7;
  color: #166534;
}

.status-draft {
  background: #F3F4F6;
  color: #6B7280;
}

.campaign-date {
  font-size: 12px;
  color: var(--text-tertiary);
}

.campaign-card-title {
  font-size: 20px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.campaign-card-client {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.campaign-card-variants {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.variant-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.variant-thumb img {
  width: 80px;
  height: 160px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.variant-thumb span {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.campaign-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.lang-tags {
  display: flex;
  gap: 6px;
}

.lang-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bg-input);
  color: var(--text-secondary);
}

.variant-count {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ── Variant Cards ───────────────────────────────────────────── */
.section-title {
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 20px;
  letter-spacing: -0.3px;
}

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

.variant-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.variant-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.variant-card-preview {
  position: relative;
  width: 100%;
  height: 280px;
  overflow: hidden;
  background: #f0f0f0;
}

.variant-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.4s ease;
}

.variant-card:hover .variant-card-preview img {
  transform: scale(1.03);
}

.variant-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.variant-card:hover .variant-card-overlay {
  opacity: 1;
}

.btn-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--post-yellow);
  color: var(--text-primary);
  border: none;
  border-radius: 100px;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.btn-preview:hover {
  background: var(--post-yellow-dark);
  transform: scale(1.05);
}

.variant-card-body {
  padding: 20px 24px 24px;
}

.variant-card-title {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.2px;
}

.variant-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.variant-card-langs {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.lang-btn {
  padding: 6px 16px;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  background: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.lang-btn:hover {
  border-color: var(--post-yellow);
  background: var(--post-yellow-light);
  color: var(--text-primary);
}

.variant-card-version {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 12px;
}

/* ── Editor Layout ───────────────────────────────────────────── */
.editor-layout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: start;
}

.editor-preview-panel {
  position: sticky;
  top: 32px;
}

.lang-switcher {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  width: fit-content;
}

.switcher-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.lang-switch-btn {
  padding: 8px 20px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.lang-switch-btn.active {
  background: var(--post-yellow);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.lang-switch-btn:not(.active):hover {
  background: var(--bg-input);
}

.preview-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  display: inline-block;
}

#banner-container {
  overflow: hidden;
  line-height: 0;
}

.preview-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 0;
}

.ctrl-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
  flex-shrink: 0;
}

.ctrl-btn:hover {
  border-color: var(--post-yellow);
  background: var(--post-yellow-light);
  color: var(--text-primary);
}

.timeline-bar {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.timeline-bar {
  cursor: pointer;
  position: relative;
}

.timeline-progress {
  height: 100%;
  background: var(--post-yellow);
  border-radius: 2px;
  width: 0;
  pointer-events: none;
}

.timeline-cursor {
  position: absolute;
  top: -4px;
  width: 3px;
  height: 12px;
  background: var(--text-primary);
  border-radius: 2px;
  left: 0;
  pointer-events: none;
  transition: none;
}

.timeline-time {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  min-width: 32px;
  text-align: right;
}

.preview-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary:hover {
  border-color: var(--post-yellow);
  background: var(--post-yellow-light);
}

.btn-secondary svg {
  width: 16px;
  height: 16px;
}

/* ── Editor Config Panel ─────────────────────────────────────── */
.editor-config-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.editor-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.editor-section-title {
  font-size: 14px;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  letter-spacing: -0.2px;
}

.scene-number {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--post-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  color: var(--text-primary);
  flex-shrink: 0;
}

.editor-field {
  margin-bottom: 12px;
}

.editor-field:last-child {
  margin-bottom: 0;
}

.editor-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.editor-field input[type="text"],
.editor-field input[type="url"],
.editor-field input[type="number"],
.editor-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  font-family: inherit;
  font-size: 13px;
  color: var(--text-primary);
  transition: border-color var(--transition);
  outline: none;
  resize: vertical;
}

.editor-field input:focus,
.editor-field textarea:focus {
  border-color: var(--post-yellow);
  box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.15);
}

.editor-field input[type="color"] {
  width: 40px;
  height: 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 2px;
  background: var(--bg-input);
}

.editor-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Version History ─────────────────────────────────────────── */
.version-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.version-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 8px 0;
}

.version-item:not(:last-child) {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.version-badge {
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--post-teal-light);
  color: var(--post-teal);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

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

.version-notes {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
}

.version-meta {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }

  .editor-preview-panel {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 220px;
    min-width: 220px;
  }

  #main-content {
    padding: 24px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .campaigns-grid {
    grid-template-columns: 1fr;
  }

  .variants-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Scrollbar ───────────────────────────────────────────────── */
.main-area::-webkit-scrollbar {
  width: 6px;
}

.main-area::-webkit-scrollbar-track {
  background: transparent;
}

.main-area::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.main-area::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* ── Selection ───────────────────────────────────────────────── */
::selection {
  background: var(--post-yellow);
  color: var(--text-primary);
}

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 560px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-title {
  font-size: 18px;
  font-weight: 900;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  font-size: 22px;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* ── Export grid ──────────────────────────────────────────────── */
.export-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.export-option {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition);
}

.export-option:hover {
  border-color: var(--post-yellow);
  background: var(--post-yellow-light);
}

.export-option-full {
  grid-column: 1 / -1;
  background: var(--bg-input);
}

.export-option-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--post-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.export-option-label {
  font-size: 14px;
  font-weight: 900;
  color: var(--text-primary);
}

.export-option-desc {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* ── Batch progress ──────────────────────────────────────────── */
.batch-progress {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

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

.batch-progress-fill {
  height: 100%;
  background: var(--post-yellow);
  border-radius: 3px;
  width: 0;
  transition: width 0.3s ease;
}

.batch-progress-text {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
  font-weight: 500;
}

.btn-batch {
  border-color: var(--post-yellow) !important;
  background: var(--post-yellow-light) !important;
}

/* ── Crop modal ──────────────────────────────────────────────── */
.crop-modal-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 900px;
  max-width: 95vw;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.crop-body {
  display: flex;
  gap: 16px;
  padding: 16px;
  flex: 1;
  min-height: 0;
}

.crop-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: #111;
  cursor: crosshair;
}

.crop-container img {
  display: block;
  width: 100%;
  pointer-events: none;
  opacity: 0.4;
}

.crop-rect {
  position: absolute;
  border: 2px solid var(--post-yellow);
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
  cursor: move;
  z-index: 2;
}

.crop-resize-handle {
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 18px;
  height: 18px;
  background: var(--post-yellow);
  border-radius: 50%;
  cursor: nwse-resize;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  z-index: 5;
}

.crop-sidebar {
  width: 180px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.crop-preview-box {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.crop-preview {
  border-radius: 4px;
  background-repeat: no-repeat;
}

.crop-info {
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
  font-weight: 600;
}

/* ── Import dialog ───────────────────────────────────────────── */
.import-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  transition: all var(--transition);
  cursor: pointer;
}

.import-dropzone.dragover {
  border-color: var(--post-yellow);
  background: var(--post-yellow-light);
}

.import-drop-content p {
  margin: 6px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.import-parsed {
  padding: 16px 0;
}

.import-format-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--post-teal-light);
  color: var(--post-teal);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 10px;
}

.import-summary {
  margin-bottom: 12px;
}

.import-layers-preview {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  margin-bottom: 16px;
  max-height: 200px;
  overflow-y: auto;
}

.import-layer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  font-size: 12px;
}

.import-layer-row:nth-child(odd) {
  background: rgba(0,0,0,0.02);
}

.import-layer-type {
  font-weight: 700;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--border);
  color: var(--text-secondary);
  min-width: 40px;
  text-align: center;
}

.import-layer-id {
  flex: 1;
  color: var(--text-primary);
  font-weight: 500;
}

.import-layer-dur {
  font-variant-numeric: tabular-nums;
  color: var(--text-tertiary);
  font-size: 11px;
}

.import-layer-img {
  color: var(--post-teal);
  font-size: 10px;
  font-weight: 700;
}

.import-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.import-actions select {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  background: var(--bg-input);
}

/* ── Size Indicator ──────────────────────────────────────────── */
.size-indicator {
  margin-top: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.size-bar-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.size-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
}

.size-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.size-bar-fill.size-ok {
  background: linear-gradient(90deg, #22c55e, #16a34a);
}

.size-bar-fill.size-over {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.size-info {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.size-value {
  font-size: 18px;
  font-weight: 900;
  color: var(--text-primary);
}

.size-over-text {
  color: #ef4444;
}

.size-limit {
  font-size: 12px;
  color: var(--text-tertiary);
}

.size-breakdown {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.size-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

.size-row-total {
  font-weight: 700;
  color: var(--text-primary);
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.size-warning {
  font-size: 12px;
  font-weight: 600;
  color: #ef4444;
  padding: 6px 10px;
  background: #fef2f2;
  border-radius: var(--radius-sm);
}

.size-pass {
  font-size: 12px;
  font-weight: 600;
  color: #16a34a;
  padding: 6px 10px;
  background: #f0fdf4;
  border-radius: var(--radius-sm);
}

.size-loading {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.size-error {
  font-size: 13px;
  color: #ef4444;
  font-weight: 500;
}

/* ── Quality Slider ──────────────────────────────────────────── */
.quality-control {
  margin-top: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

.quality-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.quality-label span {
  font-size: 13px;
  font-weight: 900;
  color: var(--text-primary);
}

.quality-control input[type="range"] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 3px;
  outline: none;
}

.quality-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--post-yellow);
  border: 2px solid var(--post-yellow-dark);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.quality-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 6px;
}

/* ── Timeline Editor (full width) ────────────────────────────── */
.timeline-editor {
  margin-top: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

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

.te-title {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -0.2px;
}

.te-duration {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.te-body {
  position: relative;
  padding: 0 0 8px;
  min-height: 100px;
}

/* Ruler */
.te-ruler {
  display: flex;
  align-items: center;
  height: 28px;
  padding-left: 90px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-input);
}

.te-ruler-track {
  flex: 1;
  position: relative;
  height: 100%;
}

.te-tick {
  position: absolute;
  top: 0;
  height: 100%;
  border-left: 1px solid rgba(0,0,0,0.08);
}

.te-tick span {
  position: absolute;
  top: 6px;
  left: 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Playhead */
.te-playhead-line {
  position: absolute;
  top: 28px;
  bottom: 0;
  width: 2px;
  background: var(--post-red);
  z-index: 20;
  pointer-events: none;
  transition: none;
}

.te-playhead-line::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -5px;
  width: 12px;
  height: 12px;
  background: var(--post-red);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}

/* Rows */
.te-row {
  display: flex;
  align-items: center;
  height: 32px;
  transition: background 0.1s;
}

.te-row:hover {
  background: rgba(0,0,0,0.015);
}

.te-row-selected {
  background: var(--post-yellow-light) !important;
}

.te-row-label {
  width: 90px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
}

.te-row-label:hover {
  color: var(--text-primary);
}

.te-row-track {
  flex: 1;
  position: relative;
  height: 24px;
  margin-right: 12px;
}

/* Bar */
.te-bar {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 4px;
  display: flex;
  overflow: hidden;
  cursor: grab;
  min-width: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.te-bar:hover {
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.te-bar:active {
  cursor: grabbing;
}

.te-zone {
  height: 100%;
  min-width: 2px;
}

.te-zone-enter {
  border-radius: 4px 0 0 4px;
}

.te-zone-hold {
  flex-shrink: 1;
}

.te-zone-exit {
  border-radius: 0 4px 4px 0;
}

.te-bar-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 6px;
  font-size: 9px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  pointer-events: none;
}

/* Drag handles - 4 types: enter-start, enter-end, exit-start, exit-end */
.te-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10px;
  cursor: col-resize;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.15s;
}

.te-bar:hover .te-handle {
  opacity: 1;
}

.te-handle::after {
  content: '';
  position: absolute;
  top: 3px;
  bottom: 3px;
  width: 3px;
  border-radius: 1.5px;
}

/* Enter start (left edge of bar) */
.te-handle-es {
  left: -3px;
}
.te-handle-es::after {
  left: 3px;
  background: rgba(255,255,255,0.9);
}

/* Enter end (boundary between enter zone and hold) */
.te-handle-ee {
  margin-left: -5px;
}
.te-handle-ee::after {
  left: 4px;
  background: rgba(255,255,0,0.9);
  box-shadow: 0 0 4px rgba(255,255,0,0.5);
}

/* Exit start (boundary between hold and exit zone) */
.te-handle-xs {
  margin-left: -5px;
}
.te-handle-xs::after {
  left: 4px;
  background: rgba(255,100,0,0.9);
  box-shadow: 0 0 4px rgba(255,100,0,0.5);
}

/* Exit end (right edge of bar) */
.te-handle-xe {
  right: -3px;
}
.te-handle-xe::after {
  right: 3px;
  background: rgba(255,255,255,0.9);
}

/* ── Image replace ───────────────────────────────────────────── */
.image-field {
  display: flex;
  align-items: center;
  gap: 12px;
}

.image-thumb {
  width: 60px;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.btn-sm {
  padding: 6px 14px !important;
  font-size: 12px !important;
}

/* ── Layer property groups ───────────────────────────────────── */
.layer-prop-group {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 8px;
  margin-bottom: 8px;
}

.layer-prop-header {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: var(--post-teal);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

/* ── Select styling ──────────────────────────────────────────── */
.editor-field select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  font-family: inherit;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
}

.editor-field select:focus {
  border-color: var(--post-yellow);
  box-shadow: 0 0 0 3px rgba(255,204,0,0.15);
}

/* ── Slider fields ───────────────────────────────────────────── */
.slider-field {
  display: flex;
  align-items: center;
  gap: 10px;
}

.slider-field input[type="range"] {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 3px;
  outline: none;
}

.slider-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--post-yellow);
  border: 2px solid var(--post-yellow-dark);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.slider-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 50px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── Preset chips ────────────────────────────────────────────── */
.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.preset-chip {
  padding: 4px 10px;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  background: none;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.preset-chip:hover {
  border-color: var(--post-yellow);
  background: var(--post-yellow-light);
}

.preset-chip.active {
  border-color: var(--post-yellow);
  background: var(--post-yellow);
  color: var(--text-primary);
}

/* ── Add buttons ─────────────────────────────────────────────── */
.btn-add-layer, .btn-add-scene {
  display: block;
  width: 100%;
  padding: 8px;
  margin-top: 8px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  background: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-add-layer:hover, .btn-add-scene:hover {
  border-color: var(--post-teal);
  color: var(--post-teal);
  background: var(--post-teal-light);
}

.btn-add-scene {
  padding: 14px;
  font-size: 13px;
  margin-top: 12px;
}

/* ── Icon button ─────────────────────────────────────────────── */
.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-tertiary);
  transition: color var(--transition);
  margin-left: auto;
}

.btn-icon:hover {
  color: var(--post-teal);
}

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

.layer-prop-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.image-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ── Animation controls ──────────────────────────────────────── */
.anim-controls {
  margin-top: 8px;
  padding: 10px;
  background: rgba(0,150,143,0.04);
  border: 1px solid rgba(0,150,143,0.12);
  border-radius: var(--radius-sm);
}

.anim-controls-header {
  font-size: 10px;
  font-weight: 800;
  color: var(--post-teal);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.anim-controls .editor-field-row {
  grid-template-columns: 1fr 1fr 1fr;
}

.anim-controls select {
  font-size: 12px;
  padding: 6px 8px;
}

/* ── Flash highlight (double-click from timeline) ────────────── */
@keyframes flash-highlight {
  0% { box-shadow: 0 0 0 3px var(--post-yellow); }
  50% { box-shadow: 0 0 0 6px var(--post-yellow); }
  100% { box-shadow: 0 0 0 0px transparent; }
}
.flash-highlight {
  animation: flash-highlight 1.2s ease-out;
}

/* ── Apply to all languages button ───────────────────────────── */
.btn-apply-langs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 12px;
  border: 1.5px solid var(--post-teal);
  border-radius: var(--radius-sm);
  background: var(--post-teal-light);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  color: var(--post-teal);
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
  justify-content: center;
}

.btn-apply-langs:hover, .btn-apply-sizes:hover {
  background: var(--post-teal);
  color: #fff;
}

.sync-btns {
  display: flex;
  gap: 6px;
}

.btn-apply-sizes {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  flex: 1;
  justify-content: center;
}

.sync-btns .btn-apply-langs,
.sync-btns .btn-apply-sizes {
  flex: 1;
}

.btn-apply-langs svg {
  width: 14px;
  height: 14px;
}

/* ── Scene strip ─────────────────────────────────────────────── */
.scene-strip {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  overflow-x: auto;
}

.scene-strip-item {
  flex-shrink: 0;
  width: 56px;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.scene-strip-item:hover {
  background: rgba(255,204,0,0.15);
}

.scene-strip-item.active {
  background: var(--post-yellow);
  box-shadow: 0 2px 8px rgba(255,204,0,0.3);
}

.scene-strip-item img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  border: 1.5px solid var(--border);
  display: block;
  margin: 0 auto;
}

.scene-strip-item.active img {
  border-color: var(--text-primary);
}

.scene-strip-item span {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-top: 3px;
  display: block;
}

.scene-strip-item.active span {
  color: var(--text-primary);
}

.scene-strip-end {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--border);
  margin: 0 auto;
}

/* ── Inspector sections ──────────────────────────────────────── */
.insp-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 8px;
}

.insp-title {
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 12px;
  letter-spacing: -0.2px;
}

.insp-row {
  margin-bottom: 10px;
}

.insp-row label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}

.insp-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  outline: none;
  margin-bottom: 10px;
}

.insp-textarea:focus {
  border-color: var(--post-yellow);
}

.insp-compact-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.insp-mini {
  flex: 1;
  min-width: 0;
}

.insp-mini label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 3px;
}

.insp-mini select,
.insp-mini input[type="text"],
.insp-mini input[type="color"] {
  width: 100%;
  padding: 5px 6px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  background: var(--bg-input);
  font-family: inherit;
  font-size: 11px;
  outline: none;
}

.insp-mini input[type="color"] {
  height: 28px;
  padding: 2px;
  cursor: pointer;
}

.insp-mini .slider-field {
  gap: 4px;
}

.insp-mini .slider-value {
  font-size: 10px;
  min-width: 36px;
}

.insp-mini .slider-field input[type="range"] {
  height: 4px;
}

/* ── Visual shadow editor ────────────────────────────────────── */
.shadow-editor {
  display: flex;
  gap: 12px;
  margin: 10px 0;
  padding: 10px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.shadow-preview {
  width: 56px;
  height: 56px;
  background: #333;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.shadow-preview-text {
  font-family: 'Swiss Post Sans', sans-serif;
  font-weight: 900;
  font-size: 28px;
  color: #FFCC00;
}

.shadow-sliders {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.shadow-slider-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.shadow-slider-row label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-tertiary);
  width: 36px;
  flex-shrink: 0;
  text-transform: uppercase;
}

.shadow-slider-row input[type="range"] {
  flex: 1;
  height: 3px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}

.shadow-slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--post-yellow);
  border: 1.5px solid var(--post-yellow-dark);
  cursor: pointer;
}

.shadow-slider-row span {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 28px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── Details/collapse ────────────────────────────────────────── */
.editor-details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-top: 8px;
}

.editor-details summary {
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  list-style: none;
}

.editor-details summary::-webkit-details-marker { display: none; }
.editor-details summary::before {
  content: '\25B6';
  font-size: 8px;
  margin-right: 8px;
  display: inline-block;
  transition: transform 0.2s;
}

.editor-details[open] summary::before {
  transform: rotate(90deg);
}

.editor-details[open] {
  padding-bottom: 12px;
}

.editor-details .editor-field,
.editor-details .editor-field-row {
  padding: 0 16px;
}

/* ══════════════════════════════════════════════════════════════
   New editor layout (v2)
   ══════════════════════════════════════════════════════════════ */
.ed-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.ed-title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.3px;
  margin-right: auto;
}

/* Preview + Timeline side by side */
.ed-preview-row {
  display: flex;
  gap: 16px;
  margin-bottom: 0;
  align-items: stretch;
}

.ed-preview-col {
  flex-shrink: 0;
}

.ed-preview-col .preview-wrapper {
  padding: 12px;
}

.ed-timeline-col {
  flex: 1;
  min-width: 0;
}

.ed-timeline-col .timeline-editor {
  margin: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.ed-timeline-col .te-body {
  flex: 1;
  overflow-y: auto;
}

/* Shared playback bar */
.ed-playback {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 8px 0;
}

/* Scene clips (full-width filmstrip) */
.ed-scene-clips {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding: 4px 0;
}

.scene-clip {
  flex: 1;
  min-width: 80px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
}

.scene-clip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scene-clip:hover {
  border-color: var(--post-yellow);
}

.scene-clip.active {
  border-color: var(--post-yellow);
  box-shadow: 0 0 0 2px var(--post-yellow);
}

.scene-clip-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 4px 6px;
  background: linear-gradient(transparent 40%, rgba(0,0,0,0.6));
}

.scene-clip-num {
  font-size: 11px;
  font-weight: 900;
  color: #fff;
}

.scene-clip-dur {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  font-variant-numeric: tabular-nums;
}

.scene-clip-end {
  max-width: 100px;
  flex: 0.5;
}

/* Properties row */
.ed-props-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.ed-props-main {
  flex: 1;
  min-width: 0;
}

.ed-props-side {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ed-export-box, .ed-global-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.ed-export-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.ed-export-btns .btn-secondary {
  flex: 1;
  min-width: 0;
  justify-content: center;
  font-size: 11px;
  padding: 7px 8px;
}

/* Fix shadow preview */
.shadow-preview {
  background-size: cover !important;
  background-position: center bottom !important;
  border: 1px solid var(--border);
}

@media (max-width: 1100px) {
  .ed-preview-row {
    flex-direction: column;
  }
  .ed-props-row {
    flex-direction: column;
  }
  .ed-props-side {
    width: 100%;
  }
}
