/* Kinetix 3D Studio v3 ULTRA — Cinema Production Styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  color-scheme: dark;
  accent-color: var(--accent);
  interpolate-size: allow-keywords;
  view-transition-name: none;
  --bg-app: #08090d;
  --bg-panel: rgba(13, 15, 21, 0.96);
  --bg-elevated: #161923;
  --bg-input: #0e1016;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f3f4f6;
  --text-dim: #94a3b8;
  --accent: #0a84ff;
  --accent-hover: #3898ff;
  --brand-accent: #0a84ff;
  --landing-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  --danger: #ff453a;
  --success: #30d158;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --topbar-h: 50px;
  --timeline-h: 146px;
  --activity-w: 46px;
  --status-h: 24px;
  --left-w: 246px;
  --right-w: 324px;

  --scrollbar-thumb: #5b6478;
  --scrollbar-track: #0b0d12;
}

::selection {
  background: rgba(10, 132, 255, 0.36);
  color: #ffffff;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  background: var(--bg-app);
  color: var(--text);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

body.preview-mode { overflow-y: auto; overflow-x: hidden; }
body.preview-mode.viewer-only { overflow: hidden; }

/* Scrollbar acorde al tema oscuro (modern-web-guidance: customize-scrollbar-color-and-thickness & browser-ui-theming) */
.scroller,
.topbar,
.tablist,
.code-box,
.ide-console-output {
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  overscroll-behavior: contain;
}
.scroller { scrollbar-gutter: stable; }
@supports not (scrollbar-color: auto) {
  .scroller,
  .topbar,
  .tablist,
  .code-box,
  .ide-console-output {
    scrollbar-width: auto;
  }
  .scroller::-webkit-scrollbar,
  .code-box::-webkit-scrollbar,
  .ide-console-output::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }
  .scroller::-webkit-scrollbar-thumb,
  .code-box::-webkit-scrollbar-thumb,
  .ide-console-output::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 999px;
    border: 2px solid var(--scrollbar-track);
  }
  .scroller::-webkit-scrollbar-track,
  .code-box::-webkit-scrollbar-track,
  .ide-console-output::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
  }
}

/* Iconos SVG vectoriales del IDE */
.ic {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ide-act-btn .ic { width: 17px; height: 17px; }
.ide-sb-btn .ic { width: 12px; height: 12px; }

/* Scroll progress indicator (CSS Scroll-Driven Animation + fallback) */
#scroll-progress {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--brand-accent), #64d2ff);
  transform-origin: 0 50%;
  transform: scaleX(0);
  z-index: 220;
  display: none;
  pointer-events: none;
}
body.preview-mode:not(.viewer-only) #scroll-progress { display: block; }
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    @keyframes grow-scroll-progress {
      from { transform: scaleX(0); }
      to { transform: scaleX(1); }
    }
    body.preview-mode:not(.viewer-only) #scroll-progress {
      animation: grow-scroll-progress auto linear;
      animation-timeline: scroll(root block);
    }
  }
}

/* Layout principal del Estudio IDE */
.studio-shell {
  position: fixed; inset: 0;
  display: grid;
  grid-template-rows: var(--topbar-h) 1fr auto var(--status-h);
  grid-template-columns: var(--activity-w) var(--left-w) 1fr var(--right-w);
  grid-template-areas:
    "top top top top"
    "activity left stage right"
    "activity timeline timeline timeline"
    "status status status status";
  z-index: 10;
  pointer-events: none;
}
body.preview-mode .studio-shell { display: none; }

/* Topbar */
.topbar {
  grid-area: top;
  pointer-events: auto;
  background: rgba(11, 13, 18, 0.96);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 10px; gap: 6px; overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
}
.topbar::-webkit-scrollbar { display: none; }
.topbar-group { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }

