/* ————— MediaPack editor chrome: a quiet backstage console ————— */

* { box-sizing: border-box; margin: 0; padding: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* MediaPack brand: cool ink ground, paper text, vermilion signal */
:root {
  --c-bg: #121316;
  --c-panel: #191b20;
  --c-line: #2a2e35;
  --c-ink: #eceded;
  --c-dim: #8d93a0;
  --c-amber: #f0532e;      /* brand vermilion (var name kept for stability) */
  --c-amber-ink: #fff6f2;
  --font-ui: 'Inter', sans-serif;
  --font-brand: 'Instrument Serif', serif;
  --font-mono: 'DM Mono', monospace;
}

html, body { height: 100%; }

body {
  font-family: var(--font-ui);
  background: var(--c-bg);
  color: var(--c-ink);
  overflow: hidden;
}

/* faint grain so the chrome never feels flat */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

#chrome { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100vh; }

/* ————— top bar ————— */

#topbar {
  display: flex; align-items: center; gap: 1rem;
  height: 54px; padding: 0 1.1rem;
  border-bottom: 1px solid var(--c-line);
  background: color-mix(in srgb, var(--c-panel) 80%, transparent);
}

.brand {
  display: flex; align-items: center; gap: .5rem;
  font-family: var(--font-brand);
  font-size: 1.25rem; font-weight: 560; letter-spacing: -.01em;
}
.brand .mark { width: 22px; height: 22px; flex: none; }
#topbar .brand { cursor: pointer; }
#topbar .brand:hover em { text-decoration: underline; text-underline-offset: 3px; }
.brand em {
  font-style: italic; color: var(--c-amber);
  font-size: .8em; margin-left: .45em; font-weight: 400;
}

.tb-shuffle {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; gap: .4rem; align-items: center;
}
#topbar { position: relative; }
.tb-shuffle .btn:disabled { opacity: .35; cursor: default; }

.src {
  flex: 1; text-align: right; padding-right: 1rem;
  font-family: var(--font-mono);
  font-size: .62rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--c-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.actions { display: flex; gap: .5rem; }

.btn {
  font-family: var(--font-ui); font-size: .8rem; font-weight: 600;
  padding: .48rem .85rem; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--c-line); background: transparent; color: var(--c-ink);
  transition: border-color .15s, background .15s, transform .1s;
}
.btn:hover { border-color: var(--c-dim); }
.btn:active { transform: translateY(1px); }
.btn.solid { background: var(--c-amber); border-color: var(--c-amber); color: var(--c-amber-ink); }
.btn.solid:hover { filter: brightness(1.08); }
.btn.icon { padding: .48rem .6rem; }
.btn.sm { font-size: .72rem; padding: .35rem .6rem; }

/* ————— workbench ————— */

#workbench { display: flex; flex: 1; min-height: 0; }

/* the panel is a slide-over drawer now — the page itself is the editor,
   the drawer is where the fine-tuning lives */
#panel {
  position: fixed; top: 55px; right: 0; bottom: 0; z-index: 60;
  width: min(360px, 94vw); display: flex; flex-direction: column;
  border-left: 1px solid var(--c-line); background: var(--c-panel);
  box-shadow: -18px 0 48px rgba(0,0,0,.35);
  transform: translateX(calc(100% + 30px));
  transition: transform .28s cubic-bezier(.2,.8,.25,1);
  min-height: 0;
}
body.panel-open #panel { transform: none; }

.tabs { display: flex; align-items: stretch; border-bottom: 1px solid var(--c-line); }
.tabs button {
  flex: 1; padding: .8rem 0; cursor: pointer;
  background: none; border: none; border-bottom: 2px solid transparent;
  font-family: var(--font-mono); font-size: .7rem; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--c-dim);
}
.tabs button.on { color: var(--c-amber); border-bottom-color: var(--c-amber); }
.tabs #panelClose {
  flex: none; width: 2.6rem; letter-spacing: 0; font-size: .85rem;
}
.tabs #panelClose:hover { color: var(--c-ink); }

.tab { display: none; overflow-y: auto; padding: 1.1rem; flex: 1; min-height: 0; }
.tab.on { display: block; }

/* ——— the five-minute panel: numbered steps ——— */
.panel-name {
  flex: 1; align-self: center; padding-left: 1.1rem; margin: 0;
  font-family: var(--font-mono); font-size: .7rem; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--c-dim);
}
#steps { overflow-y: auto; flex: 1; min-height: 0; scrollbar-gutter: stable; }
.step { border-bottom: 1px solid var(--c-line); }
.step-head {
  display: flex; align-items: center; gap: .75rem; width: 100%;
  padding: .85rem 1.1rem; cursor: pointer; text-align: left;
  background: none; border: none; color: var(--c-ink);
}
.step-head:hover { background: rgba(255,255,255,.03); }
.step-n {
  flex: none; width: 1.7rem; height: 1.7rem; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--c-line);
  font-family: var(--font-mono); font-size: .72rem; color: var(--c-dim);
  transition: all .2s;
}
.step.open .step-n { border-color: var(--c-amber); color: var(--c-amber); }
.step-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.step-t b { font-size: .85rem; font-weight: 600; letter-spacing: .02em; }
.step-t small { font-size: .68rem; color: var(--c-dim); line-height: 1.35; }
.step-tick {
  flex: none; opacity: 0; transform: scale(.6); transition: all .25s;
  color: var(--c-amber); font-size: .85rem;
}
.step.done .step-tick { opacity: 1; transform: none; }
.step.done .step-n { border-color: var(--c-amber); }
.step-body { display: none; padding: .3rem 1.1rem 1.3rem; }
.step.open .step-body { display: block; }
.step-tip {
  margin: .2rem 0 1rem; padding: .7rem .8rem; border-radius: 8px;
  background: rgba(255,255,255,.04); border: 1px solid var(--c-line);
  font-size: .78rem; line-height: 1.5; color: var(--c-dim);
}
.step-tip b { color: var(--c-ink); }
.step-cta { width: 100%; margin-bottom: .9rem; }
details.fine { margin-top: .4rem; border-top: 1px dashed var(--c-line); padding-top: .8rem; }
details.fine > summary {
  cursor: pointer; user-select: none; list-style: none;
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--c-dim); padding: .3rem 0 .9rem;
}
details.fine > summary::before { content: '▸ '; }
details.fine[open] > summary::before { content: '▾ '; }
details.fine > summary::-webkit-details-marker { display: none; }
.hk-row { display: flex; gap: .6rem; }

/* the open panel must never amputate the page — the preview yields room */
@media (min-width: 1000px) {
  body.panel-open #previewWrap { margin-right: min(360px, 94vw); transition: margin-right .28s cubic-bezier(.2,.8,.25,1); }
  #previewWrap { transition: margin-right .28s cubic-bezier(.2,.8,.25,1); }
}

/* template chips: two columns — big enough minis to actually judge a design */
#steps .chips { grid-template-columns: 1fr 1fr; }
/* mini previews never invent word-breaks a real-size template wouldn't show
   (!important: template CSS like register's overflow-wrap:anywhere loads
   after this sheet and would win the tie otherwise — minis only) */
.stage.mini, .stage.mini * {
  word-break: normal !important;
  overflow-wrap: normal !important;
  hyphens: none !important;
}

/* preview toolbar labels hold one line */
.pv-label, #btnReplay { white-space: nowrap; }
@media (max-width: 560px) { #btnReplay { display: none; } }

/* photo "change" chips: hover-revealed where hover exists — a poster wall
   tiled with forty pencil tags reads as a glitch, not an affordance */
@media (hover: hover) {
  .ph-tap { opacity: 0; transition: opacity .15s; }
  .has-badge:hover > .ph-tap, .ph-tap:focus-visible { opacity: 1; }
}

/* block rails collide with the sheet on phones — inline editing stays */
@media (max-width: 640px) { .gutter-rail { display: none; } }

.tray-bar span { white-space: nowrap; }

/* chip blurbs: two lines, even card heights */
.chip small {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* the panel hints there's more below the fold */
#steps::after {
  content: ''; position: sticky; bottom: 0; display: block; height: 26px;
  margin-top: -26px; pointer-events: none;
  background: linear-gradient(transparent, var(--c-panel));
}

/* marquee lobby: the editor's "+ add" pill gets its own row, clear of the
   ornament rule it used to sit on */
.pg-marquee .add-mini { display: block; margin: .8rem auto 0; position: relative; z-index: 2; }

.group { margin-bottom: 1.6rem; }
.group > h3 {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; user-select: none;
  font-family: var(--font-mono);
  font-size: .62rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase;
  color: var(--c-dim); margin-bottom: .6rem;
}
.group > h3:hover { color: var(--c-ink); }
.group > h3 i { font-style: normal; font-size: .6rem; transition: transform .18s ease; }
.group.closed > h3 i { transform: rotate(-90deg); }
.group.closed > :not(h3) { display: none; }
.group.closed { margin-bottom: 1rem; }
.group .hint { font-size: .72rem; color: var(--c-dim); margin: -.35rem 0 .6rem; line-height: 1.4; }

/* chips (template / palette / preloader pickers) */

.chips { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .5rem; }
.chip {
  display: flex; flex-direction: column; align-items: center; gap: .3rem;
  padding: .6rem .3rem .55rem; cursor: pointer;
  background: var(--c-bg); color: var(--c-ink);
  border: 1px solid var(--c-line); border-radius: 9px;
  font-family: var(--font-ui);
  transition: border-color .15s, box-shadow .15s;
}
.chip:hover { border-color: var(--c-dim); }
.chip.on { border-color: var(--c-amber); box-shadow: 0 0 0 1px var(--c-amber); }
.chip b { font-size: .74rem; font-weight: 600; }
.chip small { font-size: .6rem; color: var(--c-dim); text-align: center; line-height: 1.25; }

/* live mini-preview: a real render, scaled way down */
.tpl-live {
  display: block; width: 100%; height: 58px;
  border-radius: 5px; overflow: hidden; position: relative;
  border: 1px solid rgba(255,255,255,.06);
  pointer-events: none;
}
.tpl-live .stage.mini {
  display: block; width: 1100px; min-height: 900px;
  transform: scale(.082); transform-origin: top left;
}
.h-card .tpl-live { height: 62px; }

/* generic template mini-preview, drawn from the template's thumb spec
   (--tb ground, --ti ink, --ta accent) + a layout archetype */
.tpl-thumb {
  position: relative; width: 100%; height: 46px; border-radius: 5px; overflow: hidden;
  display: block; background: var(--tb); border: 1px solid rgba(255,255,255,.06);
}
.tpl-thumb i { position: absolute; display: block; }
/* serif: editorial headline + rule + column */
.tpl-thumb[data-layout="serif"] i:nth-child(1) { left: 8%; top: 22%; width: 42%; height: 22%; background: var(--ti); border-radius: 2px 6px 2px 6px; }
.tpl-thumb[data-layout="serif"] i:nth-child(2) { left: 8%; top: 56%; width: 26%; height: 9%; background: var(--ta); }
.tpl-thumb[data-layout="serif"] i:nth-child(3) { right: 8%; top: 18%; width: 22%; height: 64%; background: color-mix(in srgb, var(--ti) 34%, var(--tb)); }
.tpl-thumb[data-layout="serif"] i:nth-child(4) { left: 8%; bottom: 14%; width: 50%; height: 4%; background: color-mix(in srgb, var(--ti) 40%, var(--tb)); }
/* caps: huge stacked display lines */
.tpl-thumb[data-layout="caps"] i:nth-child(1) { left: 8%; top: 18%; width: 66%; height: 18%; background: var(--ti); }
.tpl-thumb[data-layout="caps"] i:nth-child(2) { left: 16%; top: 42%; width: 48%; height: 18%; border: 1.5px solid var(--ti); }
.tpl-thumb[data-layout="caps"] i:nth-child(3) { left: 8%; bottom: 12%; width: 30%; height: 8%; background: var(--ta); }
.tpl-thumb[data-layout="caps"] i:nth-child(4) { display: none; }
/* mono: wall label + one hung object */
.tpl-thumb[data-layout="mono"] i:nth-child(1) { left: 10%; top: 16%; width: 18%; height: 5%; background: var(--ti); }
.tpl-thumb[data-layout="mono"] i:nth-child(2) { left: 10%; top: 26%; width: 12%; height: 4%; background: color-mix(in srgb, var(--ti) 45%, var(--tb)); }
.tpl-thumb[data-layout="mono"] i:nth-child(3) { right: 14%; top: 26%; width: 26%; height: 48%; background: color-mix(in srgb, var(--ti) 30%, var(--tb)); }
.tpl-thumb[data-layout="mono"] i:nth-child(4) { right: 14%; bottom: 12%; width: 10%; height: 4%; background: var(--ta); }
/* grid: contact-sheet cells */
.tpl-thumb[data-layout="grid"] i { width: 18%; height: 30%; background: color-mix(in srgb, var(--ti) 30%, var(--tb)); }
.tpl-thumb[data-layout="grid"] i:nth-child(1) { left: 8%; top: 14%; }
.tpl-thumb[data-layout="grid"] i:nth-child(2) { left: 32%; top: 14%; background: var(--ta); }
.tpl-thumb[data-layout="grid"] i:nth-child(3) { left: 56%; top: 14%; }
.tpl-thumb[data-layout="grid"] i:nth-child(4) { left: 8%; top: 54%; width: 66%; height: 8%; background: var(--ti); }
/* frame: thick accent border console */
.tpl-thumb[data-layout="frame"] { border: 2.5px solid var(--ta); }
.tpl-thumb[data-layout="frame"] i:nth-child(1) { left: 10%; bottom: 18%; width: 58%; height: 20%; background: var(--ta); }
.tpl-thumb[data-layout="frame"] i:nth-child(2) { left: 10%; top: 18%; width: 40%; height: 12%; background: var(--ti); }
.tpl-thumb[data-layout="frame"] i:nth-child(3) { right: 10%; top: 18%; width: 12%; height: 12%; background: color-mix(in srgb, var(--ti) 40%, var(--tb)); }
.tpl-thumb[data-layout="frame"] i:nth-child(4) { display: none; }
/* columns: centered playbill hierarchy */
.tpl-thumb[data-layout="columns"] i { left: 50%; transform: translateX(-50%); }
.tpl-thumb[data-layout="columns"] i:nth-child(1) { top: 14%; width: 20%; height: 5%; background: var(--ta); }
.tpl-thumb[data-layout="columns"] i:nth-child(2) { top: 26%; width: 56%; height: 20%; background: var(--ti); }
.tpl-thumb[data-layout="columns"] i:nth-child(3) { top: 54%; width: 38%; height: 8%; background: color-mix(in srgb, var(--ti) 50%, var(--tb)); }
.tpl-thumb[data-layout="columns"] i:nth-child(4) { top: 70%; width: 46%; height: 5%; background: color-mix(in srgb, var(--ti) 35%, var(--tb)); }

/* palette swatch grid — no names, the colours are the label */
.pal-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: .35rem; }
.pal {
  position: relative; height: 30px; cursor: pointer;
  border-radius: 6px; border: 1px solid rgba(255,255,255,.12);
  background: var(--bg, #222);
  transition: transform .12s ease;
}
.pal:hover { transform: translateY(-1px); border-color: rgba(255,255,255,.3); }
.pal .pi { position: absolute; left: 5px; bottom: 5px; width: 11px; height: 3px; border-radius: 2px; background: var(--ink, #eee); }
.pal .pa { position: absolute; right: 5px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent, #f90); }
.pal.on { outline: 2px solid var(--c-amber); outline-offset: 1px; }

.pl-icon { font-size: 1rem; letter-spacing: .1em; height: 30px; display: flex; align-items: center; color: var(--c-amber); }

/* character segmented controls */
.seg-row { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.seg-label {
  flex: none; width: 74px;
  font-family: var(--font-mono); font-size: .56rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--c-dim);
}
.seg { flex: 1; display: flex; border: 1px solid var(--c-line); border-radius: 7px; overflow: hidden; }
.seg button {
  flex: 1; padding: .34rem 0; cursor: pointer;
  background: none; border: none; border-right: 1px solid var(--c-line);
  font-family: var(--font-ui); font-size: .66rem; font-weight: 600; color: var(--c-dim);
}
.seg button:last-child { border-right: none; }
.seg button.on { background: var(--c-line); color: var(--c-ink); }
.seg button:hover:not(.on) { color: var(--c-ink); }

/* custom palette wells */
.wells { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-top: .7rem; }
.wells.on .well { border-color: var(--c-amber); }
.well {
  display: flex; flex-direction: column; align-items: center; gap: .3rem;
  padding: .5rem .3rem; border: 1px solid var(--c-line); border-radius: 9px;
  background: var(--c-bg); cursor: pointer;
}
.well input[type="color"] {
  width: 30px; height: 30px; padding: 0; border: none; border-radius: 50%;
  background: none; cursor: pointer;
}
.well input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.well input[type="color"]::-webkit-color-swatch { border: 1px solid rgba(255,255,255,.2); border-radius: 50%; }
.well span { font-family: var(--font-mono); font-size: .56rem; letter-spacing: .12em; text-transform: uppercase; color: var(--c-dim); }

/* logo dropzone */

.dropzone {
  position: relative; display: flex; align-items: center; justify-content: center;
  min-height: 92px; border: 1.5px dashed var(--c-line); border-radius: 10px;
  cursor: pointer; text-align: center; font-size: .78rem; color: var(--c-dim);
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--c-amber); background: rgba(226,166,61,.05); }
.dropzone small { font-size: .68rem; }
.dropzone img { max-height: 64px; max-width: 70%; object-fit: contain; }
.dropzone .rm {
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px; border-radius: 50%;
  border: none; cursor: pointer; font-size: .7rem;
  background: var(--c-line); color: var(--c-ink);
}
.dropzone .rm:hover { background: #a33; }

/* content fields */

.field { display: block; margin-bottom: .75rem; }
.field span {
  display: block; font-size: .66rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--c-dim); margin-bottom: .3rem;
}
.field input, .field textarea, .stat-row input {
  width: 100%; padding: .5rem .6rem;
  background: var(--c-bg); color: var(--c-ink);
  border: 1px solid var(--c-line); border-radius: 7px;
  font-family: var(--font-ui); font-size: .82rem; line-height: 1.45;
  resize: vertical;
}
.field input:focus, .field textarea:focus, .stat-row input:focus {
  outline: none; border-color: var(--c-amber);
}

/* design shuffle bar */
.shuffle-bar { display: flex; gap: .45rem; margin-bottom: 1.3rem; }
.shuffle-btn { flex: 1; font-size: .82rem; }
.shuffle-bar .btn:disabled { opacity: .35; cursor: default; }
.shuffle-bar .btn:disabled:hover { border-color: var(--c-line); }

/* custom sections editor */
.field-rename input {
  width: 100%; padding: .2rem 0; margin-bottom: .3rem;
  background: none; border: none; border-bottom: 1px dashed transparent;
  font-family: var(--font-mono); font-size: .66rem; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--c-dim);
}
.field-rename input:hover { border-bottom-color: var(--c-line); }
.field-rename input:focus { outline: none; border-bottom-color: var(--c-amber); color: var(--c-ink); }
.sec-card {
  margin-bottom: .7rem; padding: .6rem;
  border: 1px solid var(--c-line); border-radius: 9px; background: var(--c-bg);
}
.sec-card textarea {
  width: 100%; margin-top: .5rem; padding: .5rem .6rem; resize: vertical;
  background: var(--c-panel); color: var(--c-ink);
  border: 1px solid var(--c-line); border-radius: 7px;
  font-family: var(--font-ui); font-size: .8rem; line-height: 1.5;
}
.sec-card textarea:focus { outline: none; border-color: var(--c-amber); }
.sec-bar { display: flex; align-items: center; gap: .4rem; }
.sec-kind {
  flex: none; padding: .18rem .45rem; border-radius: 5px;
  background: var(--c-line);
  font-family: var(--font-mono); font-size: .56rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--c-dim);
}
.sec-title {
  flex: 1; min-width: 0; padding: .35rem .5rem;
  background: none; border: none; border-bottom: 1px solid transparent;
  color: var(--c-ink); font-family: var(--font-ui); font-size: .84rem; font-weight: 600;
}
.sec-title:focus { outline: none; border-bottom-color: var(--c-amber); }
.sec-btn {
  flex: none; width: 24px; height: 26px; cursor: pointer;
  border: 1px solid var(--c-line); border-radius: 5px;
  background: none; color: var(--c-dim); font-size: .68rem;
}
.sec-btn:hover:not(:disabled) { border-color: var(--c-dim); color: var(--c-ink); }
.sec-btn:disabled { opacity: .3; cursor: default; }
.sec-add { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin-top: .3rem; }
.sec-add > span {
  font-family: var(--font-mono); font-size: .58rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--c-dim);
  margin-right: .2rem;
}

