/* Builder 2.0's full-screen page editor (TRK-841): top bar, left rail and its panel, the page, and the right panel */
.pe {
  --pe-top: 52px;
  --pe-rail: 64px;
  --pe-panel: 288px;
  --pe-inspector: 320px;
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  grid-template-rows: var(--pe-top) auto minmax(0, 1fr);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}
body:has(.pe) { overflow: hidden; }

.pe-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.pe-icon-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}
.pe-icon-button:disabled { opacity: 0.35; cursor: default; }
.pe-icon-button[aria-pressed="true"], .pe-icon-button[aria-expanded="true"] { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.pe-icon-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (hover: hover) and (pointer: fine) {
  .pe-icon-button:not(:disabled):hover { background: var(--sunken); color: var(--text); }
}

/* Tooltips: the button's name, after a short wait */
.pe [data-tip] { position: relative; }
.pe [data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  z-index: 60;
  padding: 4px 8px;
  border-radius: 6px;
  background: #101828;
  color: #fff;
  font: 500 12px/1.3 Inter, system-ui, sans-serif;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -2px);
  transition: opacity 120ms ease, transform 120ms ease;
}
.pe [data-tip]:hover::after, .pe [data-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); transition-delay: 350ms; }
.pe-rail [data-tip]::after { top: 50%; left: calc(100% + 8px); transform: translate(-2px, -50%); }
.pe-rail [data-tip]:hover::after, .pe-rail [data-tip]:focus-visible::after { transform: translate(0, -50%); }
.pe-top-end [data-tip]::after, .pe-panel-head [data-tip]::after, .pe-inspector-head [data-tip]::after, .pe-layer-tools [data-tip]::after { left: auto; right: 0; transform: translate(0, -2px); }
.pe-top-end [data-tip]:hover::after, .pe-top-end [data-tip]:focus-visible::after, .pe-panel-head [data-tip]:hover::after, .pe-panel-head [data-tip]:focus-visible::after, .pe-inspector-head [data-tip]:hover::after, .pe-inspector-head [data-tip]:focus-visible::after, .pe-layer-tools [data-tip]:hover::after, .pe-layer-tools [data-tip]:focus-visible::after { transform: none; }
@media (prefers-reduced-motion: reduce) { .pe [data-tip]::after { transition: none; } }

