/* ════════════════════════════════════════════════
   AppsDo Editor — Unified Stylesheet
   Single CSS for ALL editors
   (image, video, audio, logo creator, PDF)
   ════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════
   1. DESIGN TOKENS (CSS Variables)
   ════════════════════════════════════════════════ */
:root {
  /* ── Brand ────────────────────────────────── */
  --brand: #F20000;
  --brand-dark: #BC0000;
  --brand-light: #ff4444;
  --brand-glow: rgba(242, 0, 0, 0.25);
  --brand-subtle: rgba(242, 0, 0, 0.08);

  /* ── Dark Theme Surfaces ──────────────────── */
  --bg: #111118;
  --surface: #1a1a26;
  --surface-hover: #222232;
  --surface-active: #2a2a3e;
  --elevated: #2e2e42;

  /* ── Borders ──────────────────────────────── */
  --border: #2e2e44;
  --border-light: #3a3a54;
  --border-focus: var(--brand);

  /* ── Text ──────────────────────────────────── */
  --text: #e8eaf0;
  --text-secondary: #9ca3b4;
  --text-muted: #616880;
  --text-bright: #f8f9fb;
  --text-on-brand: #ffffff;

  /* ── Semantic ──────────────────────────────── */
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  /* ── Dimensions ────────────────────────────── */
  --header-h: 44px;
  --toolbar-w: 52px;
  --panel-w: 264px;
  --status-h: 30px;

  /* ── Radius (4px base) ─────────────────────── */
  --r-xs: 3px;
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 100px;

  /* ── Spacing (4px base) ────────────────────── */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;

  /* ── Shadows ───────────────────────────────── */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow: 0 4px 16px rgba(0,0,0,0.4);

  /* ── Fonts ─────────────────────────────────── */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Cascadia Code", "Consolas", monospace;

  /* ── Transitions ───────────────────────────── */
  --ease: 200ms ease;
  --ease-fast: 120ms ease;

  /* ── Backward-Compat Aliases (video editor) ── */
  --bg-primary: var(--bg);
  --bg-secondary: var(--surface);
  --bg-tertiary: var(--surface-hover);
  --bg-quaternary: var(--surface-active);
  --bg-hover: var(--surface-hover);
  --bg-active: var(--surface-active);
  --accent: var(--brand);
  --accent-hover: var(--brand-dark);
  --accent-light: var(--brand-light);
  --accent-dim: var(--brand-dark);
  --accent-glow: var(--brand-glow);
  --text-primary: var(--text);
  --text-accent: var(--brand-light);
  --border-accent: #9333ea;
  --error: #ef4444;

  /* ── Backward-Compat Aliases (audio editor) ── */
  --bg-track: var(--surface);
  --bg-input: var(--surface-active);
  --meter-green: #22c55e;
  --meter-yellow: #eab308;
  --meter-red: #ef4444;
  --waveform-color: #ea580c;
  --waveform-bg: #1a1a1a;
  --selection-bg: rgba(234, 88, 12, 0.2);
  --selection-border: rgba(234, 88, 12, 0.6);
  --playhead-color: #fb923c;
  --ruler-bg: #1e1e1e;
  --track-colors: #ea580c, #3b82f6, #22c55e, #a855f7, #eab308, #ec4899, #06b6d4, #f97316;
  --radius: 4px;
  --radius-lg: 8px;

  /* ── Backward-Compat Aliases (logo creator) ── */
  --color-brand: var(--brand);
  --color-brand-dark: var(--brand-dark);
  --color-brand-light: var(--brand-glow);
  --color-bg: var(--bg);
  --color-surface: var(--surface);
  --color-border: var(--border);
  --color-text: var(--text);
  --color-text-heading: var(--text-bright);
  --color-text-secondary: var(--text-secondary);
  --color-text-muted: var(--text-muted);
  --color-success: #16a34a;
  --color-success-light: #1a3a26;
  --color-error: #dc2626;
  --color-error-light: #3a1a1a;
  --panel-bg: #1a1a2e;
  --panel-border: #2a2a4a;
  --panel-text: #e2e8f0;
  --panel-text-muted: #94a3b8;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-hover: 0 8px 32px rgba(0,0,0,0.4);
  --font-family: var(--font);

  /* ── Backward-Compat Aliases (video editor) ── */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-xl: 14px;
  --clip-video: #7c3aed;
  --clip-video-bg: rgba(124, 58, 237, 0.3);
  --clip-audio: #3b82f6;
  --clip-audio-bg: rgba(59, 130, 246, 0.3);
  --clip-image: #10b981;
  --clip-image-bg: rgba(16, 185, 129, 0.3);
  --clip-text: #f59e0b;
  --clip-text-bg: rgba(245, 158, 11, 0.3);
  --playhead: #a855f7;
  --snap-line: #f59e0b;
  --header-height: 42px;
  --timeline-height: 260px;
  --media-panel-width: 260px;
  --properties-panel-height: 200px;

  /* ── Backward-Compat Aliases (image editor) ── */
  --right-panel-w: 280px;
  --menubar-h: 36px;
  --toolopts-h: 38px;
  --statusbar-h: 28px;

  /* ── Backward-Compat Aliases (PDF editor) ──── */
  --ed-topbar-h: 48px;
  --ed-statusbar-h: 32px;
  --ed-sidebar-left-w: 160px;
  --ed-sidebar-right-w: 256px;
  --ed-topbar-bg: var(--surface);
  --ed-sidebar-bg: var(--surface);
  --ed-canvas-bg: var(--bg);
  --ed-accent: var(--brand);
  --ed-accent-hover: var(--brand-dark);
  --ed-text: var(--text);
  --ed-text-muted: var(--text-muted);
  --ed-border: var(--border);
  --ed-radius: 6px;
}


/* ════════════════════════════════════════════════
   2. RESET & BASE
   ════════════════════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow: hidden;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.hidden { display: none !important; }


/* ════════════════════════════════════════════════
   3. SCROLLBAR
   ════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }


/* ════════════════════════════════════════════════
   4. HEADER / MENU BAR
   ════════════════════════════════════════════════ */

/* -- Shared editor-header (core pattern) ------ */
.editor-header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-3);
  gap: var(--sp-2);
  position: relative;
  z-index: 200;
  user-select: none;
  flex-shrink: 0;
}

.editor-header .logo-link {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  text-decoration: none;
  color: var(--text);
  margin-right: var(--sp-3);
  flex-shrink: 0;
}

.editor-header .logo-link svg { width: 24px; height: 24px; flex-shrink: 0; }

.editor-header .logo-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.3px;
}

.editor-header .logo-dot {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}

/* -- Image editor menu bar -------------------- */
.menu-bar {
  height: var(--menubar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 8px;
  z-index: 200;
  position: relative;
  flex-shrink: 0;
}

.menu-bar .logo {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 12px;
  font-weight: 700;
  font-size: 13px;
  color: var(--brand-light);
}

.menu-bar .logo svg { width: 22px; height: 22px; }
.menu-bar .menu-items { display: flex; gap: 0; flex: 1; }

.menu-bar .brand-link {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-left: auto;
}

/* -- Video/Audio editor header (#header) ------ */
#header {
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  flex-shrink: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* -- Logo creator header ---------------------- */
.app-header {
  background: var(--panel-bg);
  border-bottom: 1px solid var(--panel-border);
  padding: 0 16px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
  flex-shrink: 0;
}

.app-header .logo-group {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.app-header .logo-group svg { flex-shrink: 0; }

.app-header .logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.app-header .brand {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}

.app-header .domain {
  font-size: 11px;
  color: var(--panel-text-muted);
  font-weight: 500;
}

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

.header-actions button {
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--r-sm);
  transition: all var(--ease);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-nav a {
  font-size: 13px;
  color: var(--panel-text-muted);
  font-weight: 500;
  transition: color var(--ease);
}

.header-nav a:hover { color: #fff; }

/* -- Header actions right side (core) --------- */
.editor-header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-left: auto;
}

/* -- Brand logos ------------------------------- */
.brand-logo {
  font-weight: 700;
  font-size: 14px;
  color: var(--brand-light);
  letter-spacing: -0.3px;
}

.brand-logo span {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 12px;
  margin-left: 4px;
}

.header-spacer { flex: 1; }

.header-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 8px;
}

.brand-name {
  font-weight: 700;
  color: var(--brand);
  font-size: 14px;
}

.brand-sub {
  color: var(--text-secondary);
  font-size: 12px;
}

/* -- PDF editor topbar (dark-themed) ---------- */
.editor-topbar {
  height: var(--ed-topbar-h);
  background: var(--surface);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  flex-shrink: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
}

.topbar-left { display: flex; align-items: center; gap: 8px; min-width: 160px; }
.doc-name { color: var(--text-secondary); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.topbar-tools { display: flex; align-items: center; gap: 2px; flex: 1; justify-content: center; }
.topbar-right { display: flex; align-items: center; gap: 6px; min-width: 180px; justify-content: flex-end; }
.topbar-sep { width: 1px; height: 24px; background: var(--border-light); margin: 0 4px; }

.topbar-icon-btn {
  width: 36px; height: 36px; border: none; background: transparent; color: var(--text-secondary); border-radius: 6px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .15s;
  position: relative;
}
.topbar-icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.topbar-icon-btn.active { background: var(--brand); color: #fff; }
.topbar-icon-btn .tool-shortcut {
  position: absolute; bottom: 1px; right: 3px; font-size: 8px; color: var(--text-muted); pointer-events: none;
}
.topbar-icon-btn.active .tool-shortcut { color: rgba(255,255,255,.6); }
.tool-separator { width: 1px; height: 24px; background: var(--border-light); margin: 0 4px; flex-shrink: 0; }

.export-btn {
  display: flex; align-items: center; gap: 6px; padding: 7px 18px;
  background: var(--brand); color: #fff; border: none; border-radius: 6px;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s;
}
.export-btn:hover { background: var(--brand-dark); }


/* ════════════════════════════════════════════════
   5. MENU DROPDOWNS
   ════════════════════════════════════════════════ */

/* -- Core editor-dropdown --------------------- */
.editor-menu-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.editor-menu-item {
  padding: var(--sp-1) var(--sp-2);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--r-sm);
  transition: all var(--ease-fast);
  position: relative;
  cursor: pointer;
}

.editor-menu-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.editor-menu-item.active {
  background: var(--surface-active);
  color: var(--text-bright);
}

.editor-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-1) 0;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  display: none;
}

.editor-dropdown.open { display: block; }

.editor-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2) var(--sp-3);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: background var(--ease-fast);
}

.editor-dropdown-item:hover {
  background: var(--brand);
  color: var(--text-on-brand);
}

.editor-dropdown-item .shortcut {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.editor-dropdown-item:hover .shortcut { color: rgba(255,255,255,0.7); }

.editor-dropdown-sep {
  height: 1px;
  background: var(--border);
  margin: var(--sp-1) 0;
}

/* -- Image editor menu-item / menu-dropdown --- */
.menu-item {
  position: relative;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: var(--r-sm);
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}

.menu-item:hover, .menu-item.active {
  background: var(--surface-hover);
  color: var(--text);
}

.menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 4px 0;
  box-shadow: var(--shadow-lg);
  z-index: 300;
}

.menu-item.active .menu-dropdown { display: block; }

.menu-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  width: 100%;
  text-align: left;
}

.menu-dropdown-item:hover {
  background: var(--brand);
  color: #fff;
}

.menu-dropdown-item .shortcut {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 24px;
}

.menu-dropdown-item:hover .shortcut { color: rgba(255,255,255,0.7); }

