/* ==========================================================
   POLLUX.EDITION
   UI RESPONSIVE — DESKTOP / TABLET / MOBILE
   Paneles acoplables estilo Unity incluidos (ver sección final)
========================================================== */

:root {
  --bg: #141517;
  --panel: #1a1b1f;
  --panel2: #232529;
  --panel3: #2b2d33;
  --border: #33363d;
  --purple: #a300f4d6;   /* acento principal */
  --purple2: #3902dfb7;  /* acento hover */
  --on-accent: #f6eee0;  /* texto sobre el acento */
  --text: #ececee;
  --muted: #8b8f98;
  --red: #ff5a5f;
  --green: #4cc38a;

  --header-height: 56px;
  --radius: 9px;
  --touch-size: 40px;
}

/* ==========================================================
   RESET
========================================================== */

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 34px;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  border-radius: 7px;
  padding: 7px 11px;
  cursor: pointer;
  transition:
    border-color .15s,
    background .15s,
    transform .15s;
  -webkit-tap-highlight-color: transparent;
}

button:hover:not(:disabled) {
  border-color: var(--purple);
  background: var(--panel3);
}

button:active:not(:disabled) {
  transform: scale(.97);
}

button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

button.primary {
  background: var(--purple);
  border-color: var(--purple);
  color: var(--on-accent);
  font-weight: 600;
}

button.primary:hover:not(:disabled) {
  background: var(--purple2);
  border-color: var(--purple2);
}

button.danger:hover {
  border-color: var(--red);
  color: var(--red);
}

button.recording {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  animation: pulse 1.2s infinite;
}

input,
select,
textarea {
  background: #101113;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 10px;
  width: 100%;
  min-width: 0;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--purple);
}

input[type="range"] {
  padding: 0;
  accent-color: var(--purple);
  cursor: pointer;
}

input[type="color"] {
  height: 36px;
  padding: 3px;
}

input[type="checkbox"] {
  width: auto;
  accent-color: var(--purple);
}

img,
video,
canvas {
  max-width: 100%;
}

.slot {
  display: contents;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: .6; }
  100% { opacity: 1; }
}

/* ==========================================================
   CABECERA
========================================================== */

header {
  height: var(--header-height);
  width: 100%;
  position: relative;
  z-index: 30;
  background: #101113;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 12px;
}

.brand {
  font-size: 19px;
  font-weight: 850;
  display: flex;
  gap: 10px;
  align-items: center;
  white-space: nowrap;
  min-width: 0;
}

.brand span {
  color: var(--purple);
}

.logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 10px;
  background: transparent;   /* no tiñe el logo */
  color: var(--on-accent);
  display: grid;
  place-items: center;
  font-size: 19px;
  overflow: hidden;
}

/* fondo de color solo si no hay imagen (letra de respaldo) */
.logo:not(:has(img)) {
  background: var(--purple);
}

.logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;       /* muestra el logo completo, con sus colores */
  display: block;
}

.header-actions {
  display: flex;
  gap: 7px;
  align-items: center;
  min-width: 0;
}

.header-actions button {
  white-space: nowrap;
}

.status {
  font-size: 11px;
  color: var(--green);
  margin-right: 8px;
  white-space: nowrap;
}

/* ==========================================================
   LAYOUT PRINCIPAL
========================================================== */

.app {
  width: 100%;
  height: calc(100vh - var(--header-height));
  height: calc(100dvh - var(--header-height));
  min-height: 0;

  display: grid;

  grid-template-columns:
    255px
    minmax(300px, 1fr)
    310px;

  grid-template-rows:
    minmax(240px, 1fr)
    335px;

  overflow: hidden;
}

.panel {
  background: var(--panel);
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border-right: 1px solid var(--border);
  scrollbar-width: thin;
  scrollbar-color: #3c4048 transparent;
}

.panel::-webkit-scrollbar,
.timeline-scroll::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

.panel::-webkit-scrollbar-thumb,
.timeline-scroll::-webkit-scrollbar-thumb {
  background: #3c4048;
  border-radius: 10px;
}

.panel-title {
  padding: 14px 15px;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 1px;
}

/* ==========================================================
   BIBLIOTECA MULTIMEDIA
========================================================== */

.media-panel {
  grid-column: 1;
  grid-row: 1 / 3;
  min-height: 0;
}

.media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 10px 12px;
}

.media-actions button {
  flex: 1 1 45%;
  font-size: 11px;
  min-width: 0;
}

