/* Two modes, switched by the poster on the wall: a dark poster hangs in a dark,
   neon-lit room; a light poster hangs in daylight. Same two neons in both. */
:root {
  --bg: #0d0d1a;
  --bg-2: #14142a;
  --ink: #eaf7ff;
  --ink-2: #98a4c6;
  --line: rgba(130, 160, 255, 0.24);
  --field: #12122a;
  --neon: #00f0ff;
  --hot: #ff2bd6;
  --on-neon: #04141a;
  --on-hot: #1a0016;
  --glow: 0 0 18px rgba(0, 240, 255, 0.45);
  --glow-hot: 0 0 22px rgba(255, 43, 214, 0.55);
  --wall:
    radial-gradient(60% 46% at 24% 30%, rgba(255, 43, 214, 0.34), rgba(255, 43, 214, 0) 70%),
    radial-gradient(58% 48% at 78% 68%, rgba(0, 240, 255, 0.30), rgba(0, 240, 255, 0) 70%),
    linear-gradient(180deg, #0b0b18 0%, #0d0d1f 60%, #07070f 100%);
  --frame-shadow: 0 34px 60px -22px rgba(0, 0, 0, 0.9), 0 0 60px -10px rgba(0, 240, 255, 0.25);
  --focus: #00f0ff;
  --error: #ff7a8a;
  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --text: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
:root[data-mode="light"] {
  --bg: #fbfbfd;
  --bg-2: #f0f1f6;
  --ink: #0d0d1a;
  --ink-2: #555a72;
  --line: rgba(13, 13, 26, 0.17);
  --field: #ffffff;
  --neon: #008a99;
  --hot: #d6009e;
  --on-neon: #ffffff;
  --on-hot: #ffffff;
  --glow: none;
  --glow-hot: 0 8px 22px -8px rgba(214, 0, 158, 0.6);
  --wall:
    radial-gradient(120% 90% at 18% 8%, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, #e2e4ea 0%, #e2e4ea 62%, #d2d5dd 100%);
  --frame-shadow: 0 30px 50px -22px rgba(20, 28, 40, 0.55), 0 8px 14px -6px rgba(20, 28, 40, 0.35);
  --focus: #d6009e;
  --error: #b3261e;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--text);
  transition: background-color 0.35s, color 0.35s;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

.testbar {
  margin: 0;
  padding: 8px 16px;
  background: #07070f;
  color: #00f0ff;
  font-size: 14px;
  text-align: center;
}

/* ── studio: wall on the left, panel on the right ─────────────────────────── */

.studio {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 1fr);
  align-items: start;
}

.wall {
  transition: background 0.35s;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: grid;
  place-items: center;
  padding: 4vh 4vw 12vh;
  background: var(--wall);
  overflow: hidden;
}
.hang { position: relative; height: min(72vh, 100%); aspect-ratio: 3 / 4; max-width: 100%; }
.hang[data-size="21x30"] { aspect-ratio: 210 / 297; height: min(56vh, 100%); }

.frame {
  position: relative;
  height: 100%;
  padding: 3.2%;
  background: #17181a;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, var(--frame-shadow);
  transition: background-color 0.25s, padding 0.25s;
}
.frame[data-frame="white"] { background: #f4f3ef; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), var(--frame-shadow); }
.frame[data-frame="oak"] { background: linear-gradient(92deg, #b98d57, #c79c66 40%, #b4854f 75%, #c29660); }
.frame[data-frame="none"] { padding: 0; background: none; box-shadow: 0 18px 30px -16px rgba(20, 28, 40, 0.5), 0 2px 5px rgba(20, 28, 40, 0.25); }

.sheet {
  position: relative;
  height: 100%;
  overflow: hidden;
  background: #e9eaea;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 3px 8px rgba(0, 0, 0, 0.45) inset;
  touch-action: none;
  cursor: grab;
}
.frame[data-frame="none"] .sheet { box-shadow: none; }
.sheet.dragging { cursor: grabbing; }
.sheet.placing { cursor: crosshair; }
.sheet img { position: absolute; display: block; user-select: none; -webkit-user-drag: none; }
/* The map is drawn wider than the sheet (--pad on each side) so it can be dragged;
   the lettering is its own layer on top and does not move with it. */
#poster {
  left: calc(-100% * var(--pad, 0));
  top: calc(-100% * var(--pad, 0));
  width: calc(100% * (1 + 2 * var(--pad, 0)));
  height: calc(100% * (1 + 2 * var(--pad, 0)));
}
#overlay { inset: 0; width: 100%; height: 100%; pointer-events: none; }
#poster:not([src]), #overlay:not([src]) { visibility: hidden; }
/* glass: one soft reflection across the corner */
.frame:not([data-frame="none"]) .sheet::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.04) 22%, rgba(255, 255, 255, 0) 40%);
  pointer-events: none;
}
.busy {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--hot), var(--neon), transparent);
  background-size: 40% 100%;
  background-repeat: no-repeat;
  animation: slide 1.1s linear infinite;
  z-index: 2;
}
@keyframes slide { from { background-position: -40% 0; } to { background-position: 140% 0; } }

.shadow {
  position: absolute;
  left: 6%; right: 6%; bottom: -5%;
  height: 5%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0));
  filter: blur(6px);
}
.hint {
  position: absolute;
  bottom: 6vh;
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
}

/* ── panel ────────────────────────────────────────────────────────────────── */