.menu-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* -- Video editor menu-btn / dropdown-menu ---- */
.menu-btn {
  padding: 5px 12px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-family: var(--font);
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: all 0.15s;
}

.menu-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.menu-btn.active {
  background: var(--brand);
  color: white;
}

.menu-wrapper { position: relative; }

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  display: none;
}

.dropdown-menu.open { display: block; }

.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-secondary);
  transition: all 0.12s;
}

.dropdown-item:hover {
  background: var(--brand);
  color: white;
}

.dropdown-item .shortcut {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 24px;
}

.dropdown-item:hover .shortcut { color: rgba(255,255,255,0.7); }

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* -- Audio editor dropdown -------------------- */
.menu-item > span {
  display: inline-block;
  padding: 4px 12px;
  color: var(--text-secondary);
  font-size: 13px;
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s;
}

.menu-item:hover > span,
.menu-item.open > span {
  background: var(--brand);
  color: #fff;
}

.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 200;
  padding: 4px 0;
}

.menu-item.open .dropdown { display: block; }

.dropdown button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 16px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}

.dropdown button:hover {
  background: var(--brand);
  color: #fff;
}

.dropdown button:disabled {
  opacity: 0.4;
  cursor: default;
}

.dropdown button:disabled:hover {
  background: none;
  color: var(--text);
}

.dropdown hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

.dropdown kbd {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.dropdown button:hover kbd { color: rgba(255,255,255,0.6); }

#menu-bar {
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 8px;
}

/* -- PDF editor menu (dark themed) ------------ */
.menu-sep { height: 1px; background: var(--border); margin: 4px 8px; }

/* -- Context Menu (video editor) -------------- */
.context-menu {
  position: fixed;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 4px;
  box-shadow: var(--shadow-lg);
  z-index: 3000;
  min-width: 160px;
}

.context-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--r-sm);
}

.context-menu-item:hover {
  background: var(--brand);
  color: white;
}


/* ════════════════════════════════════════════════
   6. EDITOR LAYOUT
   ════════════════════════════════════════════════ */

/* -- Core body layout ------------------------- */
.editor-body {
  display: flex;
  height: calc(100vh - var(--header-h) - var(--status-h));
  overflow: hidden;
}

/* -- Image editor layout ---------------------- */
.editor-layout {
  display: flex;
  height: calc(100vh - var(--menubar-h) - var(--toolopts-h) - var(--statusbar-h));
  overflow: hidden;
}

.editor-layout.hidden { display: none !important; }

/* -- Video editor workspace ------------------- */
#workspace {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

#center-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* -- PDF editor app layout -------------------- */
.editor-app { height: 100vh; display: flex; flex-direction: column; }


/* ════════════════════════════════════════════════
   7. TOOLBAR (Left Side Tool Buttons)
   ════════════════════════════════════════════════ */

/* -- Core editor-toolbar ---------------------- */
.editor-toolbar {
  width: var(--toolbar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--sp-2) 0;
  gap: 2px;
  flex-shrink: 0;
  overflow-y: auto;
}

/* -- Image editor .toolbar -------------------- */
.toolbar {
  width: var(--toolbar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 0;
  gap: 2px;
  overflow-y: auto;
  flex-shrink: 0;
}

/* -- Tool buttons (shared) -------------------- */
.tool-btn {
  width: 40px;
  min-height: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  color: var(--text-muted);
  transition: all var(--ease-fast);
  position: relative;
  background: transparent;
  border: none;
  cursor: pointer;
}

.tool-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.tool-btn.active {
  background: var(--brand);
  color: var(--text-on-brand);
}

.tool-btn svg { width: 20px; height: 20px; }

.tool-btn .tool-label {
  display: none;
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  font-size: 12px;
  background: var(--elevated);
  color: var(--text);
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-md);
  z-index: 50;
  pointer-events: none;
}

.tool-btn:hover .tool-label { display: block; }

.tool-btn .tool-shortcut {
  position: absolute;
  bottom: 2px;
  right: 3px;
  font-size: 8px;
  color: var(--text-muted);
  font-weight: 700;
}

.tool-btn.active .tool-shortcut { color: rgba(255,255,255,0.6); }

.tool-sep, .toolbar-divider {
  width: 28px;
  height: 1px;
  background: var(--border);
  margin: var(--sp-1) 0;
}

/* -- Logo creator sidebar (wider tool buttons) */
.editor-sidebar-left .tool-btn {
  width: 48px;
  height: 48px;
  flex-direction: column;
  gap: 2px;
  font-size: 10px;
  font-weight: 500;
  border-radius: var(--r-sm);
  color: var(--panel-text-muted);
}

.editor-sidebar-left .tool-btn:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.editor-sidebar-left .tool-btn.active {
  background: var(--brand);
  color: #fff;
}

/* -- Image editor color swatches in toolbar --- */
.toolbar .color-swatches {
  margin-top: auto;
  padding: 6px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.color-swatch-pair {
  position: relative;
  width: 34px;
  height: 34px;
}

.toolbar .color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  border: 2px solid var(--border-light);
  cursor: pointer;
  position: absolute;
}

.toolbar .color-swatch.fg { top: 0; left: 0; z-index: 2; }
.toolbar .color-swatch.bg { bottom: 0; right: 0; z-index: 1; }

.color-swap-btn {
  font-size: 10px;
  position: absolute;
  top: -2px;
  right: -2px;
  z-index: 3;
  color: var(--text-muted);
}

/* -- Tool Options Bar (image editor) ---------- */
.tool-options-bar {
  height: var(--toolopts-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 12px;
  font-size: 12px;
  overflow-x: auto;
  flex-shrink: 0;
}

.tool-opt-group {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.tool-opt-group label {
  color: var(--text-muted);
  font-size: 11px;
}

.tool-opt-group input[type="range"] {
  width: 80px;
  accent-color: var(--brand);
  height: 4px;
}

.tool-opt-group input[type="number"] {
  width: 52px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  padding: 2px 6px;
  font-size: 12px;
  text-align: center;
}

.tool-opt-group input[type="color"] {
  width: 28px;
  height: 22px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: none;
  cursor: pointer;
  padding: 1px;
}

.tool-opt-group select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  padding: 2px 6px;
  font-size: 12px;
}

.tool-opt-btn {
  padding: 3px 10px;
  background: var(--surface-active);
  border-radius: var(--r-sm);
  font-size: 11px;
  color: var(--text-secondary);
  transition: background 0.15s;
}

.tool-opt-btn:hover { background: var(--brand); color: #fff; }
.tool-opt-btn.active { background: var(--brand); color: #fff; }

.tool-opt-separator {
  width: 1px;
  height: 20px;
  background: var(--border);
}

/* -- Logo creator context toolbar ------------- */
.context-toolbar {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--r-md);
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 10;
  box-shadow: var(--shadow-md);
}

.context-toolbar button {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--panel-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--ease);
}

.context-toolbar button:hover { background: rgba(255,255,255,0.1); }
.context-toolbar button.active { background: var(--brand); color: #fff; }

.context-toolbar .separator {
  width: 1px;
  height: 24px;
  background: var(--panel-border);
  margin: 0 4px;
}

.context-toolbar select {
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--panel-border);
  color: var(--panel-text);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}

.context-toolbar input[type="number"] {
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--panel-border);
  color: var(--panel-text);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 13px;
  width: 60px;
  outline: none;
}

.context-toolbar input[type="color"] {
  width: 28px;
  height: 28px;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
}


/* ════════════════════════════════════════════════
   8. CANVAS / WORKSPACE AREA
   ════════════════════════════════════════════════ */

/* -- Core editor-workspace -------------------- */
.editor-workspace {
  flex: 1;
  background: var(--bg);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.editor-workspace::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-conic-gradient(#1a1a26 0% 25%, #15151f 0% 50%) 50% / 16px 16px;
  pointer-events: none;
  z-index: 0;
}

.editor-canvas-wrap {
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-lg);
}

/* -- Image editor canvas workspace ------------ */
.canvas-workspace {
  flex: 1;
  overflow: hidden;
  position: relative;
  background: repeating-conic-gradient(#1a1a2e 0% 25%, #151525 0% 50%) 0 0 / 20px 20px;
}

.canvas-container {
  position: absolute;
  transform-origin: 0 0;
}

.canvas-container canvas {
  position: absolute;
  top: 0;
  left: 0;
}

#overlayCanvas {
  pointer-events: none;
  z-index: 10;
}

/* -- Logo creator canvas workspace ------------ */
.editor-canvas-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2d2d3f;
  position: relative;
  overflow: hidden;
}

/* -- Logo creator canvas ---------------------- */
.canvas-workspace canvas { display: block; }

/* -- Logo creator selection handles ----------- */
.selection-box {
  position: absolute;
  border: 2px solid var(--brand);
  pointer-events: none;
  z-index: 20;
}

.selection-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #fff;
  border: 2px solid var(--brand);
  border-radius: 2px;
  pointer-events: all;
  z-index: 21;
}

.selection-handle.nw { top: -5px; left: -5px; cursor: nw-resize; }
.selection-handle.ne { top: -5px; right: -5px; cursor: ne-resize; }
.selection-handle.sw { bottom: -5px; left: -5px; cursor: sw-resize; }
.selection-handle.se { bottom: -5px; right: -5px; cursor: se-resize; }
.selection-handle.n { top: -5px; left: 50%; transform: translateX(-50%); cursor: n-resize; }
.selection-handle.s { bottom: -5px; left: 50%; transform: translateX(-50%); cursor: s-resize; }
.selection-handle.w { top: 50%; left: -5px; transform: translateY(-50%); cursor: w-resize; }
.selection-handle.e { top: 50%; right: -5px; transform: translateY(-50%); cursor: e-resize; }

.rotation-handle {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  background: #fff;
  border: 2px solid var(--brand);
  border-radius: 50%;
  cursor: grab;
  pointer-events: all;
  z-index: 21;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rotation-handle svg { width: 12px; height: 12px; color: var(--brand); }

.rotation-line {
  position: absolute;
  top: -20px;
  left: 50%;
  width: 1px;
  height: 20px;
  background: var(--brand);
  pointer-events: none;
  z-index: 20;
}

/* -- Snap Guides (logo creator) --------------- */
.snap-guide {
  position: absolute;
  background: var(--brand);
  z-index: 30;
  pointer-events: none;
}

.snap-guide.horizontal { height: 1px; left: 0; right: 0; }
.snap-guide.vertical { width: 1px; top: 0; bottom: 0; }

/* -- Canvas Zoom Info (logo creator) ---------- */
.canvas-zoom-info {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  z-index: 10;
}

/* -- PDF editor canvas area (dark themed) ----- */
.canvas-scroll {
  width: 100%; height: 100%; overflow: auto; display: flex; align-items: flex-start; justify-content: center;
  padding: 24px;
}

.canvas-wrapper {
  box-shadow: var(--shadow-lg); background: #fff; flex-shrink: 0;
  position: relative; line-height: 0;
}

.canvas-wrapper .canvas-container { display: block !important; }

/* -- Image editor crop overlay ---------------- */
.crop-overlay {
  position: absolute;
  pointer-events: none;
  z-index: 20;
}

.crop-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #fff;
  border: 1px solid #333;
  pointer-events: all;
  cursor: nwse-resize;
  z-index: 21;
}

/* -- Text Input Overlay (image editor) -------- */
.text-input-overlay {
  position: absolute;
  z-index: 30;
}

.text-input-overlay textarea {
  background: transparent;
  border: 2px dashed var(--brand);
  color: #fff;
  font-size: 24px;
  padding: 4px;
  resize: both;
  min-width: 100px;
  min-height: 32px;
  outline: none;
}