.media-actions button.full-btn {
  flex: 1 1 100%;
}

.media-list {
  padding: 0 10px;
}

.media-item {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--panel2);
  border: 1px solid transparent;
  padding: 8px;
  border-radius: 8px;
  margin-bottom: 7px;
  cursor: pointer;
  min-width: 0;
}

.media-item:hover,
.media-item.selected {
  border-color: var(--purple);
  background: var(--panel3);
}

.thumb {
  width: 52px;
  height: 38px;
  object-fit: cover;
  border-radius: 5px;
  background: #0e0f11;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.media-info {
  min-width: 0;
  flex: 1;
}

.media-name {
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-meta {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}

.media-dl-btn {
  padding: 4px 7px;
  font-size: 11px;
  border-radius: 5px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  flex-shrink: 0;
}

.media-dl-btn:hover {
  color: var(--green);
  border-color: var(--green);
}

.empty {
  text-align: center;
  padding: 20px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

/* ==========================================================
   VISTA PREVIA
========================================================== */

.preview-area {
  grid-column: 2;
  grid-row: 1;

  background: #0e0f11;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  padding: 12px;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.preview-top {
  width: 100%;
  max-width: 900px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 8px;
}

.slot-row {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.canvas-wrap {
  width: min(100%, 900px);
  max-height: calc(100% - 68px);
  aspect-ratio: 16 / 9;

  background: #000;
  border: 1px solid #2c2f36;
  border-radius: 4px;

  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;
}

#preview {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  object-fit: contain;
}

.preview-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 10px;
  max-width: 100%;
}

.preview-controls button {
  min-width: 36px;
}

.time-label {
  font-size: 11px;
  color: var(--muted);
  min-width: 125px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================
   INSPECTOR / PROPIEDADES
========================================================== */

.properties {
  grid-column: 3;
  grid-row: 1 / 3;

  border-left: 1px solid var(--border);
  border-right: 0;
}

.section {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.section h3 {
  margin: 0 0 10px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .8px;
  text-transform: uppercase;
}

.field {
  margin: 8px 0;
  min-width: 0;
}

.field label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 5px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.section button.full {
  width: 100%;
  margin-top: 6px;
}

.btn-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.btn-row button {
  flex: 1;
  min-width: 0;
  font-size: 11px;
}

/* ==========================================================
   TIMELINE
========================================================== */

.timeline {
  grid-column: 2;
  grid-row: 2;

  min-width: 0;
  min-height: 0;

  display: flex;
  flex-direction: column;

  background: #17181b;
  border-top: 1px solid var(--border);
  overflow: hidden;
}

.timeline-toolbar {
  min-height: 44px;
  height: 44px;
  flex-shrink: 0;

  display: flex;
  align-items: center;
  gap: 6px;

  padding: 0 9px;
  border-bottom: 1px solid var(--border);

  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.timeline-toolbar::-webkit-scrollbar {
  display: none;
}

.timeline-toolbar button {
  font-size: 10px;
  white-space: nowrap;
  padding: 5px 9px;
  flex-shrink: 0;
}

.dur {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.timeline-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  position: relative;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
}

.timeline-ruler {
  height: 26px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: #1d1f23;
  border-bottom: 1px solid var(--border);
  min-width: 900px;
  cursor: pointer;
}

.ruler-inner {
  height: 100%;
  position: relative;
}

.ruler-mark {
  position: absolute;
  top: 0;
  height: 100%;
  border-left: 1px solid #3a3d45;
  padding: 5px;
  font-size: 9px;
  color: var(--muted);
  pointer-events: none;
}

.track {
  height: 48px;
  min-width: 900px;
  display: flex;
  border-bottom: 1px solid #2a2c32;
}

.track-label {
  position: sticky;
  left: 0;
  z-index: 4;

  width: 105px;
  flex-shrink: 0;

  background: #1d1f23;
  border-right: 1px solid var(--border);

  display: flex;
  align-items: center;
  padding-left: 10px;

  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.track-content {
  position: relative;
  flex: none;
  height: 48px;
}

.clip {
  position: absolute;
  top: 4px;
  height: 39px;
  min-width: 14px;

  border-radius: 5px;
  padding: 4px 8px;

  overflow: hidden;
  font-size: 10px;
  white-space: nowrap;

  cursor: grab;
  user-select: none;
  touch-action: pan-y;

  border: 1px solid #ffffff2e;

  display: flex;
  align-items: center;
}

/* clips: tonos apagados con luminosidad parecida entre sí */
.clip.video {
  background: #3f5f8f;
}

.clip.image {
  background: #2f7468;
}

.clip.audio {
  background: #8a6330;
}

.clip.text {
  background: #85485f;
}

.clip.selected {
  outline: 2px solid var(--purple);
  z-index: 3;
  box-shadow: 0 2px 10px #00000080;
}

.clip-label {
  position: relative;
  z-index: 2;
  pointer-events: none;
  text-shadow: 0 1px 3px #000000bb;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clip-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 9px;
  cursor: ew-resize;
  z-index: 4;
  touch-action: none;
}

.clip-handle:hover {
  background: #ffffff44;
}

.clip-handle.left {
  left: 0;
}

.clip-handle.right {
  right: 0;
}

.playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--red);
  z-index: 7;
  pointer-events: none;
}

.playhead:before {
  content: "";
  position: absolute;
  top: 0;
  left: -5px;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--red);
}

/* ==========================================================
   AVISOS Y VENTANAS
========================================================== */

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);

  background: var(--panel3);
  border: 1px solid var(--border);

  padding: 10px 16px;
  border-radius: 8px;

  font-size: 12px;
  display: none;
  z-index: 300;

  max-width: calc(100vw - 30px);
  text-align: center;
}