/* fast bio rotator */
.bio-rotator { display: flex; align-items: center; gap: .5rem; margin: .1rem 0 .5rem; }
.bio-next { font-size: .78rem; }
.bio-counter {
  margin-left: auto;
  font-family: var(--font-mono); font-size: .6rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--c-dim);
}

/* curated lists */
.cur-list { display: flex; flex-direction: column; gap: .3rem; max-height: 300px; overflow-y: auto; padding-right: 2px; }
.cur-row { display: flex; gap: .35rem; align-items: center; }
.cur-row input { flex: 1; min-width: 0; padding: .38rem .55rem; background: var(--c-bg); color: var(--c-ink);
  border: 1px solid var(--c-line); border-radius: 6px; font-family: var(--font-ui); font-size: .78rem; }
.cur-row.off input { opacity: .38; text-decoration: line-through; }
.cur-pin, .cur-hide {
  flex: none; width: 26px; height: 28px; cursor: pointer;
  border: 1px solid var(--c-line); border-radius: 6px;
  background: none; color: var(--c-dim); font-size: .72rem;
}
.cur-pin:hover, .cur-hide:hover { border-color: var(--c-dim); }
.cur-row.pinned .cur-pin { color: var(--c-amber); border-color: var(--c-amber); }
.cur-add { display: flex; gap: .35rem; margin-top: .4rem; }
.cur-add input { flex: 1; min-width: 0; padding: .38rem .55rem; background: var(--c-bg); color: var(--c-ink);
  border: 1px dashed var(--c-line); border-radius: 6px; font-family: var(--font-ui); font-size: .78rem; }
.cur-add input:focus { outline: none; border-color: var(--c-amber); border-style: solid; }

/* image tray */
.tray-bar { margin-bottom: .5rem; font-family: var(--font-mono); font-size: .58rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--c-dim); }
.tray { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; max-height: 340px; overflow-y: auto; padding-right: 2px; }
.tray-cell { position: relative; aspect-ratio: 3/4; border-radius: 6px; overflow: hidden; background: var(--c-bg); }
.tray-cell img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .15s, filter .15s; }
.tray-cell.off img { opacity: .22; filter: grayscale(1); }
.tray-cell.feat { outline: 2px solid var(--c-amber); outline-offset: -2px; }
.tray-tags { position: absolute; top: 4px; left: 4px; display: flex; gap: 3px; }
.tray-tags b { padding: 2px 4px; border-radius: 3px; background: var(--c-amber); color: var(--c-amber-ink);
  font: 700 7px var(--font-mono); letter-spacing: .08em; }
.tray-tags b.tf { background: rgba(10,9,8,.8); color: var(--c-amber); border: 1px solid var(--c-amber); }
.tray-section {
  display: flex; align-items: center; justify-content: space-between;
  margin: .8rem 0 .4rem; font-family: var(--font-mono); font-size: .56rem;
  letter-spacing: .16em; text-transform: uppercase; color: var(--c-dim);
}
.tray-big { grid-template-columns: repeat(2, 1fr); }
.tray-big .tray-cell { aspect-ratio: 4/3; }
.tray-cell.tc-first { outline: 2px solid var(--c-amber); outline-offset: -2px; }
.tray-cell.tc-second { outline: 1px solid color-mix(in srgb, var(--c-amber) 55%, transparent); outline-offset: -1px; }
.tray-empty { grid-column: 1 / -1; padding: .6rem; border: 1px dashed var(--c-line); border-radius: 6px;
  font-size: .68rem; color: var(--c-dim); text-align: center; }
.tray-shuffle {
  cursor: pointer; padding: .2rem .5rem; border: 1px solid var(--c-line); border-radius: 999px;
  background: none; color: var(--c-amber);
  font: 500 .56rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase;
}
.tray-shuffle:hover { border-color: var(--c-amber); }
.tray-acts {
  position: absolute; inset: auto 0 0; display: flex;
  background: rgba(10,9,8,.78); opacity: 0; transition: opacity .15s;
}
.tray-cell:hover .tray-acts, .tray-cell:focus-within .tray-acts { opacity: 1; }
.tray-acts button {
  flex: 1; padding: .35rem 0; cursor: pointer; border: none; background: none;
  color: #eee; font-size: .72rem;
}
.tray-acts button:hover { color: var(--c-amber); }

.stat-row { display: flex; gap: .4rem; margin-bottom: .4rem; }
.stat-row .v { width: 74px; flex: none; }
.stat-row .rm {
  flex: none; width: 30px; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--c-line); background: none; color: var(--c-dim);
}
.stat-row .rm:hover { color: #e66; border-color: #a33; }
.stats-ed > .btn { margin-top: .2rem; }

/* ————— preview side ————— */

#previewWrap {
  position: relative; flex: 1; display: flex; flex-direction: column; min-width: 0;
}

.pv-toolbar {
  display: flex; align-items: center; gap: 1rem;
  height: 42px; padding: 0 1rem;
  border-bottom: 1px solid var(--c-line);
  font-size: .72rem; color: var(--c-dim);
}
.pv-label { display: flex; align-items: center; gap: .45em; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; }
.pv-label .dot { width: 7px; height: 7px; border-radius: 50%; background: #4cd964; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.pv-size { display: flex; margin-left: auto; border: 1px solid var(--c-line); border-radius: 7px; overflow: hidden; }
.pv-size button {
  padding: .3rem .7rem; font-size: .7rem; font-weight: 600; cursor: pointer;
  background: none; border: none; color: var(--c-dim); font-family: var(--font-ui);
}
.pv-size button.on { background: var(--c-line); color: var(--c-ink); }

/* the preview floats as a framed sheet inside a neutral canvas */
#stageScroll { flex: 1; overflow-y: auto; min-height: 0; padding: 1.5rem; background: #0c0b0a; }
#stageScroll .stage {
  max-width: 1180px; margin: 0 auto; min-height: calc(100vh - 190px);
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 14px 50px rgba(0,0,0,.55);
}
#stageScroll.mob { padding: 1.2rem 0; }
#stageScroll.mob .stage {
  max-width: 390px; min-height: calc(100vh - 140px);
  border-radius: 18px; box-shadow: 0 12px 50px rgba(0,0,0,.6);
}

/* fullscreen preview */

body.full #topbar, body.full #panel, body.full .pv-toolbar { display: none; }
body.full #stageScroll { padding: 0; background: none; }
body.full #stageScroll .stage { max-width: none; min-height: 100vh; border-radius: 0; box-shadow: none; }
/* showcase + mobile: keep the phone frame, floating on the dark canvas */
body.full #stageScroll.mob { padding: 4.4rem 0 1.2rem; background: #0c0b0a; }
body.full #stageScroll.mob .stage {
  max-width: 390px; min-height: calc(100vh - 5.6rem);
  border-radius: 18px; box-shadow: 0 12px 50px rgba(0,0,0,.6);
}
/* showcase pills: the whole first-visit UI */
#showBar {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 60;
  display: flex; gap: .5rem; padding: .4rem;
  background: rgba(14,15,18,.72); border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px; backdrop-filter: blur(10px);
  box-shadow: 0 8px 30px rgba(0,0,0,.4);
  animation: homeRise .6s cubic-bezier(.2,.7,.2,1) .3s both;
}
#showBar[hidden] { display: none; }
#showBar .btn { border-radius: 999px; }
#showBar .btn.ghost { border-color: rgba(255,255,255,.22); color: #fff; }
#showBar .btn.mob-on { background: rgba(255,255,255,.16); }

/* the demo switcher — collapsed to a single button, bottom-left */
#demoBar {
  position: fixed; bottom: 16px; left: 16px; z-index: 60;
  display: flex; align-items: flex-end; gap: .4rem; flex-wrap: wrap;
  animation: homeRise .6s cubic-bezier(.2,.7,.2,1) .45s both;
}
#demoBar[hidden] { display: none; }
#demoBar .db-toggle {
  padding: .45rem .95rem; cursor: pointer;
  background: rgba(14,15,18,.8); border: 1px solid rgba(255,255,255,.2); border-radius: 999px;
  backdrop-filter: blur(10px); box-shadow: 0 8px 30px rgba(0,0,0,.4);
  font-family: var(--font-ui); font-size: .78rem; color: #fff; transition: border-color .15s;
}
#demoBar .db-toggle:hover { border-color: var(--c-amber); }
#demoBar .db-mark {
  align-self: center; margin-left: .6rem;
  font-size: .78rem; color: rgba(236,237,237,.75);
  background: rgba(8,9,11,.55); backdrop-filter: blur(6px);
  padding: .3rem .7rem; border-radius: 999px;
}
#demoBar .db-pills {
  display: none; align-items: center; gap: .4rem; flex-wrap: wrap;
  max-width: min(84vw, 780px); padding: .45rem .7rem;
  background: rgba(14,15,18,.85); border: 1px solid rgba(255,255,255,.16);
  border-radius: 18px; backdrop-filter: blur(10px); box-shadow: 0 8px 30px rgba(0,0,0,.4);
}
#demoBar.open .db-pills { display: flex; }
#demoBar .db-label {
  font-family: var(--font-mono); font-size: .58rem;
  letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.55);
  margin-right: .25rem;
}
#demoBar button {
  padding: .32rem .75rem; cursor: pointer;
  background: none; border: 1px solid rgba(255,255,255,.2); border-radius: 999px;
  font-family: var(--font-ui); font-size: .76rem; color: #fff;
  transition: border-color .15s, background .15s;
}
#demoBar button:hover { border-color: var(--c-amber); }
#demoBar button.on { border-color: var(--c-amber); background: rgba(240,83,46,.18); }
#demoBar .db-back {
  background: var(--c-amber); border-color: var(--c-amber);
  color: var(--c-amber-ink); font-weight: 600;
}