/* ════════════════════════════════════════════════
   9. RIGHT PANEL (Sections, Labels, Inputs, etc.)
   ════════════════════════════════════════════════ */

/* -- Core editor-panel ------------------------ */
.editor-panel {
  width: var(--panel-w);
  background: var(--surface);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  flex-shrink: 0;
}

.panel-section {
  border-bottom: 1px solid var(--border);
}

.panel-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  transition: background var(--ease-fast);
}

.panel-section-header:hover { background: var(--surface-hover); }

.panel-section-header .chevron {
  width: 14px; height: 14px;
  transition: transform var(--ease);
}

.panel-section.collapsed .panel-section-header .chevron { transform: rotate(-90deg); }
.panel-section.collapsed .panel-section-body { display: none; }

.panel-section-body {
  padding: var(--sp-2) var(--sp-3) var(--sp-3);
}

/* -- Logo creator panel section title --------- */
.panel-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* -- Panel form elements ---------------------- */
.panel-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: var(--sp-1);
}

.panel-input {
  width: 100%;
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 12px;
  outline: none;
  transition: border-color var(--ease-fast);
}

.panel-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-glow);
}

.panel-select {
  width: 100%;
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 12px;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23616880' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.panel-slider {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}

.panel-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid var(--surface);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  cursor: pointer;
}

.panel-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}

.panel-row:last-child { margin-bottom: 0; }

.panel-row label {
  font-size: 11px;
  color: var(--text-secondary);
  min-width: 50px;
  flex-shrink: 0;
}

.panel-row .value {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  min-width: 32px;
  text-align: right;
}

.panel-input-sm {
  width: 56px;
  flex: none;
}

.panel-color {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
}

.panel-color::-webkit-color-swatch-wrapper { padding: 0; }
.panel-color::-webkit-color-swatch { border: none; }

/* -- Image editor right panels / panel-header - */
.right-panels {
  width: var(--right-panel-w);
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
}

.panel {
  border-bottom: 1px solid var(--border);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.panel-header:hover { background: var(--surface-hover); }

.panel-header h3 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.panel-header .panel-actions {
  display: flex;
  gap: 4px;
}

.panel-title {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.panel-actions {
  display: flex;
  gap: 4px;
}

.panel-action-btn {
  width: 24px;
  height: 24px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
}

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

.panel-body {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* -- Video editor icon-btn -------------------- */
.icon-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--r-sm);
  font-size: 14px;
  transition: all 0.15s;
}

.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.icon-btn.active { color: var(--brand-light); }

/* -- Video editor media panel ----------------- */
#media-panel {
  width: var(--media-panel-width);
  min-width: 200px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.media-drop-zone {
  padding: 20px;
  margin: 10px;
  border: 2px dashed var(--border-light);
  border-radius: var(--r-lg);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.media-drop-zone:hover,
.media-drop-zone.drag-over {
  border-color: var(--brand);
  background: var(--brand-glow);
}

.media-drop-zone .drop-icon { font-size: 28px; margin-bottom: 6px; opacity: 0.6; }
.media-drop-zone .drop-text { font-size: 12px; color: var(--text-muted); }
.media-drop-zone .drop-text strong { color: var(--brand-light); }

/* -- Media List ------------------------------- */
.media-list { flex: 1; overflow-y: auto; padding: 6px; }
.media-list.grid-view { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.media-list.list-view { display: flex; flex-direction: column; gap: 3px; }

.media-item {
  background: var(--surface-hover);
  border-radius: var(--radius-md);
  cursor: grab;
  transition: all 0.15s;
  border: 1px solid transparent;
  overflow: hidden;
}

.media-item:hover { border-color: var(--border-light); background: var(--surface-active); }
.media-item.selected { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand-glow); }
.media-item:active { cursor: grabbing; }

.grid-view .media-item { display: flex; flex-direction: column; }
.grid-view .media-thumb {
  width: 100%; aspect-ratio: 16/9; background: var(--bg); display: flex;
  align-items: center; justify-content: center; overflow: hidden; position: relative;
}
.grid-view .media-thumb img, .grid-view .media-thumb canvas { width: 100%; height: 100%; object-fit: cover; }
.grid-view .media-thumb .type-badge {
  position: absolute; top: 4px; right: 4px; font-size: 9px; padding: 1px 5px;
  border-radius: 3px; background: rgba(0,0,0,0.6); color: white; text-transform: uppercase; font-weight: 600;
}
.grid-view .media-info { padding: 5px 7px; }
.grid-view .media-name { font-size: 11px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid-view .media-meta { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

.list-view .media-item { display: flex; align-items: center; gap: 8px; padding: 5px 8px; }
.list-view .media-thumb {
  width: 50px; height: 32px; border-radius: 3px; background: var(--bg);
  overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}
.list-view .media-thumb img, .list-view .media-thumb canvas { width: 100%; height: 100%; object-fit: cover; }
.list-view .media-info { flex: 1; min-width: 0; }
.list-view .media-name { font-size: 11.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-view .media-meta { font-size: 10px; color: var(--text-muted); }

.media-thumb-placeholder { font-size: 18px; opacity: 0.3; }

/* -- Video editor properties panel ------------ */
#properties-panel {
  height: var(--properties-panel-height);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.properties-content { flex: 1; overflow-y: auto; padding: 8px 12px; }
.properties-empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--text-muted); font-size: 12px;
}

.prop-section { margin-bottom: 10px; }
.prop-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 0; cursor: pointer; user-select: none;
}
.prop-section-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.4px; color: var(--text-secondary);
}
.prop-section-toggle { font-size: 10px; color: var(--text-muted); transition: transform 0.2s; }
.prop-section-toggle.collapsed { transform: rotate(-90deg); }
.prop-section-body { padding: 4px 0; }
.prop-section-body.collapsed { display: none; }

.prop-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.prop-label { font-size: 11px; color: var(--text-muted); min-width: 70px; flex-shrink: 0; }
.prop-value { flex: 1; display: flex; align-items: center; gap: 6px; }

.prop-checkbox {
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; font-size: 11.5px; color: var(--text-secondary);
}
.prop-checkbox input[type="checkbox"] { accent-color: var(--brand); }

/* -- PDF editor properties (dark themed) ------ */
.editor-sidebar-right {
  width: var(--ed-sidebar-right-w);
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.props-empty { text-align: center; padding: 30px 10px; color: var(--text-muted); font-size: 13px; }
.props-section { margin-bottom: 16px; }
.props-section-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-muted); margin-bottom: 8px;
}
.props-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.props-row label { font-size: 12px; color: var(--text-secondary); min-width: 48px; }

