/* Promptly layout frames (DESIGN-SYSTEM.md §7 LOC, §8.8, §8.9, §8.11), the classes behind
 * FD.ui.frame.* (ui/frames.js). Lane L0, DECK-202. Colors, radii, type and spacing come from
 * ui/tokens.css; a DS size with no token yet is a literal marked "DS §7 / mock value". Media queries cannot
 * read custom properties, so the §9.1 breakpoints are written out: 980 / 760 / 560. The split's
 * side padding follows the column width (< 560 / < 640 / wider → 28 / 40 / 56); at ≥ 980 the
 * column is 5/12 of the viewport, so those widths fall at 1344 and 1536 px.
 */

/* ---- Location badge [LOC] ---- */
.p-loc { display: flex; flex-direction: column; align-items: flex-end; gap: var(--p-s-6); min-width: 0; font-family: var(--p-font); }
.p-loc__pill {
  display: flex; align-items: center; gap: var(--p-s-8); height: 34px /* DS §7 / mock value: h-loc */; padding: 0 var(--p-s-14);
  border-radius: var(--p-r-pill); border: 1px solid var(--p-line); background: var(--p-card);
  font-size: var(--p-fs-caption); color: var(--p-ink); max-width: 100%; min-width: 0;
}
.p-loc__mark { width: 7px; height: 7px /* DS §7 / mock value: loc-mark */; flex: 0 0 auto; border-radius: var(--p-r-round); background: var(--p-muted); }
.p-loc__mark--web { border-radius: 2px /* DS §7 / mock value: r-mark-square */; }
.p-loc__mark--server { background: var(--p-good); }
.p-loc__place { font-weight: 600; white-space: nowrap; }
.p-loc__host {
  font-family: var(--p-mono); font-size: 11.5px /* DS §7 / mock value: fs-meta */; color: var(--p-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.p-loc__acct { font-size: 12.5px /* DS §7 / mock value: fs-loc-acct */; color: var(--p-muted); white-space: nowrap; padding-right: var(--p-s-6); }

/* ---- Split layout [SPLIT] ---- */
.p-split {
  --px: var(--p-s-28);
  position: relative; width: 100%; height: 100%; display: grid; grid-template-columns: minmax(0, 1fr);
  background: var(--p-screen); color: var(--p-ink); font-family: var(--p-font); overflow: hidden;
}
.p-split__col { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.p-split__head {
  display: flex; align-items: flex-start; gap: var(--p-s-12); flex: 0 0 auto;
  padding: var(--p-s-40) var(--px) 0;
}
.p-split__head > .p-loc { margin-left: auto; }
.p-split__scroll {
  flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column;
  padding: var(--p-s-28) var(--px) var(--p-s-40);
}
.p-split__body {
  width: 100%; max-width: var(--p-max-setup); display: flex; flex-direction: column; gap: var(--p-s-24);
  margin: 0 auto;
}
.p-split--wide .p-split__body { max-width: var(--p-max-setup-wide); }
.p-split--center .p-split__body { margin-top: auto; margin-bottom: auto; }
.p-split__foot {
  flex: 0 0 auto; padding: var(--p-s-16) var(--px) var(--p-s-28); border-top: 1px solid var(--p-line);
  display: flex; align-items: center; gap: var(--p-s-10);
}
.p-split > .p-vis { display: none; }
.p-split--compact { --px: var(--p-s-28); }
.p-split--compact .p-split__head { padding-top: var(--p-s-22); }
.p-split--compact .p-split__scroll { padding: var(--p-s-22) var(--px) var(--p-s-28); }
.p-split--compact .p-split__foot { padding-bottom: var(--p-s-20); }
@media (min-width: 980px) {
  .p-split:not(.p-split--novis) { grid-template-columns: minmax(440px, 5fr) minmax(0, 7fr); }
  .p-split:not(.p-split--novis) .p-split__body { margin-left: 0; margin-right: 0; }
  .p-split > .p-vis { display: block; }
}
@media (min-width: 1344px) { .p-split:not(.p-split--compact) { --px: var(--p-s-40); } }
@media (min-width: 1536px) { .p-split:not(.p-split--compact) { --px: var(--p-s-56); } }
@media (max-width: 559.98px) {
  .p-split:not(.p-split--compact) { --px: var(--p-s-20); }
  .p-split__head { align-items: center; padding-top: var(--p-s-14); }
  .p-split__scroll { padding-top: var(--p-s-16); padding-bottom: var(--p-s-28); }
  .p-split__body { gap: var(--p-s-20); margin-left: 0; margin-right: 0; }
  .p-split__foot { padding-top: var(--p-s-12); padding-bottom: var(--p-s-16); }
  .p-split__head .p-loc__host, .p-split__head .p-loc__acct { display: none; }
  .p-split__head .p-loc__pill { height: 30px /* DS §7 / mock value: h-loc-compact */; padding: 0 var(--p-s-12); font-size: 12.5px /* DS §7 / mock value: fs-loc-acct */; }
}

/* ---- Visual panel [VIS] ---- */
.p-vis {
  position: relative; margin: var(--p-s-24); border-radius: var(--p-r-deck); overflow: hidden; min-width: 0;
  background: var(--p-pastel-1);
}
.p-vis__media, .p-mvis__media { position: absolute; inset: 0; display: block; pointer-events: none; }
.p-vis__video, .p-mvis__video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
}
.p-vis__top {
  position: absolute; top: var(--p-s-28); left: var(--p-s-28); right: var(--p-s-28);
  display: flex; justify-content: space-between; align-items: center;
}
.p-vis__tag {
  height: 32px /* DS §7 / mock value: h-media-chip */; padding: 0 var(--p-s-14); border-radius: var(--p-r-pill); background: var(--p-on-media);
  display: flex; align-items: center; gap: 7px /* DS §7 / mock value: */; font-family: var(--p-mono); font-size: 12.5px /* DS §7 / mock value: fs-media-chip */;
  color: var(--p-on-media-ink);
}
.p-vis__tagdot { width: 7px; height: 7px /* DS §7 / mock value: source-dot */; border-radius: 2px /* DS §7 / mock value: r-mark-square */; flex: 0 0 auto; }
.p-vis__nav { display: flex; gap: var(--p-s-8); }
.p-vis__btn {
  width: var(--p-round-inline); height: var(--p-round-inline); border-radius: var(--p-r-round); border: none; padding: 0;
  background: var(--p-on-media); color: var(--p-on-media-ink); font-size: 20px /* DS §7 / mock value: fs-vis-arrow */; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center; font-family: var(--p-font);
}
.p-vis__btn--play { font-size: var(--p-fs-caption); letter-spacing: -.1em; }
.p-vis__cap {
  position: absolute; left: var(--p-s-28); right: var(--p-s-28); bottom: var(--p-s-28); max-width: 520px /* DS §7 / mock value: max-vis-caption */;
  background: var(--p-on-media); border-radius: var(--p-r-agent-sheet); padding: var(--p-s-22) var(--p-s-24); color: var(--p-on-media-ink);
  animation: p-pop-in var(--p-dur-pop-caption) var(--p-ease);
}
.p-vis__title {
  font: var(--p-fw-title-caption) var(--p-fs-title-caption)/var(--p-lh-title-caption) var(--p-font);
  letter-spacing: var(--p-ls-title-caption); text-wrap: balance;
}
.p-vis__text { margin: var(--p-s-8) 0 0; font-size: var(--p-fs-body); line-height: var(--p-lh-body); color: var(--p-caption-body); text-wrap: pretty; }
.p-vis__dots { display: flex; gap: var(--p-s-4); margin-top: var(--p-s-14); }
.p-vis__dot {
  height: var(--p-s-24); width: 16px /* DS §7 / mock value: w-dot-off */; padding: 0; border: none; background: transparent; cursor: pointer;
  display: flex; align-items: center; transition: width .3s /* DS §7 / mock value: dur-dot */ var(--p-ease);
}
.p-vis__dot--on { width: 32px /* DS §7 / mock value: w-dot-on */; }
.p-vis__dotbar { display: block; width: 100%; height: var(--p-s-8); border-radius: var(--p-r-pill); background: var(--p-dot-off); }
.p-vis__dot--on .p-vis__dotbar { background: var(--p-dot-on); }

/* ---- Mobile visual strip [MVIS] ---- */
.p-mvis {
  position: relative; display: block; width: 100%; height: 112px /* DS §7 / mock value: h-mvis */; border-radius: var(--p-r-agent-sheet);
  overflow: hidden; flex: 0 0 auto; border: none; padding: 0; margin: 0; text-align: left; font-family: var(--p-font);
  background: var(--p-pastel-1); color: var(--p-on-media-ink);
}
/* The whole strip is one transparent "next slide" button under the chips; the chips let clicks
   through to it, bar the Pause/Play button. Its focus ring is drawn on the strip, which clips. */
.p-mvis__tap {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: none;
  border-radius: inherit; background: transparent; cursor: pointer;
}
.p-mvis__tap.p-i:focus-visible { outline: none; }
.p-mvis:has(> .p-mvis__tap:focus-visible) {
  outline: var(--p-focus-width) solid var(--p-focus-color); outline-offset: var(--p-focus-offset);
}
.p-mvis__top, .p-mvis__capslot { pointer-events: none; }
.p-mvis__ctl { display: flex; align-items: center; gap: var(--p-s-8); }
.p-mvis__play {
  pointer-events: auto; flex: 0 0 auto; width: var(--p-s-28); height: var(--p-s-28); padding: 0; border: none;
  border-radius: var(--p-r-round); background: var(--p-on-media); color: var(--p-on-media-ink); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-family: var(--p-font);
  font-size: var(--p-fs-caption); letter-spacing: -.1em;
}
.p-mvis--tall { height: 196px /* DS §7 / mock value: h-mvis-tall */; }
.p-mvis__top {
  position: absolute; top: var(--p-s-12); left: var(--p-s-12); right: var(--p-s-12);
  display: flex; align-items: center; justify-content: space-between; gap: var(--p-s-8);
}
.p-mvis__tag {
  height: var(--p-s-28); padding: 0 var(--p-s-12); border-radius: var(--p-r-pill); background: var(--p-on-media);
  display: flex; align-items: center; gap: var(--p-s-6); font-family: var(--p-mono); font-size: 11.5px /* DS §7 / mock value: fs-meta */;
  color: var(--p-on-media-ink);
}
.p-mvis__dots {
  display: flex; gap: var(--p-s-4); padding: 0 var(--p-s-10); height: var(--p-s-28); align-items: center;
  border-radius: var(--p-r-pill); background: var(--p-on-media);
}
.p-mvis__dot { width: var(--p-s-6); height: var(--p-s-6); border-radius: var(--p-r-pill); background: var(--p-dot-off); transition: width .3s /* DS §7 / mock value: dur-dot */; }
.p-mvis__dot--on { width: var(--p-s-16); background: var(--p-dot-on); }
.p-mvis__cap {
  position: absolute; left: var(--p-s-12); right: var(--p-s-12); bottom: var(--p-s-12); display: block;
  background: var(--p-on-media); border-radius: var(--p-r-notice); padding: var(--p-s-12) var(--p-s-16); color: var(--p-on-media-ink);
  font: 700 var(--p-fs-title-s)/22px var(--p-font) /* DS §7 / mock value: lh-mvis-caption */; text-wrap: balance;
  animation: p-pop-in var(--p-dur-pop-caption) var(--p-ease);
}

/* ---- Step header [STEPHEAD] and sub-step pills ---- */
.p-stephead { display: flex; flex-direction: column; gap: var(--p-s-12); position: relative; z-index: 20 /* DS §7 / mock value: z-stephead */; font-family: var(--p-font); }
.p-stephead__row { display: flex; align-items: center; gap: var(--p-s-10); }
.p-stephead__kicker, .p-solohead__kicker {
  font-family: var(--p-mono); font-size: var(--p-fs-kicker); letter-spacing: var(--p-ls-kicker); color: var(--p-muted);
  text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.p-stephead__all {
  margin-left: auto; flex: 0 0 auto; border: 1px solid var(--p-line); background: var(--p-card); border-radius: var(--p-r-pill);
  height: var(--p-s-32); padding: 0 13px /* DS §7 / mock value: */; font-family: var(--p-font); font-size: var(--p-fs-caption); color: var(--p-ink); cursor: pointer;
}
.p-stephead__segs { display: flex; gap: var(--p-s-4); }
.p-stephead__seg { flex: 1; height: var(--p-s-4); border-radius: var(--p-r-pill); background: var(--p-line); }
.p-stephead__seg--on { background: var(--p-ink); }
.p-stephead__pop { position: absolute; top: 100%; left: 0; right: 0; margin-top: var(--p-s-8); }
.p-subs { display: flex; gap: var(--p-s-6); flex-wrap: wrap; }
.p-subs__pill {
  height: var(--p-h-step); padding: 0 var(--p-s-12); border-radius: var(--p-r-pill); display: inline-flex; align-items: center; gap: 5px /* DS §7 / mock value: */;
  font-family: var(--p-font); font-size: var(--p-fs-caption); font-weight: 500; background: transparent; color: var(--p-muted);
  border: 1px solid var(--p-line); cursor: pointer;
}
.p-subs__pill--done, .p-solohead .p-subs__pill { color: var(--p-ink); }
.p-subs__pill--on, .p-solohead .p-subs__pill--on { background: var(--p-ink); color: var(--p-screen); border-color: var(--p-ink); font-weight: 600; }

/* ---- All-steps map [MAP] ---- */
.p-map { gap: var(--p-s-2); padding: var(--p-s-8); }
.p-map--pop { box-shadow: var(--p-shadow-menu); }
.p-map__list { display: flex; flex-direction: column; gap: var(--p-s-2); }
.p-map__row {
  display: flex; align-items: center; gap: var(--p-s-12); width: 100%; padding: 9px var(--p-s-10) /* DS §7 / mock value: */; border: none;
  border-radius: var(--p-r-window); background: transparent; cursor: pointer; text-align: left; font-family: var(--p-font); color: var(--p-ink);
}
.p-map__row--cur { background: var(--p-soft); }
.p-map__num {
  width: 22px; height: 22px /* DS §7 / mock value: glyph */; border-radius: var(--p-r-round); border: 1.5px solid var(--p-line); color: var(--p-muted);
  display: inline-flex; align-items: center; justify-content: center; font-family: var(--p-mono); font-size: var(--p-fs-kicker); flex: 0 0 auto;
}
.p-map__row--cur .p-map__num { background: var(--p-ink); color: var(--p-screen); border: none; }
.p-map__name { font-size: var(--p-fs-body); font-weight: 500; flex: 1; min-width: 0; }
.p-map__row--cur .p-map__name { font-weight: 600; }
.p-map__where { font-size: 12.5px /* DS §7 / mock value: fs-loc-acct */; color: var(--p-muted); white-space: nowrap; }
.p-map__tag { width: 80px /* DS §7 / mock value: w-map-tag */; display: flex; justify-content: flex-end; flex: 0 0 auto; }
.p-map__foot { display: flex; align-items: center; gap: var(--p-s-10); border-top: 1px solid var(--p-line); padding-top: var(--p-s-12); margin-top: var(--p-s-2); }
.p-map__foot > .p-btn { margin-left: auto; }
@media (max-width: 759.98px) { .p-map__where { display: none; } }

/* ---- Footer [FOOT] ---- */
.p-foot { display: flex; align-items: center; gap: var(--p-s-10); width: 100%; flex-wrap: nowrap; }
.p-foot__spacer { flex: 1; }
.p-foot__note { font-size: var(--p-fs-caption); line-height: var(--p-lh-caption); color: var(--p-muted); text-align: right; max-width: 240px /* DS §7 / mock value: max-foot-note */; }
.p-foot__next.p-btn { min-width: 0; padding: 0 26px /* DS §7 / mock value: */; flex: 0 1 auto; }
@media (max-width: 559.98px) {
  .p-foot { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "note note note" "next next next" "back . skip"; gap: var(--p-s-4); }
  .p-foot__spacer { display: none; }
  .p-foot__note { grid-area: note; text-align: center; max-width: none; }
  .p-foot__next.p-btn { grid-area: next; width: 100%; height: 52px /* DS §7 / mock value: h-cta-mobile */; }
  .p-foot__back.p-btn { grid-area: back; height: 40px /* DS §7 / mock value: h-foot-ghost */; justify-self: start; }
  .p-foot__skip.p-btn { grid-area: skip; height: 40px /* DS §7 / mock value: h-foot-ghost */; justify-self: end; }
}

/* ---- Solo mode [SOLOHEAD] ---- */
.p-solohead { display: flex; flex-direction: column; gap: var(--p-s-12); font-family: var(--p-font); }
.p-solohead__row { display: flex; align-items: center; gap: var(--p-s-10); }
.p-solohead__back {
  display: inline-flex; align-items: center; gap: var(--p-s-6); height: var(--p-s-32); padding: 0 13px 0 var(--p-s-10) /* DS §7 / mock value: */;
  border-radius: var(--p-r-pill); border: 1px solid var(--p-line); background: var(--p-card); color: var(--p-ink);
  font-family: var(--p-font); font-size: var(--p-fs-caption); cursor: pointer; flex: 0 0 auto; position: relative;
}
.p-solohead__back::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: var(--p-hit); transform: translateY(-50%); }

/* ---- Operator admin [ADMIN] ---- */
.p-admin {
  position: relative; width: 100%; height: 100%; display: flex; flex-direction: column;
  background: var(--p-screen); color: var(--p-ink); font-family: var(--p-font);
}
.p-admin__bar {
  display: flex; align-items: center; gap: var(--p-s-14); padding: var(--p-s-22) var(--p-gutter-desk);
  border-bottom: 1px solid var(--p-line); flex: 0 0 auto; flex-wrap: wrap;
}
.p-admin__spacer { flex: 1; }
.p-admin__loc { display: flex; }
.p-admin__who { font-size: var(--p-fs-caption); color: var(--p-muted); }
.p-admin__wordmark { font-size: 22px /* DS §7 / mock value: fs-wordmark */; font-weight: 700; letter-spacing: -0.02em; color: var(--p-ink); }
.p-admin__scroll { flex: 1; min-height: 0; overflow-y: auto; display: block; }
.p-admin__main {
  max-width: var(--p-max-admin); margin: 0 auto; padding: 36px var(--p-gutter-desk) 60px /* DS §7 / mock value: s-36 s-60 */;
  display: flex; flex-direction: column; gap: var(--p-s-22);
}
@media (max-width: 759.98px) {
  .p-admin__bar { gap: var(--p-s-10); padding: var(--p-s-14) var(--p-s-20); }
  .p-admin__loc, .p-admin__who { display: none; }
  .p-admin__main { padding: var(--p-s-22) var(--p-s-20) 48px /* DS §7 / mock value: s-48 */; }
}

/* D-05: videos stay on their first frame (frames.js never plays them); captions fade instead of popping in. */
@media (prefers-reduced-motion: reduce) {
  .p-vis__cap, .p-mvis__cap { animation-name: p-fade-in; }
  .p-vis__dot, .p-mvis__dot { transition: none; }
}
