/* ============================================================
   Darkroom 8 · IKEA Frame Print Guide
   Built in the print calculator's system (printing.darkroom8malaysia.com):
   one quiet card on paper, hairlines instead of boxes, tiny uppercase
   eyebrows, plain-text pickers with a red dot, numbered rows, red
   dimension callouts, one black pill for the next action.
   Tokens live in theme.css. Pixel sizes mirror the calculator's
   Tailwind classes (text-[9px] tracking-[0.2em] etc.).
   ============================================================ */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
h1, h2, h3, p, dl, dd, figure, ol { margin: 0; }
ol { padding: 0; list-style: none; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.site-header { display: block; width: 100%; height: 50px; border: 0; }

/* max-w-xl → lg:max-w-4xl, px-6 sm:px-8, pt-8 — same frame as the calculator */
.wrap { max-width: calc(36rem + 48px); margin: 0 auto; padding: 32px 24px 0; }
@media (min-width: 640px) { .wrap { max-width: calc(36rem + 64px); padding: 32px 32px 0; } }
@media (min-width: 1024px) { .wrap { max-width: calc(48rem + 64px); } }

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--gray-200);
  border-radius: 1.25rem;
  padding: 24px;
}
@media (min-width: 640px) { .card { border-radius: 2rem; padding: 40px; } }

/* ---------- atoms ---------- */

.eyebrow {
  display: block;
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gray-400);
}
@media (min-width: 640px) { .eyebrow { font-size: 10px; } }
.eyebrow--red { color: var(--red); }
.eyebrow--left { text-align: left; }

.fine-caps {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gray-400);
  text-align: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 30px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--card);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background-color 0.2s var(--ease), transform 0.2s var(--spring), opacity 0.2s var(--ease);
}
.pill:hover:not(:disabled) { background: #000; transform: translateY(-1px); }
.pill:active:not(:disabled) { transform: scale(0.98); }
.pill:disabled { background: var(--gray-300); cursor: default; }
.pill svg { flex: none; width: 16px; height: 16px; }
.pill.is-saved { background: var(--green); }
.pill.is-busy { cursor: progress; opacity: 0.75; }

.text-link {
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-500);
  text-decoration: underline;
  text-decoration-color: var(--gray-300);
  text-underline-offset: 4px;
  transition: color 0.2s var(--ease), text-decoration-color 0.2s var(--ease);
  cursor: pointer;
}
.text-link:hover { color: var(--ink); text-decoration-color: var(--ink); }

.text-btn {
  min-height: 44px;
  padding: 8px;
  margin: -8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gray-400);
  transition: color 0.2s var(--ease);
}
.text-btn:hover { color: var(--ink); }

.icon-btn { min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; padding: 0; margin: -8px; color: var(--gray-400); transition: color 0.2s var(--ease); line-height: 0; }
.icon-btn:hover { color: var(--ink); }
.icon-btn.is-off { color: var(--gray-300); }
.icon-btn.is-off:hover { color: var(--gray-500); }
.icon-btn svg { width: 15px; height: 15px; }

.round-btn {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--gray-200);
  background: var(--card);
  color: var(--gray-500);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.round-btn:hover:not(:disabled) { background: var(--gray-50); color: var(--ink); }
.round-btn:disabled { opacity: 0.35; cursor: default; }
.round-btn svg { width: 16px; height: 16px; }

.note-small {
  margin: 10px auto 0;
  max-width: 46ch;
  text-align: center;
  font-size: 11px;
  line-height: 1.75;
  color: var(--gray-500);
}
.note-small--left { text-align: left; max-width: none; margin-left: 0; }

/* red info note — the calculator's "type 35mm in the upload message" box */
.warn {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 22px auto 0;
  max-width: 50ch;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid rgba(222, 41, 16, 0.2);
  background: rgba(222, 41, 16, 0.05);
  font-size: 11px;
  line-height: 1.7;
  color: var(--ink);
  text-align: left;
}
.warn::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  margin-top: 2px;
  background: var(--red);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E") center / contain no-repeat;
}
.warn b { font-weight: 700; }

/* ---------- card top + progress ---------- */

.card-top { display: flex; justify-content: space-between; align-items: center; min-height: 20px; }

.progress { max-width: 30rem; margin: 18px auto 30px; }
.progress-list { display: grid; grid-template-columns: repeat(5, 1fr); }
.progress-list button {
  width: 100%;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 0 8px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gray-300);
  transition: color 0.3s var(--ease);
}
@media (min-width: 640px) { .progress-list button { font-size: 9px; letter-spacing: 0.2em; } }
.progress-list button::after {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--red);
  transform: scale(0);
  transition: transform 0.3s var(--spring);
}
.progress-list button.is-done { color: var(--gray-500); }
.progress-list button.is-done:hover { color: var(--ink); }
.progress-list button.is-active { color: var(--red); }
.progress-list button.is-active::after { transform: scale(1); }
.progress-list button:disabled { cursor: default; }
.progress-track { display: block; position: relative; height: 1px; background: var(--gray-100); }
.progress-fill {
  position: absolute;
  inset: 0;
  background: var(--red);
  opacity: 0.6;
  transform-origin: left center;
  transform: scaleX(var(--p, 0));
  transition: transform 0.7s var(--ease);
}
.trail {
  min-height: 16px;
  margin-top: 12px;
  text-align: center;
  font-size: 10px;
  line-height: 1.6;
  color: var(--gray-400);
}
.trail b { font-weight: 600; color: var(--gray-600); }
/* the dot ends an item, so a wrapped line never starts with one */
.trail span:not(:last-child) { margin-right: 7px; }
.trail span:not(:last-child)::after { content: "·"; margin-left: 7px; color: var(--gray-300); }
.trail span { display: inline-block; animation: dr8-step-in 0.5s var(--spring) both; }

/* ---------- screens + transitions ---------- */

.screen { transition: opacity 0.16s var(--ease), transform 0.16s var(--ease); }
.screen.is-leaving { opacity: 0; transform: translateY(-6px); }
.screen.is-entering [data-rise] { animation: dr8-step-in 0.5s var(--spring) both; animation-delay: calc(var(--i, 0) * 70ms); }