/* -- PDF sidebar left (dark themed) ----------- */
.editor-sidebar-left {
  width: var(--ed-sidebar-left-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-header {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.thumb-list { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.thumb-item {
  cursor: pointer; border-radius: 6px; overflow: hidden; border: 2px solid transparent;
  transition: all .15s; position: relative; background: var(--surface-hover); box-shadow: var(--shadow-sm);
}
.thumb-item:hover { border-color: var(--border-light); }
.thumb-item.active { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.thumb-item img { display: block; width: 100%; height: auto; }
.thumb-item span {
  display: block; text-align: center; padding: 3px; font-size: 11px; color: var(--text-muted);
  background: var(--surface);
}

/* -- Logo creator properties ------------------ */
.property-group { margin-bottom: 16px; }
.property-group:last-child { margin-bottom: 0; }

.property-label {
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  margin-bottom: 6px; display: block;
}

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

.property-input {
  flex: 1; padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; outline: none; background: var(--surface); color: var(--text);
  transition: border-color var(--ease);
}

.property-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-glow);
}

.property-input-sm { width: 64px; flex: none; }

.property-slider { width: 100%; accent-color: var(--brand); }

.property-color {
  width: 32px; height: 32px; border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer; padding: 0;
}


/* ════════════════════════════════════════════════
   10. LAYERS PANEL
   ════════════════════════════════════════════════ */

/* -- Image editor layers ---------------------- */
.layers-panel .panel-body { padding: 0; }

.layer-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.layer-item:hover { background: var(--surface-hover); }
.layer-item.active { background: var(--surface-active); border-left: 3px solid var(--brand); }

.layer-thumb {
  width: 36px; height: 36px; border-radius: 4px; border: 1px solid var(--border);
  background: repeating-conic-gradient(#333 0% 25%, #444 0% 50%) 0 0 / 6px 6px;
  overflow: hidden; flex-shrink: 0;
}

.layer-thumb canvas { width: 100%; height: 100%; object-fit: contain; }

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

.layer-name {
  font-size: 12px; color: var(--text); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

.layer-name-input {
  font-size: 12px; background: var(--bg); border: 1px solid var(--brand);
  border-radius: 3px; color: var(--text); padding: 1px 4px; width: 100%;
}

.layer-meta { font-size: 10px; color: var(--text-muted); }

.layer-visibility {
  width: 24px; height: 24px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); transition: color 0.15s; font-size: 14px;
}

.layer-visibility:hover { color: var(--text); }
.layer-visibility.hidden { color: var(--text-muted); opacity: 0.4; }

.layer-blend-row {
  display: flex; gap: 6px; padding: 6px 10px;
  border-bottom: 1px solid var(--border); align-items: center;
}

.layer-blend-row label { font-size: 11px; color: var(--text-muted); }

.layer-blend-row select {
  flex: 1; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--text); padding: 2px 4px; font-size: 11px;
}

.layer-blend-row input[type="range"] { width: 60px; accent-color: var(--brand); }

.layer-actions-row {
  display: flex; gap: 2px; padding: 6px 10px; justify-content: center;
}

.layer-action-btn {
  width: 32px; height: 28px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 16px; transition: background 0.15s, color 0.15s;
}

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

/* -- Logo creator layers list ----------------- */
.layers-list {
  display: flex; flex-direction: column; gap: 4px;
}

.layer-item .layer-preview {
  width: 32px; height: 32px; border-radius: 4px; background: var(--bg);
  border: 1px solid var(--border); overflow: hidden;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.layer-item .layer-preview canvas { max-width: 100%; max-height: 100%; }

.layer-item .layer-actions {
  display: flex; gap: 4px; opacity: 0; transition: opacity var(--ease);
}

.layer-item:hover .layer-actions { opacity: 1; }

.layer-item .layer-actions button {
  width: 24px; height: 24px; border-radius: 4px; background: transparent;
  border: none; color: var(--text-muted); display: flex; align-items: center;
  justify-content: center; cursor: pointer; transition: all var(--ease);
}

.layer-item .layer-actions button:hover { background: var(--border); color: var(--text); }
.layer-item .layer-actions button svg { width: 14px; height: 14px; }


/* ════════════════════════════════════════════════
   11. PROPERTIES PANEL (Image Editor Adjustments)
   ════════════════════════════════════════════════ */
.properties-panel .panel-body { gap: 10px; }

.adj-section {
  background: var(--bg);
  border-radius: var(--r-md);
  overflow: hidden;
}

.adj-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; cursor: pointer; font-size: 12px; font-weight: 600;
  color: var(--text-secondary); transition: background 0.15s;
}

.adj-section-header:hover { background: var(--surface-hover); }

.adj-section-header .arrow {
  font-size: 10px; transition: transform 0.2s;
}

.adj-section.collapsed .adj-section-body { display: none; }
.adj-section.collapsed .arrow { transform: rotate(-90deg); }

.adj-section-body { padding: 8px 10px; }

.adj-slider-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}

.adj-slider-row label {
  font-size: 11px; color: var(--text-muted); width: 64px; flex-shrink: 0;
}

.adj-slider-row input[type="range"] {
  flex: 1; accent-color: var(--brand); height: 4px;
}

.adj-slider-row .adj-value {
  font-size: 11px; color: var(--text-secondary); width: 36px;
  text-align: right; font-family: var(--font-mono);
}

.adj-btn {
  width: 100%; padding: 6px; background: var(--surface-active);
  border-radius: var(--r-sm); font-size: 12px; color: var(--text-secondary);
  text-align: center; transition: background 0.15s; margin-top: 4px;
}

.adj-btn:hover { background: var(--brand); color: #fff; }

/* -- Histogram & Curves ----------------------- */
.histogram-canvas {
  width: 100%; height: 60px; border-radius: 4px; background: #111; margin-bottom: 6px;
}

.curves-canvas {
  width: 100%; height: 120px; border-radius: 4px; background: #111;
  cursor: crosshair; margin-bottom: 6px;
}

/* -- PDF editor style/font/position controls -- */
.font-select {
  width: 100%; padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px;
  font-size: 13px; background: var(--surface); color: var(--text); cursor: pointer;
}

.font-size-control { display: flex; align-items: center; gap: 4px; }
.font-size-control input {
  width: 52px; text-align: center; padding: 5px 4px; border: 1px solid var(--border);
  border-radius: 4px; font-size: 13px; background: var(--surface); color: var(--text);
}
.font-size-control button {
  width: 28px; height: 28px; border: 1px solid var(--border); border-radius: 4px;
  background: var(--surface); cursor: pointer; font-size: 16px; line-height: 1; color: var(--text);
}
.font-size-control button:hover { background: var(--surface-hover); }

.style-btns { display: flex; gap: 4px; }
.style-btn {
  width: 32px; height: 32px; border: 1px solid var(--border); border-radius: 4px;
  background: var(--surface); cursor: pointer; font-size: 14px; font-weight: 700;
  transition: all .12s; color: var(--text);
}
.style-btn:hover { background: var(--surface-hover); }
.style-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.opacity-row { display: flex; align-items: center; gap: 8px; }
.opacity-row input[type="range"] { flex: 1; height: 4px; accent-color: var(--brand); }
.opacity-row .opacity-val { font-size: 12px; color: var(--text-secondary); min-width: 36px; text-align: right; }

.delete-obj-btn {
  width: 100%; padding: 8px; border: 1px solid var(--danger); background: transparent; color: var(--danger);
  border-radius: 6px; font-size: 13px; cursor: pointer; transition: all .15s; margin-top: 12px;
}
.delete-obj-btn:hover { background: var(--danger); color: #fff; }

.pos-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pos-field { display: flex; align-items: center; gap: 4px; }
.pos-field label { font-size: 11px; color: var(--text-muted); min-width: 14px; }
.pos-field input {
  width: 100%; padding: 4px 6px; border: 1px solid var(--border); border-radius: 4px;
  font-size: 12px; text-align: center; background: var(--surface); color: var(--text);
}

.stroke-widths { display: flex; gap: 6px; align-items: center; }
.stroke-w-btn {
  width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 4px;
  background: var(--surface); cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .12s;
}
.stroke-w-btn:hover { border-color: var(--border-light); }
.stroke-w-btn.active { border-color: var(--brand); background: var(--brand-subtle); }
.stroke-w-btn span { display: block; background: var(--text); border-radius: 2px; }

/* -- Alignment buttons (logo creator) --------- */
.align-buttons { display: flex; gap: 4px; }

.align-btn {
  width: 32px; height: 32px; border-radius: 6px; background: var(--bg);
  border: 1px solid var(--border); color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--ease);
}

.align-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-glow); }
.align-btn svg { width: 16px; height: 16px; }


/* ════════════════════════════════════════════════
   12. STATUS BAR
   ════════════════════════════════════════════════ */

/* -- Core editor-status ----------------------- */
.editor-status {
  height: var(--status-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-3);
  gap: var(--sp-4);
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  z-index: 50;
  flex-shrink: 0;
}

.status-item {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.status-item svg { width: 12px; height: 12px; opacity: 0.5; }
.status-sep { width: 1px; height: 14px; background: var(--border); }

/* -- Image editor status bar ------------------ */
.status-bar {
  height: var(--statusbar-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 24px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  flex-shrink: 0;
}

.status-bar span { white-space: nowrap; }

/* -- PDF editor statusbar (dark themed) ------- */
.editor-statusbar {
  height: var(--ed-statusbar-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  z-index: 10;
}

.status-left, .status-center, .status-right { display: flex; align-items: center; gap: 6px; }
.status-left { min-width: 100px; }
.status-right { min-width: 100px; justify-content: flex-end; }
.editor-brand { font-size: 11px; color: var(--text-muted); font-weight: 600; letter-spacing: .3px; }
.zoom-level { font-size: 12px; color: var(--text-secondary); min-width: 42px; text-align: center; }

.status-btn {
  width: 26px; height: 26px; border: 1px solid var(--border); border-radius: 4px;
  background: var(--surface); cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--text-secondary); transition: all .12s;
}
.status-btn:hover { background: var(--surface-hover); }

#page-info { font-size: 12px; color: var(--text-secondary); }


/* ════════════════════════════════════════════════
   13. DIALOGS / MODALS
   ════════════════════════════════════════════════ */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  backdrop-filter: blur(4px);
}

.dialog-overlay.hidden { display: none; }

.dialog {
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  width: 440px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: dialogIn 0.25s ease;
}

@keyframes dialogIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
}

.dialog-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-bright);
}

.dialog-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-bright);
}

.dialog-close {
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--ease-fast);
  font-size: 18px;
}

.dialog-close:hover { background: rgba(239,68,68,0.15); color: var(--danger); }

.dialog-body {
  padding: var(--sp-5);
}

.dialog-body .form-group {
  display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px;
}

.dialog-body .form-group label {
  font-size: 12px; color: var(--text-muted); font-weight: 600;
}

.dialog-body .form-group input,
.dialog-body .form-group select {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text); padding: 8px 10px; font-size: 13px;
}

.dialog-body .form-row {
  display: flex; gap: 12px;
}

.dialog-body .form-row .form-group { flex: 1; }

.dialog-body .form-check {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}

.dialog-body .form-check input[type="checkbox"] { accent-color: var(--brand); }
.dialog-body .form-check label { font-size: 12px; color: var(--text-secondary); }

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--border);
}

/* -- Audio editor dialogs --------------------- */
#dialog-overlay, #export-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6); z-index: 500;
  display: flex; align-items: center; justify-content: center;
}

#dialog-overlay.hidden, #export-overlay.hidden { display: none; }

#dialog-box, #export-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  min-width: 380px; max-width: 600px; max-height: 80vh; overflow-y: auto;
}

#dialog-header, #export-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 14px; color: var(--text-bright);
}

#dialog-header button, #export-header button {
  background: none; border: none; color: var(--text-secondary);
  font-size: 18px; cursor: pointer;
}

#dialog-header button:hover, #export-header button:hover { color: var(--text); }

#dialog-body, #export-body { padding: 16px; }

#dialog-footer, #export-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 16px; border-top: 1px solid var(--border);
}

/* -- Audio editor form elements --------------- */
.form-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}

.form-row label {
  min-width: 100px; font-size: 13px; color: var(--text-secondary);
}

.form-row input[type="number"],
.form-row input[type="text"],
.form-row select {
  flex: 1; padding: 6px 10px; background: var(--surface-active);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-size: 13px; font-family: var(--font); outline: none;
}

.form-row input:focus, .form-row select:focus { border-color: var(--brand); }
.form-row input[type="range"] { flex: 1; }

.form-row .range-val {
  min-width: 40px; text-align: right; font-family: var(--font-mono);
  font-size: 12px; color: var(--text-secondary);
}


/* ════════════════════════════════════════════════
   14. TOAST NOTIFICATIONS
   ════════════════════════════════════════════════ */
.toast-container,
#toast-container {
  position: fixed;
  bottom: var(--sp-6);
  right: 16px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
}

.toast {
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in 0.3s ease;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.visible { transform: translateY(0); opacity: 1; }

/* Toast type variants -- class-based & border-based */
.toast-success, .toast.success { background: var(--success); }
.toast-error, .toast.error { background: var(--danger); }
.toast-warning, .toast.warning { background: var(--warning); color: #1a1a1a; }
.toast-info, .toast.info { background: var(--info); }

/* -- Border-left style toasts (audio/image) --- */
.toast.toast-success { background: var(--surface); color: var(--text); border-left: 3px solid var(--success); }
.toast.toast-error { background: var(--surface); color: var(--text); border-left: 3px solid var(--danger); }
.toast.toast-info { background: var(--surface); color: var(--text); border-left: 3px solid var(--brand); }

@keyframes toast-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.removing, .toast.toast-out {
  animation: toast-out 0.3s ease forwards;
}

@keyframes toast-out {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(-12px); }
}


/* ════════════════════════════════════════════════
   15. BUTTONS
   ════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--r-sm);
  transition: all var(--ease);
  white-space: nowrap;
  border: none;
  font-family: var(--font);
  cursor: pointer;
}

.btn-brand, .btn-primary {
  background: var(--brand);
  color: var(--text-on-brand);
}
.btn-brand:hover, .btn-primary:hover { background: var(--brand-dark); }

.btn-surface, .btn-secondary {
  background: var(--surface-hover);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-surface:hover, .btn-secondary:hover { background: var(--surface-active); border-color: var(--border-light); }

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

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { background: #dc2626; }

.btn-sm { padding: 4px 10px; font-size: 11px; }

.btn-icon {
  width: 30px; height: 30px;
  padding: 0;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--ease-fast);
}

.btn-icon:hover { background: var(--surface-hover); color: var(--text); }
.btn-icon.active { background: var(--brand); color: var(--text-on-brand); }
.btn-icon svg { width: 16px; height: 16px; }


/* ════════════════════════════════════════════════
   16. TRANSPORT BAR (Audio/Video Playback)
   ════════════════════════════════════════════════ */
#transport-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.transport-controls {
  display: flex;
  gap: 4px;
}

.transport-controls button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-hover);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}

.transport-controls button:hover {
  background: var(--border);
  border-color: var(--brand);
}

.transport-controls button.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

#btn-record { color: var(--danger); }

#btn-record.recording {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
  animation: pulse-record 1s infinite;
}

@keyframes pulse-record {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.transport-time {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--brand-light);
  background: var(--bg);
  padding: 4px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  min-width: 220px;
  text-align: center;
}

.time-sep { color: var(--text-muted); margin: 0 4px; }

.transport-options {
  display: flex;
  gap: 12px;
}

.toggle-label {
  display: flex; align-items: center; gap: 4px;
  cursor: pointer; color: var(--text-secondary); font-size: 12px;
}

.toggle-label input[type="checkbox"] { accent-color: var(--brand); }

/* -- Metronome -------------------------------- */
.metronome-controls {
  display: flex; align-items: center; gap: 6px;
  margin-left: 8px; padding-left: 8px; border-left: 1px solid var(--border);
}

.metronome-controls button {
  width: 32px; height: 32px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface-hover);
  color: var(--text); font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background 0.15s;
}

.metronome-controls button:hover { border-color: var(--brand); }
.metronome-controls button.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.metronome-controls input[type="number"] {
  width: 52px; padding: 3px 6px; background: var(--surface-active);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-family: var(--font-mono); font-size: 12px; text-align: center;
}

.metronome-controls input[type="number"]:focus { border-color: var(--brand); outline: none; }

.metronome-controls select {
  padding: 3px 6px; background: var(--surface-active);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-size: 11px;
}

