/* Website layout (SPLIT · LOC · STEPHEAD · MAP · FOOT · VIS · MVIS, DS §8.8–§8.9) and the few blocks L0 has no
   class for yet. The look of buttons, fields, notices, cards, pills, tags and text comes from L0's .p- classes
   (v2/ui/primitives.css). Every value here is a v2/ui/tokens.css custom property: no literal color, font size,
   radius or shadow. Literal px appear only in media queries (media queries can't read custom properties) —
   each one names its DS §9.1 / §8.9 breakpoint. 1 px hairlines follow primitives.css. */

html, body { margin: 0; background: var(--p-screen); }
body { color: var(--p-ink); font-family: var(--p-font); -webkit-font-smoothing: antialiased; }

/* --- SPLIT (DS §8.9): one column below 980, visual panel beside it from 980. One viewport tall at every width:
   the column scrolls, the footer stays pinned (as in the mock's phone frame). --- */
.s-split {
  --s-gutter: var(--p-s-28);
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); height: 100dvh; overflow: hidden;
  background: var(--p-screen); color: var(--p-ink); font-family: var(--p-font);
}
.s-split__main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.s-split__head { display: flex; align-items: flex-start; gap: var(--p-s-12); flex: 0 0 auto; padding: var(--p-s-40) var(--s-gutter) 0; }
.s-split__scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; padding: var(--p-s-28) var(--s-gutter) var(--p-s-40); }
.s-split__col { width: 100%; max-width: var(--p-max-setup); display: flex; flex-direction: column; gap: var(--p-s-24); }
.s-split__col--wide { max-width: var(--p-max-setup-wide); }
.s-split__col--center { margin-top: auto; margin-bottom: auto; }
.s-split__foot { flex: 0 0 auto; padding: var(--p-s-16) var(--s-gutter) var(--p-s-28); border-top: 1px solid var(--p-line); }

/* DS §9.1 "Setup: split with visual ≥ 980" (--p-bp-split). The mock's 440 px column floor has no token; 5fr alone. */
@media (min-width: 980px) {
  .s-split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}
/* DS §4.2 setup gutter 28 / 40 / 56 by column width (< 560 / < 640 / wider); column = 5/12 of the viewport,
   so 560 / 640 px of column = 1344 / 1536 px of viewport. */
@media (min-width: 1344px) { .s-split { --s-gutter: var(--p-s-40); } }
@media (min-width: 1536px) { .s-split { --s-gutter: var(--p-s-56); } }
/* DS §9.1 "Setup: single column 760–979": the column centres. */
@media (min-width: 760px) and (max-width: 979.98px) { .s-split__col { margin-left: auto; margin-right: auto; } }
/* DS §9.1 "Setup: mobile < 760". */
@media (max-width: 759.98px) { .s-split__col { gap: var(--p-s-20); } }
/* DS §9.1 "< 560" (--p-bp-sheet): the mock's phone paddings. */
@media (max-width: 559.98px) {
  .s-split { --s-gutter: var(--p-s-20); }
  .s-split__head { align-items: center; padding-top: var(--p-s-14); }
  .s-split__scroll { padding-top: var(--p-s-16); padding-bottom: var(--p-s-28); }
  .s-split__foot { padding-top: var(--p-s-12); padding-bottom: var(--p-s-16); }
}