.q { text-align: center; margin-bottom: 26px; }
.q-title {
  margin: 10px auto 0;
  max-width: 22ch;
  font-size: clamp(20px, 5.2vw, 26px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.q-help { margin: 10px auto 0; max-width: 44ch; font-size: 12px; line-height: 1.7; color: var(--gray-500); }
.q-help:empty { display: none; }
/* no orphaned last words ("photo?" alone on a line) anywhere */
.q-title, .q-help, .welcome-title, .welcome-lede, .choice-title, .fine-caps, .wall-cap, .sizes-cap, .row-sub, .advice, .note-small, .size-sub, .asm-title, .asm-body { text-wrap: balance; }
.nobr { white-space: nowrap; }

/* ---------- welcome ---------- */

.card[data-screen="welcome"] { padding-top: 24px; }
.screen[data-screen="welcome"] { text-align: center; padding-top: 18px; }
.welcome-title {
  margin: 14px auto 0;
  max-width: 17ch;
  font-size: clamp(28px, 7vw, 40px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.035em;
}
.welcome-ask { margin-top: 38px; }
.screen[data-screen="welcome"] .fine-caps { margin-top: 20px; }

/* how it works — the calculator's OrderingFlow, now above the choice */
.how { margin-top: 30px; }
.how-row { position: relative; display: flex; justify-content: space-between; align-items: flex-start; max-width: 32rem; margin: 20px auto 0; }
.how-line {
  position: absolute;
  top: 20px;
  left: 12.5%;
  right: 12.5%;
  height: 1.5px;
  background: rgba(222, 41, 16, 0.3);
  transform: scaleX(0);
  transform-origin: left center;
}
.how.is-seen .how-line { animation: dr8-line-draw 0.7s ease 0.15s both; }
.how-step {
  position: relative;
  z-index: 1;
  width: 25%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0;
}
.how.is-seen .how-step { opacity: 1; animation: dr8-step-in 0.5s var(--spring) both; animation-delay: calc(var(--i) * 150ms); }
.how-ico {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--gray-200);
  background: var(--card);
  color: var(--red);
}
.how-ico svg { width: 18px; height: 18px; }
.how-step > span:last-child {
  padding: 0 2px;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-500);
  text-wrap: balance;
}
@media (min-width: 640px) { .how-step > span:last-child { font-size: 9px; } }
.how-step small { display: block; margin-top: 3px; font-size: 8px; font-weight: 500; letter-spacing: 0.02em; text-transform: none; color: var(--gray-400); }

/* the two ways in — the calculator's Trans Print order cards: a choice with a looping demo inside */
.choices { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 14px; text-align: left; }
@media (min-width: 640px) { .choices { grid-template-columns: 1fr 1fr; } }
.choice {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  background: #fff;
  text-align: left;
  transition: border-color 0.3s var(--ease), transform 0.2s var(--spring);
}
.choice:hover { border-color: var(--gray-300); }
.choice:active { transform: scale(0.99); }
.choice.is-selected { border-color: var(--red); }
.choice-radio {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border: 2px solid var(--gray-300);
  border-radius: 50%;
  transition: border-color 0.2s var(--ease);
}
.choice-radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--red); transform: scale(0); transition: transform 0.3s var(--spring); }
.choice.is-selected .choice-radio { border-color: var(--red); }
.choice.is-selected .choice-radio::after { transform: scale(1); }
.choice-head { display: flex; align-items: center; gap: 8px; padding-right: 26px; }
.choice-head svg { flex: none; width: 18px; height: 18px; color: var(--gray-400); transition: color 0.3s var(--ease); }
.choice:hover .choice-head svg, .choice.is-selected .choice-head svg { color: var(--red); }
.choice-title { font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.choice-sub { margin-top: 3px; padding-left: 26px; font-size: 11px; line-height: 1.5; color: var(--gray-500); }

/* the narration under each demo: "2/3 · We try every IKEA frame" */
.choice-step {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 18px;
  margin-top: 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  transition: opacity 0.15s var(--ease), color 0.3s var(--ease);
}
.choice-step b { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; color: var(--red); font-variant-numeric: tabular-nums; }
.choice-step.is-swap { opacity: 0; }
.choice-step.is-done { color: var(--green); }
.choice-step.is-done span::after { content: " ✓"; }

.demo { position: relative; display: block; width: 100%; max-width: 300px; height: 164px; margin: 12px auto 0; }
.demo-cap {
  position: absolute;
  left: 0;
  right: 0;
  font-size: 8px;
  font-weight: 700;
  line-height: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-align: center;
  color: var(--gray-400);
  white-space: nowrap;
}
.demo-cap--top { top: 0; }
.demo-slot { position: absolute; top: 16px; left: 50%; width: 48px; height: 32px; transform: translateX(-50%); border: 1px dashed var(--gray-300); border-radius: 3px; display: grid; place-items: center; }
.demo-up { width: 14px; height: 14px; color: var(--gray-400); animation: breathe 2s ease-in-out infinite; transition: opacity 0.2s var(--ease); }
.demo.is-filled .demo-up { opacity: 0; animation: none; }
.demo-photo { position: absolute; top: 0; left: 0; z-index: 2; overflow: hidden; opacity: 0; box-shadow: 0 1px 2px rgba(20, 17, 15, 0.16); will-change: transform; }
.demo-photo img, .demo-print img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* A · the photo is tried in each frame; the ones that cut it get a cross */
.demo-frames { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; align-items: flex-end; gap: 18px; }
.demo-fcol { display: flex; flex-direction: column; align-items: center; gap: 6px; }
/* plain frames, no mat: whatever doesn't match the frame's shape gets cut */
.demo-frame { position: relative; display: block; border: 3px solid var(--moulding-black); background: var(--gray-100); outline: 1px solid transparent; outline-offset: 3px; transition: opacity 0.4s var(--ease), outline-color 0.3s var(--ease); }
.demo-frame[data-shape="port"] { width: 46px; height: 64px; }
.demo-frame[data-shape="square"] { width: 54px; height: 54px; }
.demo-frame[data-shape="land"] { width: 68px; height: 48px; }
.demo-win { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--gray-100); }
.demo-frame[data-shape="port"] .demo-win { width: 40px; height: 58px; }
.demo-frame[data-shape="square"] .demo-win { width: 48px; height: 48px; }
.demo-frame[data-shape="land"] .demo-win { width: 62px; height: 42px; }
.demo-frame.is-dim { opacity: 0.3; }
.demo-frame.is-match { outline-color: var(--red); }
.demo-mark {
  height: 12px;
  font-size: 8px;
  font-weight: 700;
  line-height: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s var(--ease), transform 0.35s var(--spring);
}
.demo-mark.is-no, .demo-mark.is-yes { opacity: 1; transform: none; }
.demo-mark.is-no { color: var(--red); }
.demo-mark.is-yes { color: var(--green); }

/* B · the photo flies into the frame, cut a little bigger than the window, and tucks behind the mat */
.demo-size .demo-slot { top: 74px; left: 20%; transform: translate(-50%, -50%); }
.demo-cap--slot { top: 104px; left: 20%; right: auto; transform: translateX(-50%); }
.demo-bframe {
  position: absolute;
  top: 74px;
  left: 66%;
  width: 112px;
  height: 80px;
  border: 5px solid var(--moulding-black);
  background: var(--gray-100);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.92);
  transition: opacity 0.35s var(--ease), transform 0.5s var(--spring);
}
.demo-size.is-framed .demo-bframe { opacity: 1; transform: translate(-50%, -50%); }
/* the print is white paper with the photo in the middle: the mat will hold the white edge */
.demo-print { position: absolute; z-index: 3; overflow: hidden; background: #fff; opacity: 0; transform-origin: 0 0; box-shadow: 0 3px 8px rgba(20, 17, 15, 0.2); }
.demo-print img { position: absolute; }
.demo-print.is-under { z-index: 1; box-shadow: none; }
.demo-mat { position: absolute; inset: 0; z-index: 2; border: 15px solid var(--mat); border-width: 15px 21px; box-shadow: var(--mat-window-sm); }
.demo-outline { position: absolute; z-index: 4; border: 1px dashed rgba(222, 41, 16, 0.85); opacity: 0; transition: opacity 0.35s var(--ease); }
.demo-outline.is-on { opacity: 1; }
.demo-bcap { position: absolute; left: 66%; top: 124px; width: 160px; height: 12px; transform: translateX(-50%); }
.demo-bcap span {
  position: absolute;
  inset: 0;
  font-size: 8px;
  font-weight: 700;
  line-height: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.demo-bcap .is-gray { color: var(--gray-500); }
.demo-bcap .is-red { color: var(--red); }
.demo-size.is-framed .demo-bcap .is-gray { opacity: 1; }
.demo-size.is-landed .demo-bcap .is-gray { opacity: 0; }
.demo-size.is-landed .demo-bcap .is-red { opacity: 1; }

/* ---------- ① photo ---------- */

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 200px;
  padding: 28px;
  border: 1px dashed var(--gray-300);
  border-radius: 1.25rem;
  background: var(--paper);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.dropzone:hover, .dropzone.is-over { border-color: rgba(222, 41, 16, 0.5); background: rgba(222, 41, 16, 0.03); }
.dropzone svg { width: 22px; height: 22px; color: var(--gray-400); margin-bottom: 4px; }
.dropzone strong { font-size: 13px; font-weight: 600; }
.dropzone em { font-style: normal; font-size: 9px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: var(--gray-400); }
.breathe { animation: breathe 3s ease-in-out infinite; }
#imageInput:focus-visible + .dropzone { outline: 2px solid var(--red); outline-offset: 3px; }

.chosen { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.chosen .note-small { margin-top: -6px; }
.chosen .note-small:empty { display: none; }
.chosen-img { display: flex; justify-content: center; }
.chosen-img img {
  display: block;
  max-width: 100%;
  max-height: 240px;
  border: 1px solid var(--gray-200);
  box-shadow: 0 1px 2px rgba(20, 17, 15, 0.08);
  animation: dr8-land 0.6s var(--spring) both;
}
.readout { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 26px; }
.readout div { display: flex; flex-direction: column; align-items: center; gap: 3px; }
/* a square photo: which way the frame hangs (2026-10-15) */
.orient-picks { display: flex; gap: 6px; align-items: baseline; }
.orient-picks .text-link { font-size: inherit; color: var(--gray-400); }
.orient-picks .text-link.is-on { color: var(--ink); font-weight: 600; text-decoration-color: var(--red); }
.readout dt { font-size: 9px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gray-400); }
.readout dd { font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }

.status { margin-top: 12px; text-align: center; font-size: 11px; color: var(--gray-500); }
.status.is-error { color: var(--red); font-weight: 600; }

.alt-links { display: flex; justify-content: center; align-items: baseline; flex-wrap: wrap; gap: 6px 10px; margin-top: 20px; color: var(--gray-300); font-size: 11px; }

.shape-panel { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--gray-100); animation: dr8-step-in 0.5s var(--spring) both; }
.picks { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 20px; margin-top: 12px; }
@media (min-width: 640px) { .picks { gap: 4px 34px; } }
.pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 6px 2px 0;
  color: var(--gray-400);
  transition: color 0.3s var(--ease);
}
.pick:hover { color: var(--gray-600); }
.pick > span { font-size: 10px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; white-space: nowrap; }
.pick > i { font-style: normal; font-size: 8px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gray-300); }
.pick::after { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--red); transform: scale(0); transition: transform 0.3s var(--spring); }
.pick.is-active { color: var(--red); }
.pick.is-active::after { transform: scale(1); }
.pick .swatch { display: inline-block; width: 9px; height: 9px; margin-right: 7px; vertical-align: -1px; border-radius: 1px; background: var(--moulding-black); }
.pick .swatch.is-white { background: var(--moulding-white); box-shadow: inset 0 0 0 1px var(--gray-300); }

.shape-preview { display: flex; justify-content: center; align-items: center; height: 130px; margin-top: 14px; }
.shape-preview span {
  display: grid;
  place-items: center;
  border: 1px solid var(--gray-400);
  box-shadow: 0 1px 2px rgba(20, 17, 15, 0.06);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  transition: width 0.5s var(--spring), height 0.5s var(--spring);
}