.beat-indicator {
  width: 12px; height: 12px; border-radius: 50%; background: var(--border); transition: background 0.05s;
}
.beat-indicator.beat-flash { background: var(--brand); box-shadow: 0 0 8px var(--brand); }
.beat-indicator.accent { background: #fff; box-shadow: 0 0 10px #fff; }

/* -- Transport view toggles ------------------- */
.transport-view-toggles {
  display: flex; gap: 4px; margin-left: 8px; padding-left: 8px; border-left: 1px solid var(--border);
}

.transport-view-toggles button {
  padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-hover); color: var(--text-secondary);
  font-size: 11px; font-weight: 600; cursor: pointer; transition: all 0.15s;
}

.transport-view-toggles button:hover { border-color: var(--brand); color: var(--brand); }
.transport-view-toggles button.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* -- Master Meter (transport) ----------------- */
.master-meter {
  display: flex; align-items: center; gap: 4px; margin-left: auto;
}

.master-meter label {
  font-size: 11px; color: var(--text-muted); margin-right: 4px;
}

.meter-bar {
  width: 120px; height: 8px; background: var(--bg);
  border-radius: 4px; overflow: hidden; position: relative; border: 1px solid var(--border);
}

.meter-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--meter-green) 0%, var(--meter-green) 60%, var(--meter-yellow) 80%, var(--meter-red) 100%);
  transition: width 0.05s; border-radius: 4px;
}

.meter-peak {
  position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; right: 0; display: none;
}

.clip-indicator {
  width: 10px; height: 10px; border-radius: 50%; background: var(--border); margin-left: 4px;
}
.clip-indicator.clipping { background: var(--danger); box-shadow: 0 0 6px var(--danger); }


/* ════════════════════════════════════════════════
   17. TIMELINE (Video Editor)
   ════════════════════════════════════════════════ */
#timeline-container {
  height: var(--timeline-height);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.timeline-toolbar {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px; background: var(--surface-hover);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}

.timeline-toolbar .ctrl-btn {
  width: 28px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; color: var(--text-secondary);
  cursor: pointer; border-radius: var(--r-sm); font-size: 13px; transition: all 0.12s;
}

.timeline-toolbar .ctrl-btn:hover { background: var(--surface-hover); color: var(--text); }
.timeline-toolbar .ctrl-btn.active { color: var(--brand-light); background: var(--brand-glow); }

.toolbar-separator {
  width: 1px; height: 18px; background: var(--border);
}

.timeline-time-display {
  font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-secondary); margin-left: 6px;
}

.timeline-time-display .current-time { color: var(--brand-light); font-weight: 600; }

.zoom-control { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.zoom-control label { font-size: 11px; color: var(--text-muted); }
.zoom-slider { width: 80px; }

/* -- Timeline Canvas Area --------------------- */
.timeline-scroll-area {
  flex: 1; display: flex; overflow: hidden; position: relative;
}

.timeline-track-labels {
  width: 100px; flex-shrink: 0; background: var(--surface-hover);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
}

.track-label {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px; font-size: 11px; color: var(--text-secondary);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}

.track-label .track-name { font-weight: 500; }
.track-label .track-actions { display: flex; gap: 2px; }

.track-label .track-btn {
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 10px; border-radius: 2px;
}

.track-label .track-btn:hover { color: var(--text); background: var(--surface-hover); }
.track-label .track-btn.muted { color: var(--danger); }

.timeline-canvas-wrap {
  flex: 1; overflow-x: auto; overflow-y: hidden; position: relative;
}

.timeline-canvas { display: block; }

.timeline-ruler-area { height: 28px; flex-shrink: 0; }

.track-label.video-track { height: 50px; }
.track-label.audio-track { height: 44px; }


/* ════════════════════════════════════════════════
   18. VIDEO PLAYER
   ════════════════════════════════════════════════ */
#player-container {
  flex: 1; display: flex; flex-direction: column; background: var(--bg); min-height: 0;
}

.player-viewport {
  flex: 1; display: flex; align-items: center; justify-content: center;
  position: relative; min-height: 0; overflow: hidden; background: #000;
}

.player-canvas { max-width: 100%; max-height: 100%; background: #000; }

.player-empty-state {
  position: absolute; text-align: center; color: var(--text-muted);
}
.player-empty-state .empty-icon { font-size: 48px; margin-bottom: 10px; opacity: 0.3; }
.player-empty-state p { font-size: 13px; }

.player-controls {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px;
  background: var(--surface); border-top: 1px solid var(--border); flex-shrink: 0;
}

.player-controls .ctrl-btn {
  width: 30px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; color: var(--text-secondary);
  cursor: pointer; border-radius: var(--r-sm); font-size: 14px; transition: all 0.12s;
}

.player-controls .ctrl-btn:hover { background: var(--surface-hover); color: var(--text); }
.player-controls .ctrl-btn.playing { color: var(--brand-light); }

.player-time {
  font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-secondary);
  min-width: 140px; text-align: center;
}

.player-time .current { color: var(--text); font-weight: 500; }

.player-progress {
  flex: 1; height: 4px; background: var(--surface-active);
  border-radius: 2px; cursor: pointer; position: relative;
}

.player-progress-fill {
  height: 100%; background: var(--brand); border-radius: 2px; transition: width 0.05s linear;
}

.player-progress:hover { height: 6px; }

/* -- Text overlay preview --------------------- */
.text-overlay-preview {
  position: absolute; cursor: move; user-select: none; pointer-events: auto;
}


/* ════════════════════════════════════════════════
   19. WAVEFORM DISPLAY (Audio Editor)
   ════════════════════════════════════════════════ */

/* -- Overview bar ----------------------------- */
#overview-bar {
  height: 32px; background: var(--surface); border-bottom: 1px solid var(--border);
  position: relative; flex-shrink: 0;
}

#overview-canvas { width: 100%; height: 100%; display: block; }

#overview-viewport {
  position: absolute; top: 0; height: 100%;
  background: rgba(234, 88, 12, 0.15);
  border-left: 2px solid var(--brand);
  border-right: 2px solid var(--brand);
  pointer-events: none;
}

/* -- Time ruler ------------------------------- */
#time-ruler {
  height: 24px; background: var(--ruler-bg); border-bottom: 1px solid var(--border);
  flex-shrink: 0; cursor: pointer; position: relative;
}

#ruler-canvas { width: 100%; height: 100%; display: block; }

/* -- Track area ------------------------------- */
#track-area { flex: 1; overflow-y: auto; overflow-x: hidden; background: var(--bg); }
#track-list { min-height: 100%; }

/* -- Track row -------------------------------- */
.track-row {
  display: flex; border-bottom: 1px solid var(--border); min-height: 120px; position: relative;
}

.track-controls {
  width: 160px; min-width: 160px; background: var(--surface);
  border-right: 1px solid var(--border); padding: 8px;
  display: flex; flex-direction: column; gap: 6px; flex-shrink: 0;
}

.track-name {
  font-size: 12px; font-weight: 600; padding: 2px 4px;
  background: transparent; border: 1px solid transparent;
  border-radius: var(--radius); color: var(--text); cursor: text; width: 100%;
}

.track-name:focus {
  background: var(--surface-active); border-color: var(--brand); outline: none;
}

.track-color-bar { height: 3px; border-radius: 2px; margin-bottom: 2px; }

.track-volume-row, .track-pan-row {
  display: flex; align-items: center; gap: 4px;
}

.track-volume-row label, .track-pan-row label {
  font-size: 10px; color: var(--text-muted); width: 24px; flex-shrink: 0;
}

.track-slider {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 4px; background: var(--border); border-radius: 2px; outline: none;
}

.track-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%;
  background: var(--brand); cursor: pointer;
}

.track-slider::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--brand); cursor: pointer; border: none;
}

.track-volume-val, .track-pan-val {
  font-size: 10px; color: var(--text-muted); width: 32px;
  text-align: right; font-family: var(--font-mono);
}

.track-buttons { display: flex; gap: 4px; }

.track-btn {
  width: 24px; height: 20px; border: 1px solid var(--border); border-radius: 3px;
  background: var(--surface-hover); color: var(--text-secondary);
  font-size: 10px; font-weight: 700; cursor: pointer; transition: all 0.15s;
}

.track-btn:hover { border-color: var(--brand); }
.track-btn.active-mute { background: var(--danger); border-color: var(--danger); color: #fff; }
.track-btn.active-solo { background: var(--warning); border-color: var(--warning); color: #000; }

.track-btn-remove {
  margin-left: auto; background: none; border: none;
  color: var(--text-muted); cursor: pointer; font-size: 14px;
}
.track-btn-remove:hover { color: var(--danger); }

/* -- Waveform container ----------------------- */
.track-waveform {
  flex: 1; position: relative; overflow: hidden; cursor: text; background: var(--waveform-bg);
}

.track-waveform canvas { display: block; width: 100%; height: 100%; }

.waveform-selection {
  position: absolute; top: 0; bottom: 0;
  background: var(--selection-bg);
  border-left: 1px solid var(--selection-border);
  border-right: 1px solid var(--selection-border);
  pointer-events: none;
}

.selection-handle-left { background: linear-gradient(90deg, var(--brand), transparent); }
.selection-handle-right { background: linear-gradient(270deg, var(--brand), transparent); }

/* -- Playhead --------------------------------- */
.playhead {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: var(--playhead-color); pointer-events: none; z-index: 20;
  box-shadow: 0 0 4px rgba(251, 146, 60, 0.5);
}

.cursor-line {
  position: absolute; top: 0; bottom: 0; width: 1px;
  background: var(--text-secondary); pointer-events: none; z-index: 15;
}

/* -- Track VU meter --------------------------- */
.track-meter {
  width: 100%; height: 6px; background: var(--bg);
  border-radius: 3px; overflow: hidden; margin-top: auto;
}

.track-meter-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--meter-green), var(--meter-yellow), var(--meter-red));
  border-radius: 3px; transition: width 0.05s;
}

/* -- Empty/add track states ------------------- */
.track-empty {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-muted); font-size: 13px; pointer-events: none;
}

#add-track-bar {
  padding: 8px 16px; background: var(--surface);
  border-top: 1px solid var(--border); flex-shrink: 0;
}

#btn-add-track {
  padding: 4px 16px; background: var(--surface-hover);
  border: 1px dashed var(--border); color: var(--text-secondary);
  border-radius: var(--radius); cursor: pointer; font-size: 12px; transition: all 0.15s;
}

#btn-add-track:hover { border-color: var(--brand); color: var(--brand); }

.no-tracks-msg {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 200px; color: var(--text-muted); gap: 12px;
}

.no-tracks-msg .icon { font-size: 40px; opacity: 0.3; }
.no-tracks-msg p { font-size: 14px; }

.no-tracks-msg button {
  padding: 8px 24px; background: var(--brand); border: none; color: #fff;
  border-radius: var(--radius); cursor: pointer; font-size: 13px;
}
.no-tracks-msg button:hover { background: var(--brand-dark); }

/* -- Spectrogram mode ------------------------- */
.track-waveform.spectrogram-mode canvas { background: #0a0a0a; }

/* -- Automation lane -------------------------- */
.automation-point { cursor: grab; }
.automation-point:active { cursor: grabbing; }


/* ════════════════════════════════════════════════
   20. TRACK CONTROLS (Audio Volume, Pan, Mute, Solo)
   Covered in section 19 (.track-controls, etc.)
   ════════════════════════════════════════════════ */
/* -- Audio bottom panel info ------------------ */
#bottom-panel {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 6px 16px; flex-shrink: 0;
}

/* -- EQ Sliders ------------------------------- */
.eq-container { display: flex; gap: 8px; justify-content: center; padding: 12px 0; }

.eq-band { display: flex; flex-direction: column; align-items: center; gap: 4px; }

.eq-band input[type="range"] {
  writing-mode: vertical-lr; direction: rtl; height: 100px; width: 24px; accent-color: var(--brand);
}