/* --- VIS (≥ 980) and MVIS (< 760) — ambient video lands with L0 M3; the pastel shows until then --- */
.s-vis, .s-mvis { display: none; }
.s-vis[data-pastel="0"], .s-mvis[data-pastel="0"] { background: var(--p-pastel-1); }
.s-vis[data-pastel="1"], .s-mvis[data-pastel="1"] { background: var(--p-pastel-2); }
.s-vis[data-pastel="2"], .s-mvis[data-pastel="2"] { background: var(--p-pastel-3); }
/* DS §9.1 split ≥ 980. */
@media (min-width: 980px) {
  .s-vis { display: block; position: relative; margin: var(--p-s-24); border-radius: var(--p-r-deck); overflow: hidden; min-width: 0; }
}
/* DS §9.1 mobile < 760. Strip 112 h (tall 196), DS §8.9 — no token yet, so spelled from the spacing scale. */
@media (max-width: 759.98px) {
  .s-mvis {
    display: block; position: relative; width: 100%; height: calc(var(--p-s-56) * 2); flex: 0 0 auto; overflow: hidden;
    border: none; border-radius: var(--p-r-agent-sheet); padding: 0; margin: 0; font: inherit; color: var(--p-on-media-ink); text-align: left;
  }
  button.s-mvis { cursor: pointer; }
  .s-mvis--tall { height: calc(var(--p-s-28) * 7); }
}
.s-vis__media, .s-mvis__media { position: absolute; inset: 0; }

/* On-media chip: tag + square dot in the set's VSET color. */
.s-vis__tag {
  display: inline-flex; align-items: center; gap: var(--p-s-6); padding: var(--p-s-6) var(--p-s-14); border-radius: var(--p-r-pill);
  background: var(--p-on-media); color: var(--p-on-media-ink); font-family: var(--p-mono); font-size: var(--p-fs-code); line-height: var(--p-lh-caption); white-space: nowrap;
}
.s-vis__tagdot { width: var(--p-s-6); height: var(--p-s-6); flex: 0 0 auto; border-radius: var(--p-s-2); background: var(--c, var(--p-muted)); } /* radius 2: proposed --p-r-dot-square */
.s-vis__tag[data-tone="invite"] { --c: var(--p-vset-invite); }
.s-vis__tag[data-tone="operator"] { --c: var(--p-vset-operator); }
.s-vis__tag[data-tone="signin"] { --c: var(--p-vset-signin); }
.s-vis__tag[data-tone="install"] { --c: var(--p-vset-install); }
.s-vis__tag[data-tone="server"] { --c: var(--p-vset-server); }
.s-vis__tag[data-tone="devices"] { --c: var(--p-vset-devices); }
.s-vis__tag[data-tone="fleet"] { --c: var(--p-vset-fleet); }
.s-vis__tag[data-tone="final"] { --c: var(--p-vset-final); }
.s-vis__tag[data-tone="mac"] { --c: var(--p-vset-mac); }

.s-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; }
.s-vis__rb {
  width: var(--p-round-inline); height: var(--p-round-inline); border-radius: var(--p-r-round); border: none; padding: 0;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: var(--p-on-media); color: var(--p-on-media-ink); font-family: var(--p-font); font-size: var(--p-fs-title-m); line-height: 1;
}
.s-vis__cap {
  position: absolute; left: var(--p-s-28); right: var(--p-s-28); bottom: var(--p-s-28); max-width: var(--p-max-setup-wide);
  background: var(--p-on-media); color: var(--p-on-media-ink); border-radius: var(--p-r-agent-sheet); padding: var(--p-s-22) var(--p-s-24);
  animation: p-pop-in var(--p-dur-pop-caption) var(--p-ease);
}
.s-vis__body { 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; }
.s-vis__dots { display: flex; gap: var(--p-s-4); margin-top: var(--p-s-14); }
/* Dot = 24 h hit strip holding an 8 h bar: active 32 wide, inactive 16 (DS §8.9). */
.s-vis__dot { width: var(--p-s-16); height: var(--p-s-24); padding: 0; border: none; background: transparent; cursor: pointer; display: flex; align-items: center; position: relative; }
.s-vis__dot::before { content: ''; display: block; width: 100%; height: var(--p-s-8); border-radius: var(--p-r-pill); background: var(--p-dot-off); }
.s-vis__dot--on { width: var(--p-s-32); }
.s-vis__dot--on::before { background: var(--p-dot-on); }