/* ---- Top bar ---- */
.pe-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.pe-top-start, .pe-top-mid, .pe-top-end { display: flex; align-items: center; gap: 4px; min-width: 0; }
.pe-top-end { justify-content: flex-end; }
.pe-name {
  flex: 0 1 260px;
  min-width: 60px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: 600 14px/1 inherit;
  text-overflow: ellipsis;
}
.pe-name:hover { border-color: var(--border); }
.pe-name:focus { border-color: var(--accent); outline: none; background: var(--surface); }
.pe-name-box { display: grid; flex: 0 1 260px; min-width: 60px; }
.pe-name-box .pe-name { flex: none; width: 100%; }
.pe-name-box:has(.pe-live) .pe-name { height: 22px; }
.pe-live { overflow: hidden; padding: 0 9px; color: var(--muted); font-size: 11px; line-height: 14px; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.pe-live:hover { color: var(--accent); text-decoration: underline; }
.pe-top .funnel-step-pick { flex: 0 1 auto; }
.pe-top .funnel-step-pick .sub { display: none; }
.pe-top .funnel-step-pick select { height: 32px; max-width: 220px; font-size: 13px; }
.pe-divider { width: 1px; height: 20px; margin: 0 4px; background: var(--border); }
.pe-devices { display: inline-flex; gap: 2px; padding: 2px; border-radius: 10px; background: var(--sunken); }
.pe-devices .pe-icon-button { width: 32px; height: 30px; }
.pe-devices .pe-icon-button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(16 24 40 / 0.12); }
.pe-status { display: inline-flex; align-items: center; gap: 6px; margin-right: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pe-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #12b76a; flex-shrink: 0; }
.pe-status.is-dirty::before { background: #f79009; }
.pe-status.is-error { color: var(--danger, #d92d20); }
.pe-status.is-error::before { background: var(--danger, #d92d20); }
.pe-views { display: inline-flex; gap: 2px; padding: 2px; margin-right: 4px; border-radius: 10px; background: var(--sunken); }
.pe-views button { height: 28px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 500; }
.pe-views button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(16 24 40 / 0.12); }
.pe-publish { position: relative; height: 34px; margin-left: 6px; padding: 0 14px; border-radius: 8px; font-weight: 600; white-space: nowrap; }
.pe-publish.has-changes::after { content: ""; position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: #f79009; box-shadow: 0 0 0 2px var(--surface); }

/* The ⋯ menu */
.pe-menu-wrap { position: relative; }
.pe-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 70;
  display: grid;
  min-width: 220px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgb(16 24 40 / 0.16);
}
.pe-menu[hidden] { display: none; }
.pe-menu button { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font-size: 13px; text-align: left; }
.pe-menu button .pe-icon { width: 16px; height: 16px; color: var(--muted); }
.pe-menu button.danger { color: var(--danger, #d92d20); }
.pe-menu button.danger .pe-icon { color: currentColor; }
.pe-menu hr { margin: 4px 0; border: 0; border-top: 1px solid var(--border); }
@media (hover: hover) and (pointer: fine) { .pe-menu button:hover { background: var(--sunken); } }
/* TRK-861: a section's agent menu, opened from the sparkle on the page, so it sits over the page's frame */
.pe-agent-menu { position: fixed; top: auto; right: auto; z-index: 80; }
.pe-agent-menu button:disabled { opacity: 0.45; cursor: default; background: transparent; }
.pe-notice { padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--border); max-height: 40vh; overflow: auto; }
.pe-notice:empty { display: none; }

/* ---- Body: rail, panel, page, right panel ---- */
.pe-body {
  display: grid;
  grid-template-columns: var(--pe-rail) minmax(0, 1fr) var(--pe-inspector);
  min-height: 0;
}
.pe-body.has-panel { grid-template-columns: var(--pe-rail) var(--pe-panel) minmax(0, 1fr) var(--pe-inspector); }
.pe-body.is-preview { grid-template-columns: minmax(0, 1fr); }
.pe-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
}
.pe-rail-item {
  display: grid;
  justify-items: center;
  gap: 3px;
  width: 52px;
  padding: 7px 0 6px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
}
.pe-rail-item[aria-expanded="true"] { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.pe-rail-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (hover: hover) and (pointer: fine) { .pe-rail-item:not([aria-expanded="true"]):hover { background: var(--sunken); color: var(--text); } }
.pe-rail-end { margin-top: auto; }

.pe-panel, .pe-inspector {
  min-height: 0;
  overflow: hidden auto;
  overscroll-behavior: contain;
  background: var(--surface);
}
.pe-panel { border-right: 1px solid var(--border); }
.pe-inspector { border-left: 1px solid var(--border); }
.pe-panel-head, .pe-inspector-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 12px 8px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.pe-panel-head h2, .pe-inspector-head h2 { flex: 1; margin: 0; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pe-panel-body { display: grid; gap: 14px; padding: 14px 16px 24px; }
.pe-crumb { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; font-size: 14px; }
.pe-crumb button { padding: 2px 4px; border: 0; border-radius: 4px; background: none; color: var(--muted); font-size: 14px; }
.pe-crumb button:hover { color: var(--text); background: var(--sunken); }
.pe-crumb strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pe-crumb .sep { color: var(--muted); }
.pe-tabs { display: flex; gap: 2px; padding: 3px; margin: 12px 16px 0; border-radius: 10px; background: var(--sunken); }
.pe-tabs button { flex: 1; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-weight: 500; font-size: 13px; }
.pe-tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(16 24 40 / 0.12); }
.pe-inspector-body { display: grid; gap: 14px; padding: 14px 16px 32px; }
/* The old section box sits flat inside the right panel */
.pe-inspector-body .loop-row.funnel-section, .pe-inspector-body .funnel-signups, .pe-inspector-body > .loop-row { padding: 0; border: 0; background: none; box-shadow: none; }
/* Only the picked section's own head is hidden (its tools are on the page and below); a quiz question's, a popup's
   and a popup block's heads keep their buttons */
.pe-inspector-body > .funnel-section > .funnel-section-head { display: none; }
.pe-inspector-body > .funnel-global > .funnel-section-head { display: flex; }
.pe-inspector-body > .funnel-global > .funnel-section-head .funnel-section-tools { display: none; }
.pe-page-group { display: grid; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.pe-page-group:last-child { border-bottom: 0; }
.pe-page-group > h3 { margin: 0; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.pe-empty-hint { margin: 0; padding: 12px; border: 1px dashed var(--border); border-radius: 8px; color: var(--muted); font-size: 12px; line-height: 1.5; }

/* The page */
.pe-canvas { display: flex; min-width: 0; min-height: 0; padding: 16px; background: var(--sunken); overflow: auto; }
.pe-stage { display: flex; flex: 1; justify-content: center; min-height: 0; }
.pe-stage .funnel-frame { width: 100%; height: 100%; min-height: 480px; border: 1px solid var(--border); border-radius: 8px; background: #fff; box-shadow: 0 1px 3px rgb(16 24 40 / 0.06); transition: width 220ms cubic-bezier(0.23, 1, 0.32, 1); }
.pe-stage-tablet .funnel-frame { width: 820px; max-width: 100%; }
.pe-stage-phone .funnel-frame { width: 390px; max-width: 100%; border-radius: 20px; }
.pe-body.is-preview .pe-canvas { padding: 0; }
.pe-body.is-preview .pe-stage .funnel-frame { border: 0; border-radius: 0; box-shadow: none; }
.pe-body.is-preview .pe-stage-phone, .pe-body.is-preview .pe-stage-tablet { padding: 16px; }
.pe-body.is-preview .pe-stage-phone .funnel-frame, .pe-body.is-preview .pe-stage-tablet .funnel-frame { border: 1px solid var(--border); border-radius: 20px; }
.pe-stage { position: relative; }
.pe-stage.is-scaled { justify-content: flex-start; overflow: hidden; }
.pe-stage.is-scaled .funnel-frame { flex: none; max-width: none; min-height: 0; transform-origin: 0 0; transition: none; }
@media (prefers-reduced-motion: reduce) { .pe-stage .funnel-frame { transition: none; } }
.pe-report { min-height: 0; overflow: auto; padding: 20px 24px 40px; }
.pe-report > * { max-width: 1200px; margin-inline: auto; }

/* ---- Layers ---- */
.pe-layers { list-style: none; display: grid; gap: 2px; margin: 0; padding: 0; }
.pe-layer { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 0 4px 0 2px; border: 1px solid transparent; border-radius: 8px; }
.pe-layer.is-picked { background: color-mix(in srgb, var(--accent) 10%, transparent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.pe-layer.is-hidden .pe-layer-name { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.pe-layer.is-over { border-color: var(--accent); border-style: dashed; }
.pe-layer.is-dragging { opacity: 0.45; }
.pe-layer-grip { display: grid; place-items: center; color: var(--muted); cursor: grab; }
.pe-layer-grip .pe-icon { width: 14px; height: 14px; }
.pe-layer-name { display: grid; min-width: 0; height: 36px; align-content: center; padding: 0 4px; border: 0; background: none; color: var(--text); text-align: left; cursor: pointer; }
.pe-layer-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pe-layer-name .sub { font-size: 11px; }
.pe-layer-tools { display: flex; opacity: 0; transition: opacity 120ms ease; }
.pe-layer:hover .pe-layer-tools, .pe-layer:focus-within .pe-layer-tools, .pe-layer.is-picked .pe-layer-tools, .pe-layer.is-hidden .pe-layer-tools { opacity: 1; }
.pe-layer-tools .pe-icon-button { width: 28px; height: 28px; }
.pe-layer-tools .pe-icon { width: 15px; height: 15px; }
/* TRK-1014: each section opens to its parts; a part row is indented by its depth */
.pe-layer-item, .pe-node-item { list-style: none; }
.pe-layer.has-picked-part { background: color-mix(in srgb, var(--accent) 5%, transparent); border-color: transparent; }
.pe-layer-kids { list-style: none; display: grid; gap: 1px; margin: 1px 0 4px; padding: 0; }
.pe-node { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 4px; padding: 0 4px 0 calc(2px + var(--depth, 1) * 14px); border: 1px solid transparent; border-radius: 8px; }
.pe-node:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.pe-node.is-picked { background: color-mix(in srgb, var(--accent) 12%, transparent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.pe-node.is-over { border-color: var(--accent); border-style: dashed; }
.pe-node.is-dragging { opacity: 0.45; }
.pe-node[draggable="true"] .pe-layer-grip { cursor: grab; }
.pe-node-name { display: grid; grid-template-columns: 16px minmax(0, 1fr); align-items: center; gap: 8px; min-width: 0; height: 32px; padding: 0 4px; border: 0; background: none; color: var(--text); text-align: left; cursor: pointer; }
.pe-node-icon { display: grid; place-items: center; color: var(--muted); }
.pe-node-icon .pe-icon { width: 14px; height: 14px; }
.pe-node.is-picked .pe-node-icon { color: var(--accent); }
.pe-node-words { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.pe-node-words > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pe-node-words > span:first-child { flex: none; font-size: 13px; }
.pe-node-words .sub { min-width: 0; font-size: 11px; }
.pe-node:hover .pe-layer-tools, .pe-node:focus-within .pe-layer-tools, .pe-node.is-picked .pe-layer-tools { opacity: 1; }
.pe-node .pe-layer-tools .pe-icon-button { width: 26px; height: 26px; }
/* TRK-1017: which devices a section shows on, picked under its row */
.pe-layer-name .pe-layer-off { font-size: 11px; color: var(--accent); }
.pe-layer-name:has(.pe-layer-off) { height: auto; min-height: 36px; padding-block: 5px; line-height: 1.35; }
.pe-layer-tools .pe-icon-button.is-on { color: var(--accent); }
.pe-layer:has(.is-on) .pe-layer-tools, .pe-layer:has([aria-expanded="true"][aria-controls]) .pe-layer-tools { opacity: 1; }
.pe-device-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin: 2px 4px 6px 26px; }
.pe-device-pick button { display: grid; justify-items: center; gap: 2px; padding: 6px 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--muted); font-size: 11.5px; cursor: pointer; transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease; }
.pe-device-pick button[aria-pressed="true"] { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); color: var(--text); }
.pe-device-pick button[aria-pressed="true"] .pe-node-icon { color: var(--accent); }
.pe-device-pick button[aria-pressed="false"] { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.pe-device-pick button:disabled { cursor: not-allowed; }
.pe-device-pick button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* TRK-1018: and which devices a part shows on, picked under the part's row (indented to its depth) */
.pe-node-words:has(.pe-layer-off) { flex-wrap: wrap; row-gap: 0; }
.pe-node-words > .pe-layer-off { flex-basis: 100%; font-size: 11px; color: var(--accent); }
/* TRK-1021: a list entry's row also has Duplicate and Delete, so where it's hidden wraps rather than being cut off */
.pe-node-words > .pe-layer-off { white-space: normal; }
.pe-node-name:has(.pe-layer-off) { height: auto; min-height: 32px; padding-block: 4px; line-height: 1.35; }
.pe-node:has(.is-on) .pe-layer-tools, .pe-node:has([aria-expanded="true"][aria-controls]) .pe-layer-tools { opacity: 1; }
.pe-node-item > .pe-device-pick { margin-left: calc(20px + min(var(--depth, 1), 2) * 14px); }
.pe-layer-group { margin: 6px 0 2px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* ---- Add panel ---- */
.pe-search { position: relative; }
.pe-search input { width: 100%; height: 34px; padding-left: 32px; font-size: 13px; }
.pe-search .pe-icon { position: absolute; left: 9px; top: 8px; width: 16px; height: 16px; color: var(--muted); }
.pe-add-group h3 { margin: 0 0 6px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.pe-add-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pe-add-item { display: grid; gap: 2px; min-height: 52px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); text-align: left; font-size: 12.5px; font-weight: 500; cursor: pointer; transition: border-color 120ms ease, background-color 120ms ease; }
.pe-add-item .sub { font-size: 11px; font-weight: 400; line-height: 1.3; }
.pe-add-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (hover: hover) and (pointer: fine) { .pe-add-item:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 4%, var(--surface)); } }
.pe-add-where { margin: 0; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--text); font-size: 12px; }
.pe-wide-button { width: 100%; }
/* TRK-855: Add page under a website's pages, and where the page sits on the website in Page settings */
.pe-add-page { display: inline-flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; }
.pe-add-page svg { width: 16px; height: 16px; flex-shrink: 0; }
.pe-site-place-form { display: grid; gap: 10px; }
.pe-site-place-form .funnel-field { margin: 0; }
.pe-site-place-form input:not([type="checkbox"]) { width: 100%; min-width: 0; }
.pe-site-place-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.pe-site-place-actions .sub { font-size: 12px; min-width: 0; }
.pe-site-place-actions button { flex-shrink: 0; }
/* TRK-842: the Add picker. Each tile is a picture of the section in the page's theme, with its name under it. */
.pe-body.panel-add { --pe-panel: 340px; }
.pe-add-groups { display: grid; gap: 16px; }
.pe-pick { align-content: start; gap: 3px; padding: 6px 6px 8px; }
.pe-pick .pe-pick-name, .pe-pick .sub { padding: 0 2px; }
.pe-pick .sub { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pe-pick-thumb { order: -1; position: relative; display: block; aspect-ratio: 16 / 10; margin-bottom: 4px; overflow: hidden; border-radius: 5px; background: color-mix(in srgb, var(--text) 5%, var(--surface)); }
.pe-pick-thumb iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; pointer-events: none; opacity: 0; transition: opacity 160ms ease; }
.pe-pick-thumb.is-drawn iframe { opacity: 1; }
.pe-pick:disabled { cursor: not-allowed; opacity: 0.55; }
.pe-pick.is-next { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); } /* TRK-864: what Enter adds while typing after a slash */
.pe-pick-hint { margin: -4px 0 0; font-size: 11.5px; }
.pe-pick-more { display: grid; gap: 6px; padding-top: 4px; }
@media (prefers-reduced-motion: reduce) { .pe-pick-thumb iframe { transition: none; } }

/* ---- Settings rows (Theme and Style) ---- */
.pe-group { display: grid; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.pe-group:last-of-type { border-bottom: 0; }
.pe-group > h3 { margin: 0; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.pe-setting { display: grid; gap: 6px; }
.pe-setting-head { display: flex; align-items: center; gap: 6px; min-height: 20px; }
.pe-setting-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--text); }
.pe-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.pe-reset { margin-left: auto; padding: 0 6px; height: 20px; border: 0; border-radius: 4px; background: none; color: var(--muted); font-size: 11px; }
.pe-reset:hover { color: var(--accent); background: var(--sunken); }
.pe-phone-mark { display: inline-flex; align-items: center; gap: 3px; padding: 0 6px 0 4px; border-radius: 4px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-size: 10px; font-weight: 600; line-height: 16px; white-space: nowrap; }
.pe-phone-mark .pe-icon { width: 11px; height: 11px; stroke-width: 2.2; }
.pe-setting.is-phone .pe-reset { color: var(--accent); }
/* TRK-844: the phone view's note and the order buttons */
.pe-phone-hint { margin: 0; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--text); font-size: 12px; line-height: 1.5; }
.pe-move { display: flex; align-items: center; gap: 4px; }
.pe-move .pe-icon-button { width: 30px; height: 28px; border: 1px solid var(--border); border-radius: 6px; }
.pe-move-where { margin-left: 4px; color: var(--muted); font-size: 12px; }
.pe-seg { display: flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--sunken); }
.pe-seg button { flex: 1 1 0; min-width: 0; height: 28px; padding: 0 4px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Four or more choices (Text size, the finish's Background; TRK-878) size to their words so none is cut short */
.pe-seg:where(:has(> :nth-child(4))) button { flex: 1 1 auto; padding: 0 3px; }
.pe-seg.pe-seg-words button { flex: 1 0 auto; padding: 0 8px; } /* TRK-907: Align on phones, so Same as desktop reads in full */
.pe-seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(16 24 40 / 0.12); }
.pe-seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pe-setting select, .pe-image input:not([type="range"]) { width: 100%; height: 32px; font-size: 13px; }
/* TRK-881: the step buttons with a pixel box beside them; 16px so phones don't zoom into it */
.pe-space { display: flex; align-items: center; gap: 6px; }
.pe-space .pe-seg { flex: 1 1 auto; min-width: 0; }
.pe-space .pe-seg button { flex: 1 0 auto; padding: 0 5px; } /* sized by their words, so Auto and None fit beside the box */
.pe-px { position: relative; flex: 0 0 68px; display: block; }
.pe-px-input { width: 100%; height: 32px; padding: 0 24px 0 8px; font-size: 16px; text-align: right; font-variant-numeric: tabular-nums; }
.pe-px-input::placeholder { color: var(--muted); font-size: 13px; }
.pe-px-unit { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 12px; pointer-events: none; }

.pe-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
/* TRK-900: the newer look of the page's preset, offered above the presets */
.pe-newer { display: grid; gap: 8px; margin: 0 0 10px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); border-radius: 8px; background: color-mix(in srgb, var(--accent) 6%, transparent); }
.pe-newer p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; text-wrap: pretty; }
.pe-newer strong { color: var(--text); font-weight: 600; }
.pe-newer-button { justify-self: start; min-height: 32px; padding: 0 12px; border: 0; border-radius: 6px; background: var(--accent); color: var(--accent-text, #fff); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; transition: filter 150ms ease, transform 120ms ease; }
@media (hover: hover) { .pe-newer-button:hover { filter: brightness(1.08); } }
.pe-newer-button:active { transform: scale(0.97); }
.pe-newer-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pe-preset { display: grid; gap: 2px; padding: 0 0 6px; border: 0; background: none; color: var(--text); text-align: left; cursor: pointer; }
.pe-preset-card { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: center; gap: 4px 8px; height: 66px; padding: 10px; border: 1px solid var(--border); box-shadow: 0 0 0 0 transparent; transition: box-shadow 150ms ease, border-color 150ms ease; overflow: hidden; }
.pe-preset[aria-pressed="true"] .pe-preset-card { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.pe-preset:focus-visible { outline: none; }
.pe-preset:focus-visible .pe-preset-card { box-shadow: 0 0 0 2px var(--accent); }
.pe-preset-aa { grid-row: 1 / 3; font-size: 24px; line-height: 1; }
.pe-preset-lines { display: grid; gap: 4px; }
.pe-preset-lines i { display: block; height: 4px; border-radius: 2px; opacity: 0.7; }
.pe-preset-lines i:last-child { width: 60%; }
.pe-preset-btn { width: 36px; height: 12px; }
.pe-preset-name { margin-top: 4px; font-size: 12.5px; font-weight: 600; }
.pe-preset-note { color: var(--muted); font-size: 11px; }
@media (hover: hover) and (pointer: fine) { .pe-preset:not([aria-pressed="true"]):hover .pe-preset-card { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); } }

.pe-colors { display: grid; gap: 4px; }
.pe-color { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; min-height: 40px; }
.pe-swatch { position: relative; width: 32px; height: 32px; border-radius: 8px; background: var(--swatch); box-shadow: inset 0 0 0 1px rgb(16 24 40 / 0.12); cursor: pointer; overflow: hidden; }
.pe-swatch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.pe-swatch:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.pe-color-text { display: grid; min-width: 0; font-size: 12.5px; font-weight: 500; }
.pe-color-hex { color: var(--muted); font-size: 11px; font-weight: 400; font-variant-numeric: tabular-nums; }
.pe-color .pe-reset { margin-left: 0; }
.pe-more summary { padding: 4px 0; color: var(--muted); font-size: 12px; cursor: pointer; }
.pe-theme { display: grid; gap: 16px; }
.pe-theme-actions { display: grid; gap: 8px; }

.pe-style { display: grid; gap: 16px; }
.pe-layouts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pe-layout { display: grid; gap: 4px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 11px; text-align: center; cursor: pointer; }
.pe-layout[aria-pressed="true"] { color: var(--text); font-weight: 600; }
.pe-layout-pic { position: relative; display: block; height: 46px; border: 1px solid var(--border); border-radius: 6px; background: var(--sunken); overflow: hidden; transition: border-color 120ms ease, box-shadow 120ms ease; }
.pe-layout[aria-pressed="true"] .pe-layout-pic { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pe-layout:focus-visible { outline: none; }
.pe-layout:focus-visible .pe-layout-pic { box-shadow: 0 0 0 2px var(--accent); }
/* A tiny sketch of each layout: three bars, placed by the layout's class */
.pe-layout-pic i { position: absolute; display: block; border-radius: 2px; background: color-mix(in srgb, var(--muted) 45%, transparent); }
.pe-layout-pic i:nth-child(1) { left: 25%; right: 25%; top: 12px; height: 5px; }
.pe-layout-pic i:nth-child(2) { left: 32%; right: 32%; top: 21px; height: 3px; }
.pe-layout-pic i:nth-child(3) { left: 40%; right: 40%; top: 29px; height: 6px; background: var(--accent); }
.pe-layout-pic[class*="split"] i:nth-child(1), .pe-layout-pic[class*="-right"] i:nth-child(1), .pe-layout-pic[class*="two-column"] i:nth-child(1) { left: 10%; right: 55%; }
.pe-layout-pic[class*="split"] i:nth-child(2), .pe-layout-pic[class*="-right"] i:nth-child(2), .pe-layout-pic[class*="two-column"] i:nth-child(2) { left: 10%; right: 62%; }
.pe-layout-pic[class*="split"] i:nth-child(3), .pe-layout-pic[class*="-right"] i:nth-child(3) { left: 55%; right: 8%; top: 8px; height: 30px; background: color-mix(in srgb, var(--accent) 35%, transparent); }
.pe-layout-pic[class*="split-left"] i:nth-child(1), .pe-layout-pic[class*="-left"] i:nth-child(1) { left: 55%; right: 10%; }
.pe-layout-pic[class*="split-left"] i:nth-child(2), .pe-layout-pic[class*="-left"] i:nth-child(2) { left: 55%; right: 17%; }
.pe-layout-pic[class*="split-left"] i:nth-child(3), .pe-layout-pic[class*="-left"] i:nth-child(3) { left: 8%; right: 55%; top: 8px; height: 30px; background: color-mix(in srgb, var(--accent) 35%, transparent); }
.pe-layout-pic[class*="background"] { background: color-mix(in srgb, var(--accent) 30%, #101828); }
.pe-layout-pic[class*="background"] i { background: rgb(255 255 255 / 0.8); }
.pe-layout-pic[class*="minimal"] i:nth-child(1) { top: 14px; height: 10px; left: 15%; right: 15%; }
.pe-layout-pic[class*="minimal"] i:nth-child(2), .pe-layout-pic[class*="minimal"] i:nth-child(3) { display: none; }
/* TRK-946: Photo collage: words at the left, three overlapping pictures at the right */
.pe-layout-pic.pe-layout-hero-collage i:nth-child(1) { left: 8%; right: 60%; top: 14px; height: 5px; }
.pe-layout-pic.pe-layout-hero-collage i:nth-child(2) { left: 8%; right: 66%; top: 23px; height: 3px; }
.pe-layout-pic.pe-layout-hero-collage i:nth-child(3) { left: 50%; right: 22%; top: 9px; height: 26px; background: color-mix(in srgb, var(--accent) 35%, var(--sunken)); }
.pe-layout-pic.pe-layout-hero-collage::before, .pe-layout-pic.pe-layout-hero-collage::after { content: ""; position: absolute; border-radius: 2px; background: color-mix(in srgb, var(--accent) 55%, var(--sunken)); box-shadow: 0 0 0 1.5px var(--sunken); }
.pe-layout-pic.pe-layout-hero-collage::before { left: 70%; right: 7%; top: 5px; height: 15px; }
.pe-layout-pic.pe-layout-hero-collage::after { left: 64%; right: 12%; top: 25px; height: 15px; }
/* TRK-963: Statement, a big sentence over three lines; words only since TRK-992 */
.pe-layout-pic.pe-layout-text-statement i { left: 10%; height: 6px; background: color-mix(in srgb, var(--muted) 70%, transparent); }
.pe-layout-pic.pe-layout-text-statement i:nth-child(1) { right: 14%; top: 8px; }
.pe-layout-pic.pe-layout-text-statement i:nth-child(2) { right: 26%; top: 19px; }
.pe-layout-pic.pe-layout-text-statement i:nth-child(3) { right: 40%; top: 30px; }
/* TRK-946: Product launch: a dark band, the words in the middle, a wide screen with a glow behind it */
.pe-layout-pic.pe-layout-hero-launch { background: #101828; }
.pe-layout-pic.pe-layout-hero-launch i:nth-child(1) { left: 30%; right: 30%; top: 7px; height: 4px; background: rgb(255 255 255 / 0.85); }
.pe-layout-pic.pe-layout-hero-launch i:nth-child(2) { left: 38%; right: 38%; top: 14px; height: 3px; background: rgb(255 255 255 / 0.5); }
.pe-layout-pic.pe-layout-hero-launch i:nth-child(3) { left: 24%; right: 24%; top: 24px; height: 26px; border-radius: 3px; background: rgb(255 255 255 / 0.9); }
.pe-layout-pic.pe-layout-hero-launch::before { content: ""; position: absolute; left: 12%; right: 12%; top: 18px; height: 34px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 75%, transparent), transparent); }
/* TRK-947: Form beside words: a dark photo band, the words at the left, a light box with a button at the right */
.pe-layout-pic.pe-layout-hero-panel { background: linear-gradient(90deg, #101828, color-mix(in srgb, var(--accent) 30%, #101828)); }
.pe-layout-pic.pe-layout-hero-panel i:nth-child(1) { left: 8%; right: 58%; top: 15px; height: 5px; background: rgb(255 255 255 / 0.85); }
.pe-layout-pic.pe-layout-hero-panel i:nth-child(2) { left: 8%; right: 66%; top: 24px; height: 3px; background: rgb(255 255 255 / 0.5); }
.pe-layout-pic.pe-layout-hero-panel i:nth-child(3) { left: 56%; right: 8%; top: 7px; height: 32px; border-radius: 3px; background: rgb(255 255 255 / 0.95); }
.pe-layout-pic.pe-layout-hero-panel::after { content: ""; position: absolute; left: 61%; right: 13%; top: 29px; height: 5px; border-radius: 2px; background: var(--accent); }
/* TRK-1011: Postcard: a wide photo, a bar over its bottom edge, the heading centered below */
.pe-layout-pic.pe-layout-hero-postcard i:nth-child(1) { left: 8%; right: 8%; top: 4px; height: 24px; background: color-mix(in srgb, var(--accent) 35%, var(--sunken)); }
.pe-layout-pic.pe-layout-hero-postcard i:nth-child(2) { left: 30%; right: 30%; top: 36px; height: 4px; background: color-mix(in srgb, var(--muted) 70%, transparent); }
.pe-layout-pic.pe-layout-hero-postcard i:nth-child(3) { left: 18%; right: 18%; top: 23px; height: 8px; border-radius: 2px; background: var(--surface, #fff); box-shadow: 0 0 0 1px var(--border); }
.pe-layout-pic.pe-layout-hero-postcard::after { content: ""; position: absolute; right: 21%; top: 25px; width: 12%; height: 4px; border-radius: 2px; background: var(--accent); }
/* TRK-1011: Lookbook: a large photo and two stacked ones, a solid band below */
.pe-layout-pic.pe-layout-hero-lookbook i:nth-child(1) { left: 8%; right: 47%; top: 4px; height: 24px; background: color-mix(in srgb, var(--accent) 35%, var(--sunken)); }
.pe-layout-pic.pe-layout-hero-lookbook i:nth-child(2) { left: 8%; right: 8%; top: 31px; height: 11px; background: var(--accent); }
.pe-layout-pic.pe-layout-hero-lookbook i:nth-child(3) { left: 55%; right: 8%; top: 4px; height: 11px; background: color-mix(in srgb, var(--accent) 35%, var(--sunken)); }
.pe-layout-pic.pe-layout-hero-lookbook::after { content: ""; position: absolute; left: 55%; right: 8%; top: 17px; height: 11px; border-radius: 2px; background: color-mix(in srgb, var(--accent) 35%, var(--sunken)); }
/* TRK-1011: Timetable: the heading over rows of classes, each with a button, a tall photo at the right */
.pe-layout-pic.pe-layout-hero-timetable i:nth-child(1) { left: 8%; right: 52%; top: 6px; height: 5px; }
.pe-layout-pic.pe-layout-hero-timetable i:nth-child(2) { left: 8%; right: 40%; top: 16px; height: 25px; background: repeating-linear-gradient(180deg, color-mix(in srgb, var(--muted) 35%, transparent) 0 4px, transparent 4px 9px); border-radius: 0; }
.pe-layout-pic.pe-layout-hero-timetable i:nth-child(3) { left: 66%; right: 8%; top: 5px; height: 36px; background: color-mix(in srgb, var(--accent) 35%, var(--sunken)); }
.pe-layout-pic.pe-layout-hero-timetable::after { content: ""; position: absolute; left: 50%; right: 37%; top: 16px; height: 22px; background: repeating-linear-gradient(180deg, var(--accent) 0 4px, transparent 4px 9px); }
/* TRK-1011: Menu board: dark, the heading over a round plate between two menus */
.pe-layout-pic.pe-layout-hero-menuboard { background: #101828; }
.pe-layout-pic.pe-layout-hero-menuboard i:nth-child(1) { left: 34%; right: 34%; top: 5px; height: 4px; background: rgb(255 255 255 / 0.85); }
.pe-layout-pic.pe-layout-hero-menuboard i:nth-child(2) { left: 8%; right: 66%; top: 18px; height: 20px; border-radius: 0; background: repeating-linear-gradient(180deg, rgb(255 255 255 / 0.5) 0 3px, transparent 3px 7px); }
.pe-layout-pic.pe-layout-hero-menuboard i:nth-child(3) { left: calc(50% - 12px); width: 24px; top: 14px; height: 24px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 55%, #fff); }
.pe-layout-pic.pe-layout-hero-menuboard::after { content: ""; position: absolute; left: 66%; right: 8%; top: 18px; height: 20px; background: repeating-linear-gradient(180deg, rgb(255 255 255 / 0.5) 0 3px, transparent 3px 7px); }
/* TRK-877: Pinned story: lines of words down the left, the active one strong, beside a pinned picture */
.pe-layout-pic[class*="-story"] i:nth-child(1) { left: 10%; right: 60%; top: 9px; height: 4px; background: var(--muted); }
.pe-layout-pic[class*="-story"] i:nth-child(2) { left: 10%; right: 66%; top: 17px; height: 3px; }
.pe-layout-pic[class*="-story"] i:nth-child(3) { left: 50%; right: 8%; top: 7px; height: 30px; background: color-mix(in srgb, var(--accent) 35%, transparent); }
.pe-layout-pic[class*="-story"]::before, .pe-layout-pic[class*="-story"]::after { content: ""; position: absolute; left: 10%; height: 3px; border-radius: 2px; background: color-mix(in srgb, var(--muted) 45%, transparent); opacity: 0.5; }
.pe-layout-pic[class*="-story"]::before { right: 62%; top: 28px; }
.pe-layout-pic[class*="-story"]::after { right: 70%; top: 35px; }
/* TRK-888: Value stack: rows with a price at the right, then the price; in a panel; or the price at the side */
.pe-layout-pic.pe-layout-valuestack-table i:nth-child(1), .pe-layout-pic.pe-layout-valuestack-card i:nth-child(1) { left: 22%; right: 22%; top: 7px; height: 19px; border-radius: 2px; background: repeating-linear-gradient(180deg, color-mix(in srgb, var(--muted) 45%, transparent) 0 3px, transparent 3px 7px); }
.pe-layout-pic.pe-layout-valuestack-table i:nth-child(2), .pe-layout-pic.pe-layout-valuestack-card i:nth-child(2) { left: 40%; right: 40%; top: 30px; height: 4px; background: var(--muted); }
.pe-layout-pic.pe-layout-valuestack-table i:nth-child(3), .pe-layout-pic.pe-layout-valuestack-card i:nth-child(3) { left: 34%; right: 34%; top: 37px; height: 5px; }
.pe-layout-pic.pe-layout-valuestack-card::before { content: ""; position: absolute; left: 14%; right: 14%; top: 3px; bottom: 2px; border: 1px solid color-mix(in srgb, var(--muted) 45%, transparent); border-radius: 5px; background: var(--surface); }
.pe-layout-pic.pe-layout-valuestack-split i:nth-child(1) { left: 8%; right: 50%; top: 9px; height: 27px; background: repeating-linear-gradient(180deg, color-mix(in srgb, var(--muted) 45%, transparent) 0 3px, transparent 3px 7px); }
.pe-layout-pic.pe-layout-valuestack-split i:nth-child(2) { left: 58%; right: 8%; top: 9px; height: 27px; border: 1px solid color-mix(in srgb, var(--muted) 45%, transparent); background: var(--surface); }
.pe-layout-pic.pe-layout-valuestack-split i:nth-child(3) { left: 64%; right: 14%; top: 26px; height: 5px; }
/* TRK-896: Guarantee: a round seal beside the words, over them in the middle, or small inside a framed strip */
.pe-layout-pic[class*="pe-layout-guarantee-"] i:nth-child(3) { right: auto; border-radius: 50%; background: var(--accent); }
.pe-layout-pic.pe-layout-guarantee-left i:nth-child(1) { left: 42%; right: 12%; top: 14px; height: 5px; }
.pe-layout-pic.pe-layout-guarantee-left i:nth-child(2) { left: 42%; right: 22%; top: 24px; height: 3px; }
.pe-layout-pic.pe-layout-guarantee-left i:nth-child(3) { left: 12%; top: 8px; width: 30px; height: 30px; }
.pe-layout-pic.pe-layout-guarantee-centered i:nth-child(1) { left: 30%; right: 30%; top: 28px; height: 4px; }
.pe-layout-pic.pe-layout-guarantee-centered i:nth-child(2) { left: 37%; right: 37%; top: 36px; height: 3px; }
.pe-layout-pic.pe-layout-guarantee-centered i:nth-child(3) { left: calc(50% - 10px); top: 4px; width: 20px; height: 20px; }
.pe-layout-pic.pe-layout-guarantee-banner::before { content: ""; position: absolute; left: 6%; right: 6%; top: 8px; bottom: 8px; border: 1px solid color-mix(in srgb, var(--muted) 45%, transparent); border-radius: 5px; background: var(--surface); }
.pe-layout-pic.pe-layout-guarantee-banner i:nth-child(1) { left: 34%; right: 14%; top: 17px; height: 4px; }
.pe-layout-pic.pe-layout-guarantee-banner i:nth-child(2) { left: 34%; right: 24%; top: 25px; height: 3px; }
.pe-layout-pic.pe-layout-guarantee-banner i:nth-child(3) { left: 13%; top: 14px; width: 18px; height: 18px; }

.pe-schemes { display: flex; gap: 6px; flex-wrap: wrap; }
.pe-scheme { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--bg, #fff); color: var(--fg, var(--text)); font-size: 11px; font-weight: 700; cursor: pointer; box-shadow: inset 0 -6px 0 var(--btn, transparent); }
.pe-scheme { background: var(--bg); }
.pe-scheme-auto { background: repeating-linear-gradient(135deg, var(--surface) 0 6px, var(--sunken) 6px 12px); color: var(--muted); box-shadow: none; }
.pe-scheme[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }
.pe-scheme:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pe-image { display: grid; gap: 8px; }
.pe-overlay { display: grid; grid-template-columns: auto 1fr 3em; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.pe-overlay output { text-align: right; font-variant-numeric: tabular-nums; }
.pe-checks { display: flex; gap: 16px; }
.pe-checks label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.pe-checks input { margin: 0; }

/* ---- Narrower screens: panels slide over the page ---- */
@media (max-width: 1240px) {
  .pe-body.has-panel { grid-template-columns: var(--pe-rail) minmax(0, 1fr) var(--pe-inspector); }
  .pe-body.has-panel .pe-panel { position: absolute; top: calc(var(--pe-top) + 1px); bottom: 0; left: var(--pe-rail); z-index: 5; width: var(--pe-panel); box-shadow: 12px 0 32px rgb(16 24 40 / 0.12); }
}
@media (max-width: 960px) {
  .pe { --pe-inspector: 300px; }
  .pe-top { grid-template-columns: minmax(0, 1fr) auto; }
  .pe-top-mid { display: none; }
  .pe-status { display: none; }
}
@media (max-width: 760px) {
  .pe-body, .pe-body.has-panel { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .pe-canvas { grid-row: 1; }
  .pe-rail { grid-row: 2; flex-direction: row; justify-content: space-around; padding: 4px 8px calc(4px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--border); }
  .pe-rail-end { margin: 0; }
  .pe-body.has-panel .pe-panel, .pe-inspector { position: fixed; left: 0; right: 0; bottom: 64px; top: auto; width: auto; max-height: 55vh; z-index: 6; border: 0; border-top: 1px solid var(--border); border-radius: 14px 14px 0 0; box-shadow: 0 -12px 32px rgb(16 24 40 / 0.16); }
  .pe-inspector:not(.is-open) { display: none; }
  .pe-name { flex-basis: 140px; }
  .pe-views { display: none; }
  .pe-rail [data-tip]::after { display: none; }
  .pe-canvas { padding: 8px; }
  .pe-setting select, .pe-image input:not([type="range"]), .pe-search input, .pe-name { font-size: 16px; }
}

/* Panels that came from the old editor, sitting flat in the rail's panel */
.pe-panel .funnel-steps-panel { position: static; padding: 0; border: 0; background: none; }
.pe-panel .funnel-steps-panel > h2, .pe-panel .funnel-steps-top h2 { font-size: 13px; }
.pe-section-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 14px; border-top: 1px solid var(--border); }
.pe-section-actions button { height: 30px; padding: 0 10px; font-size: 12px; }
.pe-saved { display: grid; gap: 10px; }

/* Keyboard shortcuts (TRK-843) */
.pe-shortcut-list { display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; margin: 4px 0 0; align-items: baseline; }
.pe-shortcut-list dt { margin: 0; }
.pe-shortcut-list dd { margin: 0; color: var(--text); }
.pe-shortcut-list kbd { display: inline-block; min-width: 24px; padding: 2px 7px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; background: var(--surface); font-family: inherit; font-size: 12px; font-weight: 600; line-height: 1.5; text-align: center; white-space: nowrap; }

/* A website's shared header and footer settings (TRK-854), on the site screen and in the editor's right panel */
.chrome-controls { display: grid; gap: 16px; min-width: 0; }
.chrome-schemes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.chrome-scheme { display: grid; justify-items: center; gap: 4px; min-width: 0; padding: 0; border: 0; background: none; color: var(--muted); font-size: 11px; cursor: pointer; }
.chrome-scheme > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chrome-swatch { display: grid; place-items: center; width: 100%; height: 36px; border: 1px solid var(--line, var(--border)); border-radius: 6px; background: var(--bg); color: var(--fg); font-size: 12px; font-weight: 700; box-shadow: inset 0 -5px 0 var(--btn); transition: box-shadow 120ms ease; }
.chrome-scheme[aria-pressed="true"] { color: var(--text); font-weight: 600; }
.chrome-scheme[aria-pressed="true"] .chrome-swatch { outline: 2px solid var(--accent); outline-offset: 2px; }
.chrome-scheme:focus-visible { outline: none; }
.chrome-scheme:focus-visible .chrome-swatch { outline: 2px solid var(--accent); outline-offset: 2px; }
.chrome-checks { display: grid; gap: 10px; }
.chrome-check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; cursor: pointer; }
.chrome-check input { margin: 2px 0 0; flex-shrink: 0; }
.chrome-check span { display: grid; gap: 1px; }
.chrome-check small, .chrome-field small { font-size: 12px; }
.chrome-field input, .chrome-field textarea { width: 100%; box-sizing: border-box; }
.chrome-contact { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; min-width: 0; }
.chrome-contact legend { padding: 0; margin-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--text); }
.chrome-note { margin: 0; font-size: 12px; }
.pe-chrome-shared { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 10px 12px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 8%, var(--surface)); color: var(--text); font-size: 12px; line-height: 1.45; }
.pe-chrome-shared .pe-icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; color: var(--accent); }
/* Layout sketches: logo, menu and button */
.pe-layout-sh-standard i:nth-child(1) { left: 10%; right: 70%; top: 19px; height: 6px; }
.pe-layout-sh-standard i:nth-child(2) { left: 42%; right: 30%; top: 20px; height: 4px; }
.pe-layout-sh-standard i:nth-child(3) { left: 74%; right: 8%; top: 17px; height: 10px; }
.pe-layout-sh-centered i:nth-child(1) { left: 38%; right: 38%; top: 9px; height: 6px; }
.pe-layout-sh-centered i:nth-child(2) { left: 22%; right: 42%; top: 26px; height: 4px; }
.pe-layout-sh-centered i:nth-child(3) { left: 62%; right: 22%; top: 23px; height: 10px; }
.pe-layout-sh-pill { background: var(--surface); }
.pe-layout-sh-pill::before { content: ""; position: absolute; left: 6%; right: 6%; top: 11px; height: 22px; border: 1px solid color-mix(in srgb, var(--muted) 45%, transparent); border-radius: 999px; background: var(--sunken); }
.pe-layout-sh-pill i:nth-child(1) { left: 12%; right: 72%; top: 19px; height: 6px; }
.pe-layout-sh-pill i:nth-child(2) { left: 38%; right: 38%; top: 20px; height: 4px; }
.pe-layout-sh-pill i:nth-child(3) { left: 70%; right: 10%; top: 16px; height: 12px; border-radius: 999px; }
.pe-layout-sf-simple i:nth-child(1) { left: 10%; right: 50%; top: 20px; height: 5px; }
.pe-layout-sf-simple i:nth-child(2) { left: 64%; right: 26%; top: 18px; height: 9px; border-radius: 50%; }
.pe-layout-sf-simple i:nth-child(3) { left: 78%; right: 12%; top: 18px; height: 9px; border-radius: 50%; }
.pe-layout-sf-columns i { top: 10px; height: 24px; background: repeating-linear-gradient(180deg, color-mix(in srgb, var(--muted) 45%, transparent) 0 3px, transparent 3px 7px); }
.pe-layout-sf-columns i:nth-child(1) { left: 8%; right: 62%; }
.pe-layout-sf-columns i:nth-child(2) { left: 44%; right: 36%; }
.pe-layout-sf-columns i:nth-child(3) { left: 72%; right: 8%; background: repeating-linear-gradient(180deg, color-mix(in srgb, var(--accent) 55%, transparent) 0 3px, transparent 3px 7px); }

/* TRK-872: the Style tab's Movement setting */
.pe-motion { display: grid; gap: 6px; }
.pe-motion .pe-hint { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
/* TRK-873, TRK-874: with four or more movements the choices wrap onto a second row rather than cut their names short */
.pe-motion .pe-seg { flex-wrap: wrap; }
/* TRK-879: what Auto comes to for this section ("Auto: Endless row, from the theme"), read before the rest of the hint */
.pe-motion .pe-motion-auto { color: var(--text); font-weight: 500; }
.pe-motion .pe-seg button { flex: 1 0 auto; padding: 0 8px; }

/* TRK-876: the Tabs layout's sketch: a row of tabs (the first open), then words beside a picture */
.pe-layout-features-tabs i:nth-child(1) { left: 10%; right: 10%; top: 7px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) 0 26%, transparent 26% 37%, color-mix(in srgb, var(--muted) 45%, transparent) 37% 63%, transparent 63% 74%, color-mix(in srgb, var(--muted) 45%, transparent) 74%); }
.pe-layout-features-tabs i:nth-child(2) { left: 10%; right: 60%; top: 22px; height: 13px; border-radius: 0; background: repeating-linear-gradient(180deg, color-mix(in srgb, var(--muted) 45%, transparent) 0 3px, transparent 3px 5px); }
.pe-layout-features-tabs i:nth-child(3) { left: 46%; right: 10%; top: 18px; height: 22px; background: color-mix(in srgb, var(--accent) 35%, transparent); }

/* TRK-875: Words that change, under the section's words */
.tw-field .tw-field-help, .tw-field .field-error { margin: 0; font-size: 12px; line-height: 1.5; }
.tw-field .tw-field-help { color: var(--muted); }

/* TRK-887: Offer stack: offers with pictures swapping sides, a picture over each offer, or offers side by side */
.pe-layout-pic.pe-layout-offerstack-alternating i:nth-child(1) { left: 10%; right: 58%; top: 11px; height: 4px; background: var(--muted); }
.pe-layout-pic.pe-layout-offerstack-alternating i:nth-child(2) { left: 50%; right: 10%; top: 5px; height: 16px; background: color-mix(in srgb, var(--accent) 35%, transparent); }
.pe-layout-pic.pe-layout-offerstack-alternating i:nth-child(3) { left: 10%; right: 50%; top: 25px; height: 16px; background: color-mix(in srgb, var(--accent) 35%, transparent); }
.pe-layout-pic.pe-layout-offerstack-alternating::before { content: ""; position: absolute; left: 58%; right: 10%; top: 31px; height: 4px; border-radius: 2px; background: var(--muted); }
.pe-layout-pic.pe-layout-offerstack-stacked i:nth-child(1) { left: 28%; right: 28%; top: 6px; height: 17px; background: color-mix(in srgb, var(--accent) 35%, transparent); }
.pe-layout-pic.pe-layout-offerstack-stacked i:nth-child(2) { left: 28%; right: 40%; top: 27px; height: 4px; background: var(--muted); }
.pe-layout-pic.pe-layout-offerstack-stacked i:nth-child(3) { left: 28%; right: 54%; top: 35px; height: 3px; background: var(--accent); }
.pe-layout-pic.pe-layout-offerstack-compact i { top: 10px; height: 26px; border: 1px solid color-mix(in srgb, var(--muted) 45%, transparent); background: transparent; }
.pe-layout-pic.pe-layout-offerstack-compact i:nth-child(1) { left: 8%; right: 66%; }
.pe-layout-pic.pe-layout-offerstack-compact i:nth-child(2) { left: 37%; right: 37%; }
.pe-layout-pic.pe-layout-offerstack-compact i:nth-child(3) { left: 66%; right: 8%; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, transparent); }

/* TRK-948: Service menu: photo cards in a row, or name, dots and price lines; Listings: photo cards, or photo at the side */
.pe-layout-pic.pe-layout-menu-cards i, .pe-layout-pic.pe-layout-listings-cards i { top: 6px; height: 34px; border: 1px solid color-mix(in srgb, var(--muted) 45%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 30%, transparent) 0 55%, var(--surface) 55%); }
.pe-layout-pic.pe-layout-menu-cards i:nth-child(1), .pe-layout-pic.pe-layout-listings-cards i:nth-child(1) { left: 8%; right: 66%; }
.pe-layout-pic.pe-layout-menu-cards i:nth-child(2), .pe-layout-pic.pe-layout-listings-cards i:nth-child(2) { left: 37%; right: 37%; }
.pe-layout-pic.pe-layout-menu-cards i:nth-child(3), .pe-layout-pic.pe-layout-listings-cards i:nth-child(3) { left: 66%; right: 8%; }
.pe-layout-pic.pe-layout-menu-list i { left: 10%; right: 10%; height: 4px; background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--muted) 45%, transparent) 0 2px, transparent 2px 4px); }
.pe-layout-pic.pe-layout-menu-list i::before, .pe-layout-pic.pe-layout-menu-list i::after { content: ""; position: absolute; top: 0; height: 4px; border-radius: 2px; }
.pe-layout-pic.pe-layout-menu-list i::before { left: 0; width: 38%; background: var(--muted); }
.pe-layout-pic.pe-layout-menu-list i::after { right: 0; width: 16%; background: var(--accent); }
.pe-layout-pic.pe-layout-menu-list i:nth-child(1) { top: 10px; }
.pe-layout-pic.pe-layout-menu-list i:nth-child(2) { top: 21px; }
.pe-layout-pic.pe-layout-menu-list i:nth-child(3) { top: 32px; }
.pe-layout-pic.pe-layout-listings-list i { left: 10%; right: 10%; height: 10px; border: 1px solid color-mix(in srgb, var(--muted) 45%, transparent); background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 30%, transparent) 0 30%, var(--surface) 30%); }
.pe-layout-pic.pe-layout-listings-list i:nth-child(1) { top: 5px; }
.pe-layout-pic.pe-layout-listings-list i:nth-child(2) { top: 18px; }
.pe-layout-pic.pe-layout-listings-list i:nth-child(3) { top: 31px; }

/* TRK-918: Quote calculator: choice rows beside the estimate panel, or the panel under them */
.pe-layout-pic.pe-layout-quote-split i:nth-child(1), .pe-layout-pic.pe-layout-quote-stacked i:nth-child(1) { left: 8%; right: 52%; top: 8px; height: 28px; background: repeating-linear-gradient(180deg, color-mix(in srgb, var(--muted) 45%, transparent) 0 4px, transparent 4px 9px); }
.pe-layout-pic.pe-layout-quote-split i:nth-child(2) { left: 56%; right: 8%; top: 7px; height: 32px; border: 1px solid color-mix(in srgb, var(--muted) 45%, transparent); background: var(--surface); }
.pe-layout-pic.pe-layout-quote-split i:nth-child(3) { left: 62%; right: 14%; top: 28px; height: 5px; }
.pe-layout-pic.pe-layout-quote-stacked i:nth-child(1) { left: 28%; right: 28%; top: 5px; height: 17px; }
.pe-layout-pic.pe-layout-quote-stacked i:nth-child(2) { left: 28%; right: 28%; top: 25px; height: 17px; border: 1px solid color-mix(in srgb, var(--muted) 45%, transparent); background: var(--surface); }
.pe-layout-pic.pe-layout-quote-stacked i:nth-child(3) { left: 36%; right: 36%; top: 33px; height: 5px; }
/* Its prices, counts and discounts sit side by side in a row's box, each with its name above */
.funnel-item:has(> .funnel-item-num) { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
.funnel-item:has(> .funnel-item-num) > :not(.funnel-item-num) { grid-column: 1 / -1; }
.funnel-item-num { display: grid; gap: 2px; min-width: 0; font-size: 12px; color: var(--muted); }
.funnel-item-num input { width: 100%; min-width: 0; font-variant-numeric: tabular-nums; }

/* TRK-909: the Style tab's Heading size setting, laid out like Movement: the six sizes wrap onto two rows */
.pe-hsize { display: grid; gap: 6px; }
.pe-hsize .pe-hint { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.pe-hsize .pe-seg { flex-wrap: wrap; }
.pe-hsize .pe-seg button { flex: 1 0 auto; padding: 0 8px; }
/* TRK-906: Picture shape's eight choices sit in two even rows of four, so none runs off the panel */
.pe-pshape .pe-seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* TRK-908: where a Picture behind hero's words sit: a 3 by 3 grid standing for the picture, the box switch and the height */
.pe-place { display: grid; gap: 6px; }
.pe-place .pe-hint { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.pe-place .pe-seg { flex-wrap: wrap; }
.pe-place .pe-seg button { flex: 1 0 auto; padding: 0 8px; }
.pe-spots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; width: 132px; padding: 3px; border: 1px solid var(--border); border-radius: 8px; background: var(--sunken); aspect-ratio: 16 / 10; }
.pe-spot { display: grid; place-items: center; min-width: 0; padding: 0; border: 0; border-radius: 5px; background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: background-color 0.15s ease; }
.pe-spot span { width: 8px; height: 8px; border-radius: 50%; background: color-mix(in srgb, var(--muted) 45%, transparent); transition: background-color 0.15s ease, transform 0.15s cubic-bezier(0.23, 1, 0.32, 1); }
.pe-spot[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 2px rgb(16 24 40 / 0.12); }
.pe-spot[aria-pressed="true"] span { width: 18px; height: 6px; border-radius: 3px; background: var(--accent); }
.pe-spot:active span { transform: scale(0.9); }
.pe-spot:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (hover: hover) and (pointer: fine) { .pe-spot:not([aria-pressed="true"]):hover span { background: var(--text); } }
@media (pointer: coarse) { .pe-spots { width: 168px; } }
.pe-switch-row { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; line-height: 1.4; cursor: pointer; }
/* TRK-959: Bento boxes and Words in a tinted box in the layout picker */
.pe-layout-pic.pe-layout-features-bento i:nth-child(1) { left: 8%; right: 40%; top: 6px; height: 32px; background: color-mix(in srgb, var(--accent) 30%, transparent); }
.pe-layout-pic.pe-layout-features-bento i:nth-child(2) { left: 64%; right: 8%; top: 6px; height: 14px; }
.pe-layout-pic.pe-layout-features-bento i:nth-child(3) { left: 64%; right: 8%; top: 24px; height: 14px; background: color-mix(in srgb, var(--muted) 45%, transparent); }
.pe-layout-pic.pe-layout-imagetext-tinted i:nth-child(1) { left: 8%; right: 34%; top: 5px; height: 28px; background: color-mix(in srgb, var(--muted) 35%, transparent); }
.pe-layout-pic.pe-layout-imagetext-tinted i:nth-child(2) { left: 52%; right: 8%; top: 18px; height: 22px; background: color-mix(in srgb, var(--accent) 45%, var(--sunken)); }
.pe-layout-pic.pe-layout-imagetext-tinted i:nth-child(3) { left: 58%; right: 18%; top: 25px; height: 3px; background: var(--text); }
.pe-seg[aria-label="Accent words"] { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); } /* TRK-993: six accent styles in two rows of three */
/* TRK-1019: a column's Add menu in Layers, and a group's Add a row */
.pe-add-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin: 2px 4px 6px calc(20px + min(var(--depth, 1), 2) * 14px); }
.pe-add-pick button { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 11.5px; cursor: pointer; transition: border-color 120ms ease, background-color 120ms ease; }
.pe-add-pick button:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.pe-add-pick button:disabled { color: var(--muted); opacity: .55; cursor: not-allowed; }
.pe-add-pick button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pe-add-line { color: var(--accent); }
.pe-add-line:disabled { color: var(--muted); cursor: not-allowed; }
.pe-add-words { font-size: 13px; white-space: nowrap; }
/* TRK-1057: the Arch photo and Stacked photos heroes' thumbnails */
.pe-layout-pic.pe-layout-hero-arch i:nth-child(1) { left: 8%; right: 56%; top: 15px; height: 5px; }
.pe-layout-pic.pe-layout-hero-arch i:nth-child(2) { left: 8%; right: 62%; top: 24px; height: 3px; }
.pe-layout-pic.pe-layout-hero-arch i:nth-child(3) { left: 58%; right: 14%; top: 5px; height: 36px; border-radius: 40% 40% 2px 2px / 30% 30% 2px 2px; background: color-mix(in srgb, var(--accent) 45%, var(--sunken)); }
.pe-layout-pic.pe-layout-hero-arch::after { content: ""; position: absolute; left: 63%; right: 9%; top: 9px; height: 36px; border: 1px solid color-mix(in srgb, var(--accent) 60%, var(--sunken)); border-radius: 40% 40% 2px 2px / 30% 30% 2px 2px; }
.pe-layout-pic.pe-layout-hero-stack i:nth-child(1) { left: 8%; right: 56%; top: 13px; height: 7px; }
.pe-layout-pic.pe-layout-hero-stack i:nth-child(2) { left: 56%; right: 18%; top: 4px; height: 13px; background: color-mix(in srgb, var(--accent) 35%, var(--sunken)); }
.pe-layout-pic.pe-layout-hero-stack i:nth-child(3) { left: 66%; right: 8%; top: 17px; height: 13px; background: color-mix(in srgb, var(--accent) 55%, var(--sunken)); box-shadow: 0 0 0 1.5px var(--sunken); }
.pe-layout-pic.pe-layout-hero-stack::after { content: ""; position: absolute; left: 58%; right: 16%; top: 30px; height: 13px; border-radius: 2px; background: color-mix(in srgb, var(--accent) 45%, var(--sunken)); box-shadow: 0 0 0 1.5px var(--sunken); }
/* TRK-1058: the Rounded frame and Layered photos heroes' thumbnails */
.pe-layout-pic.pe-layout-hero-inset i:nth-child(1) { left: 6%; right: 6%; top: 4px; height: 32px; border-radius: 5px; background: linear-gradient(90deg, #1e2733 0%, color-mix(in srgb, var(--accent) 45%, var(--sunken)) 100%); }
.pe-layout-pic.pe-layout-hero-inset i:nth-child(2) { left: 12%; right: 58%; top: 12px; height: 5px; background: rgb(255 255 255 / 0.85); }
.pe-layout-pic.pe-layout-hero-inset i:nth-child(3) { left: 14%; right: 14%; top: 31px; height: 9px; border-radius: 3px; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.25); }
.pe-layout-pic.pe-layout-hero-layered i:nth-child(1) { left: 8%; right: 58%; top: 15px; height: 5px; }
.pe-layout-pic.pe-layout-hero-layered i:nth-child(2) { left: 60%; right: 8%; top: 4px; height: 32px; background: color-mix(in srgb, var(--accent) 35%, var(--sunken)); }
.pe-layout-pic.pe-layout-hero-layered i:nth-child(3) { left: 52%; right: 30%; top: 24px; height: 17px; background: color-mix(in srgb, var(--accent) 60%, var(--sunken)); box-shadow: 0 0 0 1.5px var(--sunken); }

/* TRK-1177: the arrow beside Preview, and its menu with Preview with scripts */
.pe-preview-wrap { margin-left: -6px; }
.pe-preview-arrow { width: 18px; }
.pe-preview-arrow .pe-icon { width: 14px; height: 14px; }
.pe-preview-menu { min-width: 250px; }
.pe-preview-menu button { display: grid; grid-template-columns: 16px 1fr; column-gap: 10px; height: auto; padding: 8px 10px; }
.pe-preview-menu button small { grid-column: 2; color: var(--muted); font-size: 12px; }
.pe-preview-menu button[aria-checked="true"] span { color: var(--accent); }