.modal-overlay {
  position: fixed;
  inset: 0;

  background: rgba(8, 8, 10, .85);

  display: none;
  align-items: center;
  justify-content: center;

  z-index: 250;
  backdrop-filter: blur(4px);
  padding: 15px;
}

.modal-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;

  padding: 22px;
  width: min(450px, 92vw);
  max-height: 90vh;
  overflow-y: auto;

  box-shadow: 0 15px 40px #000000aa;
}

.modal-box h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.modal-box p {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

/* ==========================================================
   TABLETS
========================================================== */

@media (max-width: 1100px) and (min-width: 701px) {

  .app {
    grid-template-columns: 205px minmax(0, 1fr);
    grid-template-rows:
      minmax(300px, 1fr)
      320px
      auto;
  }

  .media-panel {
    grid-column: 1;
    grid-row: 1 / 4;
  }

  .preview-area {
    grid-column: 2;
    grid-row: 1;
  }

  .timeline {
    grid-column: 2;
    grid-row: 2;
  }

  .properties {
    grid-column: 2;
    grid-row: 3;

    border-left: 0;
    border-top: 1px solid var(--border);

    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
  }

  .properties > .panel-title {
    grid-column: 1 / -1;
  }

  .properties > .section {
    min-width: 0;
  }

  .canvas-wrap {
    max-width: 100%;
  }
}

/* ==========================================================
   MÓVIL (≤ 700px) — ESTILO CAPCUT
   Vista previa arriba · timeline abajo · barra inferior
   Biblioteca y Propiedades se abren como hojas desde abajo.
   Necesita mobile-ui.js (crea la barra inferior y las hojas).
========================================================== */

.m-bar,
.m-backdrop,
.m-sheet-head {
  display: none;
}

@media (max-width: 700px) {

  :root {
    --bar-h: 58px;
    --m-header: 48px;
    --m-accent: #c58bff;
  }

  html,
  body {
    height: 100%;
  }

  body {
    overflow: hidden;
  }

  /* CABECERA */

  header {
    height: var(--m-header);
    padding: 0 10px;
    gap: 6px;
  }

  .brand {
    font-size: 15px;
    gap: 7px;
  }

  .logo {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 16px;
  }

  .header-actions {
    gap: 5px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .header-actions::-webkit-scrollbar {
    display: none;
  }

  .header-actions button {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 11px;
    flex-shrink: 0;
  }

  .status {
    display: none;
  }

  /* ÁREA PRINCIPAL: vista previa + timeline */

  .app {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: calc(100dvh - var(--m-header) - var(--bar-h) - env(safe-area-inset-bottom, 0px));
    min-height: 0;
    overflow: hidden;
  }

  .preview-area {
    flex: 0 0 40%;
    min-height: 170px;
    padding: 6px 8px;
    justify-content: center;
    overflow: hidden;
  }

  .preview-top {
    font-size: 10px;
    margin-bottom: 5px;
  }

  .canvas-wrap {
    width: 100%;
    max-width: 100%;
    max-height: calc(100% - 58px);
    aspect-ratio: 16 / 9;
  }

  #preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .preview-controls {
    width: 100%;
    gap: 5px;
    margin-top: 6px;
  }

  .preview-controls button {
    min-width: 34px;
    min-height: 38px;
    padding: 6px 8px;
  }

  .time-label {
    min-width: 84px;
    font-size: 10px;
  }

  /* TIMELINE */

  .timeline {
    flex: 1 1 0;
    min-height: 0;
    border-top: 1px solid var(--border);
  }

  .timeline-toolbar {
    height: 48px;
    min-height: 48px;
    padding: 0 8px;
    gap: 6px;
  }

  .timeline-toolbar button {
    min-height: 36px;
    font-size: 11px;
    padding: 6px 11px;
  }

  .dur {
    font-size: 9px;
  }

  .timeline-scroll {
    -webkit-overflow-scrolling: touch;
  }

  .timeline-ruler,
  .track {
    min-width: 900px;
  }

  .track {
    height: 52px;
  }

  .track-label {
    width: 78px;
    padding-left: 7px;
    font-size: 9px;
  }

  .track-content {
    height: 52px;
  }

  .clip {
    top: 4px;
    height: 43px;
    min-width: 20px;
    font-size: 10px;
    padding: 4px 8px;
  }

  .clip-handle {
    width: 16px;
  }

  /* HOJAS DESLIZABLES: Biblioteca y Propiedades */

  .media-panel,
  .properties {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px));

    width: 100%;
    height: 60dvh;
    max-height: none;
    min-height: 0;

    z-index: 120;
    overflow: auto;

    border: 0;
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -12px 40px #000c;

    transform: translateY(calc(100% + var(--bar-h) + 24px));
    visibility: hidden;
    transition:
      transform .25s ease,
      visibility 0s linear .25s;
  }

  .media-panel.m-open,
  .properties.m-open {
    transform: none;
    visibility: visible;
    transition: transform .25s ease;
  }

  .m-backdrop {
    position: fixed;
    inset: 0;
    z-index: 110;
    background: rgba(0, 0, 0, .5);
  }

  .m-backdrop.show {
    display: block;
  }

  .m-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;

    position: sticky;
    top: 0;
    z-index: 20;

    padding: 16px 14px 9px;
    background: var(--panel3);
    border-bottom: 1px solid var(--border);

    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    touch-action: none;
  }

  .m-sheet-head::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 50%;
    width: 38px;
    height: 4px;
    margin-left: -19px;
    border-radius: 4px;
    background: #5a5e68;
  }

  .m-close {
    min-width: 34px;
    min-height: 30px;
    padding: 2px 8px;
  }

  .panel-title {
    padding: 11px 14px;
  }

  .section {
    padding: 13px;
  }

  .field {
    margin: 10px 0;
  }

  .field label {
    font-size: 11px;
  }

  .field input,
  .field select,
  .field textarea {
    min-height: 38px;
  }

  .section button {
    min-height: 38px;
  }

  /* BARRA INFERIOR */

  .m-bar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 130;

    height: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px));
    padding: 0 6px env(safe-area-inset-bottom, 0px);

    background: #101113;
    border-top: 1px solid var(--border);
  }

  .m-bar button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;

    min-height: var(--bar-h);
    padding: 4px;

    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--muted);

    font-size: 10px;
    font-weight: 600;
  }

  .m-bar button:hover:not(:disabled) {
    background: transparent;
  }

  .m-bar .ico {
    font-size: 20px;
    line-height: 1;
  }

  .m-bar button.active {
    color: var(--m-accent);
  }

  /* VENTANAS Y AVISOS */

  .modal-overlay {
    padding: 12px;
    align-items: center;
    z-index: 250;
  }

  .modal-box {
    width: 100%;
    max-width: 450px;
    padding: 18px;
    max-height: 88dvh;
    overflow-y: auto;
  }

  .toast {
    bottom: calc(var(--bar-h) + 16px);
    width: max-content;
    max-width: calc(100vw - 30px);
  }
}