/* ---------- ② size: the frame on a wall, drawn to scale ---------- */

.wall { position: relative; height: 240px; border-radius: 14px; background: var(--wall); overflow: hidden; }
@media (min-width: 640px) { .wall { height: 280px; } }
.wall-cap { margin-top: 8px; text-align: center; font-size: 8px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: var(--gray-400); }
.wall-floor { position: absolute; left: 0; right: 0; bottom: 0; height: 12px; background: #e3ddd3; border-top: 1px solid var(--gray-300); }
.wall-board, .wall-cat { transition: left 0.6s var(--spring), bottom 0.6s var(--spring), width 0.6s var(--spring), height 0.6s var(--spring); }
.wall-board { position: absolute; display: block; border: 1px solid var(--gray-300); border-radius: 2px; background: #f6f2eb; }
.wall-board::before, .wall-board::after { content: ""; position: absolute; top: 100%; width: 3px; height: var(--leg, 8px); background: var(--gray-400); transition: height 0.6s var(--spring); }
.wall-board::before { left: 9%; }
.wall-board::after { right: 9%; }
.wall-board i { position: absolute; left: 50%; top: 12%; bottom: 12%; width: 1px; background: var(--gray-300); }
.wall-board i::before, .wall-board i::after { content: ""; position: absolute; top: 42%; width: 3px; height: 3px; border-radius: 50%; background: var(--gray-400); }
.wall-board i::before { right: 4px; }
.wall-board i::after { left: 4px; }
/* the scale cat: a flat silhouette in the house grays; it breathes, its tail sways,
   and it flicks its tail when the customer picks another size */
.wall-cat { position: absolute; display: block; overflow: visible; }
.wall-cat .cat-body path:first-child { fill: var(--gray-400); }
.cat-eye { fill: none; stroke: var(--wall); stroke-width: 0.7; stroke-linecap: round; }
.cat-tail { fill: none; stroke: var(--gray-400); stroke-width: 3; stroke-linecap: round; }
.cat-body { transform-box: fill-box; transform-origin: 50% 100%; animation: cat-breathe 3.4s ease-in-out infinite; }
.cat-tail { transform-box: fill-box; transform-origin: 0 0; animation: cat-sway 4.2s ease-in-out infinite; }
.wall-cat.is-flick .cat-tail { animation: cat-flick 0.8s ease-in-out; }
.wall-frame {
  position: absolute;
  display: block;
  border: 4px solid var(--frame, var(--moulding-black));
  background: #fff;
  box-shadow: var(--frame-drop);
  transition: left 0.6s var(--spring), bottom 0.6s var(--spring), width 0.6s var(--spring), height 0.6s var(--spring), border-width 0.6s var(--spring), border-color 0.3s var(--ease), opacity 0.3s var(--ease);
}
.wall-frame::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 1px 3px rgba(20, 17, 15, 0.16); pointer-events: none; }
.wall-frame.is-light { border-color: var(--frame, var(--moulding-white)); box-shadow: 0 0 0 1px var(--gray-300), var(--frame-drop); }
.wall-frame.is-off { opacity: 0; }
.wall-frame.no-dims .dim { display: none; }
.wall-frame.is-arriving { animation: dr8-land 0.6s var(--spring) both; }
.wall-sheet { position: absolute; left: 50%; top: 50%; overflow: hidden; background: #fff; transform: translate(-50%, -50%); transition: width 0.6s var(--spring), height 0.6s var(--spring); }
.wall-art { position: absolute; inset: 0; overflow: hidden; }
.wall-art img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.wall-mat { position: absolute; inset: 0; border: 0 solid var(--mat); box-shadow: var(--mat-window-sm); transition: border-width 0.6s var(--spring); }
.wall .dim { --gap: 12px; }
.wall .dim span { background: var(--wall); }
.wall-hint { position: absolute; left: 0; right: 0; top: 18%; text-align: center; font-size: 9px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--red); animation: breathe 3s ease-in-out infinite; }

/* the size between two circle arrows — the calculator's quantity stepper (− 1 +) */
.sizer { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 30px; }
@media (min-width: 640px) { .sizer { gap: 24px; } }
.sizer-readout { position: relative; min-width: 150px; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.sizer-flag {
  position: absolute;
  top: -15px;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--red);
  white-space: nowrap;
}
.sizer-value { display: flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }
.sizer-value b { font-size: 34px; font-weight: 300; line-height: 1; letter-spacing: -0.03em; white-space: nowrap; }
.sizer-value i { font-style: normal; font-size: 13px; color: var(--gray-400); }
.sizer-meta { font-size: 9px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: var(--gray-400); white-space: nowrap; }
.sizer-meta .is-good { color: var(--green); }
.sizer-meta .is-bad { color: var(--red); }

/* every size at once: a to-scale frame with the customer's photo in each, bottom-aligned
   like a row of frames on a shelf; the chosen one sits on a white card with a red edge */
.sizes { --cols: 4; display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 3px; max-width: 44rem; margin: 16px auto 0; padding: 4px; border-radius: 14px; background: var(--wall); }
@media (min-width: 640px) { .sizes { --cols: 5; gap: 6px; padding: 8px; } }
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 0;
  min-height: 44px;
  padding: 8px 1px 6px;
  border: 1.5px solid transparent;
  border-radius: 10px;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}
@media (min-width: 640px) { .tile { padding: 10px 4px 8px; } }
.tile:hover { background: rgba(255, 255, 255, 0.55); }
.tile.is-active { background: var(--card); border-color: var(--red); }
.tile-stage { display: flex; align-items: flex-end; justify-content: center; width: 100%; height: var(--stage-h, 40px); margin-bottom: 4px; }
.tile-frame {
  display: block;
  flex: none;
  width: calc(var(--w) * var(--k, 0.5) * 1px);
  height: calc(var(--h) * var(--k, 0.5) * 1px);
  min-width: 5px;
  min-height: 5px;
  border: 1.5px solid var(--frame, var(--moulding-black));
  background: linear-gradient(180deg, #d6e0e1 0 52%, #a9bab3 52% 64%, #d9cfb8 64% 100%) center / cover no-repeat;
  box-shadow: 0 1px 2px rgba(20, 17, 15, 0.18);
  transition: width 0.5s var(--spring), height 0.5s var(--spring);
}
.tile-flag { height: 10px; font-size: 7px; font-weight: 700; line-height: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--red); white-space: nowrap; }
@media (min-width: 640px) { .tile-flag { height: 12px; font-size: 8px; line-height: 12px; } }
.tile-size { font-size: 12px; font-weight: 500; color: var(--gray-600); white-space: nowrap; font-variant-numeric: tabular-nums; transition: color 0.2s var(--ease); }
@media (min-width: 640px) { .tile-size { font-size: 15px; } }
.tile.is-active .tile-size { color: var(--red); }
.tile-fit { font-size: 10px; font-weight: 600; color: var(--gray-400); font-variant-numeric: tabular-nums; }
@media (min-width: 640px) { .tile-fit { font-size: 11px; } }
.tile-fit.is-good { color: var(--green); }
.tile-fit.is-bad { color: var(--red); }
.sizes-cap { margin-top: 8px; text-align: center; font-size: 8px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: var(--gray-400); }

.size-info { min-height: 42px; margin: 18px auto 0; max-width: 44ch; text-align: center; font-size: 11px; line-height: 1.8; color: var(--gray-500); text-wrap: balance; }
.size-info b { font-weight: 600; color: var(--ink); }
.size-info .is-good { font-weight: 600; color: var(--green); }
.size-info .is-bad { font-weight: 600; color: var(--red); }

/* ---------- the live preview (frame · mat · print) with red callouts ---------- */

.preview-host { display: flex; justify-content: center; padding: 10px 0 20px; border-radius: 14px; background: var(--wall); }
.preview-host .dim span { background: var(--wall); }
.preview-host:empty { display: none; }
.card > .preview { display: none; }
.preview { position: relative; margin: 0; padding: 34px 40px 2px 6px; }
.pv-frame {
  position: relative;
  border: 10px solid var(--frame, var(--moulding-black));
  background: #fff;
  box-shadow: var(--frame-drop);
  transition: width 0.5s var(--spring), height 0.5s var(--spring), border-width 0.5s var(--spring), border-color 0.3s var(--ease);
}
/* the moulding's shadow, over the mat (or the photo) */
.pv-frame::after { content: ""; position: absolute; inset: 0; box-shadow: var(--frame-inner); pointer-events: none; }
.pv-frame.is-light { border-color: var(--frame, var(--moulding-white)); box-shadow: 0 0 0 1px var(--gray-300), var(--frame-drop); }
.pv-sheet {
  position: absolute;
  left: 50%;
  top: 50%;
  overflow: hidden;
  background: #fff;
  transform: translate(-50%, -50%);
  transition: width 0.5s var(--spring), height 0.5s var(--spring);
}
.pv-art { position: absolute; inset: 0; overflow: hidden; transition: inset 0.5s var(--spring); }
.pv-art img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.pv-mat {
  position: absolute;
  inset: 0;
  border: 0 solid var(--mat);
  box-shadow: var(--mat-window);
  transition: border-width 0.5s var(--spring);
}