/* welcome intro — the site's own cinematic intro, played once ever */
#welcomeIntro {
  position: fixed; inset: 0; z-index: 70;
  display: grid; place-items: center;
  background:
    radial-gradient(70rem 42rem at 80% -10%, rgba(240,83,46,.12), transparent 60%),
    rgba(14,15,18,.94);
  backdrop-filter: blur(8px);
  transition: opacity .6s ease, transform .65s cubic-bezier(.7, 0, .3, 1);
}
#welcomeIntro[hidden] { display: none; }
#welcomeIntro.lift { opacity: 0; transform: translateY(-4%); pointer-events: none; }
.wi-card { max-width: min(92vw, 470px); text-align: center; color: #fff; padding: 1rem; }
.wi-card .mark { width: 40px; height: 40px; animation: plateRise .6s cubic-bezier(.2,.7,.2,1) .1s both; }
.wi-card h2 {
  margin-top: 1.1rem;
  font-family: var(--font-brand); font-weight: 400; font-size: 2.2rem;
  animation: plateRise .6s cubic-bezier(.2,.7,.2,1) .22s both;
}
.wi-lede {
  margin-top: .7rem; font-size: .95rem; line-height: 1.6; color: rgba(255,255,255,.78);
  animation: plateRise .6s cubic-bezier(.2,.7,.2,1) .34s both;
}
.wi-hints {
  list-style: none; margin: 1.4rem auto 0; padding: 0;
  display: grid; gap: .55rem; text-align: left; width: fit-content;
  animation: plateRise .6s cubic-bezier(.2,.7,.2,1) .46s both;
}
/* was a fixed-width icon column; now these are words and must flow inline */
.wi-hints li { display: block; font-size: .85rem; line-height: 1.45; color: rgba(255,255,255,.85); }
.wi-hints li::before { content: '— '; color: rgba(255,255,255,.35); }
.wi-hints b { color: var(--c-amber); font-weight: 600; white-space: nowrap; }
#wiGo { margin-top: 1.6rem; animation: plateRise .6s cubic-bezier(.2,.7,.2,1) .58s both; }
.wi-fine {
  margin-top: 1rem;
  font-family: var(--font-mono); font-size: .58rem;
  letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.45);
  animation: plateRise .6s cubic-bezier(.2,.7,.2,1) .7s both;
}
@media (prefers-reduced-motion: reduce) {
  #welcomeIntro, .wi-card * { animation: none !important; transition: opacity .2s ease; }
}
/* centred floating bars animate with their translateX preserved */
@keyframes barRise { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translateX(-50%); } }
/* barRise is ONLY for centred bars (left:50%). #demoBar sits at left:16px —
   borrowing barRise parked it at translateX(-50%), HALF OFF-SCREEN for every
   cold caller (the fourth barRise victim, after the player, the coach card
   and the ghost #showBar). homeRise, declared on the element itself, is the
   correct entrance — so no override here at all. */
#showBar { animation-name: barRise; }
#welcomePlate { animation-name: plateRise; }
@keyframes plateRise { from { opacity: 0; transform: translateY(14px); } }

/* publish: the one money-action, in go-green */
#showPublish {
  /* was top-right, where it struck through template taglines */
  position: fixed; bottom: 20px; right: 20px; z-index: 61;
  padding: .62rem 1.25rem; border: none; border-radius: 999px; cursor: pointer;
  background: #2fbf71; color: #06130b;
  font-family: var(--font-ui); font-size: .88rem; font-weight: 700;
  box-shadow: 0 6px 24px rgba(47,191,113,.35);
  animation: homeRise .6s cubic-bezier(.2,.7,.2,1) .45s both;
  transition: filter .15s, transform .15s;
}
#showPublish:hover { filter: brightness(1.08); transform: translateY(-1px); }
#showPublish[hidden] { display: none; }
/* RoyaltyPro members: Publish pinned top-right, away from the task toolbar */
body.rp #showPublish { top: 16px; bottom: auto; right: 16px; }
/* Members arrive with their own data — the Demos bar is explorer chrome only */
body.rp #demoBar { display: none; }
/* Members never shuffle — the rail below is their design picker */
body.rp .tb-shuffle { display: none; }

/* Member template rail: the 13 Collection designs, always visible, one click */
#tplRail {
  position: fixed; left: 14px; top: 50%; transform: translateY(-50%);
  z-index: 60; display: flex; flex-direction: column; gap: 3px;
  max-height: 86vh; overflow-y: auto; padding: 10px;
  background: rgba(8,9,11,.72); backdrop-filter: blur(10px);
  border: 1px solid rgba(236,237,237,.14); border-radius: 14px;
}
#tplRail[hidden] { display: none; }
/* the FlipBook is a showcase, not a design surface — no studio over the deck */
body.flipmode #tplRail, body.flipmode #palRail, body.flipmode #mediaBar { display: none !important; }
#tplRail .tr-head {
  font-family: var(--font-ui); font-size: .66rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  color: rgba(236,237,237,.6); padding: 2px 4px 7px;
}
#tplRail .tr-item {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 8px; border-radius: 9px;
  border: 1px solid transparent; background: transparent;
  color: #eceded; font-family: var(--font-ui);
  font-size: .8rem; font-weight: 600; cursor: pointer; text-align: left;
}
#tplRail .tr-item:hover { border-color: var(--c-amber); }
#tplRail .tr-item.on { border-color: var(--c-amber); background: rgba(240,83,46,.16); }
#tplRail .tr-item .tpl-thumb { width: 38px; height: 26px; flex: none; }
#tplRail .tr-name { white-space: nowrap; }

/* the right edge: colours — compact, not a wall */
#palRail {
  position: fixed; right: 14px; top: 50%; transform: translateY(-50%);
  z-index: 60; display: flex; flex-direction: column; gap: 4px;
  width: 152px; max-height: 86vh; overflow-y: auto; padding: 10px;
  background: rgba(8,9,11,.72); backdrop-filter: blur(10px);
  border: 1px solid rgba(236,237,237,.14); border-radius: 14px;
}
#palRail[hidden] { display: none; }
#palRail .pal-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
#palRail .pal {
  width: 100%; height: 20px; border-radius: 5px; overflow: hidden;
  display: flex; padding: 0; cursor: pointer;
  border: 2px solid transparent; background: none;
}
#palRail .pal i { flex: 1; display: block; }
#palRail .pal:hover { border-color: rgba(240,83,46,.55); }
#palRail .pal.on { border-color: var(--c-amber); }
/* the recall swatch: your own colours, one click on any design */
#palRail .pal-mine-wrap { display: flex; align-items: center; gap: .5rem; }
#palRail .pal-mine-wrap:empty { display: none; }
#palRail .pal-mine { width: 46px; height: 22px; flex: none; }
#palRail .pal-mine-lbl {
  font-family: var(--font-ui); font-size: .7rem; font-weight: 700;
  color: rgba(236,237,237,.8); white-space: nowrap;
}
/* four wells in the narrow rail: minmax(0,1fr) lets them SHRINK — repeat(4,
   1fr) forced a min content width so "Surface" clipped 11px past the rail
   edge and read "SURFA" (blind cold-sceptic, 2026-07-30) */
#palRail .tr-wells { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-top: 2px; }
#palRail .well { padding: 0; min-width: 0; overflow: hidden; }
#palRail .well span { font-size: .54rem; letter-spacing: .02em; }
#palRail .tr-intro {
  margin-top: 2px; width: 100%;
  font-family: var(--font-ui); font-size: .74rem; font-weight: 600;
  color: #eceded; background: rgba(236,237,237,.08);
  border: 1px solid rgba(236,237,237,.18); border-radius: 8px;
  padding: .32rem .35rem;
}
#palRail .tr-head { padding: 4px 2px 2px; }

/* the bottom edge: media doors */
#mediaBar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 14px;
  z-index: 61; display: flex; gap: 6px; align-items: center;
  padding: 8px; border-radius: 999px;
  background: rgba(8,9,11,.78); backdrop-filter: blur(10px);
  border: 1px solid rgba(236,237,237,.14);
}
#mediaBar[hidden] { display: none; }
#mediaBar .mb-btn {
  font-family: var(--font-ui); font-size: .84rem; font-weight: 700;
  color: #eceded; background: transparent;
  border: 1px solid transparent; border-radius: 999px;
  padding: .45rem .95rem; cursor: pointer; white-space: nowrap;
}
#mediaBar .mb-btn:hover { border-color: var(--c-amber); }
#mediaBar .mb-mobile { display: none; }
#mbMenu {
  position: absolute; bottom: calc(100% + 8px); right: 0; z-index: 95;
  display: flex; flex-direction: column; gap: 2px; padding: 8px;
  background: rgba(8,9,11,.9); backdrop-filter: blur(10px);
  border: 1px solid rgba(236,237,237,.16); border-radius: 12px;
}
#mbMenu[hidden] { display: none; }
#mbMenu button {
  font-family: var(--font-ui); font-size: .84rem; font-weight: 600;
  color: #eceded; background: transparent; text-align: left;
  border: 1px solid transparent; border-radius: 8px;
  padding: .45rem .9rem; cursor: pointer; white-space: nowrap;
}
#mbMenu button:hover { border-color: var(--c-amber); }
#mbMenu .mb-menu-mobile { display: none; }
@media (max-width: 900px) {
  #mbMenu .mb-menu-mobile { display: block; }
  #mbMenu .mb-desktop-only { display: none; }
}