.brand-mark {
  display: flex; align-items: center; gap: 7px;
  font-weight: 700; font-size: 13px; letter-spacing: -0.02em;
}
.brand-dot {
  width: 22px; height: 22px; border-radius: 7px;
  background: linear-gradient(135deg, #0a84ff, #bf5af2, #ff375f);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 800; color: #fff;
}
.badge-v3 {
  font-size: 9px; font-weight: 800; letter-spacing: 0.05em;
  background: linear-gradient(90deg, rgba(10,132,255,0.25), rgba(191,90,242,0.28));
  color: #e4aaff; padding: 2px 6px; border-radius: 4px;
}

.project-name-input {
  background: transparent; border: 1px solid transparent; color: var(--text);
  font-weight: 600; font-size: 12px; padding: 4px 7px; border-radius: 6px; width: 126px;
}
.project-name-input:hover, .project-name-input:focus {
  background: var(--bg-input); border-color: var(--border-strong); outline: none;
}

.v-sep { width: 1px; height: 20px; background: var(--border); margin: 0 2px; }

.segmented {
  display: inline-flex; background: var(--bg-input); padding: 3px;
  border-radius: 9px; border: 1px solid var(--border); gap: 2px;
}
.seg-btn {
  border: none; background: transparent; color: var(--text-dim);
  padding: 4px 8px; border-radius: 6px; font-size: 11px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--bg-elevated); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.4); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text);
  padding: 6px 10px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { background: #262a34; border-color: var(--border-strong); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; }
.btn-icon { padding: 6px 8px; }
.btn-primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-accent-soft {
  background: rgba(10, 132, 255, 0.14); border-color: rgba(10, 132, 255, 0.35); color: #64b5ff;
}
.btn-accent-soft:hover { background: rgba(10, 132, 255, 0.24); color: #fff; }
.btn-magic {
  background: linear-gradient(135deg, rgba(191,90,242,0.22), rgba(10,132,255,0.22));
  border-color: rgba(191,90,242,0.45); color: #e2b4ff;
}
.btn-magic:hover { background: linear-gradient(135deg, #bf5af2, #0a84ff); color: #fff; border-color: transparent; }
.btn-danger {
  background: rgba(255, 69, 58, 0.14); border-color: rgba(255, 69, 58, 0.35); color: #ff6961;
}
.btn-danger:hover { background: var(--danger); color: #fff; }

/* Panels */
.panel {
  pointer-events: auto; background: var(--bg-panel); backdrop-filter: blur(20px);
  display: flex; flex-direction: column; min-height: 0;
}
.panel-left {
  grid-area: left; border-right: 1px solid var(--border);
  content-visibility: auto;
  contain-intrinsic-size: auto 246px auto 720px;
}
.panel-right {
  grid-area: right; border-left: 1px solid var(--border);
  content-visibility: auto;
  contain-intrinsic-size: auto 326px auto 720px;
}
@supports not (content-visibility: auto) {
  .panel-left, .panel-right { contain: layout style paint; }
}

.panel-head {
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.panel-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-dim);
}
.panel-body {
  flex: 1; overflow-y: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 12px;
}

/* Escenas */
.scene-list { display: flex; flex-direction: column; gap: 6px; }
.scene-card {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px;
  border-radius: 10px; background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent; cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.scene-card:hover { background: rgba(255, 255, 255, 0.06); }
.scene-card.active { background: rgba(10, 132, 255, 0.16); border-color: rgba(10, 132, 255, 0.55); }
.scene-swatch {
  width: 24px; height: 24px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.22); flex-shrink: 0;
  display: grid; place-items: center; font-size: 10px; font-weight: 700;
}
.scene-meta { flex: 1; min-width: 0; }
.scene-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scene-pct { font-size: 10px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.scene-actions { display: flex; gap: 2px; opacity: 0; transition: opacity 0.15s ease; }
.scene-card:hover .scene-actions, .scene-card.active .scene-actions { opacity: 1; }
.mini-act {
  border: none; background: transparent; color: var(--text-dim);
  width: 20px; height: 20px; border-radius: 5px; cursor: pointer;
  font-size: 12px; display: grid; place-items: center;
}
.mini-act:hover { background: rgba(255,255,255,0.12); color: #fff; }
.preset-block {
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px;
}

/* Accessible Tabs */
.tablist {
  flex-shrink: 0;
  display: flex; overflow-x: auto; padding: 6px 8px 0; gap: 2px;
  border-bottom: 1px solid var(--border); scrollbar-width: none;
}
.tablist::-webkit-scrollbar { display: none; }
.tablist [role="tab"], .tablist button {
  position: relative; flex: 1 0 auto; border: none; background: transparent;
  color: var(--text-dim); padding: 8px 8px 10px; font-size: 11px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: color 0.15s ease;
}
.tablist button:hover { color: var(--text); }
.tablist button[aria-selected="true"] { color: #ffffff; }
.tablist button[aria-selected="true"]::after {
  content: ""; position: absolute; inset: auto 4px 0; border-block-end: 2px solid var(--accent);
}
.tabpanel-host {
  flex: 1;
  min-height: 0;
  display: grid;
  align-items: start;
  overflow-y: auto;
}
.tabpanel-host > [role="tabpanel"] {
  grid-area: 1 / 1;
  min-width: 0;
}
.tabpanel-host > [role="tabpanel"][hidden] {
  pointer-events: none;
  z-index: 0;
}
.tabpanel-host > [role="tabpanel"]:not([hidden]) {
  position: relative;
  z-index: 2;
  pointer-events: auto;
}
.tabpanel-inner { padding: 12px; display: flex; flex-direction: column; gap: 11px; }

/* Accessible Toolbar (siguiendo modern-web-guidance: toolbar) */
.stage-toolbar {
  position: fixed;
  top: calc(var(--topbar-h) + 10px);
  left: calc(var(--activity-w) + var(--left-w) + 12px);
  max-inline-size: calc(100vw - var(--activity-w) - var(--left-w) - var(--right-w) - 24px);
  z-index: 8;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  border-radius: 12px;
  background: rgba(14, 16, 22, 0.84);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  pointer-events: auto;
}
.stage-toolbar [role="group"] {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.stage-toolbar [role="separator"] {
  inline-size: 1px;
  block-size: 18px;
  border-inline-start: 1px solid var(--border-strong);
  margin: 0 3px;
}
/* Workspaces & Modo Zen (v14 SOLARIS) */
.ws-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px;
  border-radius: 8px;
}
.ws-pill.active {
  background: var(--accent);
  color: #fff;
}
[data-ws-hidden="true"] { display: none !important; }

body.zen-mode .panel-left,
body.zen-mode .panel-right,
body.zen-mode .timeline {
  display: none !important;
}
body.zen-mode .stage-toolbar {
  left: 50%;
  transform: translateX(-50%);
  max-inline-size: calc(100vw - 24px);
}
body.zen-mode .stage-hud-bottom {
  bottom: 14px;
}
@media (max-width: 1380px) {
  :root {
    --left-w: 220px;
    --right-w: 296px;
  }
}

.tb-btn {
  min-inline-size: 28px;
  min-block-size: 28px;
  padding: 4px 8px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.tb-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
@media (hover: hover) {
  .tb-btn:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
}
.tb-btn[aria-pressed="true"] {
  background: var(--accent);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}
@media (pointer: coarse) {
  /* Workspaces & Modo Zen (v14 SOLARIS) */
.ws-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px;
  border-radius: 8px;
}
.ws-pill.active {
  background: var(--accent);
  color: #fff;
}
[data-ws-hidden="true"] { display: none !important; }

body.zen-mode .panel-left,
body.zen-mode .panel-right,
body.zen-mode .timeline {
  display: none !important;
}
body.zen-mode .stage-toolbar {
  left: 50%;
  transform: translateX(-50%);
  max-inline-size: calc(100vw - 24px);
}
body.zen-mode .stage-hud-bottom {
  bottom: 14px;
}
@media (max-width: 1380px) {
  :root {
    --left-w: 220px;
    --right-w: 296px;
  }
}

.tb-btn { min-inline-size: 38px; min-block-size: 38px; }
}
@media (forced-colors: active) {
  .tb-btn[aria-pressed="true"] { background: Highlight; color: HighlightText; border-color: ButtonText; }
}

.stage-hud-bottom {
  position: fixed;
  bottom: calc(var(--timeline-h) + 10px);
  right: calc(var(--right-w) + 12px);
  max-inline-size: calc(100vw - var(--left-w) - var(--right-w) - 24px);
  flex-wrap: wrap;
  justify-content: flex-end;
  z-index: 8; display: flex; align-items: center; gap: 6px; pointer-events: auto;
}
body.preview-mode .stage-toolbar,
body.preview-mode .stage-hud-bottom { display: none; }

.hud-pill {
  background: rgba(16, 18, 24, 0.8); backdrop-filter: blur(12px);
  border: 1px solid var(--border); color: var(--text);
  padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
}
.hud-pill:hover { background: rgba(34, 38, 48, 0.94); }

/* Cubic-Bezier Editor SVG */
.bezier-wrap {
  display: flex; flex-direction: column; gap: 6px; align-items: center;
}
.bezier-svg {
  width: 100%; height: auto; border-radius: 8px;
  background: var(--bg-input); border: 1px solid var(--border);
  touch-action: none;
}
.bz-readout {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px; color: var(--text-dim); font-variant-numeric: tabular-nums;
}

/* Form fields */
.field { display: flex; flex-direction: column; gap: 5px; }
.field-label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; font-weight: 600; color: var(--text-dim);
}
.field-val {
  font-variant-numeric: tabular-nums; color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px;
}
input[type="text"], input[type="url"], input[type="number"], textarea, select {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text); padding: 7px 9px; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 12px;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 52px; line-height: 1.4; }
input[type="range"] { width: 100%; accent-color: var(--accent); cursor: pointer; }
input[type="color"] {
  width: 32px; height: 26px; border: 1px solid var(--border-strong);
  border-radius: 6px; background: var(--bg-input); cursor: pointer; padding: 2px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.section-card {
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 10px;
  display: flex; flex-direction: column; gap: 9px;
}
.section-card-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-dim);
}
.swatches { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.swatch {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.22); cursor: pointer;
}
@media (prefers-reduced-motion: no-preference) {
  .swatch { transition: transform 0.15s ease; }
  .swatch:hover { transform: scale(1.1); }
}
.swatch.active { box-shadow: 0 0 0 2px var(--bg-panel), 0 0 0 4px var(--accent); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; gap: 8px; }

/* Viewport 3D Central (con content-visibility para pausar GPU cuando esté oculto) */
#stage-backdrop {
  position: fixed;
  top: var(--topbar-h); left: var(--left-w); right: var(--right-w); bottom: var(--timeline-h);
  z-index: 1; display: grid; place-items: center; background: #090a0d;
  content-visibility: auto;
  contain-intrinsic-size: auto none auto 640px;
}
body.preview-mode #stage-backdrop,
body.keynote-mode #stage-backdrop { inset: 0; background: transparent; }

#viewport-frame {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  transition: background 0.35s ease;
}
@media (prefers-reduced-motion: no-preference) {
  #viewport-frame {
    transition: width 0.25s ease, height 0.25s ease, border-radius 0.25s ease, background 0.35s ease;
  }
}
body:not(.preview-mode) #viewport-frame.vp-tablet {
  width: min(768px, calc(100% - 28px)); height: calc(100% - 28px);
  border-radius: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55); border: 1px solid var(--border-strong);
}
body:not(.preview-mode) #viewport-frame.vp-mobile {
  width: 390px; height: min(740px, calc(100% - 28px));
  border-radius: 34px; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65); border: 2px solid var(--border-strong);
}

#canvas-container { position: absolute; inset: 0; cursor: grab; }
#canvas-container:active { cursor: grabbing; }
#canvas-container.pin-mode { cursor: crosshair; }
body.preview-mode.scroll-only #canvas-container { pointer-events: none; cursor: default; }