.panel {
  padding: 28px clamp(20px, 3.4vw, 52px) 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.brand { margin-bottom: clamp(28px, 7vh, 72px); }
.mark {
  font: 700 17px/1 var(--display);
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.mark span { font-weight: 400; color: var(--hot); }

h1 {
  margin: 0 0 16px;
  font: 700 clamp(34px, 3.6vw, 54px) / 1.02 var(--display);
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.lede { margin: 0 0 28px; max-width: 46ch; font-size: 18px; color: var(--ink-2); }
.lede strong { color: var(--ink); white-space: nowrap; }

h2 {
  margin: 32px 0 12px;
  font: 600 15px/1.2 var(--text);
  color: var(--ink);
}

.find { position: relative; }
.find label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 15px; }
.find-row { display: flex; gap: 8px; flex-wrap: wrap; }
.find input {
  flex: 1 1 220px;
  min-width: 0;
  height: 52px;
  padding: 0 16px;
  border: 1.5px solid var(--neon);
  border-radius: 4px;
  background: var(--field);
  box-shadow: var(--glow);
  font-size: 18px;
}
.find input::placeholder { color: var(--ink-2); opacity: 0.8; }
.ghost {
  height: 52px;
  padding: 0 16px;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  background: transparent;
  white-space: nowrap;
}
.ghost:hover { border-color: var(--neon); color: var(--neon); }
.results {
  position: absolute;
  z-index: 5;
  left: 0; right: 0;
  margin: 4px 0 0;
  padding: 4px;
  list-style: none;
  background: var(--field);
  border: 1.5px solid var(--neon);
  border-radius: 4px;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.6);
}
.results li { padding: 9px 12px; border-radius: 3px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.results li small { color: var(--ink-2); text-align: right; }
.results li[aria-selected="true"], .results li:hover { background: var(--bg-2); color: var(--neon); }
.find-note { min-height: 21px; margin: 8px 0 0; font-size: 14px; color: var(--ink-2); }

.facts { margin: 20px 0 0; padding: 14px 0 0; list-style: none; border-top: 1px solid var(--line); }
.facts li { padding: 2px 0; }
.facts li:first-child { font-weight: 600; color: var(--neon); }

.variants { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.variant { padding: 0; border: 0; background: none; text-align: left; }
.variant img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: var(--bg-2); outline: 1px solid var(--line); }
.variant span { display: block; margin-top: 6px; font-size: 14px; color: var(--ink-2); }
.variant[aria-pressed="true"] img { outline: 2.5px solid var(--neon); outline-offset: 2px; box-shadow: var(--glow); }
.variant[aria-pressed="true"] span { color: var(--ink); font-weight: 600; }

.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px 8px; }
.theme { padding: 0; border: 0; background: none; font-size: 13px; color: var(--ink-2); text-align: center; }
.theme i {
  display: block;
  height: 44px;
  margin-bottom: 5px;
  border-radius: 3px;
  outline: 1px solid var(--line);
  /* a tiny poster: background, a water band, one accent line */
  background:
    linear-gradient(var(--a), var(--a)) 18% 38% / 64% 3px no-repeat,
    linear-gradient(var(--i), var(--i)) 50% 78% / 34% 3px no-repeat,
    linear-gradient(160deg, transparent 58%, var(--w) 58%, var(--w) 72%, transparent 72%),
    var(--b);
}
.theme[aria-checked="true"] { color: var(--ink); font-weight: 600; }
.theme[aria-checked="true"] i { outline: 2.5px solid var(--neon); outline-offset: 2px; box-shadow: var(--glow); }

.range { display: grid; grid-template-columns: 40px 1fr 40px auto; align-items: center; gap: 10px; }
.range input { width: 100%; accent-color: var(--neon); }
.range output { min-width: 5.5ch; font-variant-numeric: tabular-nums; color: var(--ink-2); text-align: right; }
.step { height: 40px; border: 1.5px solid var(--line); border-radius: 4px; background: none; font-size: 20px; line-height: 1; }
.step:hover { border-color: var(--neon); color: var(--neon); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 13px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: none;
  font-size: 15px;
  color: var(--ink-2);
}
.chip[aria-pressed="true"] { background: var(--neon); border-color: var(--neon); color: var(--on-neon); font-weight: 600; }

.seg { display: inline-flex; margin-top: 12px; border: 1.5px solid var(--line); border-radius: 4px; overflow: hidden; flex-wrap: wrap; }
.seg button { padding: 8px 12px; border: 0; background: none; font-size: 14px; color: var(--ink-2); }
.seg button[aria-checked="true"] { background: var(--neon); color: var(--on-neon); font-weight: 600; }

.fields { display: grid; gap: 10px; }
.fields label { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; font-size: 15px; color: var(--ink-2); }
.fields input, .marker input, dialog input {
  height: 44px;
  min-width: 0;
  padding: 0 12px;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  background: var(--field);
  color: var(--ink);
}
.fields input:focus, .marker input:focus, dialog input:focus { border-color: var(--neon); }

.marker { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.marker .ghost { height: 44px; }
.marker .ghost[aria-pressed="true"] { background: var(--hot); border-color: var(--hot); color: var(--on-hot); }
.marker input { flex: 1 1 200px; }
.link { padding: 0; border: 0; background: none; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-align: left; }

.products { display: grid; gap: 8px; }
.product {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  background: none;
  text-align: left;
}
.product b { font-weight: 600; }
.product[aria-checked="true"] { border-color: var(--neon); box-shadow: 0 0 0 1px var(--neon) inset, var(--glow); }
.frames { display: flex; gap: 14px; margin-top: 14px; }
.swatch { display: flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; font-size: 15px; color: var(--ink-2); }
.swatch i { width: 26px; height: 26px; border-radius: 50%; outline: 1px solid var(--line); }
.swatch[aria-checked="true"] { color: var(--ink); font-weight: 600; }
.swatch[aria-checked="true"] i { outline: 2.5px solid var(--neon); outline-offset: 2px; }

.buy {
  position: sticky;
  bottom: 0;
  margin: 36px calc(-1 * clamp(20px, 3.4vw, 52px)) 0;
  padding: 14px clamp(20px, 3.4vw, 52px) 16px;
  background: var(--bg);
  border-top: 1px solid var(--line);
  transition: background-color 0.35s;
}
.buy-main { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.price span { display: block; font: 700 28px/1 var(--display); letter-spacing: -0.02em; color: var(--neon); }
.price small { color: var(--ink-2); font-size: 13px; }
.cta {
  height: 54px;
  padding: 0 28px;
  border: 0;
  border-radius: 4px;
  background: var(--hot);
  color: var(--on-hot);
  box-shadow: var(--glow-hot);
  font: 700 17px/1 var(--text);
}
.cta:hover { filter: brightness(1.12); }
.cta:disabled { opacity: 0.6; cursor: progress; }
.buy .link { font-size: 14px; color: var(--ink-2); }
.error { margin: 8px 0 0; color: var(--error); font-size: 14px; }
.error:empty { display: none; }

.gift-banner {
  margin: 0 0 24px;
  padding: 14px 16px;
  background: var(--bg-2);
  color: var(--ink);
  border: 1.5px solid var(--hot);
  border-radius: 4px;
}

/* ── below the studio ─────────────────────────────────────────────────────── */

.more { background: #07070f; color: #e8ecf2; padding: clamp(48px, 8vw, 112px) clamp(20px, 5vw, 80px) 40px; }
.more h2 { margin: 0 0 12px; font: 700 clamp(26px, 2.6vw, 38px) / 1.08 var(--display); letter-spacing: -0.025em; color: #fff; }
.more p { max-width: 60ch; margin: 0 0 24px; color: #a4afcc; }
.more > div + div { margin-top: clamp(48px, 7vw, 96px); }
.strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.strip button { padding: 0; border: 0; background: none; color: #b9c3d2; text-align: left; font-size: 14px; }
.strip img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; margin-bottom: 8px; transition: transform 0.2s; }
.strip button:hover img { transform: translateY(-4px); }
.steps ol { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.steps li { counter-increment: s; color: #b9c3d2; border-top: 1px solid rgba(255, 255, 255, 0.22); padding-top: 14px; }
.steps li::before { content: counter(s); display: block; font: 700 30px/1 var(--display); color: #00f0ff; text-shadow: 0 0 16px rgba(0, 240, 255, 0.6); margin-bottom: 10px; }
.steps b { display: block; color: #fff; font-weight: 600; }
footer { margin-top: clamp(48px, 7vw, 96px); padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.16); font-size: 13px; }
footer p { margin: 0; color: #8e9bb0; max-width: none; }
footer a { color: inherit; }

/* ── dialog ───────────────────────────────────────────────────────────────── */

dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 28px;
  border: 0;
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
  outline: 1.5px solid var(--line);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
}
dialog::backdrop { background: rgba(5, 5, 12, 0.7); }
dialog h3 { margin: 0 0 10px; font: 700 26px/1.1 var(--display); letter-spacing: -0.02em; }
dialog p { margin: 0 0 14px; color: var(--ink-2); }
dialog form { display: grid; gap: 10px; }
dialog .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
dialog .actions { display: flex; gap: 12px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
dialog code { display: block; margin: 0 0 14px; padding: 12px; background: var(--bg-2); color: var(--neon); border-radius: 4px; font: 600 17px/1.3 var(--text); word-break: break-all; }

/* ── small screens ────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .studio { grid-template-columns: 1fr; }
  .wall { position: relative; height: auto; }
  .strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .steps ol { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .variants { gap: 8px; }
  .buy-main { gap: 10px; }
  .cta { padding: 0 18px; }
  dialog .row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ── step 2: format and frame ─────────────────────────────────────────────── */
.back { display: inline-block; margin-bottom: 20px; color: var(--ink-2); }
.back::before { content: "‹ "; }
#step2 h1 { margin-top: 0; }
.frame-note { min-height: 21px; margin: 12px 0 0; font-size: 14px; color: var(--ink-2); }

/* ── step 1 as an editor: tools, one pane open, zoom on the wall ──────────── */
.tools { display: flex; gap: 4px; margin: 0 0 28px; padding: 4px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--bg-2); }
.tools button { flex: 1 1 0; min-width: 0; padding: 10px 4px; border: 0; border-radius: 5px; background: none; color: var(--ink-2); font-size: 15px; white-space: nowrap; }
.tools button[aria-selected="true"] { background: var(--neon); color: var(--on-neon); font-weight: 700; box-shadow: var(--glow); }
.pane > h2:first-child { margin-top: 0; }
.pane .facts { margin-top: 12px; }
.tool-hint { margin: 0 0 14px; color: var(--ink-2); }
.marker input { flex: 1 1 100%; }

.zoom { position: absolute; right: clamp(12px, 2.4vw, 32px); top: 50%; transform: translateY(-50%); display: grid; gap: 6px; justify-items: center; }
.zoom .step { width: 44px; height: 44px; background: var(--bg); color: var(--ink); border-color: var(--line); font-size: 22px; }
.zoom output { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.pin { position: absolute; z-index: 3; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--hot); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85), var(--glow-hot); pointer-events: none; }

.editbar { display: none; }

@media (max-width: 900px) {
  .brand { display: none; }
  .testbar { font-size: 12px; padding: 5px 12px; }
  .panel { min-height: 0; padding: 20px 16px 0; }
  .hint, .shadow { display: none; }
  .find input, .ghost { height: 48px; }
  .buy { margin: 20px -16px 0; padding: 10px 16px 12px; }
  .price span { font-size: 22px; }
  .cta { height: 48px; }
  .frame { height: 100%; }
  .sheet, .hang[data-size="21x30"] .sheet { aspect-ratio: auto; height: 100%; }

  /* Screen 1, the place: an ordinary scrolling page with the poster as a teaser. */
  body[data-step="place"] .studio { display: flex; flex-direction: column; }
  body[data-step="place"] .panel { order: 1; }
  body[data-step="place"] .wall { order: 2; padding: 22px 16px 110px; }
  body[data-step="place"] .buy { position: fixed; z-index: 6; left: 0; right: 0; bottom: 0; margin: 0; }
  body[data-step="place"] .hang { width: min(64vw, 300px); height: auto; aspect-ratio: 3 / 4; }
  body[data-step="place"] h1 { font-size: 30px; }
  body[data-step="place"] .lede { font-size: 16px; margin-bottom: 20px; }

  /* Screens 2 and 3 fill the phone exactly: the poster takes everything the controls leave. */
  body[data-step="edit"] .testbar, body[data-step="edit"] .more { display: none; }
  body[data-step="edit"] .studio, body[data-step="format"] .studio { display: flex; flex-direction: column; align-items: stretch; height: 100dvh; }
  body[data-step="format"] .studio { height: calc(100dvh - var(--bar-h, 0px)); }
  body[data-step="edit"] .wall, body[data-step="format"] .wall { flex: 1 1 0; min-height: 0; padding: 12px 16px; }
  body[data-step="edit"] .wall { padding: 58px 8px 10px; }
  body[data-step="edit"] .hang, body[data-step="format"] .hang { width: auto; max-width: none; height: min(100%, calc((100vw - 32px) * 4 / 3)); }
  body[data-step="edit"] .hang { height: min(100%, calc((100vw - 16px) * 4 / 3)); }
  body[data-step="edit"] .panel, body[data-step="format"] .panel { flex: 0 0 auto; position: relative; padding: 0 16px; }

  /* the poster screen: a bar on top, the tools at the bottom, the open tool as a sheet over the poster's foot */
  .editbar { position: absolute; z-index: 4; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px 8px 14px; }
  .editbar .to-place { max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0; border: 0; background: none; color: var(--ink); font: 700 18px/1 var(--display); letter-spacing: -0.01em; }
  .editbar .to-place::before { content: "‹ "; color: var(--ink-2); }
  .editbar .cta { height: 40px; padding: 0 20px; font-size: 16px; }
  body[data-step="edit"] .buy, body[data-step="edit"] .back { display: none; }
  .zoom { right: 10px; top: auto; bottom: 12px; transform: none; grid-auto-flow: column; align-items: center; z-index: 3; }
  .zoom .step { width: 42px; height: 42px; }
  .zoom output { min-width: 44px; text-align: center; color: var(--ink); background: var(--bg); padding: 2px 6px; border-radius: 4px; }
  .tools { margin: 8px 0 10px; }
  .tools button { padding: 13px 2px; }
  .pane { position: absolute; z-index: 5; left: 0; right: 0; bottom: 100%; max-height: 44dvh; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 12px; background: var(--bg); border-top: 1.5px solid var(--line); box-shadow: 0 -18px 30px -18px rgba(0, 0, 0, 0.7); }
  .pane h2 { margin: 14px 0 8px; font-size: 14px; }
  /* looks as two swipeable rows, so the sheet stays low and the poster stays visible */
  .variants { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
  .variant { flex: 0 0 86px; }
  .variant span { font-size: 12px; }
  .themes { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 6px; }
  .theme { flex: 0 0 68px; }
  .fields { gap: 8px; }
  .fields label { grid-template-columns: 96px 1fr; gap: 8px; }

  #step2 { max-height: 56dvh; overflow-y: auto; padding: 14px 0 6px; overscroll-behavior: contain; }
  #step2 h1 { font-size: 26px; }
  body[data-step="format"] .buy { margin-top: 8px; position: static; }
}

/* the poster screen on a desktop: the way back to the place sits above the tools */
#stepEdit > .back { margin-bottom: 16px; }

/* ── tools with icons; frosted chrome floating over the poster on a phone ──── */
.tools button { display: flex; align-items: center; justify-content: center; gap: 8px; }
.tools svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pane-close { display: none; }
.sheet { touch-action: none; }

@media (pointer: coarse) {
  .zoom { display: none; }  /* two fingers do this on a touch screen */
}

@media (max-width: 900px) {
  /* The poster owns the whole screen. Everything else floats over the wall around it,
     translucent, and steps back while the map is being moved. */
  body[data-step="edit"] .studio { position: fixed; inset: 0; height: auto; display: block; }
  body[data-step="edit"] .wall { position: absolute; inset: 0; height: auto; display: grid; place-items: center; padding: calc(60px + env(safe-area-inset-top)) 8px calc(92px + env(safe-area-inset-bottom)); }
  body[data-step="edit"] .hang { height: min(100%, calc((100vw - 16px) * 4 / 3)); }
  body[data-step="edit"] .panel { position: absolute; z-index: 5; left: 0; right: 0; bottom: var(--kb, 0px); padding: 0 10px calc(10px + env(safe-area-inset-bottom)); background: none; pointer-events: none; transition: opacity 0.2s; }
  body[data-step="edit"] .panel > *, body[data-step="edit"] #stepEdit > * { pointer-events: auto; }
  body[data-step="edit"] #stepEdit { pointer-events: none; display: flex; flex-direction: column; }
  .editbar { padding: calc(8px + env(safe-area-inset-top)) 10px 8px; transition: opacity 0.2s; }
  .editbar .to-place, .editbar .cta { -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
  .editbar .to-place { height: 42px; padding: 0 16px 0 12px; border-radius: 999px; background: color-mix(in srgb, var(--bg) 62%, transparent); border: 1px solid var(--line); font-size: 16px; }
  .editbar .cta { height: 42px; border-radius: 999px; }
  body.gesturing .editbar, body.gesturing[data-step="edit"] .panel { opacity: 0.12; }

  body[data-step="edit"] .tools { order: 2; align-self: center; gap: 2px; margin: 8px 0 0; padding: 5px; border-radius: 20px; border: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 58%, transparent); -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3); box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6); }
  body[data-step="edit"] .tools button { flex: 0 0 auto; flex-direction: column; gap: 3px; width: 74px; min-height: 56px; padding: 6px 2px; border-radius: 15px; font-size: 11.5px; color: var(--ink); }
  body[data-step="edit"] .tools svg { width: 24px; height: 24px; }
  body[data-step="edit"] .tools button[aria-selected="true"] { color: var(--on-neon); }

  body[data-step="edit"] .pane { position: relative; order: 1; bottom: auto; max-height: 32dvh; padding: 14px 16px 14px; border: 1px solid var(--line); border-radius: 18px; background: color-mix(in srgb, var(--bg) 72%, transparent); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3); box-shadow: 0 14px 34px -12px rgba(0, 0, 0, 0.65); }
  body[data-step="edit"] .pane > h2:first-of-type { margin-top: 0; padding-right: 76px; }
  .pane-close { display: block; position: absolute; top: 8px; right: 8px; height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--ink); font-size: 13px; }
  .pane .tool-hint { font-size: 14px; margin-bottom: 10px; }

  .hint { display: block; position: absolute; z-index: 6; top: calc(64px + env(safe-area-inset-top)); bottom: auto; left: 50%; transform: translateX(-50%); padding: 8px 14px; border-radius: 999px; white-space: nowrap; font-size: 13px; color: var(--ink); background: color-mix(in srgb, var(--bg) 70%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 1px solid var(--line); opacity: 0; pointer-events: none; transition: opacity 0.4s; }
  .hint.toast { opacity: 1; }
}

@media (max-width: 900px) {
  /* both rows of looks must fit in the sheet without scrolling it */
  body[data-step="edit"] .pane { max-height: 38dvh; }
  body[data-step="edit"] .variant { flex: 0 0 60px; }
  body[data-step="edit"] .variant span { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body[data-step="edit"] .pane h2 { margin: 10px 0 6px; font-size: 13px; }
  body[data-step="edit"] .theme i { height: 38px; }
}
@media (max-width: 900px) {
  body[data-step="edit"] .pane[data-pane="look"] h2:nth-of-type(2) { display: none; }
  body[data-step="edit"] .pane[data-pane="look"] .themes { margin-top: 10px; }
}
@media (max-width: 900px) {
  /* a flex item will not shrink below its image without this */
  body[data-step="edit"] .variant { min-width: 0; width: 60px; max-width: 60px; overflow: hidden; }
  body[data-step="edit"] .variants { align-items: flex-start; }
}

/* ── phone, poster screen: the framed poster, as large as the screen allows ────
   Whole poster in its true ratio, in its frame, on the wall. It is sized from the
   width and from the height left between the top bar and the tools, whichever is
   tighter, so it never runs off an edge in any browser. */
@media (max-width: 900px) {
  html:has(body[data-step="edit"]) { overflow: hidden; overscroll-behavior: none; background: #07070f; }
  html[data-mode="light"]:has(body[data-step="edit"]) { background: #d9dce3; }
  body[data-step="edit"] { overflow: hidden; touch-action: manipulation; }
  body[data-step="edit"] .wall { --top: calc(62px + env(safe-area-inset-top)); --bottom: calc(92px + env(safe-area-inset-bottom)); padding: var(--top) 0 var(--bottom); display: flex; align-items: center; justify-content: center; }
  body[data-step="edit"] .hang { flex: none; height: auto; max-width: none; aspect-ratio: 3 / 4; width: min(100vw - 24px, (100dvh - var(--top) - var(--bottom) - 8px) * 0.75); }
  body[data-step="edit"] .hang[data-size="21x30"] { aspect-ratio: 210 / 297; width: min(100vw - 24px, (100dvh - var(--top) - var(--bottom) - 8px) * 210 / 297); }
  body[data-step="edit"] .frame { height: 100%; }
  body[data-step="edit"] .sheet { height: 100%; }
  body[data-step="edit"] .tools { margin-bottom: 4px; }
}

/* ── phone, format step: an ordinary scrolling page, sized from the width ──── */
@media (max-width: 900px) {
  body[data-step="format"] .studio { display: flex; flex-direction: column; align-items: stretch; height: auto; }
  body[data-step="format"] .wall { flex: none; min-height: 0; padding: 22px 16px 26px; }
  body[data-step="format"] .hang { width: min(58vw, 280px); height: auto; aspect-ratio: 3 / 4; max-width: none; }
  body[data-step="format"] .hang[data-size="21x30"] { width: min(48vw, 232px); aspect-ratio: 210 / 297; }
  body[data-step="place"] .hang[data-size="21x30"] { aspect-ratio: 210 / 297; }
  body[data-step="format"] .panel { position: static; padding: 18px 16px 120px; }
  #step2, body[data-step="format"] #step2 { max-height: none; overflow: visible; padding: 0; }
  body[data-step="format"] .buy { position: fixed; z-index: 6; left: 0; right: 0; bottom: 0; margin: 0; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  body[data-step="place"] .buy { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  body[data-step="format"] .more { display: none; }
}

/* ── the first screen: logo, the visitor's own place as the headline, and their poster
   hanging between two others ─────────────────────────────────────────────── */
.studio { position: relative; }
.top { position: absolute; z-index: 7; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 22px clamp(20px, 3.4vw, 52px); pointer-events: none; }
.top > * { pointer-events: auto; }
.logo { display: flex; align-items: center; gap: 11px; font: 700 19px/1 var(--display); letter-spacing: -0.015em; color: var(--ink); text-decoration: none; }
.logo svg { width: 24px; height: 30px; flex: none; }
.logo i { font-style: normal; font-weight: 400; color: var(--hot); }
.lf { fill: none; stroke: var(--ink); stroke-width: 2.2; }
.lr { fill: none; stroke: var(--neon); stroke-width: 1.8; }
.lp { fill: var(--hot); }
.top nav { display: flex; gap: 24px; }
.top nav button { padding: 6px 0; border: 0; background: none; font-size: 15px; color: var(--ink-2); }
.top nav button:hover { color: var(--ink); }

.hero { margin-bottom: 20px; font-size: clamp(40px, 4.7vw, 76px); font-weight: 400; line-height: 0.98; letter-spacing: -0.04em; text-wrap: wrap; }
.hero span { display: block; font-weight: 800; overflow-wrap: anywhere; }

.flank { position: absolute; height: 76%; aspect-ratio: 3 / 4; padding: 2.4%; border: 0; background: #17181a; box-shadow: var(--frame-shadow); filter: brightness(0.6) saturate(0.85); transition: opacity 0.45s, filter 0.25s, transform 0.25s; }
.flank-a { right: 92%; top: 7%; }
.flank-b { left: 92%; top: 17%; }
.flank img { display: block; width: 100%; height: 100%; object-fit: cover; }
.flank img:not([src]) { visibility: hidden; }
.flank.swap { opacity: 0; }
.flank:hover, .flank:focus-visible { filter: none; transform: translateY(-4px); }
:root[data-mode="light"] .flank { filter: saturate(0.8) opacity(0.8); }
:root[data-mode="light"] .flank:hover { filter: none; }
body:not([data-step="place"]) .flank { display: none; }

.found { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.found:has(.facts:empty) { display: none; }
.found h2 { margin: 0 0 8px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.found .facts { margin: 0; padding: 0; border: 0; }
.found-note { margin: 10px 0 0; font-size: 14px; color: var(--ink-2); }

@media (min-width: 901px) {
  .panel { padding-top: 108px; }
}
@media (max-width: 900px) {
  .top { position: static; order: 0; padding: 14px 16px 2px; }
  .top nav { display: none; }
  .logo { font-size: 17px; gap: 9px; }
  .logo svg { width: 20px; height: 25px; }
  body[data-step="edit"] .top { display: none; }

  /* headline, then the poster, then the search: the panel's parts are laid out around the wall */
  body[data-step="place"] .panel, body[data-step="place"] #stepPlace { display: contents; }
  body[data-step="place"] .gift-banner { order: 1; margin: 10px 16px 0; }
  body[data-step="place"] .hero { order: 2; margin: 16px 16px 10px; font-size: clamp(34px, 10.6vw, 48px); }
  body[data-step="place"] .lede { order: 3; margin: 0 16px 14px; max-width: none; font-size: 15.5px; line-height: 1.45; }
  body[data-step="place"] .wall { order: 4; padding: 20px 16px 28px; }
  body[data-step="place"] .hang { width: min(56vw, 280px, 38dvh); }
  body[data-step="place"] .find { order: 5; margin: 18px 16px 0; }
  body[data-step="place"] .found { order: 6; margin: 20px 16px 0; padding-bottom: 28px; }
  body[data-step="place"] .more { padding-bottom: 130px; }
}
@media (max-width: 900px) {
  body[data-step="place"] .studio { align-items: stretch; }
  body[data-step="place"] .hang { width: min(52vw, 270px, 35dvh); }
  body[data-step="place"] .wall { padding: 18px 16px 24px; }
}
body[data-step="place"] .hint { display: none; }
@media (max-width: 900px) {
  /* the price is in the bar at the bottom of the screen already */
  body[data-step="place"] .lede strong { display: none; }
  body[data-step="place"] .hang { width: min(48vw, 270px, 33dvh); }
  body[data-step="place"] .wall { padding: 16px 16px 22px; }
}

/* ── the InPost locker ────────────────────────────────────────────────────── */
.locker-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.locker-pick p { margin: 0; color: var(--ink-2); font-size: 15px; }
.locker-pick p b { display: block; color: var(--neon); font: 700 18px/1.2 var(--display); }
dialog .locker-pick { margin: 2px 0; }
dialog .locker-pick .ghost { height: 44px; }
.locker-dialog { width: min(1100px, calc(100vw - 24px)); height: min(820px, calc(100dvh - 24px)); max-width: none; max-height: none; padding: 0; overflow: hidden; }
.locker-dialog[open] { display: flex; flex-direction: column; }
.locker-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 18px; font: 700 18px/1 var(--display); }
.locker-head .ghost { height: 38px; font: 500 15px/1 var(--text); }
.locker-map { flex: 1 1 0; min-height: 0; background: #fff; }
.locker-map inpost-geowidget { display: block; width: 100%; height: 100%; }
.locker-map .error { padding: 20px; }
@media (max-width: 600px) {
  .locker-dialog { width: 100vw; height: 100dvh; border-radius: 0; }
}

/* ── QA pass, 2026-11-24 ──────────────────────────────────────────────────── */

/* Side posters: their outer part fades out, so wherever the wall's edge cuts them it looks intended. */
.flank-a { -webkit-mask-image: linear-gradient(to left, #000 55%, transparent); mask-image: linear-gradient(to left, #000 55%, transparent); }
.flank-b { -webkit-mask-image: linear-gradient(to right, #000 55%, transparent); mask-image: linear-gradient(to right, #000 55%, transparent); }
@media (min-width: 901px) {
  .flank { height: 70%; }
  .flank-a { right: 76%; top: 9%; }
  .flank-b { left: 76%; top: 21%; }
}

/* Locate: an icon with words on a wide screen, an icon alone beside the search on a phone. */
#locate { display: inline-flex; align-items: center; gap: 8px; }
#locate svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

/* Look proposals: the look's name, then what it is about, each on its own line. */
.variant span b { display: block; font-weight: 600; color: var(--ink); }
.variant span { line-height: 1.3; }

/* Format step: the gift offer as a quiet line at the end, not in the bar. */
.gift-line { margin: 28px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 15px; }
.gift-line .link { color: var(--ink); font-weight: 600; margin-right: 4px; }
.gift-info .cta { margin-top: 4px; }

@media (max-width: 900px) {
  .lede { max-width: 60ch; }
  /* Phone, first screen: name of the place, the search for it, then the posters, then the rest. */
  .find label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .find-row { flex-wrap: nowrap; }
  #locate { width: 48px; padding: 0; justify-content: center; flex: none; }
  #locate span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  body[data-step="place"] .find { order: 3; margin: 2px 16px 0; }
  body[data-step="place"] .find-note:empty { min-height: 0; margin: 0; }
  body[data-step="place"] .wall { order: 4; }
  body[data-step="place"] .lede { order: 5; margin: 4px 16px 0; }
  body[data-step="place"] .found { order: 6; }
  body[data-step="place"] .more { padding-bottom: calc(var(--buy-h, 90px) + 32px); }
  body.typing[data-step="place"] .buy { display: none; }

  /* The bar: one line of price, one button, never wrapping. */
  .buy-main { margin-bottom: 0; }
  .price small { display: block; white-space: nowrap; font-size: 12.5px; line-height: 1.3; }
  .cta { white-space: nowrap; }
  body[data-step="format"] .panel { padding-bottom: calc(var(--buy-h, 90px) + 28px); }

  /* Editor sheets: solid enough that the poster behind does not muddle the controls. */
  body[data-step="edit"] .pane { background: color-mix(in srgb, var(--bg) 94%, transparent); padding-top: 12px; }
  body[data-step="edit"] .pane > h2:first-of-type { min-height: 40px; display: flex; align-items: center; margin: 0 0 6px; }
  .pane-close { top: 12px; right: 10px; height: 40px; padding: 0 16px; }
  body[data-step="edit"] .pane[data-pane="map"] { max-height: 52dvh; }
  body[data-step="edit"] .variant, body[data-step="edit"] .variants .variant { width: 72px; max-width: 72px; flex: 0 0 72px; }
  body[data-step="edit"] .variant span { white-space: normal; font-size: 11.5px; }
  body[data-step="edit"] .variant span b { font-size: 12px; }
  .editbar .to-place::before { content: "‹"; font-size: 24px; line-height: 0; margin-right: 6px; position: relative; top: 1px; }
}
@media (max-width: 480px) {
  .steps ol { grid-template-columns: 1fr; gap: 16px; }
  .steps li { display: grid; grid-template-columns: 36px 1fr; column-gap: 8px; }
  .steps li::before { grid-row: span 2; margin: 0; }
}

/* Touch screens: everything tappable is at least 44px tall. */
@media (pointer: coarse) {
  .chip { min-height: 44px; }
  .link, .back { min-height: 44px; display: inline-flex; align-items: center; }
  .swatch { min-height: 44px; }
  .locker-head .ghost { height: 44px; }
}
@media (max-width: 360px) {
  .buy-main { gap: 8px; }
  .cta { padding: 0 14px; font-size: 15.5px; }
  .price span { font-size: 20px; }
  .price small { font-size: 11.5px; }
}
.variant span i { display: block; font-style: normal; }
.variant[aria-pressed="true"] span { font-weight: 400; }
.variant[aria-pressed="true"] span i { color: var(--ink-2); }
@media (max-width: 900px) {
  /* on a phone the look's name alone; the thumbnail shows what it is about */
  body[data-step="edit"] .variant span i { display: none; }
  body[data-step="edit"] .variant, body[data-step="edit"] .variants .variant { width: 64px; max-width: 64px; flex: 0 0 64px; }
  body[data-step="edit"] .variant span b { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body[data-step="edit"] .pane[data-pane="look"] { max-height: 46dvh; }
  .editbar .to-place::before { content: ""; display: inline-block; width: 8px; height: 8px; margin: 0 9px 0 3px; border: solid currentColor; border-width: 0 0 2.2px 2.2px; transform: rotate(45deg); top: -1px; font-size: 0; }
}
.back::before { content: "‹"; margin-right: 6px; }
:root[data-mode="light"] .flank { background: #f4f3ef; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), var(--frame-shadow); }

/* ── UX pass, 2026-11-25 ──────────────────────────────────────────────────── */

/* Where am I: the three steps, always in the same place. They replace the two "back" links. */
.back { display: none !important; }
.crumbs ol { display: flex; align-items: center; gap: 10px; margin: 0 0 26px; padding: 0; list-style: none; counter-reset: c; font-size: 15px; }
.crumbs li { counter-increment: c; display: flex; align-items: center; gap: 10px; min-width: 0; }
.crumbs li + li::before { content: ""; flex: none; width: clamp(10px, 2vw, 28px); height: 1.5px; background: var(--line); }
.crumbs button { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 44px; padding: 0; border: 0; background: none; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs button::before { content: counter(c); flex: none; display: grid; place-items: center; width: 24px; height: 24px; border: 1.5px solid var(--line); border-radius: 50%; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.crumbs button:hover { color: var(--ink); }
.crumbs button[aria-current] { color: var(--ink); font-weight: 600; }
.crumbs button[aria-current]::before { background: var(--neon); border-color: var(--neon); color: var(--on-neon); }
.crumbs li:first-child { flex: 0 1 auto; }
.crumbs li:first-child button { max-width: 16ch; display: block; }
.crumbs li:first-child button::before { display: inline-grid; margin-right: 8px; vertical-align: -1px; }

/* The order bar keeps its place at the foot of the panel, whichever tool is open. */
@media (min-width: 901px) {
  .panel > .buy { margin-top: auto; }
  #stepEdit, #step2, #stepPlace { padding-bottom: 36px; }
  .price small { display: block; margin-top: 4px; }
}

/* An empty frame waits in the room's own colour, not as a pale blank. */
.sheet { background: var(--bg-2); }

/* Layers: on and off told by a mark as well as by colour, and quiet enough to sit in a row of fifteen. */
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px 7px 11px; }
.chip::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid currentColor; opacity: 0.55; }
.chip[aria-pressed="true"] { background: color-mix(in srgb, var(--neon) 14%, transparent); border-color: var(--neon); color: var(--ink); font-weight: 500; }
.chip[aria-pressed="true"]::before { background: var(--neon); border-color: var(--neon); opacity: 1; box-shadow: var(--glow); }
.chip:hover { border-color: var(--neon); }

/* Formats: a mark, a name, a line about it, the price. */
.product { align-items: center; padding: 14px 16px 14px 14px; gap: 14px; }
.product::before { content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line); }
.product[aria-checked="true"]::before { border-color: var(--neon); background: radial-gradient(circle, var(--neon) 0 42%, transparent 48%); }
.product:hover { border-color: var(--neon); }
.p-name { flex: 1 1 auto; min-width: 0; }
.p-name b { display: block; }
.p-name small { display: block; margin-top: 2px; font-size: 14px; color: var(--ink-2); }
.p-price { flex: none; font: 700 18px/1 var(--display); font-variant-numeric: tabular-nums; }
.product[aria-checked="true"] .p-price { color: var(--neon); }
.swatch i { width: 32px; height: 32px; }
.frames { gap: 20px; flex-wrap: wrap; }

/* Suggestions: the place, and under it what and where it is. */
.results li { flex-direction: column; gap: 0; padding: 8px 12px; }
.results li small { text-align: left; font-size: 13.5px; }

@media (max-width: 900px) {
  body[data-step="edit"] .crumbs { display: none; }
  .crumbs ol { margin-bottom: 14px; font-size: 14px; gap: 6px; }
  .crumbs li { gap: 6px; }
  .crumbs li:first-child button { max-width: 11ch; }

  /* Format step: the poster is a reminder here; the choices must be on the first screen. */
  body[data-step="format"] .wall { padding: 14px 16px 18px; }
  body[data-step="format"] .hang { width: min(40vw, 200px, 27dvh); }
  body[data-step="format"] .hang[data-size="21x30"] { width: min(32vw, 160px, 22dvh); }
  body[data-step="format"] .lede { font-size: 16px; margin-bottom: 4px; }
  #step2 h2 { margin-top: 24px; }

  /* Editor: the poster shrinks into the room above the open sheet, so every change is seen whole. */
  body[data-step="edit"] .wall { --bottom: calc(var(--panel-h, 84px) + var(--kb, 0px) + 8px); }
  body[data-step="edit"] .hang,
  body[data-step="edit"] .hang[data-size="21x30"] { transition: width 0.22s ease; }
  body[data-step="edit"] .hang { width: max(30vw, min(100vw - 24px, (100dvh - var(--top) - var(--bottom) - 8px) * 0.75)); }
  body[data-step="edit"] .hang[data-size="21x30"] { width: max(30vw, min(100vw - 24px, (100dvh - var(--top) - var(--bottom) - 8px) * 210 / 297)); }
  body[data-step="edit"] .wall { align-items: flex-start; }
  body[data-step="edit"][data-sheet="closed"] .wall { align-items: center; }

  /* Layer chips small enough that all fifteen fit without hiding the poster. */
  body[data-step="edit"] .chips { gap: 6px; }
  body[data-step="edit"] .chip { min-height: 36px; padding: 4px 11px 4px 9px; font-size: 14px; gap: 6px; }
  body[data-step="edit"] .seg { margin-top: 10px; }
  body[data-step="edit"] .pane[data-pane="map"] { max-height: 46dvh; }
}
@media (prefers-reduced-motion: reduce) {
  body[data-step="edit"] .hang { transition: none; }
}

/* Trail colours: a label and three short choices on one line. */
.seg { align-items: stretch; flex-wrap: nowrap; }
.seg-label { display: flex; align-items: center; padding: 0 12px; font-size: 14px; color: var(--ink); border-right: 1.5px solid var(--line); white-space: nowrap; }
.seg button { white-space: nowrap; min-height: 40px; }
@media (max-width: 900px) {
  body[data-step="edit"] .pane[data-pane="map"] { max-height: 50dvh; }
  body[data-step="edit"] .seg { display: flex; }
  body[data-step="edit"] .seg button { flex: 1 1 0; padding: 8px 6px; font-size: 13.5px; }
  /* Format step on a phone: the step indicator already names the screen, and the bar states the delivery. */
  body[data-step="format"] #step2Title { display: none; }
  body[data-step="format"] #step2Lede { font-size: 15px; margin: 0 0 6px; }
  body[data-step="format"] #step2 h2:first-of-type { margin-top: 8px; }
}
@media (max-width: 420px) {
  /* Smallest phones: only the current step keeps its number, so all three names fit. */
  .crumbs li { flex: none; }
  .crumbs li:first-child { flex: 0 1 auto; }
  .crumbs li + li::before { width: 10px; }
  .crumbs button:not([aria-current])::before { display: none !important; }
  .product { padding: 12px; gap: 10px; }
  .product::before { display: none; }
  .p-name small { font-size: 13.5px; line-height: 1.35; }
}
@media (max-width: 360px) {
  .price { min-width: 0; }
  .price small { white-space: normal; }
}

/* Legal: the acceptance line by the order button, and the documents in the footer. */
.terms { margin: 8px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--ink-2); max-width: none; }
.terms a { color: inherit; text-underline-offset: 2px; }
dialog .terms { margin: 14px 0 0; }
footer nav { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-bottom: 14px; font-size: 14px; }
footer nav a { color: #c9d2e6; min-height: 44px; display: inline-flex; align-items: center; text-underline-offset: 3px; }
@media (max-width: 900px) { .buy .terms { font-size: 11.5px; margin-top: 6px; } }

/* Invoice for a company: a tick, then the NIP. */
#invoiceBox { margin-top: 26px; }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--neon); }
.nip-row { margin-top: 6px; }
.nip-row label, .gift-nip { display: block; margin-bottom: 6px; font-size: 14px; color: var(--ink-2); }
.nip-row input, .gift-nip input { display: block; width: min(100%, 240px); height: 46px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 4px; background: var(--field); color: var(--ink); font-size: 17px; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.nip-row input:focus, .gift-nip input:focus { border-color: var(--neon); }
.gift-nip input { margin-top: 6px; }
.nip-row .frame-note { margin-top: 6px; }

/* Questions people ask before buying, and links to the city pages. */
.faq-list { max-width: 760px; border-top: 1px solid rgba(255, 255, 255, 0.16); }
.faq details { border-bottom: 1px solid rgba(255, 255, 255, 0.16); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 10px 0; cursor: pointer; list-style: none; font-weight: 600; font-size: 17px; color: #fff; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font: 400 24px/1 var(--display); color: #00f0ff; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 18px; max-width: 64ch; }
footer nav.places { align-items: center; }
footer nav.places b { color: #fff; font-weight: 600; margin-right: 4px; }
/* The format step's title looks like a main heading, but the page has only one h1: the hero. */
.as-h1 { margin: 0 0 16px; font: 700 clamp(34px, 3.6vw, 54px) / 1.02 var(--display); letter-spacing: -0.03em; }

/* ── guidance: a sentence in each tool, the pin shown as an example, first-visit tips ── */
.pane .tool-hint { font-size: 15px; }
.pane .tool-hint.lead { margin-bottom: 18px; }

/* What a pin looks like on a poster: a piece of a real one, with the pin and its caption. */
.pin-demo { position: relative; height: 132px; margin: 0 0 14px; border-radius: 4px; overflow: hidden; outline: 1px solid var(--line); background: #0b1626; }
.pin-demo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(8, 14, 28, 0.55), rgba(8, 14, 28, 0.15)); }
.pin-demo-dot { position: absolute; z-index: 1; left: 50%; top: 58%; width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; border-radius: 50%; background: #ff5a4e; box-shadow: 0 0 0 2.5px #0b1626, 0 0 0 4.5px #ff5a4e; }
.pin-demo-label { position: absolute; z-index: 1; left: 50%; top: 58%; transform: translate(-50%, -34px); padding: 0 6px; font: 700 13px/1.4 var(--text); letter-spacing: 0.02em; color: #fff; text-shadow: 0 1px 6px #0b1626, 0 0 2px #0b1626; white-space: nowrap; }

/* First-visit tips. One bubble, moved to the control it talks about. */
.coach { position: fixed; z-index: 30; left: 0; top: 0; width: min(320px, calc(100vw - 20px)); padding: 16px 16px 12px; border-radius: 12px; background: var(--ink); color: var(--bg); box-shadow: 0 18px 44px -10px rgba(0, 0, 0, 0.7); transition: transform 0.28s ease; }
.coach p { margin: 0 0 12px; font-size: 15.5px; line-height: 1.45; }
.coach-row { display: flex; align-items: center; gap: 14px; }
.coach-row span { margin-right: auto; font-size: 13px; opacity: 0.6; font-variant-numeric: tabular-nums; }
.coach .link { color: inherit; font-size: 14.5px; min-height: 40px; }
.coach .cta { height: 40px; padding: 0 18px; font-size: 15px; box-shadow: none; }
.coach::after { content: ""; position: absolute; left: var(--arrow, 50%); bottom: -7px; width: 14px; height: 14px; margin-left: -7px; background: inherit; transform: rotate(45deg); }
.coach[data-below="true"]::after { bottom: auto; top: -7px; }
.coach.no-arrow::after { display: none; }
.coach-target { box-shadow: 0 0 0 3px var(--hot), var(--glow-hot) !important; border-radius: 8px; }
@media (prefers-reduced-motion: reduce) { .coach { transition: none; } }

@media (max-width: 900px) {
  body[data-step="edit"] .pane .tool-hint { font-size: 13.5px; line-height: 1.4; margin: 0 0 10px; }
  body[data-step="edit"] .pane .tool-hint.lead { display: none; }   /* the two rows of looks speak for themselves in a small sheet */
  .pin-demo { height: 76px; margin-bottom: 10px; }
  .pin-demo-label { transform: translate(-50%, -30px); font-size: 12px; }
}

/* The pin example is a real, sharp piece of a printed poster, shown small; it never stretches. */
img.pin-demo { display: block; width: min(100%, 380px); height: auto; aspect-ratio: 760 / 320; background: #0b1626; object-fit: cover; }
img.pin-demo::after { content: none; }
@media (max-width: 900px) {
  img.pin-demo { width: 100%; max-width: 380px; height: 96px; aspect-ratio: auto; }
}

/* The logo: the lockup made for dark rooms, and its twin for the light mode. */
.logo img { display: block; height: 56px; width: auto; }
.logo .logo-light, :root[data-mode="light"] .logo .logo-dark { display: none; }
:root[data-mode="light"] .logo .logo-light { display: block; }
@media (max-width: 900px) { .logo img { height: 38px; } }

/* Phone, first screen: keep room for what arrives a moment later (the note under the search box,
   the list of what we found, the price bar), so the page does not jump while it loads. */
@media (max-width: 900px) {
  body[data-step="place"] .find-note, body[data-step="place"] .find-note:empty { min-height: 42px; margin: 8px 0 0; }
  body[data-step="place"] .found:has(.facts:empty) { display: block; visibility: hidden; min-height: 258px; }
  body[data-step="place"] .buy[hidden] { display: block; visibility: hidden; min-height: 71px; }
}

/* "12/40" inside the right edge of a field whose text is printed on the poster. */
.fields label, .counted { position: relative; }
.counted { display: block; }
.counted:has(input[hidden]) { display: none; }
.count { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink-2); opacity: 0.75; pointer-events: none; }
.count.full { color: var(--neon); opacity: 1; }
.fields input, .counted input { padding-right: 54px; }
.type-note { margin: 10px 0 0; font-size: 13px; color: var(--ink-2); }