.placeholder-art {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #d6e0e1 0 52%, #a9bab3 52% 64%, #d9cfb8 64% 100%);
}
.placeholder-art span { font-size: 9px; font-weight: 700; letter-spacing: 0.15em; color: rgba(20, 17, 15, 0.35); }

/* red dimension lines with tick end-caps, drawn from the centre */
.dim { position: absolute; pointer-events: none; --gap: 18px; }
.dim--w { left: 0; right: 0; top: calc(-1 * var(--mould, 0px) - var(--gap)); height: 0; }
.dim--h { top: 0; bottom: 0; right: calc(-1 * var(--mould, 0px) - var(--gap)); width: 0; }
.dim .bar {
  position: absolute;
  inset: 0;
  border: 0 solid rgba(222, 41, 16, 0.6);
}
.dim--w .bar { border-top-width: 1px; }
.dim--h .bar { border-right-width: 1px; }
.dim .bar::before, .dim .bar::after { content: ""; position: absolute; background: rgba(222, 41, 16, 0.6); }
.dim--w .bar::before, .dim--w .bar::after { top: -4px; width: 1px; height: 8px; }
.dim--w .bar::before { left: 0; }
.dim--w .bar::after { right: 0; }
.dim--h .bar::before, .dim--h .bar::after { right: -4px; width: 8px; height: 1px; }
.dim--h .bar::before { top: 0; }
.dim--h .bar::after { bottom: 0; }
.dim span {
  position: absolute;
  background: var(--card);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--red);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.dim--w span { top: -8px; left: 50%; transform: translateX(-50%); padding: 0 7px; line-height: 16px; }
.dim--h span { right: -8px; top: 50%; transform: translateY(-50%) rotate(180deg); padding: 7px 0; writing-mode: vertical-rl; line-height: 16px; }
.is-drawing .dim--w .bar { animation: dr8-line-draw-c 0.7s ease both; }
/* grey: the frame's outside, edge to edge, on the left and below (owner, 2026-10-15) */
.dim--out { --gap: 14px; }
.dim--out.dim--w { top: auto; bottom: calc(-1 * var(--mould, 0px) - var(--gap)); left: calc(-1 * var(--mould, 0px)); right: calc(-1 * var(--mould, 0px)); }
.dim--out.dim--h { right: auto; left: calc(-1 * var(--mould, 0px) - var(--gap)); top: calc(-1 * var(--mould, 0px)); bottom: calc(-1 * var(--mould, 0px)); }
.dim--out .bar { border-color: rgba(110, 103, 94, 0.55); }
.dim--out .bar::before, .dim--out .bar::after { background: rgba(110, 103, 94, 0.55); }
.dim--out.dim--w .bar { border-top-width: 0; border-bottom-width: 1px; }
.dim--out.dim--w .bar::before, .dim--out.dim--w .bar::after { top: auto; bottom: -4px; }
.dim--out.dim--h .bar { border-right-width: 0; border-left-width: 1px; }
.dim--out.dim--h .bar::before, .dim--out.dim--h .bar::after { right: auto; left: -4px; }
.dim--out span { color: var(--gray-500); font-weight: 600; letter-spacing: 0.04em; }
.dim--out.dim--w span { top: auto; bottom: -8px; }
.dim--out.dim--h span { right: auto; left: -8px; }
.preview:not(.has-out) .dim--out { display: none; }
.preview.has-out { padding: 34px 44px 30px 44px; }
/* red on the paper behind the mat, on the fit step */
.pv-print { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none; display: none; }
.pv-frame.dims-on-paper .pv-print { display: block; }
.pv-frame.dims-on-paper > .dim:not(.dim--out) { display: none; }
.pv-print .dim { --mould: 0px; }
.pv-print .dim--w { --gap: var(--print-gap-w, 10px); }
.pv-print .dim--h { --gap: var(--print-gap-h, 10px); }
.preview-host .pv-print .dim span { background: var(--mat); }
.preview-host .pv-print.out-w .dim--w span, .preview-host .pv-print.out-h .dim--h span { background: var(--wall); }
.pv-print .dim--w span { top: -7px; line-height: 14px; }   /* a little shorter, to sit inside a thin mat strip */
.pv-note { position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 8px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gray-400); pointer-events: none; }
.fit-frame-cap { margin-top: 8px; text-wrap: balance; }
.mat-demo .md-frame .dim--out span { background: var(--wall); }
.mat-demo .md-frame.no-out .dim--out { display: none; }
.is-drawing .dim--h .bar { animation: dr8-line-draw-v 0.7s ease both; }
.is-drawing .dim span { animation: dr8-fade 0.4s ease 0.35s both; }
.dims-off .dim { opacity: 0; transition: opacity 0.25s var(--ease); }

/* ---------- numbered rows (the calculator's list; the plan's print row) ---------- */

.row {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  column-gap: 14px;
  align-items: start;
  width: 100%;
  padding: 20px 0;
  border-top: 1px solid var(--gray-100);
  text-align: left;
}
@media (min-width: 640px) { .row { column-gap: 22px; padding: 24px 0; } }
.row--static { grid-template-columns: auto 1fr auto; cursor: default; }
.row-num { min-width: 22px; margin-top: 3px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; color: var(--gray-400); }
@media (min-width: 640px) { .row-num { font-size: 11px; } }
.row-main { display: flex; flex-direction: column; min-width: 0; }
.row-title { font-size: 13px; font-weight: 500; letter-spacing: 0.15em; text-transform: uppercase; transition: color 0.2s var(--ease); }
@media (min-width: 640px) { .row-title { font-size: 15px; } }
.row-sub { margin-top: 4px; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gray-400); }
/* the calculator's minimum order, under the print it applies to */
.row-min { margin-top: 6px; font-size: 11px; line-height: 1.5; color: var(--gray-500); text-wrap: pretty; }
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 2px;
  background: var(--ink);
  color: var(--card);
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.price { display: flex; align-items: flex-start; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price.is-tbc { align-items: center; white-space: normal; justify-content: flex-end; text-align: right; }
.price.is-tbc b { max-width: 8.5em; font-size: 12px; font-weight: 500; line-height: 1.3; letter-spacing: 0; }
.price sup { margin: 3px 3px 0 0; font-size: 8px; font-weight: 500; letter-spacing: -0.01em; color: var(--gray-400); line-height: 1; }
.price b { font-size: 18px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
@media (min-width: 640px) { .price b { font-size: 22px; } .price sup { margin-top: 4px; } }
.radio {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  display: grid;
  place-items: center;
  border: 2px solid var(--gray-300);
  border-radius: 50%;
  transition: border-color 0.2s var(--ease);
}
.radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--red); transform: scale(0); transition: transform 0.3s var(--spring); }

/* ---------- ③ frame cards: two wide cards per row under the preview ----------
   app.js adds .is-cols once the list is at least 560px. The card stays wide either way:
   a small drawing on the left, the name, price and material beside it, fit and colours
   underneath. Narrower than that, the same card stacks in one column. */