/* Hotspots 3D proyectados */
.hotspot-layer { position: absolute; inset: 0; pointer-events: none; z-index: 6; overflow: hidden; }
.hotspot-pin { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); pointer-events: auto; z-index: 10; }
.hotspot-dot {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.92); background: var(--brand-accent);
  backdrop-filter: blur(8px);
  --wcag-y-threshold: 0.17913;
  --y: max(0, sign(var(--wcag-y-threshold) - y));
  color: #fff;
  color: color(from var(--brand-accent) xyz-d65 calc(var(--y) * 0.9505) var(--y) calc(var(--y) * 1.089));
  color: contrast-color(var(--brand-accent));
  font-size: 16px; font-weight: 700;
  line-height: 1; display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.hotspot-pin.open .hotspot-dot { background: #1d1d1f; transform: rotate(45deg); }
.hotspot-card {
  position: absolute; left: 36px; top: 50%; transform: translateY(-50%);
  width: 224px; padding: 12px 14px; border-radius: 14px;
  background: rgba(20, 22, 28, 0.9); backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.16); color: #f5f5f7;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42); display: none; text-align: left;
}
.hotspot-pin.open .hotspot-card { display: block; }
.hotspot-card h4 { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.hotspot-card p { font-size: 11px; line-height: 1.45; color: #c7ccd6; }

/* Overlay tipográfico Landing (con tipografía y color de marca) */
.editor-copy-layer {
  position: absolute; inset: 0; pointer-events: none;
  display: flex; align-items: center; padding: 6% 7%; z-index: 4;
}
body.preview-mode .editor-copy-layer { display: none; }

.landing-copy { max-width: 470px; font-family: var(--landing-font); }
.landing-copy.glass {
  background: rgba(255, 255, 255, 0.14); backdrop-filter: blur(18px);
  padding: 26px 30px; border-radius: 22px; border: 1px solid rgba(255, 255, 255, 0.22);
}
/* Edición WYSIWYG directa en el viewport */
body:not(.preview-mode) .editable-copy {
  pointer-events: auto;
  border-radius: 6px;
  outline: 1px dashed transparent;
  transition: outline-color 0.15s ease, background-color 0.15s ease;
  cursor: text;
}
body:not(.preview-mode) .editable-copy:hover {
  outline-color: rgba(10, 132, 255, 0.45);
}
body:not(.preview-mode) .editable-copy:focus {
  outline: 2px solid var(--accent);
  background: rgba(10, 132, 255, 0.08);
}

/* Dope Sheet Multipista en el Timeline */
.dope-sheet {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 2px;
}
.dope-row {
  display: grid;
  grid-template-columns: 62px 1fr;
  align-items: center;
  gap: 8px;
  height: 12px;
}
.dope-lbl {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}
.dope-lane {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}
.dope-seg {
  position: absolute;
  top: 0; bottom: 0;
  border-radius: 999px;
}
.dope-seg.explode { background: linear-gradient(90deg, #ff9f0a, #ff375f); }
.dope-seg.hotspot { background: linear-gradient(90deg, #0a84ff, #bf5af2); }

/* Selector de variantes de color en Preview (estilo Apple Store) */
.preview-swatches {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 88;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(20, 22, 28, 0.72);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.14);
}
body.preview-mode.show-swatches .preview-swatches { display: flex; }

/* Paleta de Comandos (⌘K) */
dialog.cmd-dialog {
  max-width: 540px;
  margin-top: 12vh;
  margin-bottom: auto;
}
.cmd-search-wrap {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.cmd-search-wrap input {
  border: none;
  background: transparent;
  font-size: 14px;
  padding: 4px;
}
.cmd-list {
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cmd-item {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 9px 12px;
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  font-size: 13px;
}
.cmd-item.active {
  background: rgba(10, 132, 255, 0.22);
  color: #fff;
}
.cmd-main { display: flex; align-items: center; gap: 10px; }
.cmd-group {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  padding: 2px 6px; border-radius: 5px;
  background: rgba(255,255,255,0.08); color: var(--text-dim);
}
.cmd-item.active .cmd-group { background: var(--accent); color: #fff; }

/* Vúmetro Audio-Reactivo */
.audio-meter {
  inline-size: 100%;
  block-size: 6px;
  border-radius: 999px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  overflow: hidden;
}
.audio-meter-fill {
  block-size: 100%;
  inline-size: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, #30d158, #0a84ff, #bf5af2);
}

/* Sección Bento Grid Post-3D en Preview (CSS Grid + subgrid + Container Queries) */
.bento-band {
  position: relative;
  z-index: 25;
  inline-size: 100%;
  padding: 12vh 8vw 10vh;
  background: rgba(11, 12, 16, 0.88);
  backdrop-filter: blur(28px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #f5f5f7;
  font-family: var(--landing-font);
  pointer-events: auto;
  container: bento / inline-size;
}
.bento-header {
  max-inline-size: 680px;
  margin-block-end: 44px;
}
.bento-header h2 {
  font-size: clamp(28px, 4.5cqi, 52px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  margin-block: 10px 12px;
}
.bento-header p {
  font-size: 17px;
  color: #a1a8b6;
  line-height: 1.5;
}
.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  grid-template-rows: auto auto 1fr;
  gap: 16px;
  margin-block-end: 56px;
}
.bento-card {
  grid-row: span 3;
  display: grid;
  grid-template-rows: auto auto 1fr;
  grid-template-rows: subgrid;
  gap: 8px;
  padding: 24px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.bento-val {
  font-size: clamp(32px, 5cqi, 48px);
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #ffffff, var(--brand-accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.bento-label {
  font-size: 16px;
  font-weight: 700;
}
.bento-desc {
  font-size: 13px;
  line-height: 1.5;
  color: #a1a8b6;
}
.bento-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block-start: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.bento-price {
  font-size: 24px;
  font-weight: 700;
}
.bento-price small {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #9da3ae;
}
.copy-eyebrow {
  display: inline-block; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--brand-accent); margin-bottom: 9px;
}
.copy-title {
  font-size: clamp(26px, 3.6vw, 54px); line-height: 1.05;
  letter-spacing: -0.03em; font-weight: 700; margin-bottom: 12px;
}
.copy-sub { font-size: clamp(14px, 1.25vw, 19px); line-height: 1.45; opacity: 0.82; }
.copy-cta {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 20px; padding: 10px 22px; border-radius: 999px;
  background: var(--brand-accent);
  --wcag-y-threshold: 0.17913;
  --y: max(0, sign(var(--wcag-y-threshold) - y));
  color: #fff;
  color: color(from var(--brand-accent) xyz-d65 calc(var(--y) * 0.9505) var(--y) calc(var(--y) * 1.089));
  color: contrast-color(var(--brand-accent));
  font-size: 13px;
  font-weight: 600; text-decoration: none; pointer-events: auto;
}

/* Navbar Preview opcional */
.preview-nav {
  position: fixed; top: 0; left: 0; right: 0; height: 56px; z-index: 80;
  display: none; align-items: center; justify-content: space-between;
  padding: 0 5vw; background: rgba(15, 17, 22, 0.45); backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255,255,255,0.1); color: #fff;
  font-family: var(--landing-font);
}
body.preview-mode.show-nav .preview-nav { display: flex; }
.pnav-links { display: flex; gap: 18px; }
.pnav-links button {
  border: none; background: transparent; color: inherit; opacity: 0.8;
  font-size: 13px; font-weight: 500; cursor: pointer;
}
.pnav-links button:hover { opacity: 1; }

/* Timeline Inferior */
.timeline-bar {
  grid-area: timeline; pointer-events: auto;
  background: var(--bg-panel); backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 9px 18px 12px; gap: 8px;
}
.tl-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tl-readout {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-dim);
}
.tl-readout strong { color: var(--text); }

.tl-track-wrap {
  position: relative; height: 50px; display: flex; align-items: center;
  cursor: pointer; user-select: none;
}
.tl-ruler {
  position: absolute; inset: 0 0 auto 0; height: 14px;
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--text-dim); font-variant-numeric: tabular-nums; pointer-events: none;
}
.tl-rail {
  position: relative; width: 100%; height: 9px; margin-top: 16px;
  background: var(--bg-input); border-radius: 999px; border: 1px solid var(--border);
}
.tl-fill {
  position: absolute; top: 0; left: 0; bottom: 0; width: 0%;
  background: linear-gradient(90deg, rgba(10,132,255,0.45), var(--brand-accent));
  border-radius: 999px; pointer-events: none;
}
.tl-playhead {
  position: absolute; top: -8px; left: 0%; width: 14px; height: 24px;
  transform: translateX(-50%); background: #ffffff; border: 2px solid var(--accent);
  border-radius: 4px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); z-index: 8; pointer-events: none;
}
.tl-marker {
  position: absolute; top: 50%; width: 15px; height: 15px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: var(--bg-elevated); border: 2px solid #8e96a6; border-radius: 3px;
  z-index: 6; cursor: ew-resize;
}
.tl-marker.pinned { cursor: pointer; border-color: #64d2ff; }
.tl-marker.active { background: var(--accent); border-color: #fff; }
.tl-marker-lbl {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  font-size: 9px; font-weight: 700; color: var(--text-dim);
  white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums;
}

/* Preview Modes */
#preview-scroll { position: relative; z-index: 20; display: none; pointer-events: none; }
body.preview-mode:not(.viewer-only) #preview-scroll { display: block; }
.preview-section { height: 100vh; display: flex; align-items: center; padding: 0 9vw; pointer-events: none; }
.preview-section.align-left { justify-content: flex-start; }
.preview-section.align-center { justify-content: center; text-align: center; }
.preview-section.align-right { justify-content: flex-end; }

/* Reveal animations de texto en Preview (opt-in con prefers-reduced-motion) */
@media (prefers-reduced-motion: no-preference) {
  .preview-section .landing-copy { transition: opacity 0.6s ease, transform 0.65s cubic-bezier(0.22, 1, 0.36, 1), filter 0.6s ease; }
  .preview-section.anim-fadeUp:not(.in-view) .landing-copy { opacity: 0; transform: translateY(36px); }
  .preview-section.anim-blurIn:not(.in-view) .landing-copy { opacity: 0; filter: blur(12px); transform: scale(0.96); }
  .preview-section.anim-slide:not(.in-view) .landing-copy { opacity: 0; transform: translateX(-40px); }
  .preview-section.anim-zoom:not(.in-view) .landing-copy { opacity: 0; transform: scale(0.88); }
}

.viewer-pills {
  position: fixed; left: 40px; top: 50%; transform: translateY(-50%);
  z-index: 85; display: none; flex-direction: column; gap: 10px; align-items: flex-start;
}
body.preview-mode.show-pills .viewer-pills { display: flex; }
.apple-pill {
  display: inline-flex; align-items: center; gap: 11px; padding: 10px 18px 10px 12px;
  border: 1px solid rgba(128,128,128,0.22); border-radius: 999px;
  background: rgba(245, 245, 247, 0.88); backdrop-filter: blur(14px);
  color: #1d1d1f; font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}
.apple-pill .ic {
  width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #1d1d1f;
  display: grid; place-items: center; font-size: 13px; line-height: 1;
}
.apple-pill.active .ic { background: var(--brand-accent); border-color: var(--brand-accent); color: #fff; font-size: 10px; }

.preview-bar {
  position: fixed; top: 14px; right: 20px; z-index: 95;
  display: none; align-items: center; gap: 8px;
}
body.preview-mode .preview-bar { display: flex; }

.preview-dots {
  position: fixed; right: 22px; top: 50%; transform: translateY(-50%);
  z-index: 90; display: none; flex-direction: column; gap: 10px;
}
body.preview-mode:not(.viewer-only) .preview-dots { display: flex; }
.p-dot {
  width: 10px; height: 10px; border-radius: 50%;
  border: 1.5px solid rgba(128,128,128,0.65); background: transparent; cursor: pointer; padding: 0;
}
.p-dot.active { background: var(--brand-accent); border-color: var(--brand-accent); transform: scale(1.3); }

/* Modales nativos <dialog> con animación Top-Layer */
dialog {
  margin: auto; border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  background: #16181e; color: var(--text); padding: 0; max-width: 650px;
  width: calc(100vw - 32px); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.22s; transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}
@media (prefers-reduced-motion: no-preference) { dialog { transform: scale(0.95); } }
dialog[open] { display: flex; flex-direction: column; }
dialog[open]:where(:not([data-closing])) {
  opacity: 1;
  @starting-style { opacity: 0; }
  @media (prefers-reduced-motion: no-preference) {
    transform: scale(1);
    @starting-style { transform: scale(0.95); }
  }
}
dialog:modal { overscroll-behavior: contain; }
dialog::backdrop {
  background-color: rgba(0, 0, 0, 0); backdrop-filter: blur(6px);
  overflow: hidden; overscroll-behavior: contain;
  transition-property: background-color, display, overlay;
  transition-duration: 0.22s; transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}
dialog[open]:where(:not([data-closing]))::backdrop {
  background-color: rgba(0, 0, 0, 0.64);
  @starting-style { background-color: rgba(0, 0, 0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  dialog, dialog::backdrop { transition-duration: 0.1s; }
}

.dialog-head { padding: 15px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.dialog-head h2 { font-size: 16px; font-weight: 700; }
.dialog-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; max-height: 72vh; overflow-y: auto; }
.dialog-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

.code-box {
  background: #0b0c0f; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px; line-height: 1.5; color: #c9d1d9; max-height: 230px; overflow: auto; white-space: pre;
}
.progress-meter { width: 100%; height: 8px; border-radius: 999px; background: var(--bg-input); overflow: hidden; border: 1px solid var(--border); }
.progress-meter-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #0a84ff, #30d158); transition: width 0.12s linear; }

.drop-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(10, 132, 255, 0.16); backdrop-filter: blur(8px);
  border: 3px dashed var(--accent); display: none; place-items: center;
  font-size: 20px; font-weight: 700; color: #fff; pointer-events: none;
}
.drop-overlay.visible { display: grid; }

/* Toast Top-Layer con popover="manual" (modern-web-guidance: persistent-toast-notifications) */
.toast {
  position: fixed;
  inset: auto auto calc(var(--timeline-h) + 16px) 50%;
  margin: 0;
  transform: translate(-50%, 10px);
  background: #1c1f27;
  border: 1px solid var(--border-strong);
  color: #fff;
  padding: 7px 10px 7px 15px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  max-inline-size: min(460px, calc(100vw - 24px));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.48);
  opacity: 0;
  align-items: center;
  gap: 10px;
}
.toast:is(:popover-open, .\:popover-open) {
  display: inline-flex;
  opacity: 1;
  transform: translate(-50%, 0);
}
@media (prefers-reduced-motion: no-preference) {
  .toast {
    transition: opacity 0.2s ease, transform 0.2s ease, display 0.2s ease, overlay 0.2s ease;
    transition-behavior: allow-discrete;
  }
  .toast:is(:popover-open, .\:popover-open) {
    @starting-style {
      opacity: 0;
      transform: translate(-50%, 10px);
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; transform: translate(-50%, 0); }
}
.toast-close {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  border-radius: 50%;
  inline-size: 20px;
  block-size: 20px;
  font-size: 10px;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.toast-close:hover, .toast-close:focus-visible { background: rgba(255, 255, 255, 0.2); color: #fff; }

/* HUD Control por Voz en Vivo */
.voice-hud {
  position: absolute;
  top: 62px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 14;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 14px;
  border-radius: 999px;
  background: rgba(16, 18, 26, 0.9);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 69, 58, 0.55);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  max-inline-size: min(520px, calc(100% - 28px));
  pointer-events: auto;
}
.voice-hud[hidden] { display: none; }
#voice-transcript { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.kbd {
  display: inline-block; padding: 2px 6px; border-radius: 5px;
  background: var(--bg-input); border: 1px solid var(--border-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px;
}
.hidden-input { display: none; }

/* === v6 TITAN: Switch Controls, Viewport-Aware Popover, Split Compare, Aspect Framing & Copy Feedback === */

/* Native HTML Switch (con fallback a input-switch-polyfill) */
input[type="checkbox"][switch] {
  accent-color: var(--accent);
  margin: 0;
  cursor: pointer;
}
input[type="checkbox"][switch]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Cinema Quick Popover (Popover API + CSS Anchor Positioning con Progressive Enhancement) */
.cinema-popover {
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(18, 20, 27, 0.96);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  color: var(--text);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.6);
  inline-size: min(300px, calc(100vw - 24px));
}
.cinema-popover:is(:popover-open, .\:popover-open) {
  display: flex;
  flex-direction: column;
  gap: 11px;
}
@supports (position-area: block-end) {
  .cinema-popover {
    inset: auto;
    margin: 0;
    margin-block-start: 8px;
    position-area: block-end span-inline-end;
    position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline;
  }
}
.pop-section { display: flex; flex-direction: column; gap: 6px; }
.pop-btn-grid { display: flex; flex-wrap: wrap; gap: 5px; }
.pop-opt { padding: 5px 9px; font-size: 11px; }
.pop-opt.active { background: var(--accent); border-color: transparent; color: #fff; }

/* Live WebGL Split-Screen Comparator */
.split-overlay {
  position: absolute;
  inset: 0;
  z-index: 9;
  pointer-events: none;
}
.split-overlay[hidden] { display: none; }
body.preview-mode .split-overlay { display: none; }
.split-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  inline-size: 2px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 18px rgba(10, 132, 255, 0.7);
  cursor: ew-resize;
  pointer-events: auto;
  touch-action: none;
}
.split-handle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.split-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  inline-size: 36px;
  block-size: 36px;
  border-radius: 50%;
  background: rgba(16, 18, 25, 0.92);
  border: 2px solid #fff;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
  user-select: none;
}
.split-badge {
  position: absolute;
  top: 58px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(14, 16, 22, 0.78);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
}
.split-badge-left { left: 14px; }
.split-badge-right { right: 14px; }

/* Cinema Aspect Ratio Letterbox Framing */
.aspect-overlay {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
}
body.preview-mode .aspect-overlay { display: none; }
.aspect-bar {
  position: absolute;
  background: rgba(5, 6, 9, 0.88);
  transition: width 0.2s ease, height 0.2s ease;
}
.aspect-top { top: 0; left: 0; right: 0; height: 0; border-bottom: 1px solid rgba(255,255,255,0.14); }
.aspect-bottom { bottom: 0; left: 0; right: 0; height: 0; border-top: 1px solid rgba(255,255,255,0.14); }
.aspect-left { top: 0; bottom: 0; left: 0; width: 0; border-right: 1px solid rgba(255,255,255,0.14); }
.aspect-right { top: 0; bottom: 0; right: 0; width: 0; border-left: 1px solid rgba(255,255,255,0.14); }
.aspect-overlay:not(.active) .aspect-bar { border: 0; }
.aspect-tag {
  position: absolute;
  bottom: 10px;
  left: 14px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(12, 14, 20, 0.75);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  opacity: 0;
}
.aspect-overlay.active .aspect-tag { opacity: 1; }

/* Declarative Copy Button + Live Status Tip (visible via opacity, never display:none) */
.copy-row { display: flex; gap: 6px; align-items: center; }
.copy-row input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.copy-wrap { position: relative; display: inline-flex; align-items: center; }
.copy-btn { min-inline-size: 28px; min-block-size: 28px; }
.copy-btn[data-copied] { background: var(--success); border-color: transparent; color: #fff; }
.copy-btn[data-failed] { background: var(--danger); border-color: transparent; color: #fff; }
.copy-tip {
  position: absolute;
  inset-block-end: calc(100% + 6px);
  inset-inline-end: 0;
  padding: 3px 8px;
  border-radius: 6px;
  background: #10131a;
  border: 1px solid var(--border-strong);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.copy-btn[data-copied] + .copy-tip,
.copy-btn[data-failed] + .copy-tip {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .copy-tip { transform: none; transition: opacity 0.12s ease; }
}

/* Editor de Tarjetas Bento Specs */
.bento-editor-list { display: flex; flex-direction: column; gap: 8px; }
.bento-editor-item {
  padding: 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bento-editor-head { display: flex; gap: 6px; align-items: center; }
.bento-editor-head input:first-child { width: 76px; flex-shrink: 0; font-weight: 700; }

/* === v7 OMEGA: Graph Editor (interpolate-size), Multi-Cam PiP HUD, Director IA & Material Presets === */

.timeline-bar { min-block-size: var(--timeline-h); }
body.graph-open .stage-hud-bottom { bottom: calc(var(--timeline-h) + 178px); }

/* Collapsible Pro Graph Editor (animate-to-intrinsic-sizes) */
.graph-drawer {
  block-size: 0;
  opacity: 0;
  overflow: hidden;
  transition: block-size 0.34s ease-out, opacity 0.24s ease;
}
.graph-drawer.is-expanded {
  block-size: auto;
  opacity: 1;
}
.graph-drawer[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) {
  .graph-drawer { transition: none !important; }
}
.graph-drawer-inner {
  padding-block-end: 8px;
  margin-block-end: 6px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.graph-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.graph-channels { display: flex; gap: 5px; flex-wrap: wrap; }
.graph-ch-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: var(--bg-input); color: var(--text-dim);
  padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; cursor: pointer;
}
.graph-ch-btn.active { border-color: var(--ch-col); color: #fff; background: rgba(255,255,255,0.08); }
.graph-dot { inline-size: 7px; block-size: 7px; border-radius: 50%; background: var(--ch-col); }
.graph-hint { font-size: 11px; color: var(--text-dim); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.graph-svg {
  inline-size: 100%;
  block-size: 132px;
  border-radius: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  touch-action: none;
  display: block;
}

/* Monitor Director PiP (Segunda cámara en vivo) */
.pip-hud {
  position: absolute;
  z-index: 9;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  overflow: hidden;
}
.pip-hud[hidden] { display: none; }
body.preview-mode .pip-hud { display: none; }
.pip-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  background: linear-gradient(180deg, rgba(8, 10, 15, 0.85), rgba(8, 10, 15, 0));
}
.pip-rec {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fff;
}
.pip-dot {
  inline-size: 6px;
  block-size: 6px;
  border-radius: 50%;
  background: #ff453a;
  box-shadow: 0 0 8px #ff453a;
}
.pip-mode-btn {
  pointer-events: auto;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(16, 18, 25, 0.85);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  cursor: pointer;
}
.pip-mode-btn:hover { background: var(--accent); border-color: transparent; }

/* Presets PBR rápidos en Outliner de Piezas */
.mat-presets { display: flex; flex-wrap: wrap; gap: 5px; }

/* Director IA Modal */
.director-chips { display: flex; flex-direction: column; gap: 6px; }
.director-chip {
  text-align: left;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.4;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.director-chip:hover { background: rgba(191, 90, 242, 0.14); border-color: rgba(191, 90, 242, 0.45); color: #fff; }
.director-summary {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(48, 209, 88, 0.12);
  border: 1px solid rgba(48, 209, 88, 0.35);
  color: #a7f3c1;
  font-size: 11px;
  line-height: 1.45;
}

/* === v8 INFINITY: Storyboard Contact Sheet + View Transitions (group-element-transitions & dynamic-sort) === */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

::view-transition {
  pointer-events: none;
}
::view-transition-group(.sb-card) {
  animation-duration: 0.34s;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

dialog.storyboard-dialog {
  max-width: 960px;
}
.sb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 14px;
}
.sb-card {
  view-transition-class: sb-card;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.sb-thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #090b10;
  overflow: hidden;
}
.sb-thumb {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  display: block;
}
.sb-num, .sb-pct {
  position: absolute;
  top: 8px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(10, 12, 18, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #fff;
}
.sb-num { left: 8px; }
.sb-pct { right: 8px; color: #64d2ff; font-family: ui-monospace, monospace; }
.sb-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sb-title {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-meta {
  font-size: 11px;
  color: var(--text-dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.sb-actions {
  display: flex;
  gap: 5px;
  margin-top: 2px;
}

/* === v9 SINGULARITY: Live Keynote Stage Presentation Mode + Interest-Triggered Hint Tooltips === */
body.keynote-mode .studio-shell,
body.keynote-mode .stage-toolbar,
body.keynote-mode .stage-hud-bottom,
body.keynote-mode .editor-copy-layer,
body.keynote-mode .split-overlay,
body.keynote-mode .aspect-overlay,
body.keynote-mode .pip-hud {
  display: none !important;
}

.keynote-stage {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: none;
  pointer-events: none;
}
body.keynote-mode .keynote-stage { display: block; }

.keynote-laser {
  position: fixed;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  pointer-events: none;
  z-index: 98;
}
.keynote-copy-wrap {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 6% 8%;
  pointer-events: none;
  z-index: 96;
}
@media (prefers-reduced-motion: no-preference) {
  .landing-copy.kn-enter {
    animation: kn-slide-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  @keyframes kn-slide-in {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

.keynote-dock {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(14, 16, 23, 0.84);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
  opacity: 0.72;
  transition: opacity 0.2s ease;
}
.keynote-dock:hover,
.keynote-dock:focus-within { opacity: 1; }
#kn-laser[aria-pressed="true"] { background: #ff375f; border-color: transparent; color: #fff; }
.kn-dots { display: flex; gap: 6px; padding-inline: 4px; }
.kn-dot {
  inline-size: 9px; block-size: 9px; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  background: transparent; cursor: pointer; padding: 0;
}
.kn-dot.active { background: var(--brand-accent); border-color: var(--brand-accent); transform: scale(1.25); }
.kn-timer {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--text-dim); padding-inline: 4px;
}

/* Native Interest-Triggered Hint Tooltips (interestfor + popover="hint" + Anchor Positioning) */
[interestfor] {
  --interest-delay-start: 0.2s;
  interest-delay-start: var(--interest-delay-start);
  --interest-delay-end: 0.1s;
  interest-delay-end: var(--interest-delay-end);
}
[interestfor]:is(:interest-source, .interest-source) {
  border-color: var(--accent);
}
.hint-tip[popover="hint"] {
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(12, 14, 20, 0.96);
  border: 1px solid var(--border-strong);
  color: #f5f5f7;
  font-size: 11px;
  font-weight: 600;
  max-inline-size: 260px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}
.hint-tip[popover]:is(:popover-open, .\:popover-open) {
  display: block;
}
@supports (position-area: block-start) {
  .hint-tip[popover] {
    inset: auto;
    margin: 0;
    margin-block-end: 8px;
    position-area: block-start;
    position-try-fallbacks: flip-block, flip-inline;
  }
}

/* === v10 GENESIS: Webcam AR Backdrop, Visual Node Graph Compositor & E-Commerce 3D Configurator === */
.webcam-bg {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  display: none;
  z-index: 0;
  pointer-events: none;
}
body.webcam-ar-active .webcam-bg { display: block; }
body.webcam-ar-active #viewport-frame { background: transparent !important; }

/* Visual Node Graph Editor */
dialog.nodes-dialog {
  max-width: 920px;
}
.ng-canvas {
  position: relative;
  inline-size: 100%;
  block-size: 446px;
  border-radius: 14px;
  background-color: #0b0d13;
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 20px 20px;
  border: 1px solid var(--border-strong);
  overflow: hidden;
}
.ng-wires {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  pointer-events: none;
}
.ng-wire {
  fill: none;
  stroke: rgba(157, 163, 174, 0.25);
  stroke-width: 2;
}
.ng-wire.active {
  stroke: var(--brand-accent);
  stroke-width: 2.5;
  stroke-dasharray: 7 5;
}
@media (prefers-reduced-motion: no-preference) {
  .ng-wire.active { animation: ng-flow 1.4s linear infinite; }
  @keyframes ng-flow { to { stroke-dashoffset: -24; } }
}

.ng-node {
  position: absolute;
  inline-size: 214px;
  border-radius: 12px;
  background: rgba(20, 23, 32, 0.94);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0.62;
  transition: opacity 0.16s ease, border-color 0.16s ease;
}
.ng-node.is-active {
  opacity: 1;
  border-color: rgba(10, 132, 255, 0.65);
}
.ng-cat-input { border-left: 3px solid #30d158; }
.ng-cat-fx { border-left: 3px solid #bf5af2; }
.ng-cat-output { border-left: 3px solid #0a84ff; }
.ng-node-head {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ng-node-title {
  flex: 1;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ng-node-sub {
  font-size: 10px;
  color: var(--text-dim);
  padding-inline-start: 22px;
}
.node-drag-handle {
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  border-radius: 5px;
  padding: 2px 5px;
  font-size: 11px;
  line-height: 1;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.node-drag-handle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.node-drag-handle.dragging { cursor: grabbing; background: var(--accent); color: #fff; }
.ng-power {
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}
.ng-power[aria-pressed="true"] {
  background: var(--success);
  border-color: transparent;
  color: #06150b;
}
.ng-tag {
  font-size: 9px;
  font-weight: 800;
  color: #30d158;
  background: rgba(48, 209, 88, 0.14);
  padding: 2px 6px;
  border-radius: 999px;
}

/* Configurador Tienda E-Commerce 3D en Preview */
.store-configurator {
  position: fixed;
  right: 28px;
  bottom: 24px;
  z-index: 92;
  inline-size: min(312px, calc(100vw - 32px));
  padding: 16px;
  border-radius: 20px;
  background: rgba(16, 18, 25, 0.86);
  backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.55);
  color: #f5f5f7;
  display: none;
  flex-direction: column;
  gap: 12px;
  font-family: var(--landing-font);
}
body.preview-mode.show-configurator .store-configurator { display: flex; }
.cfg-head { display: flex; flex-direction: column; gap: 2px; }
.cfg-kicker { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brand-accent); }
.cfg-title { font-size: 16px; font-weight: 800; }
.cfg-group { display: flex; flex-direction: column; gap: 6px; }
.cfg-lbl { font-size: 11px; font-weight: 600; color: var(--text-dim); }
.cfg-swatches, .cfg-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.cfg-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: 10px; border-top: 1px solid var(--border);
}
.cfg-price { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; }
.cfg-sub { font-size: 10px; color: var(--text-dim); }

/* === v11 QUANTUM: Marketing Kit Semantic Cards (subgrid + container queries), Paint 3D Dock, Live Monitor & Auditor === */
#canvas-container.paint-mode { cursor: crosshair !important; }

.paint-dock {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(14, 16, 23, 0.9);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(10, 132, 255, 0.55);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
}
.paint-dock[hidden] { display: none; }
.paint-title { font-size: 11px; font-weight: 800; color: #64d2ff; white-space: nowrap; }

/* Dual-Screen Live Monitor Mode (?live-monitor=1) */
.live-monitor-badge {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 120;
  display: none;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(12, 14, 20, 0.72);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fff;
  pointer-events: none;
}
body.live-monitor-mode .live-monitor-badge { display: inline-flex; }
body.live-monitor-mode .studio-shell,
body.live-monitor-mode .stage-toolbar,
body.live-monitor-mode .stage-hud-bottom,
body.live-monitor-mode .editor-copy-layer,
body.live-monitor-mode .split-overlay,
body.live-monitor-mode .aspect-overlay,
body.live-monitor-mode .pip-hud,
body.live-monitor-mode .paint-dock { display: none !important; }
body.live-monitor-mode #stage-backdrop { inset: 0; }

/* Marketing Kit Semantic Cards (modern-web-guidance: card — direct minimal regions + subgrid + container queries) */
dialog.kit-dialog { max-width: 980px; }
.kit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  grid-template-rows: auto auto 1fr auto;
  gap: 14px;
}
.kit-card {
  grid-row: span 4;
  display: grid;
  grid-template-rows: subgrid;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-strong);
  container-type: inline-size;
}
.kit-card > img {
  inline-size: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 9px;
  background: #090b10;
  display: block;
}
.kit-card.is-alpha > img {
  background-image: linear-gradient(45deg, #1b1f2a 25%, transparent 25%),
    linear-gradient(-45deg, #1b1f2a 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #1b1f2a 75%),
    linear-gradient(-45deg, transparent 75%, #1b1f2a 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-color: #11141c;
  object-fit: contain;
}
.kit-card > hgroup h3 { font-size: clamp(13px, 5cqi, 15px); font-weight: 700; margin-bottom: 2px; }
.kit-card > hgroup .kit-res { font-size: 10px; font-weight: 700; color: #64d2ff; font-family: ui-monospace, monospace; }
.kit-card > p { font-size: 11px; color: var(--text-dim); line-height: 1.45; }
.kit-card > footer { padding-top: 4px; }

/* Auditor de Rendimiento 3D en Exportación */
.audit-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px 13px;
  margin-bottom: 10px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-strong);
}
.audit-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.audit-grade {
  font-size: 18px; font-weight: 900; padding: 3px 10px; border-radius: 8px;
  background: rgba(48, 209, 88, 0.14); font-family: ui-monospace, monospace;
}
.audit-metrics {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  font-family: ui-monospace, monospace; font-size: 10px;
}
.audit-metric {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 7px; padding: 6px 8px;
}
.audit-metric strong { display: block; font-size: 12px; color: #fff; }
.audit-tip { font-size: 11px; color: var(--text-dim); line-height: 1.4; }

/* === v17 STUDIO IDE PROFESIONAL: Activity Bar, Outliner 3D, Revisión Colaborativa, Analíticas, Terminal & Status Bar === */
.ide-activity-bar {
  grid-area: activity;
  pointer-events: auto;
  background: #0a0b0f;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  gap: 6px;
  z-index: 12;
}
.ide-act-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  position: relative;
  transition: background 0.15s ease, color 0.15s ease;
}
.ide-act-btn:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.ide-act-btn.active,
.ide-act-btn[aria-pressed="true"] {
  background: rgba(10, 132, 255, 0.18);
  border-color: rgba(10, 132, 255, 0.45);
  color: #fff;
}
.ide-act-btn.active::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 7px;
  bottom: 7px;
  width: 2.5px;
  border-radius: 2px;
  background: var(--accent);
}

.ide-sidebar-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.ide-sidebar-view[hidden] { display: none !important; }

.panel-left, .panel-right { position: relative; }
.ide-resizer {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 6px;
  cursor: col-resize;
  z-index: 25;
  background: transparent;
  transition: background 0.15s ease;
}
.ide-resizer:hover, .ide-resizer.dragging { background: rgba(10, 132, 255, 0.55); }
.ide-resizer-left { right: -3px; }
.ide-resizer-right { left: -3px; }

/* Outliner 3D */
.ide-block { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.ide-block-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.ide-tree-summary { font-size: 10px; font-family: ui-monospace, monospace; color: #64d2ff; }
.ide-tree { display: flex; flex-direction: column; gap: 3px; }
.ide-tree-sec { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); padding: 4px 2px; }
.ide-tree-row {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 5px 7px; border-radius: 7px; border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.03); color: var(--text); font-size: 11px;
  cursor: pointer; text-align: left; width: 100%;
}
.ide-tree-row:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--border); }
.ide-tree-row.mesh-row { padding: 2px 4px; }
.ide-tree-sel {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px;
  border: none; background: transparent; color: inherit; font: inherit; cursor: pointer; padding: 3px 4px;
}
.ide-tree-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.ide-tree-row small { font-family: ui-monospace, monospace; font-size: 10px; color: var(--text-dim); }
.ide-eye-btn { border: none; background: transparent; cursor: pointer; font-size: 12px; padding: 2px 4px; opacity: 0.85; }
.ide-eye-btn:hover { opacity: 1; }

/* Comentarios 3D Colaborativos */
.comment-layer { position: absolute; inset: 0; pointer-events: none; z-index: 6; overflow: hidden; }
.comment-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  width: 26px; height: 26px;
  border-radius: 50% 50% 50% 4px;
  border: 2px solid #fff;
  background: #ff9f0a;
  color: #111;
  font-size: 11px; font-weight: 900;
  display: none; place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
}
.comment-pin.resolved { background: #30d158; opacity: 0.72; }
.ide-comment-list { display: flex; flex-direction: column; gap: 8px; }
.ide-comment-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-left: 3px solid #ff9f0a;
  border-radius: 10px;
  padding: 9px;
  display: flex; flex-direction: column; gap: 6px;
}
.ide-comment-card.resolved { border-left-color: #30d158; opacity: 0.7; }
.ide-cm-head { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.ide-cm-num { background: #ff9f0a; color: #111; font-weight: 800; padding: 1px 5px; border-radius: 5px; font-size: 10px; }
.ide-cm-time { margin-left: auto; font-size: 10px; color: var(--text-dim); font-family: ui-monospace, monospace; }
.ide-cm-text { font-size: 12px; line-height: 1.4; color: #eceef2; }
.ide-cm-acts { display: flex; gap: 5px; }

/* Analíticas IDE */
.ide-kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-bottom: 10px; }
.ide-kpi {
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 9px;
  padding: 8px; text-align: center;
}
.ide-kpi strong { display: block; font-size: 17px; color: #fff; font-variant-numeric: tabular-nums; }
.ide-kpi span { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }
.ide-bar-row { display: flex; flex-direction: column; gap: 3px; }
.ide-bar-meta { display: flex; justify-content: space-between; font-size: 11px; }
.ide-bar-track { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.ide-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #0a84ff, #64d2ff); }
.ide-bar-fill.alt { background: linear-gradient(90deg, #bf5af2, #ff375f); }
.ide-feed { display: flex; flex-direction: column; gap: 4px; }
.ide-feed-item { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-dim); }
.ide-tag { background: rgba(10, 132, 255, 0.18); color: #64d2ff; font-family: ui-monospace, monospace; font-size: 9px; padding: 1px 5px; border-radius: 4px; text-transform: uppercase; }
.ide-empty { font-size: 11px; color: var(--text-dim); line-height: 1.45; }

/* Consola / Terminal IDE */
.ide-console-drawer {
  background: #08090d;
  border-bottom: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  height: 158px;
}
.ide-console-drawer[hidden] { display: none; }
.ide-console-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 10px; font-family: ui-monospace, monospace; font-size: 10px;
  color: #9da3ae; border-bottom: 1px solid var(--border);
}
.ide-console-output {
  flex: 1; overflow-y: auto; padding: 6px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px;
  display: flex; flex-direction: column; gap: 2px;
}
.ide-log { color: #cbd5e1; white-space: pre-wrap; }
.ide-log-cmd { color: #64d2ff; font-weight: 600; }
.ide-log-ok { color: #30d158; }
.ide-log-warn { color: #ff9f0a; }
.ide-console-form {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-top: 1px solid var(--border); background: #0c0e14;
}
.ide-prompt { color: #30d158; font-family: ui-monospace, monospace; font-weight: 800; }
#ide-console-input {
  flex: 1; border: none; background: transparent; color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; outline: none;
}

/* Status Bar Profesional (24px inferior) */
.ide-statusbar {
  grid-area: status;
  pointer-events: auto;
  background: #0a0b10;
  border-top: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  color: var(--text-dim);
  z-index: 15;
}
.ide-sb-group { display: flex; align-items: center; gap: 10px; }
.ide-sb-pill.ok { color: #30d158; font-weight: 700; }
.ide-sb-btn {
  display: inline-flex; align-items: center; gap: 4px;
  border: none; background: transparent; color: inherit; font: inherit;
  cursor: pointer; padding: 1px 6px; border-radius: 4px;
}
.ide-sb-btn:hover, .ide-sb-btn[aria-pressed="true"] { background: rgba(10, 132, 255, 0.22); color: #fff; }

.stage-hud-bottom { bottom: calc(var(--timeline-h) + var(--status-h) + 10px); }
body.zen-mode .ide-activity-bar,
body.zen-mode .ide-statusbar { display: none !important; }

/* === v18: Active FX Icon HUD + Pista FX Clips Multi-Pista + Mini-Iconos en Escenas === */
.active-fx-hud {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 9;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-inline-size: min(560px, calc(100% - 24px));
  pointer-events: none;
}
.active-fx-hud[hidden],
body.preview-mode .active-fx-hud { display: none !important; }

.fx-chip {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(11, 13, 19, 0.84);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.38);
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.fx-chip:hover {
  border-color: var(--fx-col, var(--accent));
  transform: translateY(-1px);
}
.fx-chip-main {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  background: transparent;
  color: #f3f4f6;
  font: inherit;
  font-size: 10.5px;
  font-weight: 600;
  padding: 4px 7px 4px 8px;
  cursor: pointer;
}
.fx-chip-main .ic { width: 12px; height: 12px; }
.fx-chip-off {
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.09);
  background: transparent;
  color: var(--text-dim);
  font-size: 11px;
  padding: 4px 7px;
  cursor: pointer;
  line-height: 1;
}
.fx-chip-off:hover { background: rgba(255, 69, 58, 0.24); color: #fff; }

/* Pista FX Clips en el Timeline Dope Sheet */
.dope-seg.fx-clip {
  position: absolute;
  top: 0;
  bottom: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(90deg, rgba(10, 132, 255, 0.34), rgba(191, 90, 242, 0.34));
  border-left: 2px solid var(--clip-accent, #64d2ff);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 5px;
  cursor: pointer;
  overflow: hidden;
}
.dope-seg.fx-clip.active {
  border-color: #fff;
  background: linear-gradient(90deg, rgba(10, 132, 255, 0.55), rgba(191, 90, 242, 0.52));
}
.scene-fx-icons {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 4px;
  vertical-align: middle;
}
.scene-fx-icons .ic { width: 11px; height: 11px; }

/* === v19: Timeline Pro v2 (Zoom Scroll, Trim Handles, Hotspots Editables & Audio Waveform) === */
.tl-scroll-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}
.tl-zoom-inner {
  min-width: 100%;
  width: 100%;
  transition: width 0.16s ease;
}
.dope-row { height: 18px !important; }
.dope-lane { height: 16px !important; position: relative; }
.dope-seg.fx-clip {
  padding: 0 7px;
  justify-content: center;
  cursor: grab;
  user-select: none;
}
.dope-seg.fx-clip:active { cursor: grabbing; }
.fx-clip-icons {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  pointer-events: none;
}
.dope-seg.hotspot-clip {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(48, 209, 88, 0.25);
  border: 1px solid rgba(48, 209, 88, 0.55);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
  overflow: hidden;
}
.dope-seg.hotspot-clip.active {
  background: rgba(48, 209, 88, 0.42);
  border-color: #fff;
}
.dope-seg.hotspot-clip:active { cursor: grabbing; }
.clip-lbl {
  font-size: 9.5px;
  font-weight: 700;
  color: #ecfdf5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 8px;
  pointer-events: none;
}
.clip-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 6px;
  cursor: ew-resize;
  background: rgba(255, 255, 255, 0.16);
  transition: background 0.12s ease;
}
.clip-handle:hover { background: rgba(255, 255, 255, 0.65); }
.clip-handle.left { left: 0; border-radius: 3px 0 0 3px; }
.clip-handle.right { right: 0; border-radius: 0 3px 3px 0; }
.dope-lane.wave-lane { background: rgba(8, 10, 16, 0.72); border-radius: 4px; overflow: hidden; }
.dope-waveform { display: block; width: 100%; height: 100%; }

/* === v22: Cloud Hub Panel & Live MCP Sync === */
.cloud-hub-top { display: flex; gap: 6px; align-items: center; }
.cloud-sync-on {
  background: rgba(48, 209, 88, 0.18) !important;
  border-color: rgba(48, 209, 88, 0.55) !important;
  color: #86efac !important;
}
.cloud-pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: #64748b; display: inline-block; flex-shrink: 0;
}
.cloud-sync-on .cloud-pulse {
  background: #30d158;
  box-shadow: 0 0 8px #30d158;
  animation: ch-blink 1.4s ease-in-out infinite;
}
@keyframes ch-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.cloud-watch-banner {
  font-size: 10.5px; color: #86efac; background: rgba(48, 209, 88, 0.1);
  border: 1px solid rgba(48, 209, 88, 0.28); border-radius: 8px;
  padding: 5px 8px; line-height: 1.35;
}
.cloud-hub-err {
  font-size: 11px; color: #fca5a5; background: rgba(255, 69, 58, 0.12);
  border: 1px solid rgba(255, 69, 58, 0.35); border-radius: 8px;
  padding: 7px 9px; margin-bottom: 8px;
}
.cloud-hub-list { display: flex; flex-direction: column; gap: 8px; }
.cloud-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 9px;
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.cloud-card:hover { background: rgba(255, 255, 255, 0.06); border-color: var(--border-strong); }
.cloud-card.current { border-color: rgba(10, 132, 255, 0.55); background: rgba(10, 132, 255, 0.08); }
.cloud-card-head { display: flex; align-items: center; gap: 7px; min-width: 0; }
.cloud-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cloud-card-title { font-size: 12px; font-weight: 700; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cloud-card-meta {
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
  font-size: 10px; color: var(--text-dim); font-family: ui-monospace, monospace;
}
.cloud-card-meta code { color: #64d2ff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cloud-card-acts { display: flex; flex-wrap: wrap; gap: 4px; }
.cloud-card-acts .btn { font-size: 10.5px; padding: 3px 7px; }
.cloud-del-btn { margin-left: auto; color: #fda4af; }
.cloud-del-btn:hover { background: rgba(255, 69, 58, 0.28) !important; color: #fff; border-color: transparent; }

/* === v23 SAAS: Cuenta de Usuario, Tokens MCP & CRUD Proyectos D1 === */
.btn-account { gap: 6px; padding-inline: 10px; }
.btn-account.logged-in { border-color: rgba(10, 132, 255, 0.45); background: rgba(10, 132, 255, 0.12); }
.user-avatar-dot {
  width: 19px; height: 19px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: 9px; font-weight: 800; color: #fff; flex-shrink: 0;
}
.user-btn-name { max-inline-size: 86px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-avatar-lg {
  width: 38px; height: 38px; border-radius: 12px; display: inline-grid; place-items: center;
  font-size: 14px; font-weight: 800; color: #fff; flex-shrink: 0;
}
dialog.auth-dialog { max-width: 480px; }
dialog.projects-dialog { max-width: 760px; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-foot-note { font-size: 11px; color: var(--text-dim); line-height: 1.45; margin-top: 10px; }
.profile-head { display: flex; align-items: center; gap: 10px; }
.token-reveal-box {
  background: rgba(48, 209, 88, 0.08); border: 1px solid rgba(48, 209, 88, 0.35);
  border-radius: 10px; padding: 10px; margin-top: 6px;
}
.tok-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.tok-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 9px; border-radius: 8px; background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
}
.auth-gate-card {
  background: linear-gradient(135deg, rgba(10, 132, 255, 0.12), rgba(191, 90, 242, 0.09));
  border: 1px solid var(--border-strong); border-radius: 14px; padding: 22px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.auth-gate-card h3 { font-size: 16px; }
.auth-gate-card p { font-size: 12px; color: var(--text-dim); max-inline-size: 44ch; line-height: 1.5; }
.cp-list { display: flex; flex-direction: column; gap: 8px; }
.cp-card {
  background: rgba(255, 255, 255, 0.035); border: 1px solid var(--border);
  border-radius: 12px; padding: 11px 12px; display: flex; flex-direction: column; gap: 8px;
}
.cp-card.current { border-color: rgba(10, 132, 255, 0.55); background: rgba(10, 132, 255, 0.08); }
.cp-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.cp-title { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.cp-meta { font-size: 10.5px; color: var(--text-dim); font-family: ui-monospace, monospace; margin-top: 2px; }
.cp-meta code { color: #64d2ff; }
.cp-vis-select { width: auto; min-width: 112px; font-size: 11px; padding: 4px 8px; }
.cp-acts { display: flex; flex-wrap: wrap; gap: 5px; }
.cp-vers-box {
  background: rgba(8, 10, 16, 0.72); border: 1px solid var(--border);
  border-radius: 9px; padding: 8px; display: flex; flex-direction: column; gap: 5px;
}
.cp-ver-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 11px; padding: 4px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.03);
}
#ppane-cloud[hidden], #ppane-local[hidden] { display: none !important; }