.eq-band label { font-size: 10px; color: var(--text-muted); }
.eq-band .eq-val { font-size: 10px; color: var(--brand-light); font-family: var(--font-mono); }

#btn-learn-noise { padding: 6px 16px; font-size: 12px; }
#noise-profile-status { margin-left: 8px; }


/* ════════════════════════════════════════════════
   21. VU METERS
   ════════════════════════════════════════════════ */

/* -- Audio mixer panel ------------------------ */
.mixer-panel {
  position: fixed; bottom: 0; left: 0; right: 0; height: 320px;
  background: var(--surface); border-top: 2px solid var(--brand);
  z-index: 300; display: flex; flex-direction: column;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
}
.mixer-panel.hidden { display: none; }

/* -- Video audio mixer panel ------------------ */
.audio-mixer-panel {
  position: fixed; bottom: var(--timeline-height); right: 0;
  width: 420px; max-width: 90vw;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--shadow-lg); z-index: 500;
  display: flex; flex-direction: column; overflow: hidden;
}
.audio-mixer-panel.hidden { display: none; }

.mixer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; background: var(--surface-hover);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
  font-weight: 600; font-size: 13px;
}

.mixer-title {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.4px; color: var(--text-secondary);
}

.mixer-close-btn {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; border-radius: var(--r-sm); font-size: 14px;
}
.mixer-close-btn:hover { background: var(--surface-hover); color: var(--text); }

.mixer-header button {
  background: none; border: none; color: var(--text-secondary);
  font-size: 18px; cursor: pointer;
}
.mixer-header button:hover { color: var(--text); }

.mixer-channels {
  display: flex; gap: 2px; padding: 8px;
  overflow-x: auto; flex: 1; background: var(--bg);
}

.mixer-channel {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; min-width: 68px; padding: 6px 4px;
  background: var(--surface); border-radius: var(--r-sm);
  border: 1px solid var(--border);
}

.mixer-channel.mixer-master {
  border-color: var(--brand); min-width: 120px;
}

.mixer-channel-label, .mixer-ch-label {
  font-size: 10px; font-weight: 600; color: var(--text-secondary);
  text-align: center; padding-bottom: 4px; border-bottom: 2px solid var(--border); width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.mixer-master .mixer-channel-label { color: var(--brand-light); }

.mixer-vu-meter {
  display: flex; gap: 3px; height: 80px; align-items: flex-end;
}

.vu-bar-bg {
  width: 10px; height: 100%; background: var(--bg);
  border-radius: 2px; position: relative; overflow: hidden;
  display: flex; align-items: flex-end;
}

.vu-bar-fill {
  width: 100%; background: var(--success); border-radius: 2px;
  transition: height 0.06s linear; min-height: 1px;
}

.vu-scale {
  display: flex; flex-direction: column; justify-content: space-between;
  height: 100%; font-size: 7px; color: var(--text-muted);
}

.mixer-fader-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}

.mixer-fader {
  writing-mode: vertical-lr; direction: rtl;
  width: 20px; height: 70px;
  -webkit-appearance: slider-vertical;
  accent-color: var(--brand);
  cursor: pointer;
}

.mixer-fader-val {
  font-size: 9px; color: var(--text-muted);
  font-variant-numeric: tabular-nums; font-family: var(--font-mono);
  text-align: center;
}

.mixer-pan-wrap { display: flex; align-items: center; gap: 2px; }
.mixer-pan-label { font-size: 8px; color: var(--text-muted); }
.mixer-pan { width: 50px; height: 3px; }

.mixer-buttons, .mixer-btn-row { display: flex; gap: 3px; }

.mixer-btn {
  width: 22px; height: 18px; font-size: 9px; font-weight: 700;
  border: 1px solid var(--border); border-radius: 2px;
  background: var(--surface-hover); color: var(--text-muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.12s; font-family: var(--font);
}

.mixer-btn:hover { background: var(--surface-hover); color: var(--text); border-color: var(--brand); }
.mixer-btn.active-red { background: var(--danger); color: white; border-color: var(--danger); }
.mixer-btn.active-green { background: var(--success); color: white; border-color: var(--success); }
.mixer-btn.active-yellow { background: var(--warning); color: #1a1a1a; border-color: var(--warning); }
.mixer-btn.active-mute { background: var(--danger); border-color: var(--danger); color: #fff; }
.mixer-btn.active-solo { background: var(--warning); border-color: var(--warning); color: #000; }

/* -- Mixer vertical meter --------------------- */
.mixer-meter-vert {
  width: 8px; height: 100px; background: var(--bg);
  border-radius: 4px; overflow: hidden; position: relative;
  border: 1px solid var(--border); display: flex; flex-direction: column; justify-content: flex-end;
}

.mixer-meter-stereo { width: 20px; display: flex; gap: 2px; }

.mixer-meter-fill-vert {
  width: 100%; height: 0%;
  background: linear-gradient(0deg, var(--meter-green) 0%, var(--meter-green) 60%, var(--meter-yellow) 80%, var(--meter-red) 100%);
  border-radius: 4px; transition: height 0.05s;
}

.mixer-knob-row {
  display: flex; align-items: center; gap: 4px; width: 100%;
}
.mixer-knob-row label { font-size: 9px; color: var(--text-muted); min-width: 24px; }
.mixer-knob { flex: 1; height: 4px; accent-color: var(--brand); }

.mixer-peak-display {
  display: flex; flex-direction: column; gap: 2px;
  font-size: 9px; color: var(--text-muted); font-family: var(--font-mono);
}
.mixer-peak-display b { color: var(--brand-light); }

.mixer-correlation { width: 100%; text-align: center; }
.mixer-correlation label { font-size: 8px; color: var(--text-muted); }

.mixer-corr-bar {
  width: 100%; height: 4px; background: var(--bg);
  border-radius: 2px; overflow: hidden; margin-top: 2px;
}

.mixer-corr-fill {
  height: 100%; width: 50%; background: var(--meter-green);
  transition: width 0.1s; border-radius: 2px;
}


/* ════════════════════════════════════════════════
   22. TEMPLATE BROWSER / SHAPE LIBRARY
   ════════════════════════════════════════════════ */

/* -- Template overlay / browser --------------- */
.template-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 200;
  display: flex; align-items: center; justify-content: center;
}

.template-browser {
  background: var(--surface); border-radius: var(--r-xl);
  width: 720px; max-width: 90vw; max-height: 80vh;
  display: flex; flex-direction: column;
}

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

.template-browser-header h2 { font-size: 18px; font-weight: 700; color: var(--text-bright); }

.template-browser-close {
  width: 32px; height: 32px; border-radius: 50%; background: var(--bg);
  border: none; color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--ease);
}
.template-browser-close:hover { background: var(--color-error-light); color: var(--danger); }

.template-categories {
  display: flex; gap: 8px; padding: 16px 24px;
  border-bottom: 1px solid var(--border); overflow-x: auto;
}

.template-cat-btn {
  padding: 6px 14px; font-size: 13px; font-weight: 500;
  border-radius: var(--r-pill); background: var(--bg);
  border: 1px solid var(--border); color: var(--text-secondary);
  cursor: pointer; white-space: nowrap; transition: all var(--ease);
}

.template-cat-btn:hover { border-color: var(--brand); color: var(--brand); }
.template-cat-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.template-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px; padding: 20px 24px; overflow-y: auto; flex: 1;
}

.template-card {
  aspect-ratio: 1; border-radius: var(--r-md); overflow: hidden; cursor: pointer;
  border: 2px solid transparent; transition: all 250ms; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}

.template-card:hover {
  border-color: var(--brand); transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(242,0,0,0.15);
}

.template-card canvas { max-width: 100%; max-height: 100%; }

/* -- Shape Library ---------------------------- */
.shape-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}

.shape-item {
  aspect-ratio: 1; border-radius: var(--r-sm); background: var(--bg);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--ease); padding: 8px;
}

.shape-item:hover { border-color: var(--brand); background: var(--brand-glow); }
.shape-item svg { width: 100%; height: 100%; color: var(--text-secondary); }
.shape-item:hover svg { color: var(--brand); }

/* -- Size picker modal (logo creator) --------- */
.size-picker-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 200;
  display: flex; align-items: center; justify-content: center;
}

.size-picker {
  background: var(--surface); border-radius: var(--r-xl);
  padding: 32px; width: 420px; max-width: 90vw;
}

.size-picker h2 { font-size: 20px; font-weight: 700; margin-bottom: 20px; color: var(--text-bright); }

.size-presets {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-bottom: 20px;
}

.size-preset {
  padding: 10px; text-align: center; border: 1px solid var(--border);
  border-radius: var(--r-sm); cursor: pointer; transition: all var(--ease); font-size: 13px;
  color: var(--text);
}

.size-preset:hover { border-color: var(--brand); background: var(--brand-glow); }
.size-preset.active { border-color: var(--brand); background: var(--brand); color: #fff; }

.size-preset .preset-name { font-weight: 600; display: block; }
.size-preset .preset-dims { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.size-preset.active .preset-dims { color: rgba(255,255,255,0.7); }

.size-custom { display: flex; gap: 12px; margin-bottom: 20px; }

.size-custom input {
  flex: 1; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: var(--r-sm); font-size: 14px; outline: none;
  background: var(--surface); color: var(--text);
}

.size-custom input:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow);
}

.size-actions { display: flex; gap: 12px; justify-content: flex-end; }

/* -- Font picker dropdown --------------------- */
.font-picker-dropdown {
  max-height: 200px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); margin-top: 4px;
}

.font-picker-item {
  padding: 8px 12px; font-size: 14px; cursor: pointer;
  transition: background var(--ease); color: var(--text);
}

.font-picker-item:hover { background: var(--brand-glow); }
.font-picker-item.active { background: var(--brand); color: #fff; }


/* ════════════════════════════════════════════════
   23. EXPORT DIALOG
   ════════════════════════════════════════════════ */

/* -- Video export form ------------------------ */
.export-form .form-group { margin-bottom: 14px; }

.export-form .form-label {
  display: block; font-size: 11.5px; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 5px;
}

.export-form select, .export-form input { width: 100%; }

.export-form .radio-group { display: flex; gap: 10px; flex-wrap: wrap; }

.export-form .radio-option {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text-secondary); cursor: pointer;
}

.export-form .radio-option input { width: auto; accent-color: var(--brand); }

.export-progress { margin-top: 12px; }

.export-progress-bar {
  width: 100%; height: 8px; background: var(--surface-active);
  border-radius: 4px; overflow: hidden; margin-bottom: 8px;
}

.export-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-light));
  border-radius: 4px; transition: width 0.3s ease; width: 0%;
}

.export-progress-text {
  font-size: 12px; color: var(--text-secondary); text-align: center;
}

/* -- Logo creator export dialog --------------- */
.export-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 200;
  display: flex; align-items: center; justify-content: center;
}

.export-dialog {
  background: var(--surface); border-radius: var(--r-xl);
  width: 480px; max-width: 90vw; padding: 32px;
  box-shadow: var(--shadow-lg); text-align: center;
}

.export-dialog h2, .export-dialog h3 {
  font-size: 20px; font-weight: 700; margin-bottom: 24px; color: var(--text-bright);
}

.export-format-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-bottom: 24px;
}

.export-format-btn {
  padding: 16px 12px; text-align: center;
  border: 1px solid var(--border); border-radius: var(--r-md);
  cursor: pointer; transition: all var(--ease); background: var(--surface); color: var(--text);
}