.s-mvis__top { position: absolute; top: var(--p-s-12); left: var(--p-s-12); right: var(--p-s-12); display: flex; justify-content: space-between; align-items: center; gap: var(--p-s-8); }
.s-mvis .s-vis__tag { padding: var(--p-s-4) var(--p-s-12); font-size: var(--p-fs-kicker); }
.s-mvis__dots { display: inline-flex; align-items: center; gap: var(--p-s-4); padding: var(--p-s-10); border-radius: var(--p-r-pill); background: var(--p-on-media); }
.s-mvis__dot { width: var(--p-s-6); height: var(--p-s-6); border-radius: var(--p-r-pill); background: var(--p-dot-off); }
.s-mvis__dot--on { width: var(--p-s-16); background: var(--p-dot-on); }
.s-mvis__cap {
  position: absolute; left: var(--p-s-12); right: var(--p-s-12); bottom: var(--p-s-12);
  background: var(--p-on-media); color: var(--p-on-media-ink); border-radius: var(--p-r-notice); padding: var(--p-s-12) var(--p-s-16);
}

/* --- frame parts --- */
.s-brand { display: flex; align-items: center; gap: var(--p-s-12); flex: 0 0 auto; }
.s-brand__mark { width: var(--p-round-inline); height: var(--p-round-inline); border-radius: var(--p-r-round); background: var(--p-ink); flex: 0 0 auto; }
.s-brand__name { font-size: var(--p-fs-title-m); font-weight: var(--p-fw-title-m); letter-spacing: -0.02em; color: var(--p-ink); }