.frame-cards { margin-top: 18px; }
.fcards { display: grid; grid-template-columns: 1fr; gap: 10px; }
.fcards.is-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 12px; }
/* two columns: every card the same height, so rows don't step up and down with the colour count (owner, 2026-10-06) */
.fcard {
  position: relative;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  grid-template-areas: "stage head" "body body";
  column-gap: 14px;
  align-items: center;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--gray-100);
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.3s var(--ease), color 0.2s var(--ease);
  animation: dr8-tier-in 0.6s var(--spring) both;
  animation-delay: calc(var(--i, 0) * 110ms);
}
.frame-cards.no-enter .fcard { animation: none; }
.fcard:hover { border-color: var(--gray-300); }
.fcard.is-active { border-color: var(--red); }
.fcard:not(.is-active) .fcard-title { font-weight: 400; color: var(--gray-600); }
/* the whole card is one radio button; the colour picks sit above it */
.fcard-hit { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.fcard-hit:focus-visible { outline-offset: 2px; border-radius: 12px; }
.fcard > .radio { position: absolute; top: 12px; right: 12px; z-index: 2; background: #fff; pointer-events: none; }
.fcard.is-active > .radio { border-color: var(--red); }
.fcard.is-active > .radio::after { transform: scale(1); }
.fcard-stage { grid-area: stage; position: relative; display: flex; justify-content: center; align-items: center; height: 60px; border-radius: 8px; background: var(--wall); }
.fcard-best { position: absolute; top: auto; left: 50%; bottom: -7px; transform: translateX(-50%); font-size: 7px; padding: 3px 6px; white-space: nowrap; }
.fcard-head { grid-area: head; min-width: 0; }
.fcard-title-row { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; padding-right: 22px; }
.fcard-title { display: block; min-width: 0; font-size: 13px; font-weight: 500; line-height: 1.3; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.fcard-sub { display: block; margin-top: 2px; font-size: 12px; color: var(--gray-500); }
.fcard-meta { flex: none; margin-top: 0; font-size: 14px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fcard-meta i { margin-left: 5px; font-style: normal; font-size: 8px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: var(--gray-400); }
.fcard-meta.is-quiet { font-size: 12px; font-weight: 500; color: var(--gray-500); }
.fcard-body { grid-area: body; display: flex; flex-direction: column; min-width: 0; margin-top: 10px; }
.fcard-fit { display: block; margin: 0 0 12px; font-size: 12px; font-weight: 500; line-height: 1.55; color: var(--gray-600); text-wrap: pretty; }
.fcard-fit::before { content: "✓ "; color: var(--green); }
.fcard-fit.is-bad { color: var(--red); }
.fcard-fit.is-bad::before { content: "! "; color: var(--red); font-weight: 700; }
.fcard-foot { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--gray-100); }
.fcard:not(.is-active) .fcard-foot { opacity: 0.6; }
.swatch-pick { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 12px; font-weight: 500; color: var(--gray-500); white-space: nowrap; transition: color 0.2s var(--ease); }
.swatch-pick:hover { color: var(--ink); }
.swatch-pick i { width: 14px; height: 14px; border-radius: 50%; background: var(--swatch, var(--moulding-black)); box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--gray-200); transition: box-shadow 0.25s var(--spring); }
.swatch-pick i.is-pale { box-shadow: inset 0 0 0 1px var(--gray-300), 0 0 0 2px #fff, 0 0 0 3px var(--gray-200); }
.swatch-pick.is-on { color: var(--ink); }
.swatch-pick.is-on i { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--red); }
.swatch-pick.is-on i.is-pale { box-shadow: inset 0 0 0 1px var(--gray-300), 0 0 0 2px #fff, 0 0 0 3.5px var(--red); }
.swatch-pick:disabled { color: var(--gray-400); cursor: not-allowed; text-decoration: line-through; text-decoration-color: var(--gray-300); }
.swatch-pick:disabled:hover { color: var(--gray-400); }
.swatch-pick:disabled i { opacity: 0.4; }
.swatch-pick.is-only { cursor: default; }
.swatch-pick.is-only:hover { color: var(--gray-500); }

/* a frame drawn in cm: --k px per cm comes from the card list, so every card shares one scale */
.mf {
  position: relative;
  display: block;
  flex: none;
  box-sizing: content-box;
  width: calc(var(--w) * var(--k, 1) * 1px);
  height: calc(var(--h) * var(--k, 1) * 1px);
  border: max(2px, calc(var(--m) * var(--k, 1) * 1px)) solid var(--frame, var(--moulding-black));
  background: var(--mat);
  box-shadow: var(--frame-drop);
}
.mf::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 1px 3px rgba(20, 17, 15, 0.16); pointer-events: none; }
.mf.is-light { border-color: var(--frame, var(--moulding-white)); box-shadow: 0 0 0 1px var(--gray-300), var(--frame-drop); }
.mf-win {
  position: absolute;
  left: calc(var(--x) * var(--k, 1) * 1px);
  top: calc(var(--y) * var(--k, 1) * 1px);
  width: calc(var(--w) * var(--k, 1) * 1px);
  height: calc(var(--h) * var(--k, 1) * 1px);
  background: linear-gradient(180deg, #d6e0e1 0 52%, #a9bab3 52% 64%, #d9cfb8 64% 100%) center / cover no-repeat;
  box-shadow: var(--mat-window-sm);
}
.mf-win.is-full { inset: 0; width: auto; height: auto; box-shadow: none; }

/* ---------- ④ fit ---------- */

.tabs {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 4px;
  max-width: 30rem;
  margin: 0 auto 6px;
  border-bottom: 1px solid var(--gray-200);
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 44px;
  padding: 8px 2px 12px;
  color: var(--gray-400);
  transition: color 0.3s var(--ease);
}
.tab:hover { color: var(--gray-600); }
.tab strong { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; }
@media (min-width: 640px) { .tab strong { letter-spacing: 0.2em; } }
.tab em { font-style: normal; font-size: 8px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gray-400); }
.tab.is-active { color: var(--ink); }
.tab.is-active em { color: var(--red); }
.tab-underline { position: absolute; bottom: -1px; left: 0; height: 1.5px; background: var(--red); transition: left 0.45s var(--spring), width 0.45s var(--spring); }

.screen[data-screen="fit"] .preview-host { margin-top: 18px; }
.advice { max-width: 46ch; margin: 18px auto 0; text-align: center; font-size: 12px; line-height: 1.8; color: var(--gray-600); }
@media (min-width: 640px) { .advice { font-size: 13px; } }
.advice b { font-weight: 600; color: var(--ink); }
.advice .line { display: block; }

/* fit copy sits under the centred preview, in the same quiet centre */
.screen[data-screen="fit"] .advice,
.screen[data-screen="fit"] .quality { text-align: center; }

.edge-tuck { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--gray-100); }
/* with no advice between them, the specs' own bottom hairline is the divider: no second line 22px under it */
.specs--fit + .advice:empty + .edge-tuck { margin-top: 0; border-top: 0; }
.edge-tuck.is-notable summary { color: var(--red); }
.edge-check { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 8px; animation: dr8-step-in 0.45s var(--spring) both; }
.edge-img { position: relative; overflow: hidden; margin-top: 4px; border-radius: 2px; }
.edge-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; display: block; }
.edge-window {
  position: absolute;
  outline: 1px solid #fff;
  box-shadow: 0 0 0 999px rgba(20, 17, 15, 0.5);
  transition: left 0.3s var(--ease), top 0.3s var(--ease), width 0.3s var(--ease), height 0.3s var(--ease);
}
.edge-check .note-small { margin-top: 0; }
.edge-check .text-link { display: inline-flex; align-items: center; min-height: 44px; }
.edge-tuck.is-notable #edgeHint { color: var(--red); font-weight: 600; }
.nudge { display: grid; gap: 12px; width: min(100%, 300px); }
.nudge label { display: grid; gap: 4px; font-size: 9px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: var(--gray-400); }
.nudge input { width: 100%; accent-color: var(--red); }

.quality { margin: 16px auto 0; max-width: 46ch; text-align: center; font-size: 11px; line-height: 1.7; color: var(--gray-500); text-wrap: balance; }
.quality:empty { display: none; }
.quality::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--gray-300); vertical-align: 1px; }
.quality.is-good::before { background: var(--green); }
.quality.is-fair::before { background: var(--amber); }
.quality.is-low { color: var(--red); }
.quality.is-low::before { background: var(--red); }

/* ---------- ⑤ plan ---------- */

/* the answer: three numbers in a row, each under a small label (the photo step's readout).
   On a phone the print size takes the first line and the other two share the second. */