.export-format-btn:hover { border-color: var(--brand); background: var(--brand-glow); }
.export-format-btn.active { border-color: var(--brand); background: var(--brand); color: #fff; }

.export-format-btn .format-name { font-size: 16px; font-weight: 700; display: block; }
.export-format-btn .format-desc { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.export-format-btn.active .format-desc { color: rgba(255,255,255,0.7); }

.export-options { margin-bottom: 24px; }

.export-option-row {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}

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

.export-option-row input,
.export-option-row select {
  padding: 7px 12px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; outline: none; width: 140px;
  background: var(--surface); color: var(--text);
}

.export-option-row input:focus,
.export-option-row select:focus { border-color: var(--brand); }

.export-actions { display: flex; gap: 12px; justify-content: flex-end; }
.export-actions .btn-primary { padding: 10px 24px; font-size: 15px; }
.export-actions .btn-secondary { padding: 10px 24px; font-size: 15px; }

/* -- Progress bar (audio editor) -------------- */
.progress-bar {
  width: 100%; height: 6px; background: var(--bg);
  border-radius: 3px; overflow: hidden; margin: 8px 0;
}

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


/* ════════════════════════════════════════════════
   24. WELCOME SCREEN / UPLOAD OVERLAY
   ════════════════════════════════════════════════ */

/* -- Logo creator welcome --------------------- */
.editor-welcome {
  text-align: center; padding: 60px 24px; max-width: 600px; margin: 0 auto;
}

.editor-welcome h1 {
  font-size: 32px; font-weight: 800; color: #fff; margin-bottom: 12px;
}

.editor-welcome h1 span {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.editor-welcome p {
  font-size: 16px; color: var(--text-secondary); margin-bottom: 32px; line-height: 1.5;
}

.welcome-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.welcome-card {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r-xl); padding: 24px; width: 170px;
  cursor: pointer; transition: all 250ms; text-align: center;
}

.welcome-card:hover {
  background: rgba(255,255,255,0.1); border-color: var(--brand); transform: translateY(-2px);
}

.welcome-card svg { width: 32px; height: 32px; stroke: var(--brand); margin-bottom: 12px; }
.welcome-card .card-title { font-size: 14px; font-weight: 600; color: #fff; margin-bottom: 4px; }
.welcome-card .card-desc { font-size: 12px; color: var(--panel-text-muted); }

/* -- PDF editor upload overlay (dark themed) -- */
.editor-upload-overlay {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: var(--bg); z-index: 100;
}

.upload-modal { text-align: center; max-width: 480px; width: 100%; padding: 40px; }
.upload-logo { margin-bottom: 20px; }
.upload-modal h2 { font-size: 26px; font-weight: 700; margin-bottom: 8px; color: var(--text-bright); }
.upload-hint { color: var(--text-muted); margin-bottom: 28px; font-size: 14px; }

.upload-drop-area {
  border: 2px dashed var(--border-light); border-radius: 16px; padding: 40px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  cursor: pointer; transition: all .2s; color: var(--text-secondary); background: var(--surface);
}

.upload-drop-area:hover, .upload-drop-area.drag-over {
  border-color: var(--brand); background: var(--brand-glow); color: var(--brand-light);
}

.upload-or { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

.upload-browse-btn {
  padding: 10px 28px; background: var(--brand); color: #fff; border: none; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: background .2s;
}
.upload-browse-btn:hover { background: var(--brand-dark); }

.back-link { display: inline-block; margin-top: 24px; color: var(--text-muted); text-decoration: none; font-size: 13px; }
.back-link:hover { color: var(--brand); }

/* -- Image editor drop zone ------------------- */
.drop-zone-overlay {
  position: fixed; inset: 0; background: rgba(242,0,0,0.08);
  border: 3px dashed var(--brand); z-index: 9000;
  display: flex; align-items: center; justify-content: center;
}

.drop-zone-content {
  text-align: center; color: var(--brand-light); font-size: 18px; font-weight: 600;
}
.drop-zone-content p { margin-top: 12px; }

#fileInput { display: none; }

/* -- PDF editor loading (dark themed) --------- */
.editor-loading {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(17,17,24,.85); z-index: 200;
}

.editor-loading-inner { text-align: center; color: var(--text); }

.editor-loading-spinner {
  width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--brand);
  border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 12px;
}

/* -- PDF tooltip (dark themed) ---------------- */
.topbar-icon-btn[title]::after {
  content: attr(title); position: absolute; bottom: -28px; left: 50%; transform: translateX(-50%);
  background: var(--elevated); color: var(--text); padding: 3px 8px; border-radius: 4px; font-size: 11px;
  white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 100;
}
.topbar-icon-btn[title]:hover::after { opacity: 1; }


/* ════════════════════════════════════════════════
   25. COLOR PICKERS & SWATCHES
   ════════════════════════════════════════════════ */

/* -- PDF color swatches (dark themed) --------- */
.color-swatches { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }

.color-swatch {
  width: 24px; height: 24px; border-radius: 4px; border: 2px solid transparent;
  cursor: pointer; transition: all .12s; flex-shrink: 0;
}

.color-swatch:hover { transform: scale(1.15); }
.color-swatch.active { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }

.color-swatch.no-fill {
  background: var(--surface) !important; position: relative; overflow: hidden;
}

.color-swatch.no-fill::after {
  content: ''; position: absolute; top: 50%; left: -2px; width: 130%; height: 2px;
  background: var(--danger); transform: rotate(-45deg); transform-origin: center;
}

.color-picker-wrap { position: relative; width: 24px; height: 24px; flex-shrink: 0; }

.color-picker-wrap input[type="color"] {
  position: absolute; inset: 0; width: 100%; height: 100%; border: none; padding: 0;
  cursor: pointer; border-radius: 4px; opacity: 0;
}

.color-picker-icon {
  width: 24px; height: 24px; border-radius: 4px; border: 1px dashed var(--border-light);
  display: flex; align-items: center; justify-content: center; pointer-events: none;
  font-size: 16px; color: var(--text-muted);
}

/* -- Video editor keyframe styles ------------- */
.keyframe-row .kf-label { cursor: pointer; display: flex; align-items: center; gap: 4px; }

.kf-diamond { color: var(--text-muted); font-size: 10px; transition: color 0.15s; }
.kf-diamond.active { color: #f59e0b; }
.kf-label:hover .kf-diamond { color: #f59e0b; }
.kf-value { font-size: 10px; color: var(--text-muted); min-width: 40px; }

.kf-add-btn {
  font-size: 9px !important; padding: 2px 6px !important;
  background: var(--surface-active) !important; color: var(--text-muted) !important;
  border: 1px solid var(--border) !important;
}
.kf-add-btn:hover { background: var(--brand) !important; color: white !important; }

.kf-list { margin-left: 16px; margin-bottom: 6px; padding-left: 8px; border-left: 2px solid var(--border); }

.kf-item {
  display: flex; align-items: center; gap: 5px;
  padding: 2px 0; font-size: 10px; color: var(--text-muted);
}

.kf-diamond-sm { color: #f59e0b; font-size: 8px; }
.kf-time { color: var(--text-secondary); font-variant-numeric: tabular-nums; min-width: 38px; }
.kf-val { color: var(--text-muted); min-width: 30px; }

.kf-easing {
  font-size: 9px; padding: 1px 3px; background: var(--surface-hover);
  border: 1px solid var(--border); color: var(--text-muted); border-radius: 2px; max-width: 65px;
}

.kf-remove-btn {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 10px; padding: 0 3px; border-radius: 2px;
}
.kf-remove-btn:hover { background: var(--danger); color: white; }

/* -- Color grading wheels --------------------- */
.cg-wheels-row { display: flex; justify-content: space-around; gap: 6px; margin: 8px 0; }
.cg-wheel-group { display: flex; flex-direction: column; align-items: center; }
.cg-wheel { display: flex; flex-direction: column; align-items: center; cursor: crosshair; }
.cg-wheel-canvas { border-radius: 50%; border: 2px solid var(--border); cursor: crosshair; }
.cg-wheel-canvas:hover { border-color: var(--brand); }
.cg-wheel-label { font-size: 9px; color: var(--text-muted); margin-top: 3px; text-align: center; }

/* -- Video sticker panel ---------------------- */
.sticker-panel {
  position: fixed; top: var(--header-height); right: 0; width: 280px;
  max-height: calc(100vh - var(--header-height) - var(--timeline-height));
  background: var(--surface); border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg);
  z-index: 400; display: flex; flex-direction: column; overflow: hidden;
  border-radius: 0 0 0 var(--r-lg);
}
.sticker-panel.hidden { display: none; }

.sticker-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}

.sticker-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 4px; padding: 8px; overflow-y: auto; flex: 1;
}

.sticker-item {
  aspect-ratio: 1; padding: 4px; background: var(--surface-hover);
  border-radius: var(--r-sm); cursor: pointer; border: 1px solid transparent;
  transition: all 0.12s; display: flex; align-items: center; justify-content: center;
}

.sticker-item:hover { border-color: var(--brand); background: var(--surface-active); transform: scale(1.08); }
.sticker-item svg { width: 100%; height: 100%; }

/* -- Green screen ----------------------------- */
.gs-color-label { font-family: var(--font-mono); }

/* -- Marker styles ---------------------------- */
.marker-badge {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 1px; transform: rotate(45deg); margin-right: 4px;
}

/* -- Audio markers panel ---------------------- */
#markers-panel {
  background: var(--surface); border-top: 1px solid var(--border);
  max-height: 200px; overflow-y: auto; flex-shrink: 0;
}
#markers-panel.hidden { display: none; }

.markers-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 16px; border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 12px; color: var(--text-bright);
}

.markers-panel-header button {
  background: none; border: none; color: var(--text-secondary);
  font-size: 16px; cursor: pointer;
}
.markers-panel-header button:hover { color: var(--text); }

.markers-panel-body { padding: 8px 16px; }

.markers-panel-body h4 {
  font-size: 11px; color: var(--text-muted); margin: 6px 0 4px;
  text-transform: uppercase; letter-spacing: 0.5px;
}

.marker-item, .region-item {
  display: flex; align-items: center; gap: 8px; padding: 3px 0;
  font-size: 12px; border-bottom: 1px solid var(--border);
}

.marker-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.marker-time {
  font-family: var(--font-mono); font-size: 11px; color: var(--brand-light); min-width: 70px;
}

.marker-label {
  flex: 1; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.marker-goto, .region-export, .marker-del {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 13px; padding: 2px 4px;
}

.marker-goto:hover, .region-export:hover { color: var(--brand); }
.marker-del:hover { color: var(--danger); }

.markers-actions {
  display: flex; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border);
}
.markers-actions button { font-size: 11px; padding: 4px 12px; }


/* ════════════════════════════════════════════════
   26. UTILITY CLASSES & MISC
   ════════════════════════════════════════════════ */

/* -- Generic inputs (video editor global) ----- */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%; height: 4px;
  background: var(--surface-active);
  border-radius: 2px; outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--brand); cursor: pointer;
  border: 2px solid var(--surface);
}

input[type="range"]::-webkit-slider-thumb:hover { background: var(--brand-dark); }