/* THE editor: one toggle top-centre; the studio only exists while editing */
#editToggle {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 70; cursor: pointer;
  font-family: var(--font-ui); font-size: .9rem; font-weight: 700;
  color: #eceded; background: rgba(8,9,11,.78); backdrop-filter: blur(10px);
  border: 1px solid rgba(236,237,237,.2); border-radius: 999px;
  padding: .55rem 1.6rem;
  animation: homeRise .5s cubic-bezier(.2,.7,.2,1) both;
  transition: border-color .15s, transform .15s;
}
#editToggle:hover { border-color: var(--c-amber); transform: translateX(-50%) translateY(-1px); }
#editToggle[hidden] { display: none; }
body.flipmode #editToggle, body.published #editToggle { display: none !important; }
/* the owner's door: top-left, only once a site exists */
#studioLink {
  position: fixed; top: 16px; left: 16px; z-index: 70; cursor: pointer;
  font-family: var(--font-ui); font-size: .82rem; font-weight: 700;
  color: #eceded; background: rgba(8,9,11,.78); backdrop-filter: blur(10px);
  border: 1px solid rgba(236,237,237,.2); border-radius: 999px;
  padding: .5rem 1.1rem;
  animation: homeRise .5s cubic-bezier(.2,.7,.2,1) both;
}
#studioLink:hover { border-color: var(--c-amber); }
#studioLink[hidden] { display: none; }
body.flipmode #studioLink, body.published #studioLink { display: none !important; }
/* one image system: the popover's stage affordances retire in the studio */
body.studio .ph-tap, body.studio .img-badge { display: none !important; }
/* the old workbench chrome never shows inside the studio */
body.studio #topbar { display: none; }
body.studio .pv-toolbar { display: none; }
body.studio #panel { display: none !important; }
body.studio .gutter-rail, body.studio .sec-add, body.studio .seam { display: none !important; }
body.studio #showPublish { top: 16px; bottom: auto; right: 16px; }
/* the one-question modal + pitch note field */
#promptModal h3 { font-family: var(--font-ui); font-size: 1rem; margin-bottom: .4rem; }
.pm-input {
  width: 100%; margin: .6rem 0 .9rem; padding: .55rem .7rem;
  font: inherit; color: inherit;
  background: rgba(236,237,237,.06);
  border: 1px solid rgba(236,237,237,.18); border-radius: 8px;
}
.pm-row { display: flex; gap: .5rem; }
.pp-note-input {
  width: 100%; margin: .7rem 0; padding: .55rem .7rem;
  font: inherit; color: inherit; resize: vertical;
  background: rgba(236,237,237,.06);
  border: 1px solid rgba(236,237,237,.18); border-radius: 8px;
}
.pp-label-input {
  width: 100%; margin: .7rem 0; padding: .55rem .7rem;
  font: inherit; color: inherit;
  background: rgba(236,237,237,.06);
  border: 1px solid rgba(236,237,237,.18); border-radius: 8px;
}
/* one-tap adds from what the site already carries */
.pp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: .6rem 0; }
.pp-chip {
  font: inherit; font-size: .78rem; color: inherit; cursor: pointer;
  padding: .32rem .6rem; border-radius: 999px;
  background: rgba(236,237,237,.07);
  border: 1px solid rgba(236,237,237,.2);
  max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pp-chip:hover { background: rgba(236,237,237,.14); }
/* the whole card is the drop target */
.pp-drop-over { outline: 2px dashed rgba(236,237,237,.55); outline-offset: -6px; }

/* ——— THE PAGE IS THE EDITOR: private-page editing bars ——— */
#ppeBar, #ppeAdd {
  position: fixed; left: 0; right: 0; z-index: 86;
  display: flex; gap: .5rem; align-items: center; flex-wrap: wrap;
  padding: .55rem .8rem;
  background: rgba(10,11,13,.94); backdrop-filter: blur(10px);
}
#ppeBar { top: 0; border-bottom: 1px solid rgba(255,255,255,.1); }
#ppeAdd { bottom: 0; border-top: 1px solid rgba(255,255,255,.1); padding-bottom: max(.55rem, env(safe-area-inset-bottom, 0px)); }
#ppeBar .pp-label-input { flex: 1; min-width: 140px; margin: 0; }
#ppeBar .ppe-code {
  width: 130px; padding: .5rem .7rem; font: inherit; font-size: .8rem;
  color: inherit; background: rgba(236,237,237,.06);
  border: 1px solid rgba(236,237,237,.18); border-radius: 8px;
}
.ppe-status { font-size: .74rem; color: #9aa0a9; max-width: 300px; }
#ppeAdd input[type="url"] {
  flex: 1; min-width: 150px; padding: .5rem .7rem; font: inherit; font-size: .8rem;
  color: inherit; background: rgba(236,237,237,.06);
  border: 1px solid rgba(236,237,237,.18); border-radius: 8px;
}
#ppeChips { display: flex; gap: 6px; overflow-x: auto; max-width: 100%; flex-basis: 100%; }
#ppeChips:empty { display: none; }
/* the page clears the bars — and the WHOLE page glows when files hover */
body.pitchedit #stageScroll { padding-top: 64px !important; padding-bottom: 110px !important; }
body.pitchedit.ppe-over #stageScroll { outline: 2px dashed rgba(236,237,237,.6); outline-offset: -8px; }
/* each media unit's ✕, anchored to its box */
body.pitchedit .pg .media { position: relative; }
.ppe-rm {
  position: absolute; top: 6px; right: 6px; z-index: 5;
  width: 28px; height: 28px; border-radius: 999px;
  background: rgba(10,11,13,.85); color: #fff; font-size: 12px;
  border: 1px solid rgba(255,255,255,.3); cursor: pointer;
}
.ppe-rm:hover { background: rgba(200,40,40,.9); }
/* reorder within the band: ‹ › cluster, top-left of each unit */
.ppe-tools { position: absolute; top: 6px; left: 6px; z-index: 5; display: flex; gap: 4px; }
.ppe-mv {
  width: 28px; height: 28px; border-radius: 999px;
  background: rgba(10,11,13,.85); color: #fff; font-size: 14px; line-height: 1;
  border: 1px solid rgba(255,255,255,.3); cursor: pointer;
}
.ppe-mv:hover { background: rgba(255,255,255,.25); }
/* on audio cards the play button owns the top-left — park ‹ › beside the ✕ */
body.pitchedit .media-fplay .ppe-tools, body.studio .media-fplay .ppe-tools { left: auto; right: 40px; }
/* the studio's media units anchor the same controls as private pages */
body.studio .pg .media { position: relative; }
.ppe-stats { font-size: .74rem; color: #cfd3da; white-space: nowrap; cursor: default; }
/* the studio's coach card has no business over the pack builder */
body.pitchedit #coach { display: none !important; }

/* ═════════ THE LIGHTROOM — palette-dressed image viewer ═════════ */
#lightbox {
  position: fixed; inset: 0; z-index: 130;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--bg, #0b0c0e) 88%, black);
  animation: aioIn .22s ease both;
  cursor: zoom-out;
}
#lightbox figure { margin: 0; max-width: 92vw; max-height: 88vh; text-align: center; cursor: default; }
#lightbox .lb-img {
  max-width: 92vw; max-height: 82vh; display: block; margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0 30px 90px rgba(0,0,0,.6);
}
#lightbox .lb-cap {
  margin-top: 12px; font-size: .82rem; letter-spacing: .04em;
  color: color-mix(in srgb, var(--ink, #e7e9ec) 80%, transparent);
}
#lightbox .lb-cap:empty { display: none; }
#lightbox .lb-x, #lightbox .lb-a {
  position: fixed; z-index: 2; cursor: pointer;
  width: 44px; height: 44px; border-radius: 999px;
  display: grid; place-items: center; font-size: 18px; line-height: 1;
  background: color-mix(in srgb, var(--bg, #111) 70%, black);
  color: var(--ink, #fff);
  border: 1px solid color-mix(in srgb, var(--ink, #fff) 28%, transparent);
  transition: border-color .15s, transform .15s;
}
#lightbox .lb-x:hover, #lightbox .lb-a:hover { border-color: var(--accent, #f0532e); transform: scale(1.06); }
#lightbox .lb-x { top: 16px; right: 16px; }
#lightbox .lb-a { top: 50%; transform: translateY(-50%); font-size: 26px; }
#lightbox .lb-a:hover { transform: translateY(-50%) scale(1.06); }
#lightbox .lb-prev { left: 14px; }
#lightbox .lb-next { right: 14px; }
#lightbox .lb-n {
  position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%);
  font-size: .74rem; letter-spacing: .08em;
  color: color-mix(in srgb, var(--ink, #9aa0a9) 65%, transparent);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 640px) { #lightbox .lb-a { display: none; } }  /* swipe rules phones */

/* ═══════════ AI ONBOARDING — the conversation surface ═══════════ */
body.aionboard #chrome, body.aionboard #mediaBar, body.aionboard #tplRail,
body.aionboard #palRail, body.aionboard #editToggle, body.aionboard #demoBar,
body.aionboard #coach, body.aionboard #showPublish, body.aionboard #landing { display: none !important; }
#aio {
  position: fixed; inset: 0; z-index: 120;
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(240,83,46,.09), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(240,83,46,.05), transparent 60%),
    #0b0c0e;
  color: #e7e9ec;
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
}
#aio.aio-over::after {
  content: 'Drop it anywhere';
  position: fixed; inset: 12px; z-index: 5; pointer-events: none;
  border: 2px dashed rgba(240,83,46,.7); border-radius: 18px;
  display: grid; place-items: center;
  font-weight: 600; color: rgba(236,237,237,.85);
  background: rgba(11,12,14,.55); backdrop-filter: blur(2px);
}
.aio-col {
  height: 100%; max-width: 680px; margin: 0 auto;
  display: flex; flex-direction: column;
  padding: 0 clamp(12px, 4vw, 24px);
}
.aio-head { padding: 18px 4px 10px; }
.aio-mark {
  font-family: 'Libre Franklin', sans-serif; font-weight: 800;
  font-size: 1.05rem; letter-spacing: -.02em;
}
.aio-mark b { color: #f0532e; }
.aio-mark i { font-style: normal; color: #eceded; }
.aio-feed {
  flex: 1; overflow-y: auto; min-height: 0;
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px 0 18px;
  scrollbar-width: thin;
}
.aio-b {
  max-width: 86%;
  padding: .8rem 1rem;
  border-radius: 16px;
  font-size: .95rem; line-height: 1.55;
  animation: aioIn .3s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes aioIn { from { opacity: 0; transform: translateY(8px); } }
.aio-mp {
  align-self: flex-start;
  background: rgba(236,237,237,.06);
  border: 1px solid rgba(236,237,237,.1);
  border-bottom-left-radius: 4px;
}
.aio-me {
  align-self: flex-end;
  background: #f0532e; color: #17120f;
  font-weight: 500;
  border-bottom-right-radius: 4px;
}
.aio-typing { display: flex; gap: 5px; padding: 1rem 1.1rem; }
.aio-typing span {
  width: 7px; height: 7px; border-radius: 999px; background: rgba(236,237,237,.5);
  animation: aioDot 1.1s ease-in-out infinite;
}
.aio-typing span:nth-child(2) { animation-delay: .18s; }
.aio-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes aioDot { 40% { transform: translateY(-5px); opacity: 1; } }
.aio-chips { display: flex; flex-wrap: wrap; gap: 8px; background: none; border: none; padding: .2rem 0; }
.aio-chips button {
  font: inherit; font-size: .88rem; color: #e7e9ec; cursor: pointer;
  padding: .55rem 1rem; border-radius: 999px;
  background: rgba(236,237,237,.07); border: 1px solid rgba(236,237,237,.25);
  transition: border-color .15s, background .15s;
}
.aio-chips button:hover:not(:disabled) { border-color: #f0532e; }
.aio-chips button.on { background: #f0532e; color: #17120f; border-color: #f0532e; }
.aio-chips button:disabled:not(.on) { opacity: .4; }
.aio-cards {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  max-width: 100%; background: none; border: none; padding: .2rem 0;
}
.aio-cards figure {
  position: relative; margin: 0; border-radius: 10px; overflow: hidden;
  aspect-ratio: 1; cursor: pointer; opacity: .35;
  outline: 2px solid transparent; transition: opacity .15s, outline-color .15s;
}
.aio-cards figure.on { opacity: 1; outline-color: rgba(240,83,46,.7); }
.aio-cards img { width: 100%; height: 100%; object-fit: cover; display: block; }
.aio-cards b {
  position: absolute; top: 5px; right: 5px;
  width: 22px; height: 22px; border-radius: 999px;
  background: #f0532e; color: #17120f; font-size: 12px;
  display: none; place-items: center;
}
.aio-cards figure.on b { display: grid; }
.aio-prog { display: flex; align-items: center; gap: 10px; }
.aio-prog i {
  width: 16px; height: 16px; flex: none; border-radius: 999px;
  border: 2px solid rgba(240,83,46,.9); border-top-color: transparent;
  animation: aioSpin .8s linear infinite;
}
@keyframes aioSpin { to { transform: rotate(360deg); } }
.aio-inrow {
  display: flex; gap: 8px; align-items: flex-end;
  padding: 10px 0 max(14px, env(safe-area-inset-bottom, 0px));
}
.aio-inrow[hidden] { display: none; }   /* author display:flex would beat [hidden] */
.aio-inrow textarea {
  flex: 1; resize: none; font: inherit; font-size: .95rem; color: #fff;
  padding: .85rem 1.1rem; border-radius: 999px;
  background: rgba(236,237,237,.07); border: 1px solid rgba(236,237,237,.25);
}
.aio-inrow textarea:focus { outline: none; border-color: rgba(240,83,46,.8); }
.aio-inrow button {
  font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer;
  padding: .85rem 1.3rem; border-radius: 999px; border: none;
  background: #f0532e; color: #17120f;
}
#aioBuild {
  position: sticky; bottom: max(14px, env(safe-area-inset-bottom, 0px));
  margin: 0 0 14px; align-self: center;
  font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer;
  padding: .95rem 1.8rem; border-radius: 999px; border: none;
  background: #eceded; color: #17120f;
  box-shadow: 0 12px 40px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.1);
  animation: aioIn .4s ease both;
}
#aioBuild:hover { transform: translateY(-1px); }
#aioBuild:disabled { opacity: .7; }
@media (max-width: 560px) {
  .aio-cards { grid-template-columns: repeat(3, 1fr); }
  .aio-b { max-width: 94%; }
}
/* files hovering the studio: the page glows to say "drop it anywhere" */
body.studio.drop-ready #stageScroll { outline: 2px dashed rgba(236,237,237,.6); outline-offset: -8px; }
/* the on-page note invites writing when empty */
[data-ppe-note] { outline: none; cursor: text; min-height: 1.4em; }
[data-ppe-note]:empty::before { content: 'A note for them — click here and write…'; opacity: .45; }
/* editing chrome never leaks to a visitor's page */
body.published:not(.pitchedit) .ppe-rm, body.published:not(.pitchedit) #ppeBar, body.published:not(.pitchedit) #ppeAdd { display: none !important; }
/* phone: the bars wrap to two rows — the page must clear the taller bars */
@media (max-width: 640px) {
  body.pitchedit #stageScroll { padding-top: 108px !important; padding-bottom: 128px !important; }
  #ppeBar .ppe-status { flex-basis: 100%; max-width: none; }
}
/* private-page editor: photo strip */
.pe-imgs { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.pe-img { display: flex; flex-direction: column; gap: 3px; width: 92px; }
.pe-img img { width: 92px; height: 66px; object-fit: cover; border-radius: 6px; }
.pe-img button {
  font-family: var(--font-ui); font-size: .68rem; font-weight: 600;
  color: rgba(236,237,237,.75); background: none; border: none;
  cursor: pointer; padding: 2px 0; text-align: left;
}
.pe-img button:hover { color: var(--c-amber); }
/* words & details pop-up */
.tm-sub {
  font-family: var(--font-ui); font-size: .72rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--c-amber); margin: 1.3rem 0 .4rem;
}

/* the Text pop-up */
.im-card--narrow { width: min(560px, 94vw); }
.tm-field { display: block; margin: .8rem 0; }
.tm-field span {
  display: block; font-family: var(--font-ui); font-size: .78rem;
  font-weight: 700; letter-spacing: .04em; color: rgba(236,237,237,.65);
  margin-bottom: .3rem;
}
.tm-field input, .tm-field textarea {
  width: 100%; padding: .55rem .7rem; font: inherit; color: inherit;
  background: rgba(236,237,237,.06);
  border: 1px solid rgba(236,237,237,.14); border-radius: 8px;
  resize: vertical;
}

/* phone: rails hide behind Designs/Colours buttons in the bar */
@media (max-width: 900px) {
  #tplRail, #palRail { display: none; }
  #tplRail.open, #palRail.open {
    display: flex; left: 10px; right: 10px; top: auto; bottom: 74px;
    transform: none; flex-direction: row; max-height: none;
    overflow-x: auto; overflow-y: hidden; padding: 8px; z-index: 62;
  }
  #tplRail .tr-head, #palRail .tr-head { display: none; }
  #tplRail .tr-item { flex-direction: column; gap: 4px; font-size: .68rem; padding: 6px; }
  #tplRail.open, #palRail.open { width: auto; }
  #palRail.open .pal-grid { display: flex; gap: 5px; }
  #palRail.open .pal { width: 44px; height: 30px; flex: none; }
  #palRail.open .tr-wells { display: flex; }
  #palRail.open .well { width: 44px; }
  /* no overflow here: it would CLIP the drop-up More menu to the bar's box */
  #mediaBar { left: 10px; right: 10px; transform: none; bottom: 10px; justify-content: space-between; gap: 2px; }
  #mediaBar .mb-btn { padding: .45rem .6rem; font-size: .76rem; }
  #mediaBar .mb-mobile { display: block; }
  #mediaBar #mbPhotos, #mediaBar #mbMusic, #mediaBar #mbTracks, #mediaBar #mbAIBar { display: none; }
  #mbMenu { position: fixed; right: 10px; bottom: 64px; }
}

/* desktop studio: both rails are permanently on stage — the scroll area
   clears them (and the media bar below) so the chrome FRAMES the page
   instead of sitting on top of the words. :not(.full) outguns the word-rail
   padding-right further down the file. */
@media (min-width: 901px) {
  body.studio:not(.full) #stageScroll {
    padding-left: 226px;
    padding-right: 206px;
    padding-bottom: 96px;
  }
}

#pubSheet {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  background: rgba(8,9,11,.6); backdrop-filter: blur(6px);
}
#pubSheet[hidden] { display: none; }
.pub-card {
  width: min(460px, calc(100% - 2rem));
  padding: 2rem 2.1rem 1.8rem;
  background: var(--c-panel); border: 1px solid var(--c-line); border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
}
.pub-card .mark { width: 30px; height: 30px; margin-bottom: 1rem; }
.pub-card h3 { font-family: var(--font-brand); font-weight: 400; font-size: 1.5rem; margin-bottom: .7rem; }
.pub-card p { font-size: .88rem; line-height: 1.6; color: #aab0ba; }
.pub-card p b { color: var(--c-ink); }
.pub-card .pub-now { margin-top: .8rem; }
.pub-actions { display: flex; gap: .6rem; margin-top: 1.3rem; }
.slug-row {
  display: flex; align-items: center; margin-top: 1.1rem;
  border: 1px solid var(--c-line); border-radius: 10px; overflow: hidden;
  background: rgba(255,255,255,.03);
}
.slug-host {
  padding: .65rem .1rem .65rem .8rem; font-family: var(--font-mono, monospace);
  font-size: .85rem; color: #8a8f99; white-space: nowrap;
}
#pubSlug {
  flex: 1; min-width: 0; padding: .65rem .8rem .65rem .1rem;
  background: none; border: 0; outline: none; color: var(--c-ink);
  font-family: var(--font-mono, monospace); font-size: .85rem;
}
.pub-status { min-height: 1.3em; margin-top: .55rem; font-size: .8rem; }
.pub-status.good { color: #6fce8f; }
.pub-status.bad { color: #e0705a; }
.pub-card .linkish {
  background: none; border: 0; padding: 0; color: var(--c-amber, #f0532e);
  font: inherit; cursor: pointer; text-decoration: underline;
}
.pub-live-url { margin-top: 1rem; font-size: 1.05rem; }
.pub-live-url a, .pub-live-url b { color: var(--c-ink); font-family: var(--font-mono, monospace); }
.pub-sites { margin-top: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.pub-site-row {
  display: flex; align-items: center; gap: .8rem;
  padding: .55rem .8rem; border: 1px solid var(--c-line); border-radius: 10px;
}
.pub-site-row a { color: var(--c-ink); font-family: var(--font-mono, monospace); font-size: .9rem; }
.pub-site-row span { flex: 1; font-size: .78rem; color: #8a8f99; }
.pub-site-row button {
  background: none; border: 1px solid var(--c-line); border-radius: 8px;
  color: #e0705a; font-size: .74rem; padding: .3rem .6rem; cursor: pointer;
}
.pub-site-row button:hover { border-color: #e0705a; }

/* ————— a published site: pure showcase, none of the editor exists ————— */
body.published #topbar, body.published #panel, body.published .pv-toolbar,
body.published #showBar, body.published #demoBar, body.published #showPublish,
body.published #tplRail, body.published #palRail, body.published #mediaBar, body.published #editToggle,
body.published #welcomeIntro, body.published #pubSheet { display: none !important; }
/* THE FREE-TIER BADGE: dressed in the site's own palette (the element
   carries data-palette, so --accent/--bg/--ink resolve to the design's
   colours) — accent ground, page-colour type: of the design, yet
   unmissable. Falls back to the old dark pill when no palette lands. */
#mpBanner {
  position: fixed; right: 14px; bottom: 14px; z-index: 70;
  padding: .55rem .95rem; border-radius: 999px;
  background: var(--accent, rgba(14,15,18,.82));
  border: 1px solid color-mix(in srgb, var(--ink, #fff) 30%, transparent);
  color: var(--bg, #cfd3da); font-size: .74rem; font-weight: 600;
  text-decoration: none;
  box-shadow: 0 8px 30px rgba(0,0,0,.35);
  transition: transform .15s ease, filter .15s ease;
}
#mpBanner b { color: var(--bg, #fff); }
#mpBanner:hover { transform: translateY(-1px); filter: brightness(1.08); }
/* the owner's door back in — quieter twin, page-coloured, other corner */
#mpOwner {
  position: fixed; left: 14px; bottom: 14px; z-index: 70;
  padding: .5rem .85rem; border-radius: 999px;
  background: color-mix(in srgb, var(--bg, #0e0f12) 88%, var(--ink, #fff));
  border: 1px solid color-mix(in srgb, var(--ink, #fff) 22%, transparent);
  color: color-mix(in srgb, var(--ink, #9aa0a9) 72%, var(--bg, #0e0f12));
  font-size: .74rem; text-decoration: none;
  box-shadow: 0 8px 30px rgba(0,0,0,.35);
}
#mpOwner:hover { color: var(--ink, #fff); border-color: color-mix(in srgb, var(--ink, #fff) 40%, transparent); }

/* ————— the landing: the cold caller's first frame ————— */
#landing {
  position: fixed; inset: 0; z-index: 150;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center; gap: 2rem;
  padding: clamp(1.5rem, 5vw, 5rem);
  background:
    radial-gradient(1200px 700px at 82% 40%, rgba(240,83,46,.08), transparent 60%),
    #0e0f12;
  overflow: hidden;
}
#landing[hidden] { display: none; }
.land-type { max-width: 560px; justify-self: end; }
.land-k {
  font-family: 'DM Mono', monospace; font-size: .68rem; letter-spacing: .32em;
  text-transform: uppercase; color: #f0532e; margin-bottom: 1.1rem;
}
.land-wm {
  font-family: 'Libre Franklin', sans-serif; font-weight: 800;
  font-size: clamp(2rem, 4.5vw, 2.8rem); letter-spacing: -.03em; line-height: 1;
  color: #eceded; margin-bottom: 1.6rem;
}
.land-wm .land-p { color: #f0532e; }
.land-wm .land-dot { display: inline-block; animation: bl-beat 1.15s ease-in-out infinite; }
#landing h1 {
  font-family: 'Libre Franklin', sans-serif; font-weight: 800;
  font-size: clamp(2rem, 4.8vw, 3.6rem); letter-spacing: -.03em; line-height: 1.04;
  color: #eceded; margin-bottom: 1.2rem;
}
.land-sub { color: #9aa0aa; font-size: 1.02rem; line-height: 1.65; margin-bottom: 1.8rem; max-width: 46ch; }
.land-sub b { color: #eceded; }
.land-fine { margin-top: 1.2rem; color: #6d727c; font-size: .8rem; }

/* the stack: five cards flipping themselves, CSS only */
.land-stack {
  position: relative; justify-self: start;
  width: min(320px, 34vw); aspect-ratio: 9 / 14;
}
.land-stack img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
  opacity: 0;
  animation: land-cycle 10s ease-in-out infinite;
  animation-delay: calc(var(--i) * 2s);
}
@keyframes land-cycle {
  0%      { opacity: 0; transform: translateY(26px) rotate(2.5deg) scale(.96); }
  4%, 18% { opacity: 1; transform: none; }
  22%     { opacity: 0; transform: translateY(-34px) rotate(-2deg) scale(1.02); }
  100%    { opacity: 0; }
}
.land-tag {
  position: absolute; bottom: -2.2rem; left: 50%; transform: translateX(-50%);
  font-family: 'DM Mono', monospace; font-size: .66rem; letter-spacing: .3em;
  text-transform: uppercase; color: #6d727c; white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
  .land-stack img { animation: none; opacity: 0; }
  .land-stack img[style*="--i:0"] { opacity: 1; }
  .land-wm .land-dot { animation: none; }
}
@media (max-width: 860px) {
  #landing { grid-template-columns: 1fr; align-content: center; }
  .land-type { justify-self: center; text-align: center; }
  .land-sub { margin-inline: auto; }
  .land-stack { display: none; }
}

/* the unmissable road home while an example is showing */
#stashBanner {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 85;
  display: flex; align-items: center; gap: .9rem;
  padding: .55rem .6rem .55rem 1rem; border-radius: 999px;
  background: rgba(14,15,18,.92); backdrop-filter: blur(10px);
  border: 1px solid rgba(240,83,46,.5);
  box-shadow: 0 10px 40px rgba(0,0,0,.45);
}
#stashBanner span { color: #cfd3da; font-size: .8rem; }
#stashBanner button {
  padding: .45rem .9rem; border-radius: 999px; cursor: pointer;
  background: #f0532e; border: 1px solid #f0532e; color: #fff;
  font-size: .8rem; font-weight: 600;
}
#stashBanner button:hover { filter: brightness(1.08); }

/* ————— the private pitch gate ————— */
#pitchGate {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  background: #0c0d0f;
}
#pitchGate .pg-card {
  width: min(400px, calc(100% - 2rem));
  padding: 2.2rem 2.2rem 2rem; text-align: center;
  background: #131519; border: 1px solid rgba(255,255,255,.08); border-radius: 16px;
}
#pitchGate .mark { width: 32px; height: 32px; margin-bottom: 1rem; color: #eceded; }
#pitchGate h2 { color: #eceded; font-family: var(--font-brand); font-weight: 400; margin-bottom: .6rem; }
#pitchGate p { color: #9aa0aa; font-size: .88rem; line-height: 1.6; }
#pitchGate p b { color: #eceded; }
#pitchGate input {
  width: 100%; margin: 1.1rem 0 .8rem; padding: .7rem .9rem; text-align: center;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px; color: #eceded; font-family: var(--font-mono, monospace);
  font-size: 1rem; letter-spacing: .12em; outline: none;
}
#pitchGate input:focus { border-color: #f0532e; }
#pitchGate .btn { width: 100%; }
#pitchGate .pg-err { color: #e0705a; margin-top: .8rem; font-size: .82rem; }

/* ————— preloader overlays ————— */

.pl {
  position: absolute; inset: 0; z-index: 40;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2rem;
  background: var(--bg, #111); color: var(--ink, #eee);
  transition: opacity .5s ease, transform .6s cubic-bezier(.7, 0, .3, 1);
  overflow: hidden;           /* nothing ever escapes into the editor chrome */
  container-type: size;       /* children size against the frame, not the viewport */
  padding: 1rem;
}
.pl p { font-family: var(--font-brand); font-size: clamp(.95rem, 5cqmin, 1.35rem); opacity: .9; text-align: center; text-wrap: balance; }
.pl p.mono { font-family: var(--font-mono); font-size: clamp(.55rem, 2.6cqmin, .7rem); letter-spacing: .22em; text-transform: uppercase; }
.pl.out { opacity: 0; pointer-events: none; }
.pl-page.out { opacity: 1; transform: translateY(-101%); }

@media (prefers-reduced-motion: reduce) {
  .pl, .pl * { animation: none !important; }
  .pl { transition: opacity .2s ease; }
  .pl-page.out { transform: none; }
}

/* signal bars — audio bars resolve into the wordmark */
.pl .pl-bars { display: flex; align-items: flex-end; gap: 6px; height: 44px; }
.pl .pl-bars i { width: 8px; background: var(--accent, #f90); animation: eq 0.9s ease-in-out infinite; }
.pl .pl-bars i:nth-child(1) { animation-delay: 0s; }
.pl .pl-bars i:nth-child(2) { animation-delay: .15s; }
.pl .pl-bars i:nth-child(3) { animation-delay: .3s; }
.pl .pl-bars i:nth-child(4) { animation-delay: .45s; }
.pl .pl-bars i:nth-child(5) { animation-delay: .6s; }
@keyframes eq { 0%, 100% { height: 22%; } 50% { height: 100%; } }

/* needle drop — spindle spins while the progress groove completes */
.pl .pl-disc {
  width: clamp(52px, 22cqmin, 84px); height: clamp(52px, 22cqmin, 84px); border-radius: 50%;
  background: repeating-radial-gradient(circle, var(--ink, #eee) 0 1px, transparent 1px 5px),
              radial-gradient(circle, transparent 55%, color-mix(in srgb, var(--ink, #eee) 18%, transparent) 56%);
  border: 2px solid var(--ink, #eee);
  display: flex; align-items: center; justify-content: center;
  animation: spin 1.2s linear infinite;
}
.pl .pl-disc span { width: 32%; height: 32%; border-radius: 50%; background: var(--accent, #f90); }
@keyframes spin { to { transform: rotate(360deg); } }
.pl .pl-groove { width: clamp(110px, 42cqmin, 170px); height: 2px; background: color-mix(in srgb, var(--ink, #eee) 30%, transparent); }
.pl .pl-groove i { display: block; height: 100%; background: var(--accent, #f90); animation: groove 1.35s linear both; }
@keyframes groove { from { width: 0; } to { width: 100%; } }

/* page turn — a sheet turns away to reveal the name */
.pl .pl-sheet {
  position: absolute; inset: 12% 18%;
  background: var(--surface, #333);
  border: 1px solid color-mix(in srgb, var(--ink, #eee) 25%, transparent);
  transform-origin: left center;
  animation: pageTurn 1.15s cubic-bezier(.6, 0, .3, 1) .25s both;
}
@keyframes pageTurn { to { transform: perspective(900px) rotateY(-88deg); opacity: .1; } }
.pl .pl-name {
  font-family: var(--font-brand);
  font-size: clamp(1.6rem, 5vw, 3.2rem);
  animation: riseIn .9s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes riseIn { from { opacity: 0; transform: translateY(26px); } }

/* aperture — an iris ring widens around the name */
.pl .pl-iris {
  position: absolute; left: 50%; top: 50%;
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--accent, #f90);
  transform: translate(-50%, -50%);
  animation: iris 1.3s cubic-bezier(.5, 0, .2, 1) both;
}
@keyframes iris {
  0% { width: 8cqmin; height: 8cqmin; opacity: 1; border-width: 16px; }
  100% { width: 160cqmax; height: 160cqmax; opacity: 0; border-width: 2px; }
}

/* film leader — 3·2·1 with a sweeping second hand */
.pl .pl-leader {
  position: relative;
  width: clamp(84px, 34cqmin, 130px); height: clamp(84px, 34cqmin, 130px); border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--ink, #eee) 45%, transparent);
  display: grid; place-items: center;
}
.pl .pl-leader::before, .pl .pl-leader::after {
  content: ''; position: absolute; background: color-mix(in srgb, var(--ink, #eee) 30%, transparent);
}
.pl .pl-leader::before { width: 100%; height: 1px; }
.pl .pl-leader::after { width: 1px; height: 100%; }
.pl .pl-leader i {
  position: absolute; inset: 0; border-radius: 50%; z-index: 1;
  background: conic-gradient(color-mix(in srgb, var(--accent, #f90) 30%, transparent) 0deg, transparent 0);
  animation: sweep 1.35s linear both;
}
@keyframes sweep {
  from { background: conic-gradient(color-mix(in srgb, var(--accent, #f90) 30%, transparent) 0deg, transparent 0); }
  to { background: conic-gradient(color-mix(in srgb, var(--accent, #f90) 30%, transparent) 360deg, transparent 0); }
}
.pl .pl-leader span {
  position: absolute; z-index: 2;
  font: 700 clamp(1.8rem, 12cqmin, 3rem) var(--font-ui); opacity: 0;
}
.pl .pl-leader span:nth-of-type(1) { animation: tick .45s steps(1) 0s both; }
.pl .pl-leader span:nth-of-type(2) { animation: tick .45s steps(1) .45s both; }
.pl .pl-leader span:nth-of-type(3) { animation: tick .45s steps(1) .9s both; }
@keyframes tick { 0% { opacity: 1; } 100% { opacity: 0; } }

/* arrival banner */
#arrivalBar {
  display: flex; align-items: center; gap: .8rem;
  padding: .55rem 1rem;
  background: color-mix(in srgb, var(--c-amber) 14%, var(--c-panel));
  border-bottom: 1px solid var(--c-amber);
  font-size: .78rem;
}
#arrivalBar span { flex: 1; }

/* curtain — two panels part around the name */
.pl-curtain::before, .pl-curtain::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 51%; z-index: 1;
  background: var(--surface, #333);
  border-right: 1px solid color-mix(in srgb, var(--ink, #eee) 20%, transparent);
}
.pl-curtain::before { left: 0; animation: curtL 1s cubic-bezier(.7, 0, .3, 1) .3s both; }
.pl-curtain::after { right: 0; border-right: none; border-left: 1px solid color-mix(in srgb, var(--ink, #eee) 20%, transparent); animation: curtR 1s cubic-bezier(.7, 0, .3, 1) .3s both; }
@keyframes curtL { to { transform: translateX(-101%); } }
@keyframes curtR { to { transform: translateX(101%); } }

/* develop — contact frames expose in sequence */
.pl .pl-frames { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pl .pl-frames i {
  width: clamp(34px, 12cqmin, 52px); aspect-ratio: 3/4;
  background: var(--surface, #333);
  border: 1px solid color-mix(in srgb, var(--ink, #eee) 30%, transparent);
  opacity: 0; animation: expose .4s ease-out forwards;
}
.pl .pl-frames i:nth-child(1) { animation-delay: .1s; }
.pl .pl-frames i:nth-child(2) { animation-delay: .32s; }
.pl .pl-frames i:nth-child(3) { animation-delay: .54s; background: var(--accent, #f90); }
.pl .pl-frames i:nth-child(4) { animation-delay: .76s; }
@keyframes expose { from { opacity: 0; filter: brightness(3); } to { opacity: 1; filter: none; } }

/* stamp — the name lands like a rubber stamp */
.pl .pl-stampname {
  animation: stampIn .5s cubic-bezier(.2, 1.4, .4, 1) .25s both;
  border: 3px solid var(--accent, #f90); padding: .35em .7em; rotate: -2deg;
}
@keyframes stampIn { from { opacity: 0; transform: scale(2.4) rotate(4deg); } to { opacity: 1; transform: none; } }

/* spines — book spines shelve themselves */
.pl .pl-spines { display: flex; align-items: flex-end; gap: 5px; height: clamp(48px, 20cqmin, 72px); }
.pl .pl-spines i { width: clamp(9px, 3.4cqmin, 13px); background: var(--ink, #eee); animation: shelf .5s cubic-bezier(.2, .8, .3, 1) both; }
.pl .pl-spines i:nth-child(1) { height: 82%; animation-delay: .05s; }
.pl .pl-spines i:nth-child(2) { height: 100%; animation-delay: .17s; }
.pl .pl-spines i:nth-child(3) { height: 70%; animation-delay: .29s; background: var(--accent, #f90); }
.pl .pl-spines i:nth-child(4) { height: 92%; animation-delay: .41s; }
.pl .pl-spines i:nth-child(5) { height: 64%; animation-delay: .53s; }
@keyframes shelf { from { transform: translateY(110%); } }

/* flash — a photo flash, then the name */
.pl-flash::before { content: ''; position: absolute; inset: 0; background: var(--ink, #eee); animation: flashOut .55s ease-out both; pointer-events: none; }
.pl-flash .pl-name { animation-delay: .3s; }
@keyframes flashOut { from { opacity: 1; } to { opacity: 0; } }

/* billing — a title card assembles line by line */
.pl .pl-billing { display: grid; gap: .9rem; justify-items: center; text-align: center; }
.pl .pl-billing small {
  font-family: var(--font-mono); font-size: clamp(.5rem, 2.2cqmin, .62rem);
  letter-spacing: .34em; text-transform: uppercase; color: var(--accent, #f90);
  opacity: 0; animation: billLine .5s ease-out forwards;
}
.pl .pl-billing p {
  font-family: var(--font-brand); font-size: clamp(1.3rem, 6cqmin, 2.4rem);
  opacity: 0; animation: billLine .6s ease-out .3s forwards;
}
.pl .pl-billing small:last-child { animation-delay: .6s; }
@keyframes billLine { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* "shuffle everything" — the quiet escape hatch beside the scoped shuffle */
.scope-all { font-size: .68rem; color: #8a8f99; }
.scope-all:hover { color: var(--c-amber); }
.scope-all[hidden] { display: none; }

/* ————— the wordmark: ink Media · vermilion Pack · ink dot ————— */
.wm {
  font-family: 'Libre Franklin', sans-serif; font-weight: 800;
  letter-spacing: -.03em; line-height: 1; white-space: nowrap;
}
.wm .wm-p { color: #f0532e; }
.wm .wm-m, .wm .wm-dot { color: inherit; }
.wm-card { display: block; font-size: 1.5rem; margin-bottom: 1rem; color: #eceded; }

/* topbar divider + undo/redo */
.tb-div { width: 1px; height: 1.2rem; background: var(--c-line); margin: 0 .15rem; }
#tbUndo:disabled, #tbRedo:disabled { opacity: .3; cursor: default; }

/* floating item controls [↑ ↓ ✕] */
#itemCtl {
  position: absolute; z-index: 74;   /* inside #stageScroll: scrolls with the page */
  display: flex; gap: .15rem; padding: .2rem;
  background: rgba(14,15,18,.92); border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px; backdrop-filter: blur(8px);
  box-shadow: 0 8px 26px rgba(0,0,0,.45);
  animation: popIn .12s ease-out both;
}
#itemCtl button {
  width: 1.6rem; height: 1.6rem; cursor: pointer;
  display: grid; place-items: center;
  background: none; border: none; border-radius: 5px;
  font-family: var(--font-ui); font-size: .78rem; color: #fff;
}
#itemCtl button:hover { background: var(--c-amber); color: #16110e; }

/* the photo manager overlay */
#imgMgr, .mp-overlay {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  background: rgba(10,11,13,.72); backdrop-filter: blur(8px);
  animation: fadeIn .18s ease-out both;
}
/* media modals: tracks + music & video share the photo manager's card */
.mm-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .3rem; }
.mm-head h3 { font-family: var(--font-ui); font-size: 1.05rem; }
.mm-row {
  display: flex; align-items: center; gap: .5rem;
  padding: .35rem 0; border-bottom: 1px solid rgba(236,237,237,.08);
}
.mm-row input {
  flex: 1; min-width: 0; padding: .4rem .6rem;
  background: rgba(236,237,237,.06); color: inherit;
  border: 1px solid rgba(236,237,237,.14); border-radius: 7px; font: inherit;
}
.mm-row input.mm-pub { flex: 0 1 220px; }
.mm-n { font-family: var(--font-mono, monospace); font-size: .72rem; opacity: .55; width: 1.6em; }
.mm-url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .8; font-size: .85rem; }
.mm-row.mm-drop { outline: 2px dashed var(--c-amber); outline-offset: 2px; border-radius: 8px; }
.mm-add { display: flex; gap: .5rem; margin: .8rem 0 .5rem; }
.mm-add input {
  flex: 1; padding: .45rem .65rem;
  background: rgba(236,237,237,.06); color: inherit;
  border: 1px solid rgba(236,237,237,.14); border-radius: 7px; font: inherit;
}
@media (max-width: 640px) {
  .mm-row { flex-wrap: wrap; }
  .mm-row input.mm-pub { flex: 1 1 100%; }
}
@keyframes fadeIn { from { opacity: 0; } }
.im-card {
  width: min(880px, 94vw); max-height: 88vh; overflow-y: auto;
  background: var(--c-panel); border: 1px solid var(--c-line);
  border-radius: 14px; padding: 1.1rem 1.2rem 1.4rem;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
}
.im-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .9rem; }
.im-head h3 {
  flex: 1; font-family: var(--font-brand); font-size: 1.15rem; font-weight: 560;
  color: var(--c-ink);
}
.im-hint { font-size: .8rem; color: var(--c-dim); margin: -.4rem 0 .8rem; }
.im-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: .6rem;
}
.im-tile {
  position: relative; border-radius: 9px; overflow: hidden;
  background: #0c0d10; border: 1px solid var(--c-line);
}
.im-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
/* tiers: pinned rows the drag understands */
.im-tier { margin-top: 1rem; }
.im-tier .im-sec i {
  font-style: normal; font-weight: 400; font-size: .72rem;
  color: #8a8f99; margin-left: .5rem; letter-spacing: 0;
}
.im-tier .im-grid { min-height: 86px; padding: .45rem; border: 1px dashed var(--c-line); border-radius: 12px; }
.im-hero-slot { grid-template-columns: 110px !important; }
.im-hero-slot.im-over { border-color: var(--c-amber); background: rgba(240,83,46,.06); }
.im-tile[draggable="true"] { cursor: grab; }
.im-tile.im-dragging { opacity: .35; cursor: grabbing; }
.im-empty {
  display: grid; place-items: center; aspect-ratio: 1;
  color: #8a8f99; font-size: .72rem; border: 1px dashed var(--c-line); border-radius: 8px;
}
.im-tile.pick { cursor: pointer; transition: transform .12s, border-color .12s; }
.im-tile.pick:hover { transform: scale(1.03); border-color: var(--c-amber); }
.im-class {
  position: absolute; top: .35rem; left: .35rem;
  padding: .15rem .45rem; border-radius: 999px;
  background: rgba(14,15,18,.85); color: #fff;
  font-family: var(--font-ui); font-size: .6rem; font-weight: 600; letter-spacing: .04em;
}
.im-class.hero { background: var(--c-amber); color: #16110e; }
.im-class.off { background: rgba(255,255,255,.25); }
/* choose a photo, then act on it in words along the bottom of the panel */
.im-tile.on { border-color: var(--c-amber); box-shadow: 0 0 0 2px var(--c-amber); }
.im-bar {
  position: sticky; bottom: -1.4rem; z-index: 2;
  display: flex; flex-wrap: wrap; align-items: center; gap: .35rem;
  margin: 1rem -1.2rem -1.4rem; padding: .75rem 1.2rem;
  background: color-mix(in srgb, var(--c-panel) 94%, transparent);
  border-top: 1px solid var(--c-line); backdrop-filter: blur(8px);
}
.im-bar > span {
  font-family: var(--font-mono); font-size: .58rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--c-dim); margin-right: .2rem;
}
.im-bar button {
  padding: .38rem .75rem; cursor: pointer;
  background: none; border: 1px solid var(--c-line); border-radius: 999px;
  font-family: var(--font-ui); font-size: .76rem; color: var(--c-ink);
  transition: border-color .12s, color .12s, background .12s;
}
.im-bar button:hover { border-color: var(--c-amber); color: var(--c-amber); }
.im-bar button:last-child:hover { border-color: #e5484d; color: #e5484d; }
.im-sec {
  margin: 1.2rem 0 .5rem;
  font-family: var(--font-mono); font-size: .64rem; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--c-dim);
}

/* first-run coach: three sentences, then never again */
#coach {
  position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 84; width: 290px;
  padding: .95rem 1.05rem 1rem;
  background: rgba(18,19,22,.97); border: 1px solid rgba(255,255,255,.16);
  border-radius: 13px; backdrop-filter: blur(12px);
  box-shadow: 0 18px 50px rgba(0,0,0,.55);
  /* playerRise, NOT barRise: barRise ends at translateX(-50%) (it's for
     centred bars) and `both` keeps it — the card sat 145px off its anchor,
     covering the media bar's More button */
  animation: playerRise .3s ease-out both;
}
/* phone: the coach card sat over the bottom tab bar — you couldn't tap
   Colours/Text/More until you dismissed a tip about tapping (blind phone
   tester). Lift it clear above the media bar. */
@media (max-width: 640px) {
  #coach { left: 10px; right: 10px; width: auto; bottom: 76px; }
}
#coach b { display: block; font-family: var(--font-ui); font-size: .9rem; color: #fff; margin-bottom: .55rem; }
#coach ul { list-style: none; display: flex; flex-direction: column; gap: .45rem; margin-bottom: .8rem; }
#coach li {
  display: flex; gap: .55rem; align-items: flex-start;
  font-family: var(--font-ui); font-size: .78rem; line-height: 1.35; color: #c3c8d0;
}
#coach li i { font-style: normal; width: 1.1rem; flex: none; text-align: center; }
#coach li b { display: inline; color: var(--c-amber); margin: 0; font-size: inherit; }
#coach button {
  width: 100%; padding: .5rem; cursor: pointer;
  background: var(--c-amber); border: none; border-radius: 8px;
  font-family: var(--font-ui); font-size: .82rem; font-weight: 600; color: #16110e;
}

/* the gutter: edit mode always keeps room on the right for the section rails */
#stageScroll { position: relative; }
/* room for the word rails — DESKTOP ONLY. On a real narrow browser (not
   just phone-preview .mob) this 7.2rem became a 115px dead black band down
   the right of the editor (blind phone tester, 2026-07-30) */
@media (min-width: 901px) {
  body:not(.full) #stageScroll { padding-right: 7.2rem; }
  body:not(.full) #stageScroll.mob { padding-right: 0; }
}
/* one way to do each thing: on desktop the rail owns section actions, so the
   on-page chip and the between-sections "+" only appear in the phone preview */
#stageScroll:not(.mob) .stage.inline-editing .sec-ctl,
#stageScroll:not(.mob) .stage.inline-editing .sec-add { display: none; }

/* the halo: touch a rail, see exactly which band of the page it drives */
.sec-halo {
  position: absolute; z-index: 6; pointer-events: none;
  border: 2px solid var(--c-amber); border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(8,9,11,.34);
  animation: haloIn .14s ease-out both;
}
@keyframes haloIn { from { opacity: 0; } }

/* small "which part?" menu shared by the rails */
.mini-menu {
  position: fixed; z-index: 79; width: 168px;
  display: flex; flex-direction: column; gap: .2rem; padding: .5rem;
  background: rgba(14,15,18,.96); border: 1px solid rgba(255,255,255,.16);
  border-radius: 11px; backdrop-filter: blur(10px);
  box-shadow: 0 14px 44px rgba(0,0,0,.5);
  animation: popIn .14s ease-out both;
}
.mini-menu button {
  display: block; width: 100%; text-align: left; cursor: pointer;
  padding: .4rem .6rem; background: none; border: none; border-radius: 7px;
  font-family: var(--font-ui); font-size: .8rem; color: #fff;
}
.mini-menu button:hover { background: var(--c-amber); color: #16110e; }

/* words, not emoji: every control says what it does */
.gutter-rail {
  position: absolute; left: 0; z-index: 8;   /* left set per-rail: hugs the page */
  display: flex; flex-direction: column; align-items: stretch; gap: 1px;
  width: 88px; padding: .3rem; border-radius: 9px;
  background: rgba(24,26,31,.9); border: 1px solid rgba(255,255,255,.1);
  backdrop-filter: blur(8px);
  opacity: .9; transition: opacity .16s ease, box-shadow .16s ease;
}
.gutter-rail:hover, .gutter-rail:focus-within {
  opacity: 1; box-shadow: 0 8px 26px rgba(0,0,0,.45);
}
.gutter-rail button {
  width: 100%; cursor: pointer; text-align: left;
  padding: .34rem .5rem;
  background: none; border: none; border-radius: 5px;
  font-family: var(--font-ui); font-size: .76rem; line-height: 1.1; color: #d7dae0;
  transition: background .12s, color .12s;
}
.gutter-rail button:hover:not(:disabled) { background: var(--c-amber); color: #16110e; }
.gutter-rail button.danger { color: #f0959a; }
.gutter-rail button.danger:hover { background: #e5484d; color: #fff; }
.gutter-rail button:disabled { opacity: .3; cursor: default; }
.gutter-rail .gr-type {
  font-family: var(--font-mono); font-size: .5rem; font-style: normal;
  letter-spacing: .12em; text-transform: uppercase; color: #7c828d;
  padding: .3rem .5rem .1rem; border-top: 1px solid rgba(255,255,255,.08);
  margin-top: .15rem;
}

/* layout picker + add menu */
#addMenu {
  position: fixed; z-index: 78; width: 186px;
  display: flex; flex-direction: column; gap: .2rem; padding: .5rem;
  background: rgba(14,15,18,.96); border: 1px solid rgba(255,255,255,.16);
  border-radius: 11px; backdrop-filter: blur(10px);
  box-shadow: 0 14px 44px rgba(0,0,0,.5);
  animation: popIn .14s ease-out both;
}
#addMenu button {
  display: block; width: 100%; text-align: left; cursor: pointer;
  padding: .45rem .6rem; background: none; border: none; border-radius: 7px;
}
#addMenu button:hover { background: rgba(255,255,255,.08); }
#addMenu button b { display: block; font-family: var(--font-ui); font-size: .82rem; color: #fff; }
#addMenu button span { display: block; font-family: var(--font-ui); font-size: .7rem; color: #8d939d; }
.sm-head {
  font-family: var(--font-ui); font-size: .74rem; font-weight: 600; color: #fff;
  margin: .1rem .2rem .45rem;
}
.sm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; }
.sm-ly {
  display: flex; flex-direction: column; align-items: center; gap: .25rem;
  padding: .45rem .3rem; cursor: pointer;
  background: rgba(255,255,255,.04); border: 1.5px solid transparent; border-radius: 8px;
  color: #cfd3da;
}
.sm-ly:hover { background: rgba(255,255,255,.09); }
.sm-ly.on { border-color: var(--c-amber); color: var(--c-amber); }
.sm-ly .ly-thumb { width: 100%; height: 26px; }
.sm-ly span { font-family: var(--font-ui); font-size: .64rem; text-align: center; line-height: 1.2; }

/* section photo strip in the Details drawer (never raw data: URIs) */
.sec-thumbs { display: flex; flex-wrap: wrap; gap: .35rem; margin: .4rem 0 .55rem; }
.sec-thumbs span { position: relative; width: 54px; height: 54px; }
.sec-thumbs img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; display: block; }
.sec-thumbs button {
  position: absolute; top: -5px; right: -5px; width: 18px; height: 18px; cursor: pointer;
  display: grid; place-items: center;
  background: #e5484d; color: #fff; border: none; border-radius: 50%;
  font-size: .6rem; line-height: 1;
}

/* media block — link rows */
.sec-media-list { display: flex; flex-direction: column; gap: .35rem; margin: .4rem 0 .5rem; }
.sec-media-item { display: flex; align-items: center; gap: .5rem; font-size: .78rem; }
.sec-media-tag {
  flex: none; font: 600 9px/1 var(--font-mono, monospace); letter-spacing: .06em; text-transform: uppercase;
  padding: .28rem .45rem; border-radius: 5px; background: rgba(240,83,46,.14); color: #f0532e; min-width: 62px; text-align: center;
}
.sec-media-url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .8; }
.sec-media-item .rm {
  flex: none; width: 18px; height: 18px; cursor: pointer; display: grid; place-items: center;
  background: #e5484d; color: #fff; border: none; border-radius: 50%; font-size: .6rem; line-height: 1;
}
.sec-media-add { display: flex; gap: .4rem; }
.sec-media-add input { flex: 1; min-width: 0; }

/* section menu */
#secMenu {
  position: fixed; z-index: 78; width: 252px;
  display: flex; flex-direction: column; gap: .45rem;
  padding: .6rem;
  background: rgba(14,15,18,.95); border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px; backdrop-filter: blur(10px);
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  animation: popIn .14s ease-out both;
}
#secMenu .sm-row { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
#secMenu .sm-row > span {
  flex-basis: 100%; font-family: var(--font-mono); font-size: .56rem;
  letter-spacing: .16em; text-transform: uppercase; color: #8a8f99;
}
#secMenu button {
  padding: .32rem .6rem; cursor: pointer;
  background: none; border: 1px solid rgba(255,255,255,.18); border-radius: 999px;
  font-family: var(--font-ui); font-size: .72rem; color: #fff;
}
#secMenu button:hover:not(:disabled) { border-color: var(--c-amber); color: var(--c-amber); }
#secMenu button.on { background: var(--c-amber); border-color: var(--c-amber); color: #16110e; }
#secMenu button.danger:hover { border-color: #e5484d; color: #e5484d; }
#secMenu button:disabled { opacity: .35; cursor: default; }

/* manager: paste row, add-selected foot, selected tiles */
.im-paste { display: flex; gap: .5rem; margin-bottom: .9rem; }
.im-paste input {
  flex: 1; padding: .5rem .7rem;
  background: #0c0d10; border: 1px solid var(--c-line); border-radius: 8px;
  font-family: var(--font-ui); font-size: .78rem; color: var(--c-ink);
}
.im-paste input:focus { outline: none; border-color: var(--c-amber); }
.im-foot {
  position: sticky; bottom: -1.4rem; margin: 1rem -1.2rem -1.4rem;
  padding: .8rem 1.2rem; text-align: right;
  background: color-mix(in srgb, var(--c-panel) 92%, transparent);
  border-top: 1px solid var(--c-line); backdrop-filter: blur(8px);
}
.im-foot button:disabled { opacity: .4; cursor: default; }
.im-tile.sel { border-color: var(--c-amber); box-shadow: 0 0 0 2px var(--c-amber); }
.im-tile.sel::after {
  content: '✓'; position: absolute; top: .3rem; right: .3rem;
  width: 1.3rem; height: 1.3rem; display: grid; place-items: center;
  background: var(--c-amber); color: #16110e; border-radius: 50%;
  font-size: .7rem; font-weight: 700;
}

/* undo chip */
#undoChip[hidden] { display: none; }
#undoChip {
  position: fixed; left: 1.1rem; bottom: 1.1rem; z-index: 80;
  display: flex; align-items: center; gap: .7rem;
  padding: .55rem .6rem .55rem 1rem;
  background: rgba(14,15,18,.92); border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px; backdrop-filter: blur(10px);
  box-shadow: 0 10px 34px rgba(0,0,0,.5);
  animation: popIn .16s ease-out both;
  font-family: var(--font-ui); font-size: .78rem; color: #cfd3da;
}
#undoChip button {
  padding: .32rem .8rem; cursor: pointer;
  background: var(--c-amber); border: none; border-radius: 999px;
  font-family: var(--font-ui); font-size: .74rem; font-weight: 600; color: #16110e;
}
#undoChip button:hover { filter: brightness(1.08); }

/* image tap popover */
#imgPop {
  position: absolute; z-index: 75;   /* inside #stageScroll: scrolls with the page */
  display: flex; gap: .3rem; padding: .35rem;
  background: rgba(14,15,18,.92); border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px; backdrop-filter: blur(10px);
  box-shadow: 0 10px 34px rgba(0,0,0,.5);
  animation: popIn .16s ease-out both;
}
@keyframes popIn { from { opacity: 0; transform: scale(.92); } }
#imgPop button {
  padding: .38rem .7rem; cursor: pointer; white-space: nowrap;
  background: none; border: 1px solid transparent; border-radius: 999px;
  font-family: var(--font-ui); font-size: .74rem; color: #fff;
}
#imgPop button:hover { border-color: var(--c-amber); color: var(--c-amber); }

/* mini audio player */
#miniPlayer {
  position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 82;
  display: flex; align-items: center; gap: .6rem;
  width: min(360px, calc(100vw - 2rem));
  padding: .55rem .6rem;
  background: rgba(14,15,18,.94); border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px; backdrop-filter: blur(12px);
  box-shadow: 0 14px 44px rgba(0,0,0,.55);
  animation: barRise .25s ease-out both;
}
#miniPlayer img { width: 42px; height: 42px; border-radius: 7px; object-fit: cover; flex: none; }
#miniPlayer .mp-meta { flex: 1; min-width: 0; }
#miniPlayer .mp-meta b {
  display: block; font-family: var(--font-ui); font-size: .8rem; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#miniPlayer .mp-meta span {
  display: block; font-family: var(--font-ui); font-size: .68rem; color: #9aa0ab;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#miniPlayer .mp-bar {
  position: absolute; left: .6rem; right: .6rem; bottom: .28rem; height: 2px;
  background: rgba(255,255,255,.14); border-radius: 2px; overflow: hidden;
}
#miniPlayer .mp-bar i { display: block; height: 100%; width: 0; background: var(--c-amber); }
#miniPlayer button {
  flex: none; width: 1.9rem; height: 1.9rem; cursor: pointer;
  display: grid; place-items: center;
  background: none; border: none; border-radius: 6px;
  font-size: .85rem; color: #fff;
}
#miniPlayer button:hover { background: rgba(255,255,255,.12); }
#miniPlayer .mp-alt { color: var(--c-amber); }
#miniPlayer .mp-menu {
  position: absolute; right: 0; bottom: calc(100% + .4rem);
  display: flex; flex-direction: column; gap: .1rem;
  width: 100%; max-height: 200px; overflow-y: auto;
  padding: .3rem;
  background: rgba(14,15,18,.97); border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
}
#miniPlayer .mp-menu button {
  width: 100%; height: auto; padding: .4rem .6rem;
  font-size: .72rem; text-align: left; display: block;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* toast */

#toast {
  /* must sit above the publish sheet (80), photo manager (90) and coach (84),
     or "Copied!" silently happens behind them */
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 8px); z-index: 96;
  padding: .6rem 1rem; border-radius: 9px;
  background: var(--c-amber); color: var(--c-amber-ink);
  font-size: .8rem; font-weight: 600;
  opacity: 0; transition: opacity .25s, transform .25s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ————— polish ————— */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #33383f; border-radius: 999px; border: 2px solid var(--c-bg); }
::-webkit-scrollbar-thumb:hover { background: #454b55; }

.chip { position: relative; overflow: hidden; }
.chip:active { transform: scale(.98); }
.chip.on::after {
  content: ''; position: absolute; top: 6px; right: 6px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--c-amber);
}

button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--c-amber); outline-offset: 2px;
}

#stage { transition: background .35s ease; }
.tab { scrollbar-gutter: stable; }

/* ————— home: the front door ————— */

#home {
  position: fixed; inset: 0; z-index: 90;
  overflow-y: auto;
  background:
    radial-gradient(90rem 50rem at 85% -20%, rgba(240,83,46,.14), transparent 60%),
    radial-gradient(70rem 40rem at -10% 110%, rgba(240,83,46,.05), transparent 55%),
    var(--c-bg);
  color: var(--c-ink);
  transition: opacity .45s ease, transform .45s cubic-bezier(.6,0,.3,1);
}
#home.leaving { opacity: 0; transform: translateY(-2.5%); pointer-events: none; }

#home .h-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem clamp(1.2rem, 5vw, 4rem);
}
#home .brand { font-family: var(--font-brand); font-size: 1.35rem; }

.h-kicker {
  font-family: var(--font-mono); font-size: .66rem; font-weight: 500;
  letter-spacing: .26em; text-transform: uppercase; color: var(--c-amber);
}

.h-hero {
  padding: clamp(3rem, 10vh, 7rem) clamp(1.2rem, 5vw, 4rem) clamp(3rem, 8vh, 5rem);
  max-width: 1080px;
}
.h-hero h1 {
  margin: 1.6rem 0 1.4rem;
  font-family: var(--font-brand); font-weight: 400;
  font-size: clamp(3rem, 8.5vw, 6.4rem); line-height: .95; letter-spacing: -.01em;
  animation: homeRise .8s cubic-bezier(.2,.7,.2,1) both;
}
.h-hero h1 i { color: var(--c-amber); }
.h-sub {
  max-width: 56ch; color: #aab0ba; font-size: 1.02rem; line-height: 1.65;
  animation: homeRise .8s cubic-bezier(.2,.7,.2,1) .1s both;
}
.h-cta { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; margin-top: 2.2rem;
  animation: homeRise .8s cubic-bezier(.2,.7,.2,1) .18s both; }
.btn.lg { font-size: .95rem; padding: .85rem 1.5rem; border-radius: 9px; }
.h-note { font-family: var(--font-mono); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--c-dim); }

#home .h-personas {
  display: flex; align-items: center; gap: .45rem; flex-wrap: wrap;
  margin-top: 1.3rem;
}
#home .h-personas span {
  font-family: var(--font-mono); font-size: .6rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--c-dim);
  margin-right: .3rem;
}
#home .h-personas button {
  padding: .34rem .8rem; cursor: pointer;
  background: none; border: 1px solid var(--c-line); border-radius: 999px;
  font-family: var(--font-ui); font-size: .78rem; color: var(--c-ink);
  transition: border-color .15s, color .15s;
}
#home .h-personas button:hover { border-color: var(--c-amber); color: var(--c-amber); }
#home .h-personas button.on { border-color: var(--c-amber); }
#home .h-persona-back {
  padding: .34rem .8rem; cursor: pointer;
  background: var(--c-amber); border: 1px solid var(--c-amber); border-radius: 999px;
  font-family: var(--font-ui); font-size: .78rem; font-weight: 600; color: var(--c-amber-ink);
}
@keyframes homeRise { from { opacity: 0; transform: translateY(22px); } }

.h-designs { padding: clamp(2rem, 6vh, 4rem) clamp(1.2rem, 5vw, 4rem) 3rem; border-top: 1px solid var(--c-line); }
.h-designs-head { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: end; margin-bottom: 2rem; }
.h-designs-head h2 { grid-column: 1; margin-top: 1rem; font-family: var(--font-brand); font-weight: 400; font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.02; }
.h-designs-sub { grid-column: 2; max-width: 34ch; color: var(--c-dim); font-size: .82rem; line-height: 1.55; text-align: right; }

.h-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .8rem; }
.h-card {
  display: grid; grid-template-columns: 84px 1fr auto; align-items: center; gap: .9rem;
  padding: .8rem; cursor: pointer; text-align: left;
  background: var(--c-panel); color: var(--c-ink);
  border: 1px solid var(--c-line); border-radius: 11px;
  font-family: var(--font-ui);
  animation: homeRise .7s cubic-bezier(.2,.7,.2,1) var(--d, 0ms) both;
  transition: border-color .18s ease, transform .18s ease;
}
.h-card:hover { border-color: var(--c-amber); transform: translateY(-2px); }
.h-card .tpl-thumb { height: 56px; }
.h-card-copy b { display: block; font-size: .88rem; font-weight: 600; }
.h-card-copy small { color: var(--c-dim); font-size: .68rem; line-height: 1.3; }
.h-card > i { font-style: normal; color: var(--c-dim); transition: color .18s, transform .18s; }
.h-card:hover > i { color: var(--c-amber); transform: translateX(3px); }

.h-palettes { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.6rem; }
.h-dot {
  display: inline-flex; width: 34px; height: 20px; border-radius: 999px; overflow: hidden;
  border: 1px solid rgba(255,255,255,.14);
}
.h-dot i { flex: 1; }
.h-dot .da { background: var(--bg); }
.h-dot .db { background: var(--accent); }

.h-foot {
  padding: 2.2rem clamp(1.2rem, 5vw, 4rem) 2.6rem;
  border-top: 1px solid var(--c-line);
  display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  font-size: .8rem; color: #aab0ba;
}
.h-foot b { color: var(--c-ink); }
.h-fine { font-family: var(--font-mono); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; color: var(--c-dim); }

@media (max-width: 1620px) {
  .src { display: none; }
  .tb-shuffle { position: static; transform: none; margin-left: auto; }
}
@media (max-width: 800px) {
  #tbShuffle { font-size: .72rem; padding: .42rem .6rem; }
}

/* narrow topbar: one row, always — buttons shed labels, never wrap or clip */
#topbar .btn, .tb-shuffle .btn { white-space: nowrap; }
.brand .wm-c { display: none; font-weight: 800; letter-spacing: -.02em; }
@media (max-width: 1080px) {
  .actions .bl { display: none; }
  .actions .btn { padding: .48rem .6rem; }
  #topbar { gap: .6rem; }
  #topbar .brand em { display: none; }
}
@media (max-width: 920px) {
  /* destructive pair moves to the panel's More step — Housekeeping */
  #btnReset, #btnForget { display: none; }
}
@media (max-width: 560px) {
  #topbar {
    height: auto; min-height: 44px;
    padding: .35rem .6rem; gap: .3rem .4rem;
  }
  /* full wordmark → MP. — branded, never invisible */
  .brand .wm { display: none; }
  .brand .wm-c { display: inline; font-size: 1rem; }
  .tb-shuffle .bl { display: none; }
  .tb-shuffle { gap: .2rem; }
  #tbBack, #tbFwd { display: none; }
  .tb-div { display: none; }
  .actions { margin-left: auto; justify-content: flex-end; }
  /* thumb-sized undo/redo */
  #tbUndo, #tbRedo { min-width: 40px; min-height: 40px; }
  /* Photos lives in step 3, More is a step — Edit and Preview must fit */
  #btnPhotos, #btnDetails, #btnAccount { display: none; }
}

/* small screens: the drawer rises as a bottom sheet instead */
@media (max-width: 860px) {
  #panel {
    top: auto; left: 0; width: 100%; height: min(62vh, 520px);
    border-left: none; border-top: 1px solid var(--c-line);
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -18px 48px rgba(0,0,0,.4);
    transform: translateY(calc(100% + 30px));
  }
  body.panel-open #panel { transform: none; }
  .src { display: none; }
  .h-designs-head { grid-template-columns: 1fr; }
  .h-designs-sub { grid-column: 1; text-align: left; }
}

/* edition rows nest under their site */
.pub-edn-row { margin-left: 1.2rem; border-style: dashed; }
.pub-edn-row a { font-size: .82rem; color: #b9bec7; }

/* signed-in signal: a quiet vermilion dot, set by a local flag only */
#btnAccount.in::after, #showAccount.in::after {
  content: ''; display: inline-block; width: 7px; height: 7px;
  margin-left: 7px; border-radius: 50%; background: var(--c-amber);
  vertical-align: 2px;
}

/* ——— the Studio ——— */
body.in-studio #chrome, body.in-studio #landing, body.in-studio #welcomeIntro { display: none; }
/* the editor is an app shell (body locked); the Studio is a PAGE — it scrolls */
html:has(body.in-studio), body.in-studio { overflow: auto; height: auto; }
#studio { min-height: 100dvh; background: var(--c-bg, #121316); color: var(--c-ink, #eceded); }
.st-head { display: flex; align-items: center; gap: 1rem; padding: .9rem clamp(1rem, 4vw, 2.4rem); border-bottom: 1px solid var(--c-line); }
.st-head .wm { text-decoration: none; }
.st-title { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--c-dim); }
.st-spacer { flex: 1; }
.st-main { max-width: 1100px; margin: 0 auto; padding: 1.6rem clamp(1rem, 4vw, 2.4rem) 4rem; }
.st-loading { color: var(--c-dim); padding: 3rem 0; }
.st-loading a { color: var(--c-amber); }
.st-row { margin-top: 2.2rem; }
.st-row h2 { font-size: 1.05rem; font-weight: 700; letter-spacing: .01em; }
.st-hint { margin: .3rem 0 1rem; font-size: .78rem; color: var(--c-dim); }
.st-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .9rem; }
.st-card { border: 1px solid var(--c-line); border-radius: 12px; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .45rem; background: rgba(255,255,255,.02); }
.st-card b { font-size: .92rem; overflow-wrap: anywhere; }
.st-card p { font-size: .74rem; color: var(--c-dim); }
.st-acts { display: flex; gap: .5rem; margin-top: auto; padding-top: .5rem; flex-wrap: wrap; }
.st-new { border-style: dashed; }
.st-soon { opacity: .75; }
.st-site { border-color: color-mix(in srgb, var(--c-amber) 45%, var(--c-line)); }

/* studio gallery minis: the real page, live, scaled to a card */
.st-mini { display: block; aspect-ratio: 16/10; overflow: hidden; border-radius: 8px;
  border: 1px solid var(--c-line); background: #0d0e10; pointer-events: none; }
.st-mini iframe { width: 400%; height: 400%; border: 0;
  transform: scale(.25); transform-origin: top left; pointer-events: none; }

/* studio, composed: the site leads at double width, reels are phone-shaped */
.st-cards { align-items: stretch; }
.st-site { grid-column: span 2; }
.st-site .st-mini { aspect-ratio: 16/9; }
.st-mini--flip { aspect-ratio: 9/14; max-width: 180px; }
.st-mini--flip iframe { width: 400%; height: 400%; transform: scale(.25); }
.st-lock { display: grid; place-items: center; gap: .2rem; aspect-ratio: 16/10;
  border: 1px solid var(--c-line); border-radius: 8px; background: rgba(255,255,255,.03); }
.st-lock i { font-style: normal; letter-spacing: .35em; color: var(--c-amber); font-size: .8rem; }
.st-lock em { font-style: normal; font-family: var(--font-mono); font-size: .62rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--c-dim); }
.st-new { background: rgba(240,83,46,.04); }
.st-row h2 { font-size: 1.15rem; }
@media (max-width: 560px) { .st-site { grid-column: span 1; } }

/* pitch code: pre-made, readable, one press to reroll */
.pp-code-lab { margin: .9rem 0 .4rem; font-size: .74rem; color: var(--c-dim); }
.pp-code-row { display: flex; gap: .5rem; align-items: center; }
.pp-code-row input { flex: 1; font-family: var(--font-mono); letter-spacing: .06em; }

/* ══════════════════════════════════════════════════════════════════════
   A PUBLISHED PAGE IS A PAGE, NOT A PREVIEW

   Publishing reuses the editor shell with the furniture hidden, so a
   visitor inherited the editor's layout: body locked to 100vh with
   `overflow: hidden`, and #stageScroll — a div four levels down — doing
   the scrolling inside it.

   A desktop browser handles a nested scroller perfectly, and so does a
   desktop browser pretending to be a phone, which is why every check
   passed. A real phone does not: the address bar never collapses, flick
   momentum and rubber-banding fight the inner box, and a stage 8,000px
   tall holding 100+ images is exactly where a phone stops painting what
   is far down — the visitor scrolls into black.

   So on a published page the chain is unwound and the DOCUMENT scrolls,
   the way every other website on the internet does. The editor is
   untouched: every rule here is behind body.published.
   ══════════════════════════════════════════════════════════════════════ */

/* the FlipBook is a paged experience that deliberately locks the viewport
   and turns pages — it must keep the fixed frame, so it is excluded here */
body.published:not(.flipmode),
html:has(body.published:not(.flipmode)) {
  overflow: visible;
  height: auto;
  min-height: 100%;
}
body.published:not(.flipmode) #chrome { display: block; height: auto; }
body.published:not(.flipmode) #workbench { display: block; flex: none; min-height: 0; height: auto; }
body.published:not(.flipmode) #previewWrap { display: block; flex: none; height: auto; }
body.published:not(.flipmode) #stageScroll {
  flex: none;
  overflow: visible;
  min-height: 0;
  height: auto;
  padding: 0;
  background: none;
}
/* the stage was a framed card floating on the editor's canvas; published, it
   IS the page — full bleed, no rounding, no shadow, no height floor */
body.published:not(.flipmode) #stageScroll .stage,
body.published:not(.flipmode) #stageScroll.mob .stage {
  max-width: none;
  min-height: 0;
  margin: 0;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
}

/* ══════════════════════════════════════════════════════════════════════
   THE PLAYER AND THE BANNER ON A PHONE

   Both are fixed to the bottom-right. On a desktop the player is 360px and
   the banner sits clear of it; on a 390px phone the player is nearly the
   full width, so the two land on top of each other — which is what "the
   media player is off screen" actually was.

   On a phone the player spans the width above the home indicator, and the
   banner steps up out of its way while something is playing.
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  #miniPlayer {
    left: 8px;
    right: 8px;
    width: auto;
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
  }
  #mpBanner {
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    right: 10px;
  }
  #mpOwner {
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    left: 10px;
  }
  body:has(#miniPlayer) #mpBanner, body:has(#miniPlayer) #mpOwner {
    bottom: calc(74px + max(10px, env(safe-area-inset-bottom, 0px)));
  }
}

/* THE PLAYER WAS NEVER WHERE ITS CSS SAID.

   #miniPlayer borrowed `barRise`, an animation written for bars that are
   centred with `left: 50%`. Its final keyframe is `transform:
   translateX(-50%)`, and with `animation-fill-mode: both` that shift STAYS
   after the animation finishes. So the player sat permanently half its own
   width to the left of wherever it was positioned — about 182px.

   On a desktop, anchored bottom-right at 360px wide, that looked like a
   deliberate inset and nobody questioned it. On a 390px phone spanning the
   width, it hangs off the screen. Same bug both places; only the phone made
   it obvious.

   Its own rise, with no horizontal shift. */
@keyframes playerRise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
#miniPlayer { animation: playerRise .25s ease-out both; }

/* ══ TRACKS MANAGER v2 — a music tool, not a spreadsheet ══════════════════
   One readable row per track: status-coloured play button (green = will
   definitely play the right thing), full-width fields that never truncate,
   the wrong-match picker IN the row (it used to hide inside the player),
   icon actions instead of four text buttons. */
.mm2-row {
  display: grid;
  grid-template-columns: 40px 3ch minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  padding: 10px 8px;
  border-radius: 10px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.mm2-row:hover { background: rgba(255,255,255,.03); }
.mm2-row.mm-drop { background: rgba(94,234,132,.08); outline: 1px dashed rgba(94,234,132,.5); }
.mm2-play {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.28);
  background: none; color: #eceded;
  font-size: 12px; cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.mm2-play:hover { border-color: #fff; background: rgba(255,255,255,.1); }
.mm2-play.mm-found { border-color: #1db954; color: #1db954; }
.mm2-play.mm-found:hover { background: #1db954; color: #fff; }
.mm2-n { font: 500 11px var(--font-mono, monospace); color: #8a8f98; }
.mm2-fields { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mm2-fields input {
  width: 100%;
  background: rgba(255,255,255,.05);
  border: 1px solid transparent;
  border-radius: 7px;
  color: #eceded;
  font: 500 13.5px/1.4 var(--font-ui, sans-serif);
  padding: 7px 10px;
}
.mm2-fields input:focus { border-color: rgba(255,255,255,.25); outline: none; background: rgba(255,255,255,.08); }
.mm2-fields .mm2-pub { font-size: 12px; color: #a9aeb8; }
.mm2-cands {
  width: 100%;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 7px;
  color: #cfd3da;
  font: 500 12px var(--font-ui, sans-serif);
  padding: 6px 8px;
}
.mm2-acts { display: flex; gap: 4px; }
.mm2-ic {
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid transparent;
  background: none; color: #a9aeb8;
  font-size: 13px; cursor: pointer;
}
.mm2-ic:hover { background: rgba(255,255,255,.09); color: #fff; }
.mm2-ic:disabled { opacity: .25; cursor: default; }
.mm2-ic.mm2-up {
  width: auto;
  padding: 0 11px;
  font: 600 11.5px/1 var(--font-ui, sans-serif);
  border: 1px solid rgba(255,255,255,.22);
  white-space: nowrap;
}
.mm2-ic.mm2-up.mm-found { border-color: #1db954; }
.mm2-ic.mm-found { color: #1db954; }
@media (max-width: 640px) {
  .mm2-row { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .mm2-n { display: none; }
}

/* ══ BIO SPIN — RoyaltyPro writes ten bios; the owner should get to try
   them, not be stuck with whichever arrived first ══════════════════════ */
#bioSpin {
  position: absolute;
  z-index: 55;
  transform: translateY(-110%);
  font: 600 11px/1 var(--font-ui, sans-serif);
  letter-spacing: .04em;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(14,15,18,.9);
  color: #eceded;
  cursor: pointer;
  backdrop-filter: blur(8px);
}
#bioSpin:hover { border-color: var(--c-amber, #f0b429); color: var(--c-amber, #f0b429); }

/* THE VIDEO-HERO CHIP: the control lives ON the hero while editing —
   super obvious, exactly where the effect happens */
.mp-vh-chip {
  display: none;   /* revealed by the studio, like every edit aid */
  position: absolute; top: 14px; left: 14px; z-index: 6;
  font: 600 .78rem/1 'Inter', ui-sans-serif, sans-serif;
  color: #fff; cursor: pointer;
  padding: .55rem .9rem; border-radius: 999px;
  background: rgba(10,11,13,.78); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.3);
  transition: border-color .15s, background .15s;
}
body.studio .mp-vh-chip { display: block; }
.mp-vh-chip:hover { border-color: #f0532e; }
.mp-vh-chip.on { background: #f0532e; color: #17120f; border-color: #f0532e; }
/* phone: the long chip reached the centre and drew under the Preview pill
   (blind phone tester) — drop it below the top bar */
@media (max-width: 640px) {
  .mp-vh-chip { top: 58px; font-size: .72rem; padding: .45rem .7rem; }
}

/* AI conversation escape hatches */
.aio-head { display: flex; align-items: center; justify-content: space-between; }
.aio-headacts { display: flex; gap: 8px; }
.aio-headacts button {
  font: inherit; font-size: .78rem; color: #9aa0a9; cursor: pointer;
  padding: .4rem .8rem; border-radius: 999px;
  background: rgba(236,237,237,.06); border: 1px solid rgba(236,237,237,.18);
}
.aio-headacts button:hover { color: #fff; border-color: rgba(240,83,46,.7); }

/* ═════════ THE COPILOT DRAWER ═════════ */
#copilot {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 88;
  width: min(380px, 92vw);
  display: flex; flex-direction: column;
  background: rgba(10,11,13,.97); backdrop-filter: blur(14px);
  border-left: 1px solid rgba(255,255,255,.12);
  box-shadow: -18px 0 60px rgba(0,0,0,.5);
  animation: cpIn .28s cubic-bezier(.2,.7,.2,1) both;
  font-family: 'Inter', ui-sans-serif, sans-serif;
}
@keyframes cpIn { from { transform: translateX(30px); opacity: 0; } }
.cp-head {
  display: flex; align-items: baseline; gap: 8px;
  padding: 14px 16px 10px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.cp-head b { color: #f0532e; font-size: .95rem; }
.cp-head span { color: #9aa0a9; font-size: .7rem; flex: 1; }
.cp-head button {
  font: inherit; color: #9aa0a9; cursor: pointer; background: none; border: none; font-size: 1rem;
}
.cp-head button:hover { color: #fff; }
.cp-feed {
  flex: 1; overflow-y: auto; min-height: 0;
  display: flex; flex-direction: column; gap: 8px; padding: 12px;
  scrollbar-width: thin;
}
.cp-b {
  max-width: 92%; padding: .6rem .8rem; border-radius: 12px;
  font-size: .85rem; line-height: 1.5; color: #e7e9ec;
  animation: aioIn .25s ease both;
}
.cp-mp { align-self: flex-start; background: rgba(236,237,237,.06); border: 1px solid rgba(236,237,237,.1); border-bottom-left-radius: 4px; }
.cp-me { align-self: flex-end; background: #f0532e; color: #17120f; font-weight: 500; border-bottom-right-radius: 4px; }
.cp-think { display: flex; gap: 4px; padding: .8rem; }
.cp-think span { width: 6px; height: 6px; border-radius: 999px; background: rgba(236,237,237,.5); animation: aioDot 1.1s ease-in-out infinite; }
.cp-think span:nth-child(2) { animation-delay: .18s; }
.cp-think span:nth-child(3) { animation-delay: .36s; }
.cp-receipt { border-color: rgba(240,83,46,.4); font-family: 'DM Mono', ui-monospace, monospace; font-size: .76rem; }
.cp-back {
  margin-top: 8px; font: 600 .76rem 'Inter', sans-serif; cursor: pointer;
  color: #e7e9ec; padding: .35rem .7rem; border-radius: 999px;
  background: rgba(236,237,237,.08); border: 1px solid rgba(236,237,237,.25);
}
.cp-back:hover:not(:disabled) { border-color: #f0532e; }
.cp-back:disabled { opacity: .6; }
.cp-inrow { display: flex; gap: 8px; padding: 10px 12px max(12px, env(safe-area-inset-bottom, 0px)); border-top: 1px solid rgba(255,255,255,.08); }
.cp-inrow textarea {
  flex: 1; resize: none; font: inherit; font-size: .85rem; color: #fff;
  padding: .6rem .85rem; border-radius: 999px;
  background: rgba(236,237,237,.07); border: 1px solid rgba(236,237,237,.25);
}
.cp-inrow textarea:focus { outline: none; border-color: rgba(240,83,46,.8); }
.cp-inrow button {
  font: inherit; font-weight: 600; font-size: .84rem; cursor: pointer;
  padding: .6rem 1rem; border-radius: 999px; border: none;
  background: #f0532e; color: #17120f;
}
/* the page shifts over so the copilot never covers the work */
@media (min-width: 1101px) {
  body.copiloting.studio:not(.full) #stageScroll { padding-right: 400px !important; }
  body.copiloting #palRail { display: none; }
}
@media (max-width: 1100px) {
  body.copiloting #palRail, body.copiloting #tplRail { display: none; }
}

/* markdown inside copilot bubbles */
.cp-b ul { margin: .3rem 0 .3rem 1.1rem; display: flex; flex-direction: column; gap: .25rem; }
.cp-b code { font-family: 'DM Mono', ui-monospace, monospace; font-size: .78rem; background: rgba(236,237,237,.1); padding: .1rem .35rem; border-radius: 5px; }
.cp-b a { color: #f0864a; text-decoration: underline; }
.cp-b b { color: #fff; }

/* AI sign-in gate: explain the account BEFORE the raw Clerk box. z-index
   ABOVE the landing (z-150) — it opens straight off the landing's AI
   button and was hiding behind it. */
#aiGate { z-index: 160; }
.aig-card { max-width: 440px; text-align: center; }
.aig-mark { font-family: var(--font-ui); font-weight: 700; font-size: 1.05rem; margin-bottom: .8rem; }
.aig-mark b { color: var(--c-amber); }
.aig-card p { font-size: .9rem; line-height: 1.5; color: #c3c8d0; margin: 0 0 .7rem; }
.aig-why b { color: #fff; }
.aig-acts { display: flex; flex-direction: column; gap: .5rem; margin: 1.1rem 0 .6rem; }
.aig-fine { font-size: .76rem; color: #9aa0a9; }
/* the landing's returning-owner sign-in link */
#landSignIn.linkish {
  margin-top: .5rem; display: inline-block;
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--c-amber, #f0532e); font: inherit; font-weight: 600; text-decoration: underline;
}