.s-loc { display: flex; flex-direction: column; align-items: flex-end; gap: var(--p-s-6); min-width: 0; }
.s-loc__badge {
  display: flex; align-items: center; gap: var(--p-s-8); max-width: 100%; min-width: 0;
  padding: var(--p-s-8) var(--p-s-14); border: 1px solid var(--p-line); border-radius: var(--p-r-pill); background: var(--p-card);
  font-size: var(--p-fs-caption); line-height: var(--p-lh-caption); color: var(--p-ink);
}
.s-loc__dot { width: var(--p-s-6); height: var(--p-s-6); flex: 0 0 auto; background: var(--c, var(--p-muted)); }
.s-loc__dot--round { border-radius: var(--p-r-round); }
.s-loc__dot--square { border-radius: var(--p-s-2); } /* radius 2: proposed --p-r-dot-square */
.s-loc__name { font-weight: 600; white-space: nowrap; }
.s-loc__host { font-family: var(--p-mono); color: var(--p-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* DS §9.1 "< 560": compact badge, no host. */
@media (max-width: 559.98px) {
  .s-loc__host { display: none; }
  .s-loc__badge { padding: var(--p-s-6) var(--p-s-12); }
  .s-brand__mark { width: var(--p-h-btn-sm); height: var(--p-h-btn-sm); }
  .s-brand { gap: var(--p-s-10); }
  .s-brand__name { font-size: var(--p-fs-title-s); }
}

/* STEPHEAD (DS §8.8): kicker + tag + All steps · 13 segments 4 h · sub-step pills 30 h */
.s-stephead { display: flex; flex-direction: column; gap: var(--p-s-12); position: relative; z-index: 1; }
.s-stephead__top { display: flex; align-items: center; gap: var(--p-s-10); min-width: 0; }
.s-stephead__kick { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.s-stephead__segs { display: flex; gap: var(--p-s-4); }
.s-seg { flex: 1; height: var(--p-s-4); border-radius: var(--p-r-pill); background: var(--p-line); }
.s-seg--on { background: var(--p-ink); }
.s-stephead__subs { display: flex; flex-wrap: wrap; gap: var(--p-s-6); list-style: none; margin: 0; padding: 0; }
.s-subpill {
  display: inline-flex; align-items: center; gap: var(--p-s-4); height: var(--p-h-step); padding: 0 var(--p-s-12); box-sizing: border-box;
  border: 1px solid var(--p-line); border-radius: var(--p-r-pill); font-size: var(--p-fs-caption); font-weight: 500; color: var(--p-muted);
}
.s-subpill--done { color: var(--p-ink); }
.s-subpill--cur { background: var(--p-ink); border-color: var(--p-ink); color: var(--p-on-ink); font-weight: 600; }

/* MAP popover (DS §8.8) */
.s-map { position: absolute; top: 100%; left: 0; right: 0; margin-top: var(--p-s-8); padding: var(--p-s-8); gap: var(--p-s-2); box-shadow: var(--p-shadow-menu); }
.s-map[hidden] { display: none; }
.s-map__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--p-s-2); }
.s-map__row { display: flex; align-items: center; gap: var(--p-s-12); padding: var(--p-s-8) var(--p-s-10); border-radius: var(--p-r-window); font-size: var(--p-fs-body); font-weight: 500; }
.s-map__row--cur { background: var(--p-soft); font-weight: 600; }
.s-map__num {
  width: var(--p-box); height: var(--p-box); flex: 0 0 auto; box-sizing: border-box; border-radius: var(--p-r-round); border: 1px solid var(--p-line);
  display: inline-flex; align-items: center; justify-content: center; font-family: var(--p-mono); font-size: var(--p-fs-kicker); color: var(--p-muted);
}
.s-map__num--cur { background: var(--p-ink); border-color: var(--p-ink); color: var(--p-on-ink); }
.s-map__name { flex: 1; min-width: 0; }
.s-map__where { font-size: var(--p-fs-caption); color: var(--p-muted); white-space: nowrap; }
.s-map__tag { display: flex; justify-content: flex-end; flex: 0 0 auto; min-width: var(--p-s-56); }
.s-map__foot { display: flex; align-items: center; gap: var(--p-s-10); padding-top: var(--p-s-12); margin-top: var(--p-s-2); border-top: 1px solid var(--p-line); }
/* DS §9.1 mobile < 760. */
@media (max-width: 759.98px) { .s-map__where { display: none; } }

/* FOOT (DS §8.8): ← Back · spacer · note · Skip · Next (CTA at 17 px) */
.s-foot { display: flex; align-items: center; gap: var(--p-s-10); flex-wrap: nowrap; width: 100%; }
.s-foot__note { font-size: var(--p-fs-caption); line-height: var(--p-lh-caption); color: var(--p-muted); text-align: right; max-width: calc(var(--p-s-40) * 6); }
.s-foot__next .p-btn { min-width: 0; padding: 0 var(--p-s-26); }
/* DS §9.1 "< 560": note, then a full-width Next, then Back · Skip. */
@media (max-width: 559.98px) {
  .s-foot { flex-wrap: wrap; gap: var(--p-s-4); }
  .s-foot__note { order: 1; flex-basis: 100%; max-width: none; text-align: center; }
  .s-foot__next { order: 2; flex-basis: 100%; }
  .s-foot__next .p-btn { width: 100%; }
  .s-foot__back { order: 3; }
  .s-foot > .s-spacer { order: 4; }
  .s-foot__skip { order: 5; }
}

/* --- blocks --- */
.s-h { display: flex; flex-direction: column; gap: var(--p-s-12); }
.s-h__title { margin: 0; color: var(--p-ink); font: var(--p-fw-display-m) var(--p-fs-display-m)/var(--p-lh-display-m) var(--p-font); letter-spacing: var(--p-ls-display-m); text-wrap: balance; }
.s-h--big .s-h__title { font: var(--p-fw-display-l) var(--p-fs-display-l)/var(--p-lh-display-l) var(--p-font); letter-spacing: var(--p-ls-display-l); }
/* DS §9.1 "< 560": the mock's H steps down (34/38 big, 28/32 other → nearest display tokens). */
@media (max-width: 559.98px) {
  .s-h { gap: var(--p-s-10); }
  .s-h__title { font: var(--p-fw-display-s-setup) var(--p-fs-display-s-setup)/var(--p-lh-display-s-setup) var(--p-font); letter-spacing: var(--p-ls-display-s-setup); }
  .s-h--big .s-h__title { font: var(--p-fw-display-m) var(--p-fs-display-m)/var(--p-lh-display-m) var(--p-font); letter-spacing: var(--p-ls-display-m); }
  .s-h__lede { font-size: var(--p-fs-body); line-height: var(--p-lh-body); }
}
.s-muted { margin: 0; font-size: var(--p-fs-body-s); line-height: var(--p-lh-body-s); color: var(--p-muted); text-wrap: pretty; }
.s-muted--center { text-align: center; }
.p-t-body-s .p-t-mono { font-size: var(--p-fs-code); }
.s-col { display: flex; flex-direction: column; gap: var(--p-s-12); }
.s-col--tight { gap: var(--p-s-10); }
.s-row { display: flex; align-items: center; gap: var(--p-s-10); flex-wrap: wrap; }
.s-row--nowrap { flex-wrap: nowrap; }
.s-row--tight { gap: var(--p-s-8); }
.s-spacer { flex: 1; }
.s-live { display: flex; flex-direction: column; gap: var(--p-s-12); }
.s-split__col > .s-live:empty { position: absolute; } /* an empty live region takes no gap, but stays rendered */
.s-sep { width: 100%; height: 0; margin: 0; border: none; border-top: 1px solid var(--p-line); }
/* Spinner for markup that asks for one by class (L0's .p-spin look, same keyframes). */
.s-spin {
  display: inline-block; flex: 0 0 auto; width: var(--p-s-16); height: var(--p-s-16); box-sizing: border-box; border-radius: var(--p-r-round);
  border: 2px solid var(--p-ink); border-right-color: transparent; animation: p-spin var(--p-dur-spin) linear infinite;
}

/* Tone for fallback pills/tags/dots (FD.ui sets --c inline itself). */
.s-tone--good { --c: var(--p-good); } .s-tone--warn { --c: var(--p-warn); } .s-tone--bad { --c: var(--p-bad); }
.s-tone--info { --c: var(--p-info); } .s-tone--muted { --c: var(--p-muted); } .s-tone--ink { --c: var(--p-ink); }
.p-notice.s-notice--good { --c: var(--p-good); } .p-notice.s-notice--warn { --c: var(--p-warn); }
.p-notice.s-notice--bad { --c: var(--p-bad); } .p-notice.s-notice--info { --c: var(--p-info); }

/* KV (DS §7) until FD.ui.kv ships */
.s-kv { margin: 0; }
.s-kv__row { display: flex; align-items: center; gap: var(--p-s-14); flex-wrap: wrap; min-height: var(--p-s-24); }
.s-kv__row + .s-kv__row { padding-top: var(--p-s-12); border-top: 1px solid var(--p-line); }
.s-kv__k { flex: 1 1 auto; margin: 0; font-size: var(--p-fs-body-s); color: var(--p-muted); }
.s-kv__v {
  margin: 0; font-size: var(--p-fs-body-s); color: var(--p-ink); text-align: right; overflow-wrap: anywhere; min-width: 0;
  display: inline-flex; align-items: center; justify-content: flex-end; gap: var(--p-s-8); flex-wrap: wrap;
}
.s-kv__v--mono { font-family: var(--p-mono); }

/* --- A3 installer bundle --- */
.s-bundle__row { display: flex; align-items: center; gap: var(--p-s-12); flex-wrap: wrap; }
.s-bundle__name { display: flex; flex-direction: column; gap: var(--p-s-4); flex: 1 1 auto; min-width: 0; }
.s-bundle__title { font-size: var(--p-fs-body); font-weight: 600; }
.s-bundle__name .p-t-mono { font-size: var(--p-fs-code-sm); color: var(--p-muted); }
.s-form { display: contents; }