input[type="number"],
input[type="text"],
select {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 11.5px;
  padding: 4px 6px;
  outline: none;
  transition: border-color 0.15s;
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus { border-color: var(--brand); }

input[type="number"] { width: 55px; }
select { cursor: pointer; }

input[type="color"] {
  width: 28px; height: 24px; border: 1px solid var(--border);
  border-radius: var(--r-sm); background: none; cursor: pointer; padding: 1px;
}

/* -- Resizer handles (video editor) ----------- */
.resizer {
  background: var(--border); cursor: col-resize; width: 3px;
  flex-shrink: 0; transition: background 0.15s;
}
.resizer:hover { background: var(--brand); }
.resizer-h { cursor: row-resize; height: 3px; width: 100%; }

/* -- Drag ghost (video editor) ---------------- */
.drag-ghost {
  position: fixed; pointer-events: none; z-index: 4000;
  opacity: 0.7; transform: scale(0.8);
  background: var(--surface-hover); border: 1px solid var(--brand);
  border-radius: var(--r-md); padding: 4px 10px;
  font-size: 11px; color: var(--text);
}

/* -- Loading spinner -------------------------- */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--surface-active);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* -- Utility classes -------------------------- */
.flex-1 { flex: 1; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.gap-2 { gap: 8px; }


/* ════════════════════════════════════════════════
   26. RESPONSIVE
   ════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  :root {
    --panel-w: 220px;
  }
  .editor-sidebar-right { width: 240px; }
}

@media (max-width: 900px) {
  .editor-sidebar-right { display: none; }
  :root { --ed-sidebar-left-w: 100px; }
}

@media (max-width: 768px) {
  :root {
    --panel-w: 0px;
    --toolbar-w: 44px;
  }
  .editor-panel { display: none; }
  .editor-toolbar { width: 44px; }
  .tool-btn { width: 36px; height: 36px; }

  /* Logo creator responsive */
  .editor-sidebar-left {
    width: 100%;
    flex-direction: row;
    height: 52px;
    padding: 0 8px;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--panel-border);
  }

  .editor-sidebar-right {
    width: 100%;
    max-height: 200px;
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .editor-canvas-area { min-height: 300px; }
  .editor-sidebar-left .tool-btn { width: 44px; height: 44px; }
  .tool-separator { width: 1px; height: 32px; margin: 0 4px; }
  .welcome-actions { flex-direction: column; align-items: center; }
  .welcome-card { width: 100%; max-width: 200px; }
  .template-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

@media (max-width: 600px) {
  .editor-sidebar-left { display: none; }
  .doc-name { display: none; }
}

@media (max-width: 480px) {
  .app-header { height: 48px; }
  .editor-welcome h1 { font-size: 24px; }
  .editor-welcome p { font-size: 14px; }
  .size-picker { padding: 20px; }
  .size-presets { grid-template-columns: repeat(2, 1fr); }
  .export-format-grid { grid-template-columns: repeat(2, 1fr); }
  .context-toolbar { flex-wrap: wrap; max-width: 90vw; }
}

/* ════════════════════════════════════════════════
   SHARED UI ENHANCEMENTS — Canva-Style
   ════════════════════════════════════════════════ */

/* ── Better Tooltips ─────────────────────── */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(100% + 8px);
  background: #1a1a2e;
  color: #e8eaf0;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 150ms ease;
  z-index: 9999;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  border: 1px solid #2e2e44;
}
[data-tooltip]:hover::after {
  opacity: 1;
}
/* Position variants */
[data-tooltip-pos="right"]::after {
  left: calc(100% + 8px); bottom: auto; top: 50%; transform: translateY(-50%);
}
[data-tooltip-pos="bottom"]::after {
  bottom: auto; top: calc(100% + 8px);
}

/* ── Welcome Screen ──────────────────────── */
.welcome-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 5000;
  animation: fadeIn 300ms ease;
}
.welcome-card {
  background: var(--surface, #1a1a26);
  border: 1px solid var(--border, #2e2e44);
  border-radius: 16px;
  padding: 40px;
  max-width: 560px;
  width: 90%;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}
.welcome-card h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-bright, #f8f9fb);
  margin-bottom: 8px;
}
.welcome-card p {
  color: var(--text-secondary, #9ca3b4);
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.6;
}
.welcome-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.welcome-action-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 20px 24px;
  background: var(--surface-hover, #222232);
  border: 1px solid var(--border, #2e2e44);
  border-radius: 12px;
  color: var(--text, #e8eaf0);
  cursor: pointer;
  transition: all 200ms ease;
  min-width: 140px;
}
.welcome-action-btn:hover {
  background: var(--surface-active, #2a2a3e);
  border-color: var(--brand, #F20000);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.welcome-action-btn svg {
  width: 32px; height: 32px;
  stroke: var(--brand, #F20000);
}
.welcome-action-btn span {
  font-size: 13px; font-weight: 600;
}
.welcome-action-btn small {
  font-size: 11px; color: var(--text-muted, #616880);
}
.welcome-dismiss {
  margin-top: 16px; font-size: 12px; color: var(--text-muted);
  cursor: pointer; background: none; border: none;
}
.welcome-dismiss:hover { color: var(--text-secondary); }

/* ── Loading Overlay ─────────────────────── */
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 9000; gap: 16px;
}
.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border, #2e2e44);
  border-top-color: var(--brand, #F20000);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.loading-text {
  color: var(--text-secondary, #9ca3b4);
  font-size: 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Toast with Undo Button ──────────────── */
.toast-undo-btn {
  margin-left: 12px;
  padding: 4px 12px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms;
}
.toast-undo-btn:hover { background: rgba(255,255,255,0.25); }

/* ── Keyboard Shortcuts Modal ────────────── */
.shortcuts-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 8000;
  animation: fadeIn 200ms ease;
}
.shortcuts-card {
  background: var(--surface, #1a1a26);
  border: 1px solid var(--border, #2e2e44);
  border-radius: 12px;
  padding: 24px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}
.shortcuts-card h3 {
  font-size: 18px; font-weight: 700;
  color: var(--text-bright, #f8f9fb);
  margin-bottom: 16px;
  display: flex; justify-content: space-between; align-items: center;
}
.shortcuts-card h3 button {
  background: none; border: none; color: var(--text-muted);
  font-size: 20px; cursor: pointer; padding: 4px;
}
.shortcuts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
}
.shortcut-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border, #2e2e44);
}
.shortcut-item:last-child { border-bottom: none; }
.shortcut-label { color: var(--text-secondary, #9ca3b4); font-size: 12px; }
.shortcut-keys {
  display: flex; gap: 4px;
}
.shortcut-key {
  background: var(--surface-hover, #222232);
  border: 1px solid var(--border, #2e2e44);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text, #e8eaf0);
  min-width: 24px;
  text-align: center;
}

/* ── Better Focus Styles ─────────────────── */
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--brand, #F20000);
  outline-offset: 2px;
}

/* ── Tool Button with Label ──────────────── */
.tool-btn-labeled {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 6px 4px;
  border-radius: 6px; cursor: pointer;
  transition: all var(--ease, 200ms ease);
  color: var(--text-secondary, #9ca3b4);
  position: relative;
  min-width: 48px;
}
.tool-btn-labeled:hover {
  background: var(--surface-hover, #222232);
  color: var(--text, #e8eaf0);
}
.tool-btn-labeled.active {
  background: var(--brand-subtle, rgba(242, 0, 0, 0.08));
  color: var(--brand, #F20000);
}
.tool-btn-labeled svg {
  width: 20px; height: 20px;
}
.tool-btn-labeled .tool-name {
  font-size: 9px;
  letter-spacing: 0.02em;
  text-align: center;
  line-height: 1.1;
  max-width: 48px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Tool Name Labels in Toolbar ─────────── */
.tool-btn .tool-name {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 1px;
  text-align: center;
  line-height: 1;
  max-width: 46px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tool-btn:hover .tool-name,
.tool-btn.active .tool-name {
  color: var(--text);
}

/* ── Toolbar Section Labels ──────────────── */
.toolbar-section-label {
  display: block;
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted, #616880);
  text-align: center;
  padding-top: 2px;
}

/* ════════════════════════════════════════════════
   UNIFIED HEADER — Same across all editors
   ════════════════════════════════════════════════ */

/* ── Shared Header Bar ─────────────────────── */
.appsd-header {
  display: flex;
  align-items: center;
  height: var(--header-h, 44px);
  background: var(--surface, #1a1a26);
  border-bottom: 1px solid var(--border, #2e2e44);
  padding: 0 12px;
  gap: 4px;
  z-index: 100;
  user-select: none;
  flex-shrink: 0;
}

/* Logo area */
.appsd-header .header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 16px;
  border-right: 1px solid var(--border, #2e2e44);
  margin-right: 4px;
  text-decoration: none;
  flex-shrink: 0;
}
.appsd-header .header-logo svg {
  width: 24px;
  height: 24px;
}
.appsd-header .header-logo .logo-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-bright, #f8f9fb);
  white-space: nowrap;
}
.appsd-header .header-logo .logo-text span {
  color: var(--brand, #F20000);
}
.appsd-header .header-logo .editor-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary, #9ca3b4);
  margin-left: 2px;
}

/* Menu items */
.appsd-header .header-menus {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}
.appsd-header .menu-item {
  position: relative;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary, #9ca3b4);
  border-radius: var(--r-sm, 4px);
  cursor: pointer;
  transition: all 150ms ease;
  white-space: nowrap;
}
.appsd-header .menu-item:hover,
.appsd-header .menu-item.active {
  background: var(--surface-hover, #222232);
  color: var(--text, #e8eaf0);
}

/* Menu dropdown */
.appsd-header .menu-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 220px;
  background: var(--surface, #1a1a26);
  border: 1px solid var(--border, #2e2e44);
  border-radius: var(--r-md, 8px);
  box-shadow: var(--shadow-lg, 0 8px 32px rgba(0,0,0,0.5));
  padding: 4px;
  z-index: 1000;
  max-height: 70vh;
  overflow-y: auto;
}
.appsd-header .menu-item.active .menu-dropdown {
  display: block;
  animation: menuFadeIn 150ms ease;
}
@keyframes menuFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.appsd-header .menu-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text, #e8eaf0);
  border-radius: var(--r-sm, 4px);
  cursor: pointer;
  transition: background 100ms ease;
  gap: 24px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.appsd-header .menu-dropdown-item:hover {
  background: var(--surface-hover, #222232);
}
.appsd-header .menu-dropdown-item .shortcut {
  font-size: 11px;
  color: var(--text-muted, #616880);
  font-family: var(--font-mono);
}
.appsd-header .menu-dropdown-divider {
  height: 1px;
  background: var(--border, #2e2e44);
  margin: 4px 8px;
}

/* Right side brand */
.appsd-header .header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.appsd-header .header-brand {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand, #F20000);
  letter-spacing: 0.02em;
}

/* Header action buttons (Quick Trim, Export, etc) */
.appsd-header .header-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text, #e8eaf0);
  background: var(--surface-hover, #222232);
  border: 1px solid var(--border, #2e2e44);
  border-radius: var(--r-sm, 4px);
  cursor: pointer;
  transition: all 150ms ease;
  white-space: nowrap;
}
.appsd-header .header-action-btn:hover {
  background: var(--surface-active, #2a2a3e);
  border-color: var(--border-light, #3a3a54);
}
.appsd-header .header-action-btn svg {
  width: 14px;
  height: 14px;
}
.appsd-header .header-action-btn.primary {
  background: var(--brand, #F20000);
  border-color: var(--brand, #F20000);
  color: #fff;
}
.appsd-header .header-action-btn.primary:hover {
  background: var(--brand-dark, #BC0000);
}

/* Header separator */
.appsd-header .header-sep {
  width: 1px;
  height: 20px;
  background: var(--border, #2e2e44);
  margin: 0 4px;
}

/* ── Unified Status Bar ──────────────────────── */
.appsd-statusbar {
  display: flex;
  align-items: center;
  height: var(--status-h, 30px);
  background: var(--surface, #1a1a26);
  border-top: 1px solid var(--border, #2e2e44);
  padding: 0 12px;
  font-size: 11px;
  color: var(--text-muted, #616880);
  gap: 16px;
  flex-shrink: 0;
}
.appsd-statusbar .status-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