.specs { display: grid; grid-template-columns: 1fr 1fr; max-width: 36rem; margin: 0 auto; border-top: 1px solid var(--gray-100); border-bottom: 1px solid var(--gray-100); }
.spec { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 6px 15px; text-align: center; }
.spec dt { font-size: 9px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gray-400); }
.spec dd { display: flex; align-items: baseline; gap: 5px; font-size: 21px; font-weight: 500; line-height: 1.15; letter-spacing: -0.01em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.spec dd b { font-weight: inherit; }
.spec dd i { font-style: normal; font-size: 12px; font-weight: 400; color: var(--gray-400); }
.spec--main { grid-column: 1 / -1; border-bottom: 1px solid var(--gray-100); }
.spec--main dt { color: var(--red); }
.spec--main dd { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.spec:last-child::before { content: ""; position: absolute; left: 0; top: 24%; bottom: 24%; width: 1px; background: var(--gray-200); }
@media (min-width: 640px) {
  .specs { grid-template-columns: 1.4fr 1fr 1fr; }
  .spec--main { grid-column: auto; border-bottom: 0; }
  .spec + .spec::before { content: ""; position: absolute; left: 0; top: 24%; bottom: 24%; width: 1px; background: var(--gray-200); }
  .spec dt { font-size: 10px; }
  .spec dd { font-size: 22px; }
  .spec--main dd { font-size: 30px; }
}

/* how the print goes into the frame: drawn to scale, looping (plan-demo.js) */
.mat-demo { margin: 22px 0 0; padding: 6px 0 14px; border-radius: 14px; background: var(--wall); }
.mat-demo .dim span { background: var(--wall); }
.md-stage { position: relative; }
.md-stage > * { position: absolute; display: block; }
.md-paper { background: #fff; box-shadow: 0 0 0 1px var(--gray-300); }
.md-paper .dim { --mould: 0px; transition: opacity 0.3s var(--ease); }
.mat-demo.is-matted .md-paper .dim, .mat-demo.is-framed .md-paper .dim { opacity: 0; }
.md-art { position: absolute; overflow: hidden; }
.md-art img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.md-mat {
  border: 0 solid var(--mat);
  box-shadow: var(--mat-window), 0 1px 3px rgba(20, 17, 15, 0.12);
  opacity: 0;
  transform: translateY(-16px);
  transition: opacity 0.35s var(--ease), transform 0.7s var(--spring);
}
.mat-demo.is-matted .md-mat { opacity: 1; transform: none; animation: md-mat-land 1.7s var(--ease) both; }
@keyframes md-mat-land {
  0% { opacity: 0; transform: translateY(-16px); }
  30% { opacity: 0.55; transform: none; }
  70% { opacity: 0.55; }
  100% { opacity: 1; }
}
.md-edge { border: 1px dashed rgba(222, 41, 16, 0.85); opacity: 0; transition: opacity 0.35s var(--ease); }
.mat-demo.has-mat.is-matted .md-edge { opacity: 1; transition-delay: 0.45s; }
/* the hidden paper edge gets a name, just under the dashed line */
.md-edge-tag {
  position: absolute;
  right: -1px;
  top: calc(100% + 3px);
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 7px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
  white-space: nowrap;
}
.md-frame {
  border: 4px solid var(--frame, var(--moulding-black));
  box-shadow: var(--frame-drop), var(--frame-inner);
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.35s var(--ease), transform 0.55s var(--spring);
}
.md-frame.is-light { border-color: var(--frame, var(--moulding-white)); box-shadow: 0 0 0 1px var(--gray-300), var(--frame-drop), var(--frame-inner); }
.mat-demo.is-framed .md-frame { opacity: 1; transform: none; }

/* the zoom bubble on the window's corner, tied to it by a thin line */
.md-link, .md-spot, .md-bubble { visibility: hidden; }
.mat-demo.has-mat .md-link, .mat-demo.has-mat .md-spot, .mat-demo.has-mat .md-bubble { visibility: visible; }
.md-link { height: 1px; background: var(--gray-300); transform-origin: 0 0; }
.md-spot { width: 12px; height: 12px; margin: -6px 0 0 -6px; border: 1px solid var(--red); border-radius: 50%; }
.md-bubble { overflow: hidden; border-radius: 50%; background: var(--wall); box-shadow: 0 0 0 1px var(--gray-300), 0 4px 14px rgba(20, 17, 15, 0.1); }
.md-bubble > * { position: absolute; }
.mb-paper { background: #fff; box-shadow: inset -1px -1px 0 var(--gray-300); }
.mb-photo { background-color: #d9cfb8; background-repeat: no-repeat; }
.mb-mat {
  border: 0 solid var(--mat);
  /* magnified: the window's corner, its bevel catching the light on the bottom and right faces */
  box-shadow: inset 0 0 0 1px rgba(20, 17, 15, 0.2), inset -4px 0 0 #ebe7e0, inset 0 -4px 0 #f4f2ed, 0 0 6px rgba(20, 17, 15, 0.12);
  transform: translate(var(--slide, 30px), var(--slide, 30px));
  transition: transform 0.7s var(--spring);
}
.mat-demo.is-matted .mb-mat { transform: none; }
.mb-edge { border: solid rgba(222, 41, 16, 0.85); border-width: 0 1px 1px 0; border-style: dashed; opacity: 0; transition: opacity 0.35s var(--ease); }
.mat-demo.is-matted .mb-edge { opacity: 1; transition-delay: 0.45s; }
.mb-dim { height: 0; }
.mb-dim i { position: absolute; left: 0; right: 0; top: 0; border-top: 1px solid var(--red); transform-origin: left center; }
.mb-dim i::before, .mb-dim i::after { content: ""; position: absolute; top: -4px; width: 1px; height: 7px; background: var(--red); }
.mb-dim i::before { left: 0; }
.mb-dim i::after { right: 0; }
.mb-dim span { position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%); font-size: 8px; font-weight: 700; line-height: 1; letter-spacing: 0.04em; color: var(--red); white-space: nowrap; }
/* the number on one side of the bracket, the word on the other, each on a small white pill */
.mb-dim .n, .mb-dim .w { padding: 1px 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.88); }
.mb-dim .w { top: 3px; bottom: auto; font-size: 7px; font-weight: 600; letter-spacing: 0.02em; color: var(--gray-600); }
.mb-dim--border .n { top: 3px; bottom: auto; }
.mb-dim--border .w { top: auto; bottom: 3px; }
.mb-dim--border { transition: opacity 0.25s var(--ease); }
/* once the mat is on, the white border is under it: its bracket stays, but steps back to gray */
.mb-dim--border i, .mb-dim--border i::before, .mb-dim--border i::after, .mb-dim--border .n { transition: border-color 0.4s var(--ease), background-color 0.4s var(--ease), color 0.4s var(--ease); }
.mat-demo.is-matted .mb-dim--border i { border-top-color: var(--gray-400); }
.mat-demo.is-matted .mb-dim--border i::before, .mat-demo.is-matted .mb-dim--border i::after { background: var(--gray-400); }
.mat-demo.is-matted .mb-dim--border .n { color: var(--gray-600); }
.mb-dim--mat { opacity: 0; transition: opacity 0.3s var(--ease); }
.mat-demo.is-matted .mb-dim--mat { opacity: 1; transition-delay: 0.5s; }
.mat-demo.is-matted .mb-dim--mat i { animation: dr8-line-draw 0.6s ease 0.5s both; }
.mb-tag {
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 7px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-600);
  white-space: nowrap;
}
.mb-tag--mat { opacity: 0; transition: opacity 0.3s var(--ease); }
.mat-demo.is-matted .mb-tag--mat { opacity: 1; transition-delay: 0.6s; }
.plan-step { margin-top: 12px; }

/* the price: only the print is ours; the frame is a pointer to IKEA, indented under the print */
.budget { margin-top: 30px; }
.budget .row { padding-bottom: 12px; }
.budget-note { padding: 0 0 18px 36px; border-bottom: 1px solid var(--gray-100); }
@media (min-width: 640px) { .budget-note { padding-left: 44px; } }
.frame-note { display: block; font-size: 12px; line-height: 1.7; color: var(--gray-500); }
.frame-note .text-link { font-size: 12px; color: var(--ink); }
.frame-fine { display: block; margin-top: 2px; font-size: 10px; line-height: 1.6; color: var(--gray-400); }

/* three small tools in a row, split by short hairlines */
.tools { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 20px; }
.tool {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 12px 0;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-600);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.tool:hover { background: var(--gray-50); color: var(--ink); }
.tool + .tool::before { content: ""; position: absolute; left: 0; top: 22%; bottom: 22%; width: 1px; background: var(--gray-200); }
.tool svg { width: 18px; height: 18px; color: var(--ink); }
.tool[aria-expanded="true"] { color: var(--red); }
.tool[aria-expanded="true"] svg { color: var(--red); }
.full-plan { margin-top: 10px; animation: dr8-step-in 0.45s var(--spring) both; }
.full-plan textarea {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  background: var(--field);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
  color: var(--gray-600);
  resize: vertical;
}
.plan-status { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.plan-status .note-small { margin-top: 12px; }
.plan-status .note-small:empty { display: none; }
.saved-preview { text-align: center; animation: dr8-step-in 0.5s var(--spring) both; }
.saved-preview img { display: block; max-width: 220px; max-height: 220px; margin: 0 auto; }

/* the optional mounting walkthrough: a quiet way in, not the main button */
.next-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 14px;
  width: 100%;
  margin-top: 22px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--wall);
  text-align: left;
  transition: background-color 0.2s var(--ease);
}
.next-card:hover { background: #e6e0d6; }
.next-card-ico { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--card); color: var(--red); }
.next-card-ico svg { width: 16px; height: 16px; }
/* the walkthrough's own drawing plays inside the card, the way the welcome cards carry a demo
   (owner, 2026-10-06: it was the best animation on the site and nobody saw it) */
.next-card--demo { position: relative; padding: 12px 16px 12px 12px; cursor: pointer; }
.next-card-hit { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.next-card-hit:focus-visible { outline-offset: 2px; border-radius: 14px; }
.next-card-stage { width: 120px; min-width: 0; }
@media (min-width: 640px) { .next-card-stage { width: 240px; } }
/* on a phone the words need the room more than the arrow does */
@media (max-width: 639px) {
  .next-card--demo { grid-template-columns: 120px minmax(0, 1fr); column-gap: 12px; }
  .next-card--demo .next-card-arrow { display: none; }
}
.next-card-stage .asm-stage { border-radius: 10px; }
.next-card-stage:empty { display: none; }
.next-card-text em { display: block; margin-top: 4px; font-style: normal; font-size: 11px; line-height: 1.5; color: var(--gray-500); }
.next-card-text small { display: block; font-size: 11px; color: var(--gray-500); }
.next-card-text b { display: block; font-size: 14px; font-weight: 500; }
.next-card-arrow { width: 18px; height: 18px; color: var(--gray-500); transition: transform 0.3s var(--spring), color 0.2s var(--ease); }
.next-card:hover .next-card-arrow { transform: translateX(3px); color: var(--ink); }

.tuck { margin-top: 20px; text-align: center; }
.tuck summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  list-style: none;
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gray-400);
}
.tuck summary::-webkit-details-marker { display: none; }
.tuck summary::after { content: "+"; font-size: 13px; font-weight: 400; line-height: 1; transition: transform 0.4s var(--ease); }
.tuck[open] summary::after { transform: rotate(45deg); color: var(--ink); }
.tuck summary:hover { color: var(--ink); }

/* ---------- ⑥ putting it together: drawn like an IKEA assembly manual ----------
   Line drawings in black on a white page, a big step number, red for movement and
   measurements, green ✓ / red ✗ for right and wrong. assembly.js draws the SVG. */

