/* Stage 53.2: only activate the dock grid when all three panels are visible. */
main.tf-dock-active:not(.editor-maximized):not(.preview-maximized) {
  display: grid !important;
  grid-template-columns: var(--tf-dock-columns) !important;
  grid-template-rows: var(--tf-dock-rows) !important;
  align-items: stretch !important;
  gap: 8px !important;
}
main.tf-dock-active > section,
main.tf-dock-active > #props-panel,
main.tf-dock-active > #preview-panel {
  grid-row: var(--tf-dock-row) !important;
  grid-column: var(--tf-dock-col) !important;
  position: relative !important;
  top: auto !important;
  min-width: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  align-self: stretch !important;
}
main.tf-dock-active > #preview-panel { display: flex !important; overflow: auto !important; }
main.tf-dock-active > #props-panel { display: flex !important; flex-direction: column; overflow: hidden !important; }
main.tf-dock-active > #split-props,
main.tf-dock-active > #split-preview { display: none !important; }
main.tf-dock-active .dock-handle { cursor: grab; }
.tf-dock-overlay {
  position: absolute; inset: 0; z-index: 250; pointer-events: none;
  background: rgba(13,24,34,.22);
}
.tf-dock-zone {
  position: absolute; display: flex; justify-content: center; align-items: center;
  border: 1px dashed #8dc7a3; border-radius: 5px;
  background: rgba(64,129,112,.28); color: #e7fff2;
  font: 600 12px system-ui,sans-serif; pointer-events: auto;
}
.tf-dock-zone.tf-dock-left { left: 3%; top: 25%; bottom: 25%; width: 24%; }
.tf-dock-zone.tf-dock-right { right: 3%; top: 25%; bottom: 25%; width: 24%; }
.tf-dock-zone.tf-dock-top { top: 3%; left: 29%; right: 29%; height: 22%; }
.tf-dock-zone.tf-dock-bottom { bottom: 3%; left: 29%; right: 29%; height: 22%; }
.tf-dock-zone.tf-dock-hover { background: rgba(100,198,154,.72); border-style: solid; }
@media (max-width: 800px) {
  main.tf-dock-active { display: block !important; }
  main.tf-dock-active > section, main.tf-dock-active > #props-panel,
  main.tf-dock-active > #preview-panel { margin-bottom: 12px !important; }
}

/* Stage 53.3: draggable dock splitters, within the browser workspace. */
main.tf-dock-active { position: relative !important; }
main.tf-dock-active > .tf-dock-resizer {
  position: absolute; z-index: 220; background: transparent; touch-action: none;
  user-select: none; box-sizing: border-box;
}
main.tf-dock-active > .tf-dock-resizer:hover,
main.tf-dock-active > .tf-dock-resizer:focus-visible { background: rgba(141,199,163,.3); outline: 1px solid #8dc7a3; }
main.tf-dock-active > .tf-dock-resizer-horizontal { width: 8px; transform: translateX(-50%); cursor: col-resize; }
main.tf-dock-active > .tf-dock-resizer-vertical { height: 8px; transform: translateY(-50%); cursor: row-resize; }
@media(max-width:800px) { main.tf-dock-active > .tf-dock-resizer { display: none !important; } }

/* Stage 53.5: quiet visual splitters with a generous hit target. */
main.tf-dock-active > .tf-dock-resizer { background: transparent; outline: none; }
main.tf-dock-active > .tf-dock-resizer-horizontal { width: 14px; }
main.tf-dock-active > .tf-dock-resizer-vertical { height: 14px; }
main.tf-dock-active > .tf-dock-resizer::after {
  content: ''; position: absolute; border-radius: 999px;
  background: transparent; pointer-events: none;
  transition: background-color .12s ease, box-shadow .12s ease;
}
main.tf-dock-active > .tf-dock-resizer-horizontal::after { width: 2px; top: 8px; bottom: 8px; left: calc(50% - 1px); }
main.tf-dock-active > .tf-dock-resizer-vertical::after { height: 2px; left: 8px; right: 8px; top: calc(50% - 1px); }
main.tf-dock-active > .tf-dock-resizer:hover,
main.tf-dock-active > .tf-dock-resizer:focus-visible,
main.tf-dock-active > .tf-dock-resizer.tf-dock-resizer-dragging { background: transparent; outline: none; }
main.tf-dock-active > .tf-dock-resizer:hover::after,
main.tf-dock-active > .tf-dock-resizer:focus-visible::after,
main.tf-dock-active > .tf-dock-resizer.tf-dock-resizer-dragging::after {
  background: #8dc7a3; box-shadow: 0 0 8px rgba(141,199,163,.35);
}
body.tf-dock-resizing, body.tf-dock-resizing * { user-select: none !important; }

/* Stage 54: precise, legible docking feedback; no layout shift. */
body.tf-docking .tf-dock-overlay { background: rgba(9, 19, 27, .32); }
body.tf-docking .tf-dock-zone { opacity: .68; transition: opacity .1s ease, background-color .1s ease, border-color .1s ease; }
body.tf-docking .tf-dock-zone.tf-dock-hover { opacity: 1; border-color: #c7ffe1; box-shadow: inset 0 0 0 1px rgba(199,255,225,.4), 0 0 16px rgba(100,198,154,.25); }
main.tf-dock-active .dock-handle { user-select: none; }
main.tf-dock-active .dock-handle:active { cursor: grabbing; }