/* móvil en horizontal: vista previa a la izquierda, timeline a la derecha */

@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {

  :root {
    --bar-h: 46px;
    --m-header: 42px;
  }

  .app {
    flex-direction: row;
  }

  .preview-area {
    flex: 0 0 46%;
    min-height: 0;
  }

  .timeline {
    border-top: 0;
    border-left: 1px solid var(--border);
  }

  .media-panel,
  .properties {
    height: 78dvh;
  }

  .m-bar .ico {
    font-size: 16px;
  }
}

/* ==========================================================
   ACCESIBILIDAD Y DISPOSITIVOS TÁCTILES
========================================================== */

@media (hover: none) and (pointer: coarse) {

  button {
    min-height: var(--touch-size);
  }

  .clip-handle {
    width: 14px;
  }

  .timeline-scroll,
  .media-list,
  .media-actions {
    -webkit-overflow-scrolling: touch;
  }

  button:hover:not(:disabled) {
    background: var(--panel2);
    border-color: var(--border);
  }
}

/* ==========================================================
   PANTALLAS MUY GRANDES
========================================================== */

@media (min-width: 1600px) {

  .app {
    grid-template-columns:
      290px
      minmax(0, 1fr)
      350px;
  }

  .preview-area {
    padding: 20px;
  }

  .canvas-wrap {
    max-width: 1150px;
  }

  .timeline {
    min-height: 335px;
  }
}