.asm-stage { margin: 0 auto; overflow: hidden; border: 1px solid var(--gray-200); border-radius: 14px; background: #fff; transition: height 0.45s var(--ease); }
.asm-svg { display: block; width: 100%; height: auto; }
.asm-svg * { vector-effect: non-scaling-stroke; }
.asm-svg .asm-face { fill: #fff; stroke: var(--ink); stroke-width: 1.3; stroke-linejoin: round; }
.asm-svg .asm-side { fill: #f1eee9; stroke: var(--ink); stroke-width: 1.3; stroke-linejoin: round; }
.asm-svg .asm-side2 { fill: #e3ded5; stroke: var(--ink); stroke-width: 1.3; stroke-linejoin: round; }
.asm-svg .asm-wall { fill: #ebe7e0; stroke: var(--ink); stroke-width: 1; stroke-linejoin: round; }
.asm-svg .asm-glass { fill: #eef4f6; }
.asm-svg .asm-side.asm-glass { fill: #e0e9ec; }
.asm-svg .asm-side2.asm-glass { fill: #d3dfe3; }
.asm-svg .asm-board { fill: #f3ece0; }
.asm-svg .asm-side.asm-board { fill: #e8dece; }
.asm-svg .asm-side2.asm-board { fill: #dbcfba; }
.asm-svg .asm-paper { fill: #f8f6f2; }
.asm-svg .asm-cloth { fill: #f6f3ee; stroke: var(--gray-400); stroke-width: 1; stroke-linejoin: round; }
.asm-svg .asm-stitch { fill: none; stroke: var(--gray-300); stroke-width: 1; stroke-dasharray: 2 3; }
.asm-svg .asm-ln { fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.asm-svg .asm-thin { stroke: var(--gray-500); stroke-width: 1; }
.asm-svg .asm-glare { fill: none; stroke: #b4c6cc; stroke-width: 1.3; stroke-linecap: round; }
.asm-svg .asm-tab { fill: #d8d2c8; stroke: var(--ink); stroke-width: 1.1; stroke-linejoin: round; }
.asm-svg .asm-turn { fill: #cfc9bf; stroke: var(--ink); stroke-width: 1.1; stroke-linejoin: round; }
.asm-svg .asm-pin { fill: var(--ink); }
.asm-svg .asm-screw { fill: #d9d4cb; stroke: var(--ink); stroke-width: 1; }
.asm-svg .asm-hanger { fill: #d8d2c8; stroke: var(--ink); stroke-width: 1; stroke-linejoin: round; }
.asm-svg .asm-metal { fill: #cfc9bf; stroke: var(--ink); stroke-width: 1.1; stroke-linejoin: round; }
.asm-svg .asm-hookline { fill: none; stroke: #8a8378; stroke-width: 4; stroke-linejoin: round; }
.asm-svg .asm-film { fill: rgba(170, 205, 218, 0.38); stroke: #8fb0bc; stroke-width: 1; stroke-linejoin: round; }
.asm-svg .asm-film-corner { fill: rgba(214, 232, 238, 0.95); }
.asm-svg .asm-filmline { fill: none; stroke: #7fa3b0; stroke-width: 2.4; stroke-linecap: round; }
.asm-svg .asm-wallplane { fill: #f5f2ec; stroke: var(--gray-300); stroke-width: 1; }
.asm-svg .asm-zoomtext { font: 600 11px var(--font-sans); fill: var(--gray-600); }
.asm-svg .asm-tape { fill: rgba(236, 222, 186, 0.96); stroke: #a9915c; stroke-width: 1; }
.asm-svg .asm-print { fill: #9fb2b7; stroke: var(--ink); stroke-width: 1.1; }
.asm-svg .asm-cut { fill: #e2ddd5; stroke: var(--ink); stroke-width: 1.3; stroke-linejoin: round; }
.asm-svg .asm-arrow { fill: none; stroke: var(--red); stroke-width: 2.2; stroke-linecap: round; }
.asm-svg .asm-dash { fill: none; stroke: var(--red); stroke-width: 1.2; stroke-dasharray: 3 3; }
.asm-svg .asm-dim { fill: none; stroke: var(--red); stroke-width: 1.4; }
.asm-svg .asm-tick { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.asm-svg .asm-ring { fill: none; stroke: var(--ink); stroke-width: 1.4; }
.asm-svg .asm-link { fill: none; stroke: var(--ink); stroke-width: 1; }
.asm-svg .asm-spot { fill: none; stroke: var(--ink); stroke-width: 1.2; }
.asm-svg .asm-mini { fill: #fff; stroke: var(--gray-300); stroke-width: 1.2; }
.asm-svg .asm-spark { stroke: var(--gray-500); animation: asm-pop 0.5s var(--spring) both; }
.asm-svg .asm-num { font: 700 40px var(--font-sans); fill: var(--ink); letter-spacing: -0.02em; }
.asm-svg .asm-label { font: 500 12px var(--font-sans); fill: var(--gray-600); }
.asm-svg .asm-badge-n { font: 700 11px var(--font-sans); fill: var(--ink); }
.asm-svg .asm-cap { font: 500 10px var(--font-sans); fill: var(--gray-500); }
.asm-svg .asm-dimtext { font: 700 10px var(--font-sans); fill: var(--red); }
.asm-svg .asm-pop { animation: asm-pop 0.45s var(--ease) both; }
@keyframes asm-pop { from { opacity: 0; } to { opacity: 1; } }

.asm-copy { max-width: 46ch; min-height: 120px; margin: 22px auto 0; text-align: center; }
.asm-step-no { font-size: 10px; font-weight: 500; letter-spacing: 0.2em; color: var(--gray-400); font-variant-numeric: tabular-nums; }
.asm-step-no b { color: var(--red); font-weight: 700; }
.asm-title { margin-top: 10px; font-size: clamp(16px, 4vw, 19px); font-weight: 500; letter-spacing: -0.01em; }
.asm-body { margin-top: 10px; font-size: 12px; line-height: 1.8; color: var(--gray-500); }
.asm-controls { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 22px; }
.play-btn {
  min-width: 124px;
  height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--card);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: background-color 0.2s var(--ease);
}
.play-btn:hover, .play-btn.is-playing { background: var(--red); }
.asm-dots { display: flex; justify-content: center; gap: 2px; margin-top: 8px; }
.asm-dots button { display: grid; place-items: center; width: 30px; height: 40px; }
.asm-dots button::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--gray-200); transition: background-color 0.2s var(--ease), transform 0.25s var(--spring); }
.asm-dots button.is-done::before { background: var(--gray-400); }
.asm-dots button.is-active::before { background: var(--red); transform: scale(1.6); }

/* ---------- step navigation: back circle + one black pill ---------- */

.step-nav {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 30px -24px -24px;
  padding: 18px 24px calc(20px + env(safe-area-inset-bottom));
  border-radius: 0 0 1.25rem 1.25rem;
  background: linear-gradient(to top, var(--card) 72%, rgba(253, 252, 250, 0));
}
@media (min-width: 640px) {
  .step-nav { margin: 36px -40px -40px; padding: 22px 40px 32px; border-radius: 0 0 2rem 2rem; }
}
.pill--nav { flex: 0 1 280px; padding: 0 22px; }

/* ---------- footer (calculator's T&C line) ---------- */

.foot { margin-top: 40px; padding: 28px 0 56px; border-top: 1px solid var(--gray-100); text-align: center; }
.foot p { font-size: 11px; color: var(--gray-500); }
.foot-fine { max-width: 48ch; margin: 6px auto 16px; font-size: 10px !important; line-height: 1.7; color: var(--gray-400) !important; }
.foot a { font-size: 10px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gray-400); text-underline-offset: 4px; transition: color 0.2s var(--ease); }
.foot a:hover { color: var(--ink); }

/* ============================================================
   2026-10-06 · the page as a first-time customer meets it
   (walked through on a phone and a 900px-tall desktop)
   ============================================================ */

/* ① photo: the black pill opens the picker; skipping is a quiet text link */
.skip-line { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 0 6px; margin-top: 6px; font-size: 11px; color: var(--gray-400); }
.skip-line .text-link { display: inline-flex; align-items: center; min-height: 44px; }
.skip-line span:empty { display: none; }

/* welcome on a phone: shorter demos and tighter gaps, so both choices are within reach */
@media (max-width: 639px) {
  .how { margin-top: 22px; }
  .how-row { margin-top: 14px; }
  .welcome-ask { margin-top: 26px; }
  .choice { padding: 14px; }
  .choice-step { margin-top: 8px; }
  .demo { height: 124px; margin-top: 8px; }
  .demo-slot { top: 14px; width: 40px; height: 26px; }
  .demo-frames { gap: 14px; }
  .demo-fcol { gap: 4px; }
  .demo-frame { border-width: 2.5px; }
  .demo-frame[data-shape="port"] { width: 36px; height: 50px; }
  .demo-frame[data-shape="square"] { width: 42px; height: 42px; }
  .demo-frame[data-shape="land"] { width: 54px; height: 38px; }
  .demo-frame[data-shape="port"] .demo-win { width: 31px; height: 45px; }
  .demo-frame[data-shape="square"] .demo-win { width: 37px; height: 37px; }
  .demo-frame[data-shape="land"] .demo-win { width: 49px; height: 33px; }
  .demo-size .demo-slot { top: 56px; }
  .demo-cap--slot { top: 80px; }
  .demo-bframe { top: 56px; }
  .demo-bcap { top: 98px; }
}

/* ③ frame: the preview stays in view while the cards scroll — pinned to the top on
   phones and tablets, in a left column on a desktop. The pin is card-coloured so the
   cards slide under it cleanly; the owned route has no preview here, so no pin. */
.pv-pin { position: sticky; top: 0; z-index: 4; margin: 0 -8px; padding: 4px 8px 8px; background: var(--card); }
.pv-pin:has(.preview-host:empty) { display: none; }
.screen[data-screen="frame"] .preview-host { padding: 6px 0 12px; }

/* the name filter: an underline field, like the calculator's inputs */
.find { max-width: 24rem; margin: 4px auto 0; }
.find-field { display: flex; align-items: center; gap: 10px; padding: 0 4px; border-bottom: 1px solid var(--gray-300); transition: border-color 0.2s var(--ease); }
.find-field:focus-within { border-color: var(--ink); }
.find-field svg { flex: none; width: 15px; height: 15px; color: var(--gray-400); }
.find-field input { flex: 1; min-width: 0; height: 44px; padding: 0; border: 0; border-radius: 0; background: none; outline: none; font-size: 14px; font-weight: 400; letter-spacing: 0.06em; text-transform: uppercase; -webkit-appearance: none; appearance: none; }
.find-field input::placeholder { text-transform: none; letter-spacing: 0; color: var(--gray-400); }
.find-field input::-webkit-search-cancel-button, .find-field input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.find .note-small { margin-top: 12px; }

/* ④ fit: each tab draws how the photo sits; the words become the plan's three numbers */
.tab { gap: 3px; padding-top: 10px; }
.tab-ico { width: 24px; height: 18px; margin-bottom: 2px; fill: none; stroke: currentColor; stroke-width: 1.3; }
.tab-ico-photo { fill: currentColor; fill-opacity: 0.3; stroke: none; }
.tab-ico-mat { stroke-opacity: 0.5; }
.tab-ico-paper { stroke-opacity: 0.5; stroke-dasharray: 2 2; }
.specs--fit { margin: 18px auto 0; }
.screen[data-screen="fit"] .advice { margin-top: 14px; font-size: 12px; }
.screen[data-screen="fit"] .advice:empty { display: none; }
.edge-detail { max-width: 54ch; }
.edge-detail:empty { display: none; }

/* ⑤ plan: the minimum order sits with the price, the notes are one line each,
   and the only door out — where to order the print — is said once, in red */
.price-col { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.price-each { font-size: 9px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gray-400); white-space: nowrap; }
.price-each.is-min { color: var(--ink); }
@media (max-width: 639px) { .price-each { text-align: right; line-height: 1.5; } .each-sep { display: none; } .each-min { display: block; } }
.row-min { margin-top: 4px; font-size: 10px; line-height: 1.5; color: var(--gray-400); }
.budget-note { padding-bottom: 16px; }
.frame-fine { margin-top: 3px; }
/* "Send it to print": two numbered steps, the print file and the upload (owner, 2026-10-08) */
.send { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--gray-100); }
.send-title { margin: 6px 0 0; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
.send-steps { list-style: none; counter-reset: send; margin: 16px 0 0; padding: 0; }
.send-steps li { position: relative; counter-increment: send; display: flex; flex-direction: column; align-items: flex-start; gap: 9px; padding: 16px 0 18px 36px; border-top: 1px solid var(--gray-100); }
.send-steps li::before { content: "0" counter(send); position: absolute; left: 0; top: 19px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; color: var(--gray-400); }
@media (min-width: 640px) { .send-steps li { padding-left: 44px; } }
.send-head { font-size: 14px; font-weight: 600; color: var(--ink); }
.send-sub { max-width: 52ch; font-size: 12px; line-height: 1.7; color: var(--gray-500); }
.send .pill--small { min-height: 42px; padding: 0 22px; font-size: 12px; }
/* the two send buttons are the same size; only the one to press now is solid (paintSend, owner 2026-10-16) */
.send .send-btn { min-height: 48px; padding: 0 26px; font-size: 13px; }
@media (max-width: 639px) { .send .send-btn { width: 100%; justify-content: center; } }
.send-check { display: none; width: 15px; height: 15px; margin: 0 6px -2px 0; color: var(--red); }
.send-steps li.is-done .send-check { display: inline-block; }
.send-steps li.is-done .send-head { color: var(--gray-500); }
.send a.send-btn { text-decoration: none; }
.send-note { margin-top: -3px; font-size: 11px; line-height: 1.5; color: var(--gray-400); }
.order-more { width: 100%; font-size: 11px; color: var(--gray-500); }
.order-more summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; font-size: 9px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gray-400); }
.order-more summary::-webkit-details-marker { display: none; }
.order-more summary::after { content: "+"; font-size: 12px; font-weight: 400; letter-spacing: 0; }
.order-more[open] summary::after { content: "−"; }
.order-more .order-spec { margin-top: 8px; }
.pill--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--gray-300); }
.pill--ghost:hover:not(:disabled) { background: var(--gray-50) !important; transform: none !important; }
.send-status { margin: 0; }
.send-status:empty { display: none; }
.send-status.is-error { color: var(--red); }
/* the order line: a quiet one-line readout (the form carries it; copying is the fallback). Not ".spec" — that is the plan's three-number row. */
.order-spec { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; width: 100%; font-size: 11px; line-height: 1.6; color: var(--gray-500); }
.order-spec-label { font-size: 9px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gray-400); }
.order-spec code { font-family: var(--font-mono); font-size: 11px; color: var(--gray-600); overflow-wrap: anywhere; user-select: all; }
.order-spec .text-link { font-size: 11px; }
.send-fine { margin-top: 16px; }

/* ⑥ putting it together: the controls belong to the picture; the words follow */
.asm-controls { margin-top: 14px; }
.asm-dots { margin-top: 4px; }
.asm-copy { min-height: 96px; margin-top: 10px; }

/* a desktop is wide: the two screens that choose from many things use two columns */
@media (min-width: 1024px) {
  /* ② size: the wall on the left, every size on the right — nothing hides below the fold */
  .screen[data-screen="size"] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto 1fr auto auto;
    grid-template-areas: "q q" "wall sizer" "wall sizes" "wallcap sizescap" "info info";
    column-gap: 28px;
    align-items: start;
  }
  .screen[data-screen="size"] .q { grid-area: q; }
  .screen[data-screen="size"] .wall { grid-area: wall; height: 420px; }
  .screen[data-screen="size"] .wall-cap { grid-area: wallcap; }
  .screen[data-screen="size"] .sizer { grid-area: sizer; margin-top: 6px; }
  .screen[data-screen="size"] .sizes { grid-area: sizes; width: 100%; margin-top: 14px; }
  .screen[data-screen="size"] .sizes-cap { grid-area: sizescap; }
  .screen[data-screen="size"] .size-info { grid-area: info; }

  /* ③ frame (shop route): the preview pinned on the left, the cards in one column beside it */
  .card[data-route="photo"] .screen[data-screen="frame"] {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    grid-template-areas: "q q" "pv find" "pv cards";
    column-gap: 28px;
    align-items: start;
  }
  .card[data-route="photo"] .screen[data-screen="frame"] .q { grid-area: q; }
  .card[data-route="photo"] .screen[data-screen="frame"] .pv-pin { grid-area: pv; top: 20px; margin: 0; padding: 0; background: none; }
  .card[data-route="photo"] .screen[data-screen="frame"] .find { grid-area: find; margin-top: 0; }
  .card[data-route="photo"] .screen[data-screen="frame"] .frame-cards { grid-area: cards; margin-top: 0; }
}

/* ---------- keyframes: the calculator's set, plus two small helpers ---------- */

@keyframes breathe { 0%, 100% { opacity: 0.3; } 50% { opacity: 0.9; } }
@keyframes dr8-step-in { from { opacity: 0; transform: translateY(16px); } to { transform: translateY(0); } }
@keyframes dr8-tier-in { from { opacity: 0; transform: translateY(26px) scale(0.94); } to { transform: translateY(0) scale(1); } }
@keyframes dr8-line-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes dr8-line-draw-c { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes dr8-line-draw-v { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes dr8-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dr8-land { from { opacity: 0; transform: translateY(10px) scale(0.94); } to { transform: none; } }
@keyframes cat-breathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.04); } }
@keyframes cat-sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(6deg); } }
@keyframes cat-flick { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(20deg); } 65% { transform: rotate(-9deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .how-step { opacity: 1; }
  .how-line { transform: none; }
}


/* pre-launch review (2026-10-15) */
/* keyboard focus never lands under the sticky Next bar, or under the preview pinned over the frame cards */
html { scroll-padding-bottom: 120px; }
@media (max-width: 1023px) { html:has(.card[data-screen="frame"]) { scroll-padding-top: 220px; } }
/* iPhone zooms into a field under 16 px and doesn't zoom back */
@media (pointer: coarse) { .find-field input { font-size: 16px; } }
/* a phone on its side: the sticky bars would leave no room for the cards and the preview */
@media (max-height: 500px) and (orientation: landscape) { .pv-pin, .step-nav { position: static; } }
