/* TRK-1065: an Add panel section seen large, and the line that shows where a dragged section lands */

/* The preview: wide, in the middle, with the section at its real size */
dialog.sp {
  width: min(1200px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  padding: 0;
  overflow: hidden;
}
.sp-inner { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
/* TRK-1104: title | computer, tablet, phone and Look in the middle | ‹ n of m › × */
.sp-head { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; padding: 14px 16px 12px 20px; border-bottom: 1px solid var(--border); }
.sp-head-start { min-width: 0; }
.sp-head-mid { display: flex; align-items: center; gap: 12px; }
.sp-look { display: flex; align-items: center; gap: 8px; }
.sp-look-label { font-size: 12px; font-weight: 500; color: var(--text); }
.sp-look-select { width: 150px; height: 32px; font-size: 13px; }
.sp-look-note[hidden] { display: none; }
.sp-head h2 { margin: 0; font-size: 16px; }
.sp-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
/* TRK-1100: ‹ 3 of 24 › steps through the picker's sections; ← and → do the same */
.sp-head-end { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.sp-nav { display: flex; align-items: center; gap: 4px; }
.sp-count { min-width: 56px; text-align: center; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.sp-step:disabled { opacity: 0.35; cursor: default; }
.sp-stage { flex: 1; min-height: 160px; overflow: auto; overscroll-behavior: contain; background: color-mix(in srgb, var(--text) 4%, var(--surface)); }
.sp-frame { display: block; width: 100%; height: 320px; border: 0; background: #fff; opacity: 0; transition: opacity 160ms ease; }
/* Tablet and phone: the section at that screen's width, in the middle, framed like a device */
.sp-stage:not([data-width="desktop"]) { padding: 24px; }
.sp-stage:not([data-width="desktop"]) .sp-frame { max-width: 100%; box-sizing: border-box; margin: 0 auto; border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 8px 24px rgb(16 24 40 / 0.08); }
.sp-stage[data-width="phone"] .sp-frame { border-radius: 24px; }
dialog.sp.is-drawn .sp-frame { opacity: 1; }
.sp-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px 12px 20px; border-top: 1px solid var(--border); }
.sp-foot p { margin: 0; color: var(--muted); font-size: 13px; }
.sp-actions { display: flex; gap: 8px; flex-shrink: 0; }
@media (max-width: 900px) {
  .sp-head { grid-template-columns: minmax(0, 1fr) auto; }
  .sp-head-mid { grid-row: 2; grid-column: 1 / -1; justify-content: center; flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .sp-stage:not([data-width="desktop"]) { padding: 12px; }
  .sp-look-select { height: 36px; font-size: 16px; }
  dialog.sp { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .sp-inner { max-height: calc(100vh - 16px); }
  .sp-foot { flex-direction: column; align-items: stretch; }
  .sp-actions > * { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .sp-frame { transition: none; } }

/* Dragging: tiles show they can be picked up, and the one being dragged fades */
.pe-pick[draggable="true"] { cursor: grab; }
.pe-pick.is-dragging { opacity: 0.5; }

/* The chip under the mouse while dragging */
.sp-chip { position: fixed; top: -100px; left: -400px; padding: 6px 12px; border-radius: 999px; background: var(--accent); color: var(--accent-text); font-size: 13px; font-weight: 600; white-space: nowrap; box-shadow: 0 4px 12px rgb(16 24 40 / 0.2); }

/* A see-through cover over the canvas takes the drag, as the page itself sits in an iframe */
.sp-cover { position: absolute; inset: 0; z-index: 20; }
.sp-drop { position: absolute; height: 4px; margin-top: -2px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
.sp-drop[hidden] { display: none; }
.sp-drop::before, .sp-drop::after { content: ""; position: absolute; top: -4px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }
.sp-drop::before { left: -6px; }
.sp-drop::after { right: -6px; }
.sp-drop-label { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); max-width: calc(100% - 32px); overflow: hidden; padding: 4px 12px; border-radius: 999px; background: var(--accent); color: var(--accent-text); font-size: 12.5px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; box-shadow: 0 2px 8px rgb(16 24 40 / 0.18); }