/* ==========================================================
   PANELES ACOPLABLES (estilo Unity)
   Se activan con dock-layout.js solo en pantallas > 700px.
   Los !important son para ganarle a los media queries de arriba.
========================================================== */

.dock-handle {
  display: none;
}

.dock-reset {
  display: none;
}

body.dock-active .dock-reset {
  display: inline-block;
}

.app.dock-on {
  display: flex !important;
  flex-direction: row;
  grid-template: none !important;
  overflow: hidden;
}

/* barra para arrastrar cada panel */
.dock-on .dock-handle {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  flex: none;
  padding: 0 8px;

  font-size: 10px;
  letter-spacing: .8px;
  font-weight: 700;
  color: var(--muted);

  background: var(--panel3);
  border-bottom: 1px solid var(--border);

  cursor: grab;
  user-select: none;
  touch-action: none;

  position: sticky;
  top: 0;
  z-index: 20;
}

.dock-on .dock-handle:hover {
  color: var(--text);
}

.dock-grip {
  opacity: .7;
  font-size: 12px;
}

/* zonas: izquierda, derecha, arriba, abajo */
.dock-center {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.dock-zone {
  display: flex;
  flex: none;
  min-width: 0;
  min-height: 0;
  background: var(--panel);
}

.dock-zone.col {
  flex-direction: column;
}

.dock-zone.row {
  flex-direction: row;
}

.dock-zone[hidden],
.dock-split[hidden] {
  display: none !important;
}

.dock-zone > :not(.dock-split) {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  position: relative;
}

/* los paneles pierden su posición de grid y sus bordes */
.dock-on .panel {
  border: 0 !important;
  grid-area: auto !important;
  grid-column: auto !important;
  grid-row: auto !important;
  width: auto !important;
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  display: block !important;
}

.dock-on .timeline {
  grid-area: auto !important;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  border: 0 !important;
}

.dock-on .preview-area {
  grid-area: auto !important;
  flex: 1 1 0;
  min-width: 0;
  min-height: 120px;
}

/* separadores para cambiar el tamaño */
.dock-split {
  flex: none;
  background: var(--border);
  position: relative;
  z-index: 10;
  touch-action: none;
  transition: background .15s;
}

.dock-split::after {
  content: "";
  position: absolute;
  inset: -3px;
}

.dock-split.v {
  width: 5px;
  cursor: col-resize;
}

.dock-split.h {
  height: 5px;
  cursor: row-resize;
}

.dock-split:hover,
.dock-split:active {
  background: var(--purple);
}

/* durante el arrastre */
body.dock-busy {
  user-select: none;
}

body.dock-moving,
body.dock-moving * {
  cursor: grabbing !important;
}

.dock-ghosted {
  opacity: .45;
}

.dock-ghost {
  position: fixed;
  z-index: 1000;
  pointer-events: none;

  padding: 6px 12px;
  background: var(--panel3);
  border: 1px solid var(--purple);
  border-radius: 6px;

  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  color: var(--text);

  box-shadow: 0 8px 24px #000a;
}

.dock-drop {
  position: fixed;
  z-index: 999;
  pointer-events: none;

  background: rgba(163, 0, 244, .22);
  border: 2px dashed var(--purple);
  border-radius: 6px;

  transition: all .08s;
}

/* ==========================================================
   REDUCIR ANIMACIONES SI EL SISTEMA LO SOLICITA
========================================================== */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
