/* Builder 2.0's zoom-out view (TRK-865): the whole page small, each section a block to drag, move or open */
.pe-body.is-zoomed .pe-stage { display: none; }
.pe-body.is-zoomed .pe-canvas { padding: 0; overflow: hidden; }
.zo { display: flex; flex: 1; flex-direction: column; min-width: 0; min-height: 0; }
.zo-hint { margin: 0; padding: 10px 16px 0; color: var(--muted); font-size: 12px; line-height: 1.4; text-align: center; text-wrap: balance; }
.zo-scroll { flex: 1; min-height: 0; overflow: hidden auto; overscroll-behavior: contain; padding: 14px 16px 64px; }

.zo-page {
  --zo-scale: 0.4;
  --zo-h: 800;
  position: relative;
  width: calc(960px * var(--zo-scale));
  height: calc(var(--zo-h) * var(--zo-scale) * 1px);
  margin: 0 auto;
  opacity: 0;
}
.zo-page.is-ready { opacity: 1; }
/* Turning zoom-out on: the page settles from a little larger, quickly, so it reads as the same page getting smaller */
.zo-page.is-entering.is-ready { animation: zo-in 200ms cubic-bezier(0.23, 1, 0.32, 1); transform-origin: 50% 0; }
@keyframes zo-in { from { opacity: 0; transform: scale(1.04); } }
@keyframes zo-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .zo-page.is-entering.is-ready { animation: zo-fade 120ms ease; } }

.zo-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 960px;
  height: 800px;
  border: 0;
  background: #fff;
  transform: scale(var(--zo-scale));
  transform-origin: 0 0;
  pointer-events: none;
  box-shadow: 0 0 0 calc(1px / var(--zo-scale)) var(--border), 0 calc(4px / var(--zo-scale)) calc(16px / var(--zo-scale)) rgb(16 24 40 / 0.08);
}
.zo-frame.is-next { visibility: hidden; }

.zo-blocks { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; }
.zo-block, .zo-fixed {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--y) * var(--zo-scale) * 1px);
  height: calc(var(--bh) * var(--zo-scale) * 1px);
}
.zo-block:hover, .zo-block:focus-within { z-index: 2; }
.zo-hit {
  position: absolute;
  inset: 0;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px transparent;
  transition: box-shadow 120ms ease, background-color 120ms ease;
}
.zo-block + .zo-block .zo-hit { border-top: 1px dashed color-mix(in srgb, var(--muted) 35%, transparent); }
.zo-hit:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.zo-block.is-picked .zo-hit { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 70%, transparent); }
.zo-block.is-hidden .zo-hit { background: repeating-linear-gradient(135deg, rgb(255 255 255 / 0.55) 0 8px, rgb(255 255 255 / 0.75) 8px 16px); }
.zo-block.is-dragging .zo-hit { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.zo-block.is-dragging .zo-tools { opacity: 0; }
@media (hover: hover) and (pointer: fine) {
  .zo-hit:hover { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent); }
  .zo-block { cursor: grab; }
}

/* A section's tools: its name, then move, duplicate and delete. Shown on hover or when the keyboard is on it. */
.zo-tools {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  gap: 2px;
  max-width: calc(100% - 12px);
  padding: 2px 2px 2px 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 4px 14px rgb(16 24 40 / 0.14);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}
.zo-block:hover .zo-tools, .zo-block:focus-within .zo-tools { opacity: 1; pointer-events: auto; }
.zo-tools .pe-icon-button { width: 30px; height: 30px; }
.zo-tools .pe-icon { width: 16px; height: 16px; }
.zo-tools [data-tip]::after { left: auto; right: 0; transform: translate(0, -2px); }
.zo-tools [data-tip]:hover::after, .zo-tools [data-tip]:focus-visible::after { transform: none; }
.zo-grip { display: grid; place-items: center; color: var(--muted); cursor: grab; }
.zo-grip .pe-icon { width: 14px; height: 14px; }
.zo-name { min-width: 0; padding: 0 6px 0 2px; overflow: hidden; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.zo-hidden-tag { flex-shrink: 0; padding: 1px 6px; margin-right: 2px; border-radius: 999px; background: var(--sunken); color: var(--muted); font-size: 11px; font-weight: 500; }

/* Where a dragged section will land */
.zo-drop {
  position: absolute;
  left: -6px;
  right: -6px;
  top: calc(var(--y, 0) * var(--zo-scale) * 1px - 2px);
  z-index: 3;
  height: 4px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--surface);
  pointer-events: none;
}
.zo-drop[hidden] { display: none; }

/* A website's header and footer stay where they are */
.zo-fixed { pointer-events: none; background: color-mix(in srgb, var(--sunken) 35%, transparent); }
.zo-fixed-tag {
  position: absolute;
  top: 50%;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: calc(100% - 16px);
  padding: 2px 8px 2px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  transform: translateY(-50%);
}
.zo-fixed-tag .pe-icon { width: 12px; height: 12px; }

/* At phone width the canvas is already small and Layers moves sections, so the button steps aside */
@media (max-width: 760px) {
  .pe-zoom-button { display: none; }
}
