/* Coins for Anything brand: orange + black, Oswald headings, Yellowtail script */
:root {
  --orange: #F58220;
  --orange-dark: #d96f12;
  --orange-text: #b35507; /* orange that is still readable as small text on white */
  --navy: #2B3990;
  --black: #1A1A1A;
  --charcoal: #222222;
  --white: #FFFFFF;
  --offwhite: #F4F4F4;
  --warm: #F5F1EA;
  --text: #4A4A4A;
  --text-dark: #222222;
  --line: #DDD8D0;
  --teal: #4A7C8C;
  --font-head: "Oswald", "Arial Narrow", Impact, sans-serif;
  --font-script: "Yellowtail", "Brush Script MT", cursive;
  --font-body: "Open Sans", Roboto, Lato, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body {
  background: var(--warm);
  background-image:
    repeating-linear-gradient(90deg, rgba(0,0,0,.025) 0 2px, transparent 2px 140px),
    linear-gradient(180deg, #F7F3EC, #EFE9DF);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  display: flex;
  justify-content: center;
}

/* Text variants for small screens; declared early so the media queries below can override it */
.only-narrow { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.app {
  width: 100%;
  max-width: 1100px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--white);
  box-shadow: 0 0 0 1px var(--line);
  position: relative;
}

/* ---------- header (black nav band) ---------- */
.topbar {
  background: #000;
  color: var(--white);
  font-family: var(--font-head);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
  padding: 6px 12px;
}
.topbar b { color: var(--orange); font-weight: 600; }

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: var(--black);
  color: var(--white);
  border-bottom: 4px solid var(--orange);
}
.brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.brand-logo { height: 52px; width: auto; flex: 0 0 auto; display: block; }
.brand-text { border-left: 1px solid #444; padding-left: 16px; min-width: 0; }
.app-header h1 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 2px;
  text-transform: uppercase;
  line-height: 1.1;
}
.script {
  font-family: var(--font-script);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--orange);
  font-size: 1.25em;
  margin-right: 6px;
}
.app-header .sub { margin: 2px 0 0; font-size: 13px; color: #bbb; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--white);
  background: var(--orange);
  border: 0;
  border-radius: 0;
  padding: 11px 18px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, transform .05s;
}
.btn[hidden] { display: none; } /* the display rule above would otherwise override the hidden attribute */
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn::after { content: "\203A"; font-size: 16px; line-height: 1; transition: transform .15s; }
.btn:hover:not(:disabled)::after { transform: translateX(3px); }
.btn.plain::after, .btn.back::after { content: none; }
.btn.back::before { content: "\2039"; font-size: 16px; line-height: 1; }
.btn:hover { background: var(--orange-dark); }
.btn.dark { background: var(--black); }
.btn.dark:hover { background: #333; }
.btn.navy { background: var(--navy); }
.btn.navy:hover { background: #1f2a6e; }
.btn.small { font-size: 12px; padding: 8px 12px; letter-spacing: 1px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.app-header :focus-visible, .preview :focus-visible, .co-summary :focus-visible { outline-color: var(--white); }
.btn:disabled:hover { background: var(--orange); }
.btn.dark:disabled:hover { background: var(--black); }
.btn.navy:disabled:hover { background: var(--navy); }
.link { border: 0; background: transparent; color: var(--orange-text); font: inherit; font-weight: 600; cursor: pointer; padding: 0; text-decoration: underline; }

/* ---------- stepper ---------- */
.stepper {
  list-style: none; margin: 0; padding: 0 20px;
  display: flex; gap: 0;
  background: var(--offwhite);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.stepper li {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px 12px 0; margin-right: 18px;
  font-family: var(--font-head); font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase;
  color: #767676; white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.stepper li > span {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  background: #cfcac2; color: var(--white); font-size: 12px; transition: background .15s;
}
.stepper li.current { color: var(--text-dark); border-bottom-color: var(--orange); }
.stepper li.current > span { background: var(--orange); }
.stepper li b { font-weight: 500; }
.stepper li.done { color: var(--text-dark); cursor: pointer; }
.stepper li.done:hover > span { background: var(--orange); }
.stepper li.done > span { background: var(--black); }

/* ---------- builder layout ---------- */
.builder {
  flex: 1;
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 0;
  align-items: stretch;
}
.preview-col { background: #1E1E1E; }
.preview {
  position: sticky; top: 0;
  /* On a short screen (a tablet held sideways, a small laptop) the pinned column scrolls on its own, so nothing under the coin is out of reach */
  max-height: 100vh; max-height: 100dvh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #444 transparent;
  color: #ccc;
  padding: 20px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.preview-stage { position: relative; width: 100%; max-width: 400px; aspect-ratio: 1; background: #141414; border: 1px solid #333; box-shadow: 0 18px 40px rgba(0,0,0,.45); }
.preview-svg, .preview-ai { width: 100%; height: 100%; display: block; }
/* Coin pictures ignore the pointer, so a right-click or long-press lands on the box around them (no "Save image"),
   and they cannot be selected, dragged out, or called up with the iOS long-press menu. */
.preview-stage img, .preview-svg, .version img, .co-coin {
  pointer-events: none; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none;
}
.preview-stage, .version, .co-summary { -webkit-touch-callout: none; }
.preview-svg svg { width: 100%; height: 100%; display: block; }
.preview-ai[hidden], .preview-svg[hidden] { display: none; }
.preview-busy {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: rgba(20,20,20,.85); color: var(--white); text-align: center; padding: 20px; font-size: 14px;
}
.preview-busy[hidden] { display: none; }
.preview-busy p { margin: 0; }
.progress-sub { font-size: 12px; opacity: .7; }

/* ---------- the mint: what the customer watches while a coin renders ---------- */
/* A gold coin turning in 3D inside a ring that fills as the render moves along. It is a house coin (the Coin Nerd on
   the front, the company logo on the back) so nobody takes it for their own, and each stage of the render changes how it moves: it flips while the AI draws, rocks under a scanning
   light while the wording is read back, spins up for the finishing touches and lands with a flash when it is done.
   Everything is sized from --c, the coin's diameter, which follows the size of the overlay. */
.preview-busy {
  container-type: size; gap: 8px;
  background: radial-gradient(circle at 50% 40%, rgba(66,50,18,.95), rgba(12,12,14,.97) 72%);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
/* The Coin Nerd says what is going on: his face, and a speech bubble that pops whenever the line changes */
.mint-says { display: flex; align-items: flex-end; justify-content: center; gap: 8px; max-width: 100%; }
.mint-nerd { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; background: var(--white); box-shadow: 0 0 0 2px var(--orange); animation: mint-float 2.4s ease-in-out infinite; }
.preview-busy #progress-text {
  min-width: 0; padding: 8px 12px; text-align: left; font-size: 13px; font-weight: 600; line-height: 1.35; color: var(--text-dark); background: var(--white);
  border-radius: 14px 14px 14px 4px; transform-origin: left bottom; animation: nerd-pop .35s cubic-bezier(.2,1.5,.4,1) both;
}
.preview-busy[data-stage="retrying"] .mint-nerd { animation: nerd-shake .5s ease-in-out 3; }
@keyframes nerd-shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
/* The reading matter under him: a fun fact or a tip, two lines at most, in a box that keeps its height as they change */
.progress-sub { min-height: 3em; max-width: 36em; line-height: 1.5; opacity: .85; animation: mint-line .6s ease-out; }
.progress-sub strong { color: var(--orange); font-weight: 700; }
.mint { --c: 132px; position: relative; flex: 0 0 auto; width: calc(var(--c) * 1.36); height: calc(var(--c) * 1.36); display: grid; place-items: center; }
@supports (width: 1cqw) { .mint { --c: clamp(54px, min(46cqw, 42cqh), 190px); } }
.mint::before { content: ""; position: absolute; inset: 6%; border-radius: 50%; background: radial-gradient(circle, rgba(248,226,122,.34), rgba(248,226,122,0) 68%); animation: mint-glow 3s ease-in-out infinite; }
.mint::after { content: ""; position: absolute; inset: -12%; border-radius: 50%; background: radial-gradient(circle, #fff 0%, rgba(255,241,168,.7) 30%, rgba(255,241,168,0) 68%); opacity: 0; pointer-events: none; }

.mint-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; will-change: transform; } /* on its own layer: the bar is redrawn as it fills, and nothing else should be redrawn with it */
.mint-ring circle { fill: none; stroke-width: 2.4; }
.mint-ring-track { stroke: rgba(255,255,255,.16); stroke-dasharray: .8 3.6; stroke-linecap: round; }
.mint-ring-bar { stroke: var(--orange); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .5s ease-out; filter: drop-shadow(0 0 3px rgba(245,130,32,.85)); }

.mint-float { position: relative; width: var(--c); height: var(--c); perspective: calc(var(--c) * 6); animation: mint-float 3s ease-in-out infinite; }
.mint-coin { --t: calc(var(--c) * .035); position: relative; width: 100%; height: 100%; transform-style: preserve-3d; animation: mint-flip 3s infinite; }
.mint-face, .mint-edge { position: absolute; inset: 0; border-radius: 50%; }
.mint-face { overflow: hidden; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.mint-face svg { display: block; width: 100%; height: 100%; }
.mint-front { transform: translateZ(var(--t)); }
.mint-back { transform: rotateY(180deg) translateZ(var(--t)); }
/* The coin's thickness: a stack of rim-coloured discs between the two faces */
.mint-edge { background: #8F6612; transform: translateZ(calc(var(--z) * var(--t) / 6.5)); } /* stops just short of the faces */
/* A glint that crosses each face as it turns */
.mint-face::after { content: ""; position: absolute; inset: 0; background: linear-gradient(112deg, rgba(255,255,255,0) 14%, rgba(255,255,255,.6) 50%, rgba(255,255,255,0) 86%); transform: translateX(-120%); animation: mint-glint 3s linear infinite; }
.mint-face text { font-family: var(--font-head); font-weight: 600; font-size: 13px; letter-spacing: 2.2px; text-anchor: middle; fill: #6A480B; stroke: rgba(255,243,176,.45); stroke-width: .5; paint-order: stroke; }
.mint-reeds { fill: none; stroke: #5E3F08; stroke-opacity: .5; stroke-width: 5.6; stroke-dasharray: 1.05 1.5; } /* the grooved edge of a coin */
.mint-beads { fill: none; stroke: #FFF3B0; stroke-opacity: .6; stroke-width: 1.6; stroke-dasharray: .1 4; stroke-linecap: round; }
/* The Coin Nerd on the front, set into the metal like an enamel portrait */
.mint-cameo-shade { fill: #3C2604; fill-opacity: .4; }
.mint-cameo { fill: #FFF9EA; stroke-width: 3; }
.mint-cameo-ring { fill: none; stroke: var(--orange); stroke-width: 1.8; }

.mint-spark { position: absolute; left: var(--x); top: var(--y); width: calc(var(--c) * .1); height: calc(var(--c) * .1); background: #FFF3B0; clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); opacity: 0; animation: mint-twinkle 2.6s var(--d) ease-in-out infinite; }
/* The proofreader's light, only while the wording is being read back */
.mint-scan { position: absolute; width: var(--c); height: var(--c); border-radius: 50%; overflow: hidden; opacity: 0; pointer-events: none; transition: opacity .3s; }
.mint-scan::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 22%; background: linear-gradient(rgba(255,255,255,0), rgba(255,255,255,.7), rgba(255,255,255,0)); transform: translateY(-100%); animation: mint-scan 1.5s ease-in-out infinite alternate; }

.preview-busy[data-stage="checking"] .mint-coin { animation: mint-rock 2.6s ease-in-out infinite; }
.preview-busy[data-stage="checking"] .mint-scan { opacity: 1; }
.preview-busy[data-stage="checking"] .mint-face::after { animation: none; opacity: 0; }
.preview-busy[data-stage="retrying"] .mint-coin { animation-duration: 1.9s; }
.preview-busy[data-stage="finishing"] .mint-coin { animation: mint-whirl .9s linear infinite; }
.preview-busy[data-stage="finishing"] .mint-spark { animation-duration: 1s; }
.preview-busy[data-stage="done"] .mint-coin { animation: mint-land .7s cubic-bezier(.2,.8,.2,1) both; }
.preview-busy[data-stage="done"] .mint-face::after { animation: none; opacity: 0; }
.preview-busy[data-stage="done"] .mint::after { animation: mint-flash .7s ease-out both; }

@keyframes mint-flip {
  0% { transform: rotateX(9deg) rotateY(0); animation-timing-function: cubic-bezier(.6,0,.3,1); }
  42% { transform: rotateX(9deg) rotateY(180deg); }
  50% { transform: rotateX(9deg) rotateY(180deg); animation-timing-function: cubic-bezier(.6,0,.3,1); }
  92%, 100% { transform: rotateX(9deg) rotateY(360deg); }
}
@keyframes mint-rock { 0%, 100% { transform: rotateX(6deg) rotateY(-20deg); } 50% { transform: rotateX(6deg) rotateY(20deg); } }
@keyframes mint-whirl { from { transform: rotateX(9deg) rotateY(0); } to { transform: rotateX(9deg) rotateY(360deg); } }
@keyframes mint-land { from { transform: rotateY(-540deg) scale(.82); } 60% { transform: rotateY(0) scale(1.1); } to { transform: rotateY(0) scale(1); } }
@keyframes mint-float { 0%, 100% { transform: translateY(-3%); } 50% { transform: translateY(3%); } }
@keyframes mint-glow { 0%, 100% { opacity: .65; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.06); } }
/* Everything on the coins moves by transform or opacity alone, which the phone's graphics chip does on its own:
   nothing here asks the page to be laid out or painted again while it plays. Keep it that way. */
@keyframes mint-glint { 0%, 8% { transform: translateX(-120%); } 34%, 58% { transform: translateX(120%); } 84%, 100% { transform: translateX(-120%); } }
@keyframes mint-twinkle { 0%, 100% { opacity: 0; transform: scale(.2) rotate(0); } 50% { opacity: 1; transform: scale(1) rotate(45deg); } }
@keyframes mint-scan { from { transform: translateY(-100%); } to { transform: translateY(455%); } }
@keyframes mint-flash { 0% { opacity: 0; transform: scale(.5); } 35% { opacity: .95; } 100% { opacity: 0; transform: scale(1.25); } }
@keyframes mint-line { from { opacity: 0; transform: translateY(4px); } }
.preview-spec { margin: 2px 0 0; font-family: var(--font-head); font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; color: #e8e8e8; text-align: center; }
.preview-spec:empty { display: none; }
.builder[data-step="result"] #ai-btn { display: none; }
/* On the quote step the coin is a reminder: versions, another version and the proofreader's notes stay on the design step */
.builder[data-step="quote"] :is(.preview-actions, .versions-wrap, .ai-check, .ai-disclaimer) { display: none; }
.preview-caption { margin: 0; font-size: 12px; color: #999; text-align: center; min-height: 18px; }
/* When the column is taller than the screen it scrolls. Without this its lines of text are squeezed instead, and the
   button under them ends up on top of the words. */
.preview > * { flex-shrink: 0; }
.preview-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
/* AI versions: every render is kept, with a tick or a warning from the proofreader */
.versions-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; max-width: 400px; }
.versions-wrap[hidden] { display: none; }
.versions-label { font-family: var(--font-head); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: #999; }
.versions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
.versions-split { flex: 0 0 auto; width: 1px; height: 44px; margin: 0 2px; background: #555; }
.version { position: relative; width: 60px; height: 60px; padding: 0; border: 2px solid #444; border-radius: 0; background: #141414; cursor: pointer; transition: border-color .15s, transform .1s; }
.version:hover { border-color: #888; transform: translateY(-1px); }
.version.on { border-color: var(--orange); }
.version img { width: 100%; height: 100%; object-fit: cover; display: block; }
.version .num { position: absolute; left: 0; bottom: 0; min-width: 18px; padding: 0 4px; font-family: var(--font-head); font-size: 11px; line-height: 16px; color: var(--white); background: rgba(0,0,0,.75); text-align: center; }
.version .flag { position: absolute; top: -7px; right: -7px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; line-height: 1; color: var(--white); background: #2e7d32; box-shadow: 0 0 0 2px #1E1E1E; }
.version.warn .flag { background: #FFB300; color: var(--black); }
.ai-check { width: 100%; max-width: 400px; font-size: 13px; line-height: 1.5; padding: 10px 12px; color: #ddd; background: #2a2a2a; border-left: 3px solid #666; }
.ai-check[hidden] { display: none; }
.ai-check p { margin: 0; }
.ai-check p + p { margin-top: 6px; }
.ai-check strong { color: var(--white); }
.ai-check.ok { border-left-color: #43a047; }
.ai-check.ok strong { color: #81c784; }
.ai-check.warn { border-left-color: #FFB300; }
.ai-check.warn strong { color: #FFD54F; }
.ai-check .link { color: #bbb; font-weight: 400; font-size: 12px; white-space: nowrap; }
.ai-check .link:hover { color: var(--white); }
.preview-tabs { display: flex; gap: 0; border: 1px solid #444; }
.preview-tabs[hidden] { display: none; }
.preview-tabs button {
  border: 0; background: transparent; color: #aaa; padding: 7px 14px; cursor: pointer;
  font-family: var(--font-head); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase;
}
.preview-tabs button.on { background: var(--orange); color: var(--white); }

.typing { display: inline-flex; gap: 4px; align-items: center; height: 18px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); animation: blink 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.panel { padding: 22px 26px 30px; min-width: 0; }
.step { animation: rise .25s ease-out; }
.step[hidden] { display: none; }
/* the script word that opens a step's heading stands taller than the capitals beside it */
.step h2 .script { font-size: 1.75em; line-height: 1; margin-right: 8px; }
/* headings receive focus when the step changes (for screen readers); they are not controls, so no focus ring */
.step h2:focus { outline: none; }
.step h2 {
  margin: 0 0 14px;
  font-family: var(--font-head); font-weight: 600; font-size: 24px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-dark);
  display: flex; align-items: center; gap: 4px;
}
.group { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 20px; }
.step h2 + .group { margin-top: 0; }
.group-title {
  margin: 0 0 14px; display: flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-weight: 600; font-size: 15px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--text-dark);
}
.group-title::before { content: ""; width: 4px; height: 16px; background: var(--orange); }
.group-title em { font-family: var(--font-body); font-style: normal; font-weight: 400; font-size: 12px; letter-spacing: 0; text-transform: none; color: #767676; }
.group > .field:last-child, .group > .hint:last-child { margin-bottom: 0; }
.field { margin-bottom: 16px; }
.field.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px 12px; }
.label, .ff-label { display: block; font-family: var(--font-head); font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: #666; margin-bottom: 6px; }
.label em { color: #767676; font-style: normal; text-transform: none; letter-spacing: 0; }
.ff { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ff .label, .ff .ff-label { margin-bottom: 0; }
.ff-label i { color: var(--orange); font-style: normal; }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], textarea {
  width: 100%;
  background: var(--white); color: var(--text-dark);
  border: 1px solid #CFCAC2; border-radius: 0;
  padding: 10px 12px; font-size: 15px; font-family: var(--font-body); outline: none;
}
textarea { resize: vertical; }
input:focus, textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(245,130,32,.18); }
input::placeholder, textarea::placeholder { color: #8d8d8d; }
input.bad { border-color: #c62828; background: #fff5f5; }
input:disabled { background: #f0ede8; color: #888; }
input:read-only { background: #f4f1eb; color: #777; }
.hint { font-size: 13px; color: #666; margin: 8px 0 0; }
.hint.note { background: #fff7ef; border-left: 3px solid var(--orange); color: var(--text); padding: 8px 12px; margin: -4px 0 16px; }
.hint.note[hidden] { display: none; }
#design-hint { margin-top: 20px; }
.step-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.step-actions .btn:last-child { margin-left: auto; }

/* ---------- the Coin Nerd: a chat button in the corner with the mascot beside it, and the short chat it opens ---------- */
.nerd { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: 14px; z-index: 40; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.nerd[hidden] { display: none; }
.nerd > * { pointer-events: auto; }
.nerd-toggle { position: relative; display: flex; align-items: flex-end; gap: 2px; padding: 0; border: 0; background: none; cursor: pointer; animation: nerd-in .7s cubic-bezier(.2,1.5,.4,1) both; }
.nerd-body { display: block; width: auto; height: 104px; filter: drop-shadow(0 8px 10px rgba(0,0,0,.35)); transform-origin: 50% 100%; transition: transform .2s; }
.nerd-toggle:hover .nerd-body { transform: translateY(-3px) rotate(-4deg); }
.nerd-face { display: none; }
/* The round chat button: this is what says "chat". While the chat is open it is the way to close it. */
.nerd-chat {
  position: relative; flex: 0 0 auto; display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 4px; border-radius: 50%;
  background: var(--orange); color: var(--white); box-shadow: 0 0 0 3px var(--white), 0 8px 20px rgba(0,0,0,.4); transition: transform .2s, background .2s;
}
.nerd-toggle:hover .nerd-chat { transform: scale(1.07); background: var(--orange-dark); }
.nerd-chat .dots { fill: var(--orange); transition: fill .2s; }
.nerd-toggle:hover .nerd-chat .dots { fill: var(--orange-dark); }
.nerd-chat .ico-close, .nerd-toggle[aria-expanded="true"] .ico-chat { display: none; }
.nerd-toggle[aria-expanded="true"] .ico-close { display: block; }
/* a ring goes out from the button a few times after it arrives, to catch the eye */
.nerd-chat::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 2px var(--orange); opacity: 0; animation: nerd-ring 1.8s ease-out 1.2s 3; }
/* what he says before the chat is open: over his head, with the corner nearest him left sharp */
.nerd-teaser {
  position: absolute; right: 0; bottom: calc(100% + 6px); width: max-content; max-width: 210px; padding: 9px 13px; text-align: left;
  font-family: var(--font-body); font-size: 13px; line-height: 1.35; color: var(--text-dark); background: var(--white);
  border-radius: 14px 14px 14px 4px; box-shadow: 0 8px 24px rgba(0,0,0,.3); transform-origin: left bottom; animation: nerd-pop .35s cubic-bezier(.2,1.5,.4,1) both;
}
.nerd-teaser strong { display: block; font-weight: 700; }
.nerd-teaser[hidden] { display: none; }
/* after it has gone, pointing at him or the button brings it back until the chat is open */
@media (hover: hover) { .nerd-toggle[aria-expanded="false"]:hover .nerd-teaser[hidden] { display: block; } }
.nerd-panel {
  width: 352px; max-width: calc(100vw - 24px); display: flex; flex-direction: column; overflow: hidden;
  background: var(--white); color: var(--text); border-radius: 16px 16px 4px 16px; box-shadow: 0 18px 50px rgba(0,0,0,.4);
  transform-origin: right bottom; animation: nerd-pop .35s cubic-bezier(.2,1.5,.4,1) both;
}
.nerd-panel[hidden] { display: none; }
.nerd-head { display: flex; align-items: center; gap: 10px; padding: 8px 6px 8px 12px; background: var(--black); color: var(--white); border-bottom: 3px solid var(--orange); }
.nerd-head img { width: 36px; height: 36px; border-radius: 50%; background: var(--white); }
.nerd-head span { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.nerd-head strong { font-family: var(--font-head); font-weight: 600; font-size: 14px; letter-spacing: 1.4px; text-transform: uppercase; }
.nerd-head small { font-size: 11px; color: #bbb; }
.nerd-close { width: 40px; height: 40px; padding: 0; border: 0; background: none; color: var(--white); font-size: 24px; line-height: 1; cursor: pointer; }
.nerd-log { display: flex; flex-direction: column; gap: 8px; padding: 12px; max-height: min(430px, calc(100vh - 330px)); overflow-y: auto; overscroll-behavior: contain; }
.nerd-msg { max-width: 90%; padding: 9px 12px; font-size: 14px; line-height: 1.45; border-radius: 14px; animation: rise .25s ease-out; overflow-wrap: anywhere; }
.nerd-msg.nerd-says { align-self: flex-start; background: var(--offwhite); color: var(--text-dark); border-bottom-left-radius: 4px; }
.nerd-msg.you { align-self: flex-end; background: var(--orange); color: var(--white); border-bottom-right-radius: 4px; }
.nerd-msg a { color: var(--orange-text); font-weight: 600; }
/* What is filled in so far: the steps of the form as a list, joined by a line down their numbers. A step that is done
   gets a green tick and what they put there; the next one to do is in orange. Each row goes to its step. */
.nerd-steps { flex: 0 0 auto; align-self: stretch; overflow: hidden; background: var(--white); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line), 0 6px 16px rgba(0,0,0,.07); animation: rise .25s ease-out; }
.nerd-steps-head { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px 9px; font-family: var(--font-head); font-size: 12px; letter-spacing: 1.3px; text-transform: uppercase; color: #767676; background: var(--offwhite); border-bottom: 1px solid var(--line); }
.nerd-steps-head b { font-weight: 600; color: var(--text-dark); }
.nerd-meter { flex: 1; height: 6px; border-radius: 3px; background: #DDD8D0; overflow: hidden; }
.nerd-meter i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #EBC24A, var(--orange)); transition: width .4s ease-out; }
.nerd-step { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 7px 12px; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; transition: background .15s; }
.nerd-step:hover, .nerd-step:focus-visible { background: #FFF7EF; }
.nerd-step:focus-visible { outline-offset: -2px; }
.nerd-step .num { position: relative; z-index: 1; flex: 0 0 auto; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-family: var(--font-head); font-weight: 600; font-size: 13px; line-height: 1; color: #767676; background: var(--white); box-shadow: inset 0 0 0 1.5px #CFCAC2; }
.nerd-step:not(:last-child)::after { content: ""; position: absolute; left: 24px; top: calc(50% + 13px); width: 2px; height: calc(100% - 26px); background: #DDD8D0; }
.nerd-step.done::after { background: #2E7D32; }
.nerd-step.done .num { color: var(--white); background: #2E7D32; box-shadow: none; }
.nerd-step.next { background: #FFF7EF; }
.nerd-step.next .num { color: var(--white); background: var(--orange); box-shadow: 0 0 0 4px rgba(245,130,32,.22); }
.nerd-step .what { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.nerd-step .what b { font-size: 13.5px; font-weight: 600; color: var(--text-dark); }
.nerd-step .what small { overflow: hidden; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; color: #767676; }
.nerd-step.done .what small { color: #2E7D32; }
.nerd-step .tag { flex: 0 0 auto; font-family: var(--font-head); font-size: 10.5px; letter-spacing: 1.1px; text-transform: uppercase; color: var(--orange-text); }
.nerd-step .tag::after { content: "\203A"; margin-left: 5px; font-size: 16px; line-height: 0; color: #B5AFA6; }
.nerd-step.next .tag::after { color: var(--orange); }
.nerd-options { display: flex; flex-direction: column; gap: 6px; padding: 0 12px 12px; }
.nerd-options:empty { display: none; }
.nerd-options .btn, .nerd-options .btn.small { width: 100%; min-height: 42px; padding: 8px 12px; border-radius: 10px; font-size: 13px; letter-spacing: 1.1px; line-height: 1.25; text-align: center; animation: rise .25s ease-out; }
.nerd-options .btn.dark, .nerd-options .btn.dark:hover { background: var(--white); color: var(--text-dark); box-shadow: inset 0 0 0 1px #CFCAC2; }
@keyframes nerd-in { from { transform: translateY(130%) rotate(8deg); } to { transform: none; } }
@keyframes nerd-pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes nerd-ring { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(1.7); } }
/* Where the step's buttons are pinned to the bottom of the screen the pair sits clear of them, smaller: his face
   tucked against the chat button, and what he says to the left of it */
@media (max-width: 860px) {
  .nerd { right: max(12px, env(safe-area-inset-right)); bottom: calc(80px + env(safe-area-inset-bottom)); }
  .nerd-toggle { align-items: center; gap: 0; }
  .nerd-body { display: none; }
  .nerd-face { position: relative; z-index: 1; display: block; width: 46px; height: 46px; margin-right: -10px; border-radius: 50%; background: var(--white); box-shadow: 0 0 0 2px var(--orange), 0 6px 14px rgba(0,0,0,.45); }
  .nerd-chat { width: 52px; height: 52px; margin-bottom: 0; box-shadow: 0 0 0 2px var(--white), 0 8px 18px rgba(0,0,0,.5); }
  .nerd-chat svg { transform: translateX(3px); } /* centred in the part of the button his face leaves showing */
  .nerd-teaser { right: calc(100% + 8px); bottom: 4px; max-width: min(190px, calc(100vw - 130px)); border-radius: 14px 14px 4px 14px; transform-origin: right bottom; }
  .nerd-log { max-height: min(400px, calc(100dvh - 330px)); }
  #design-hint { padding-right: 94px; } /* the line above the buttons ends short of the pair */
}

/* ---------- the walk-through ---------- */
/* The Coin Nerd takes them through the front a step at a time (see "the walk-through" in app.js). The step he is on is
   lit up: a warm panel with an orange ring that breathes, the other steps stepping back until they are pointed at
   or typed in. His face sits inside it, saying what to do there. */
.group { transition: opacity .25s; }
.step.guiding .group:not(.guide-on), .step.guiding .lead { opacity: .45; }
.step.guiding .group:not(.guide-on):hover, .step.guiding .group:not(.guide-on):focus-within { opacity: 1; }
.group.guide-on { position: relative; z-index: 1; border-top-color: transparent; }
.group.guide-on + .group { border-top-color: transparent; }
.group.guide-on::before, .group.guide-on::after { content: ""; position: absolute; z-index: -1; inset: 2px -16px -14px; border-radius: 16px; pointer-events: none; }
.group.guide-on::after { background: linear-gradient(180deg, #FFF3E4, #FFFAF4 120px); box-shadow: 0 0 0 2px var(--orange), 0 0 0 5px rgba(245,130,32,.2); }
/* the breathing is a wider glow fading in and out behind the ring, so the ring itself is never painted again */
.group.guide-on::before { box-shadow: 0 0 0 10px rgba(245,130,32,.14), 0 14px 34px rgba(245,130,32,.26); opacity: 0; animation: guide-ring 2s ease-in-out infinite; }
@keyframes guide-ring { 50% { opacity: 1; } }
.coach { display: flex; align-items: flex-end; gap: 10px; margin: 0 0 16px; animation: rise .3s ease-out; }
.coach-face { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; background: var(--white); box-shadow: 0 0 0 2px var(--orange), 0 5px 12px rgba(0,0,0,.22); animation: mint-float 2.4s ease-in-out infinite; }
.coach-says { position: relative; flex: 1; min-width: 0; padding: 10px 38px 12px 14px; color: #E9E6E1; background: var(--black); border-radius: 16px 16px 16px 4px; box-shadow: 0 10px 24px rgba(0,0,0,.2); transform-origin: left bottom; animation: nerd-pop .35s cubic-bezier(.2,1.5,.4,1) both; }
.coach-says p { margin: 0; }
.coach-says .coach-top { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; font-family: var(--font-head); font-size: 11.5px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--orange); }
.coach-top b { font-weight: 600; }
.coach-dots { display: inline-flex; align-items: center; gap: 5px; }
.coach-dots i { width: 7px; height: 7px; border-radius: 50%; background: #55514B; transition: background .2s, width .2s; }
.coach-dots i.done { background: #66BB6A; }
.coach-dots i.at { width: 18px; border-radius: 4px; background: var(--orange); }
.coach-text { font-size: 14px; line-height: 1.5; }
.coach-text b { color: var(--white); }
.coach-says .coach-actions { display: flex; gap: 8px; margin-top: 10px; }
.coach-actions .btn { min-height: 36px; padding: 6px 14px; border-radius: 18px; }
.coach-actions .btn:disabled, .coach-actions .btn:disabled:hover { opacity: 1; background: #3A3733; color: #8E8A84; }
.coach-close { position: absolute; top: 0; right: 0; width: 38px; height: 38px; padding: 0; border: 0; background: none; color: #9A958E; font-size: 22px; line-height: 1; cursor: pointer; }
.coach-close:hover { color: var(--white); }
.coach :focus-visible { outline-color: var(--white); }
.step > .coach { margin: 22px 0 -6px; } /* over the step's buttons, pointing at Generate */
/* the button he is pointing at: a ring goes out from it */
.guide-pulse { position: relative; }
.guide-pulse::before { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 3px var(--orange); pointer-events: none; animation: guide-pulse 1.5s ease-out infinite; }
@keyframes guide-pulse { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(1.09, 1.5); } }

/* logo upload */
.logo-drop {
  border: 2px dashed #CFCAC2; background: var(--offwhite);
  padding: 18px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.logo-drop:hover, .logo-drop:focus, .logo-drop.over { border-color: var(--orange); background: #fff7ef; outline: none; }
.logo-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text); }
.logo-empty svg { color: var(--orange); }
.logo-empty strong { font-family: var(--font-head); letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dark); }
.logo-empty span { font-size: 12px; color: #666; }
.logo-empty[hidden], .logo-have[hidden] { display: none; }
.logo-have { display: flex; align-items: center; gap: 14px; text-align: left; }
/* The address of their website or of a picture, and the button that goes and gets it */
.logo-link { display: flex; gap: 8px; margin-top: 10px; }
.logo-link input { flex: 1 1 auto; min-width: 0; }
.logo-link .btn { flex: 0 0 auto; white-space: nowrap; }
.logo-link + .hint { margin-top: 6px; }
.logo-have img { width: 64px; height: 64px; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.logo-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.logo-meta strong { color: var(--text-dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo-meta span { font-size: 12px; color: #666; }

/* reference images: a thumbnail for each one the customer added, then the button that adds more */
.refs { display: flex; flex-wrap: wrap; gap: 12px; }
.ref { position: relative; width: 72px; height: 72px; background: var(--offwhite); border: 1px solid var(--line); }
.ref img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* one the screening refused: it has to come out before the coin can be rendered */
.ref.bad { border-color: #c62828; box-shadow: 0 0 0 2px #c62828; }
.ref.bad img { opacity: .45; }
.logo-drop.bad { border-color: #c62828; background: #fff5f5; }
.ref-remove {
  position: absolute; top: -9px; right: -9px; width: 24px; height: 24px; padding: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; border: 2px solid var(--white); background: var(--black); color: var(--white); font-size: 15px; line-height: 1;
}
.ref-remove::after { content: ""; position: absolute; inset: -8px; } /* a bigger target than the dot itself */
.ref-add {
  width: 72px; height: 72px; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer;
  border: 2px dashed #CFCAC2; border-radius: 0; background: var(--offwhite); color: var(--text-dark);
  font-family: var(--font-head); font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; line-height: 1.2; transition: border-color .15s, background .15s;
}
.ref-add[hidden] { display: none; }
.ref-add:hover, .ref-add:focus-visible { border-color: var(--orange); background: #fff7ef; }
.ref-add svg { color: var(--orange); }

/* finish swatches */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 8px; }
.swatch-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 2px solid transparent; background: var(--offwhite); border-radius: 0;
  padding: 8px 10px 8px 8px; cursor: pointer; text-align: left; transition: border-color .15s, background .15s;
  font-family: var(--font-head); font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-dark);
}
.swatch-btn .dot { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.35), inset 2px 2px 3px rgba(255,255,255,.6); }
.swatch-btn:hover { border-color: #ccc; }
.swatch-btn.on { border-color: var(--orange); background: #fff7ef; box-shadow: 0 2px 8px rgba(245,130,32,.18); }

/* center background: round enamel chips, a "none" chip, and a custom color chip */
.bg-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.bg-swatch {
  position: relative; width: 38px; height: 38px; padding: 0; border-radius: 50%; cursor: pointer; flex: 0 0 auto;
  border: 2px solid var(--white); outline: 1px solid #b9b3a9; background: var(--chip, var(--white));
  box-shadow: inset 3px 3px 5px rgba(255,255,255,.35), inset -3px -4px 6px rgba(0,0,0,.25); transition: transform .1s, outline-color .15s;
}
.bg-swatch:hover { transform: scale(1.08); }
.bg-swatch.on { outline: 3px solid var(--orange); }
.bg-none { background: var(--white); box-shadow: none; }
.bg-none::after { content: ""; position: absolute; left: 50%; top: 4px; bottom: 4px; width: 2px; background: #c62828; transform: rotate(45deg); }
.bg-custom { display: grid; place-items: center; box-shadow: none; overflow: hidden;
  background: linear-gradient(var(--picked, transparent), var(--picked, transparent)), conic-gradient(#e53935, #fdd835, #43a047, #1e88e5, #8e24aa, #e53935); }
.bg-custom input { position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px); opacity: 0; cursor: pointer; font-size: 16px; }
.bg-custom span { color: var(--white); font-weight: 700; font-size: 18px; line-height: 1; text-shadow: 0 1px 2px rgba(0,0,0,.6); pointer-events: none; }
.bg-custom:focus-within { outline: 3px solid var(--orange); }
.bg-texture { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.sublabel { font-family: var(--font-head); font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: #666; }

/* segmented choice buttons */
.seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; border: 1px solid #CFCAC2; }
.seg.wrap { display: flex; flex-wrap: wrap; border: 0; gap: 8px; }
.seg button {
  border: 0; background: var(--white); color: var(--text-dark); cursor: pointer;
  padding: 9px 14px; font-family: var(--font-head); font-size: 13px; letter-spacing: 1.2px; text-transform: uppercase;
  transition: background .12s, color .12s;
}
.seg:not(.wrap) button + button { border-left: 1px solid #CFCAC2; }
.seg.wrap button { border: 1px solid #CFCAC2; }
.seg button:hover { background: var(--offwhite); }
.seg button.on, .seg button.on:hover { background: var(--black); color: var(--white); border-color: var(--black); }
.seg button.on small { opacity: .85; }
.seg button small { font-family: var(--font-body, inherit); font-size: 11px; letter-spacing: 0; text-transform: none; opacity: .65; margin-left: 4px; }
input[type="range"] { width: 100%; accent-color: var(--orange); margin: 0; height: 42px; }

.qty-input { max-width: none; }
.details-form > .group:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.details-form .notes { margin-top: 14px; }
/* Quantity and the size list side by side (the list drawn like the text fields, with its own arrow); "Other" opens a
   field for the size in words under them */
.size-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 12px; align-items: end; }
.size-row .ff[hidden] { display: none; }
.size-select {
  width: 100%; appearance: none; -webkit-appearance: none; cursor: pointer;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23555' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 18px;
  color: var(--text-dark); border: 1px solid #CFCAC2; border-radius: 0;
  padding: 10px 38px 10px 12px; font-size: 15px; font-family: var(--font-body); line-height: 1.4; outline: none;
}
.size-select:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(245,130,32,.18); }
.size-select.bad { border-color: #c62828; background-color: #fff5f5; }

.group + .estimate { margin-top: 18px; }
.estimate {
  background: var(--offwhite); border-left: 4px solid var(--orange);
  padding: 12px 16px; margin-bottom: 16px;
}
.estimate[hidden] { display: none; }
.estimate .big { font-family: var(--font-head); font-size: 26px; letter-spacing: 1px; color: var(--text-dark); }
.estimate small { color: #666; font-size: 13px; }

/* The estimate: the total up top, a line on what it is priced as, and the lines behind it (coins, mold, add-ons,
   shipping) folded away under "See the breakdown" */
.quote-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.quote-title { font-family: var(--font-head); font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dark); }
.quote-summary { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--text); }
/* Up to 50 coins: the per-coin price at 100, to make the case for a bigger order */
.quote-upsell { margin: 8px 0 0; padding: 7px 10px; background: #fff; border: 1px dashed var(--orange); font-size: 13.5px; line-height: 1.45; color: var(--text-dark); }
.quote-upsell strong { color: var(--orange-text); }
.quote-more { margin: 8px 0 0; }
.quote-more summary { display: inline-block; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--orange-text); list-style: none; }
.quote-more summary::-webkit-details-marker { display: none; }
.quote-more summary::before { content: "+ "; }
.quote-more[open] summary::before { content: "\2212  "; }
.quote-lines { list-style: none; margin: 8px 0 0; padding: 10px 0 0; border-top: 1px solid #DDD8CF; }
.quote-lines li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 4px 0; font-size: 14px; color: var(--text-dark); }
.quote-lines li small { display: block; font-size: 12px; color: #666; }
.quote-lines .ql-amount { flex: 0 0 auto; font-weight: 600; }
.quote-lines .ql-free { color: var(--orange-text); }
.quote-lines .ql-discount { color: var(--orange-text); }
.ff.discount { margin-top: 14px; max-width: 320px; }
.ff.discount input { text-transform: uppercase; }
.discount-msg { font-size: 12px; line-height: 1.4; }
.discount-msg[hidden] { display: none; }
.discount-msg.ok { color: var(--orange-text); font-weight: 600; }
.discount-msg.bad { color: #c62828; }
.quote-notes { margin: 10px 0 0; font-size: 12.5px; color: #666; line-height: 1.45; }
.estimate.unpriced :is(.quote-head, .quote-summary, .quote-upsell, .quote-more), .estimate.reading :is(.quote-head, .quote-summary, .quote-upsell, .quote-more) { display: none; }
.estimate.unpriced .quote-notes { margin-top: 0; font-size: 13px; }
/* While the AI reads the design for the finish, color and add-ons, the estimate waits with a spinner */
.estimate.reading .quote-notes { display: flex; align-items: center; gap: 8px; margin-top: 0; font-size: 13px; }
.estimate.reading .quote-notes::before { content: ""; flex: 0 0 auto; width: 14px; height: 14px; border: 2px solid #e0d6c6; border-top-color: var(--orange); border-radius: 50%; animation: dr-spin .8s linear infinite; }
@keyframes dr-spin { to { transform: rotate(360deg); } }
/* The finish and color controls: only when the design could not be read */
#options-group[hidden] { display: none; }

/* details form */
.details-form .ff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.details-form .ff.wide { grid-column: 1 / -1; }
.details-form .ff-section { font-family: var(--font-head); font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dark); margin: 16px 0 0; }
.ff-error { color: #c62828; font-size: 13px; margin: 10px 0 0; }
.ff-error[hidden] { display: none; }

/* result */
#result .head { font-family: var(--font-head); font-size: 24px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-dark); margin: 0 0 10px; }
#result p { margin: 0 0 10px; overflow-wrap: anywhere; }
#result .caption { font-size: 12px; color: #777; }

/* footer */
.foot {
  padding: 8px 12px; text-align: center; font-size: 12px; color: #777;
  border-top: 1px solid var(--line); background: var(--offwhite);
}
.foot b { color: var(--text-dark); }
.foot p { margin: 0; }
.foot .foot-links { margin-top: 4px; font-size: 11px; color: #999; }
.foot a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.foot a:hover { color: var(--text-dark); }
/* "Good to know", above the foot line: the folded questions in a white card, headed like the steps above it */
.about { max-width: 760px; margin: 14px auto 18px; padding: 18px 24px 6px; text-align: left; background: var(--white); border: 1px solid var(--line); }
.about-title {
  margin: 0 0 8px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  font-family: var(--font-head); font-weight: 600; font-size: 15px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--text-dark);
}
.about-title::before { content: ""; width: 4px; height: 16px; background: var(--orange); }
.about-title em { font-family: var(--font-body); font-style: normal; font-weight: 400; font-size: 12px; letter-spacing: 0; text-transform: none; color: #767676; }
.faq details { border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 11px 0; font-size: 14px; font-weight: 600; color: var(--text-dark); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: 0 0 auto; width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--orange); border-radius: 50%; font-size: 15px; font-weight: 700; color: var(--orange-text); }
.faq details[open] summary::after { content: "\2013"; }
.faq summary:hover { color: var(--orange-text); }
.faq p { margin: 0 0 14px; max-width: 66ch; font-size: 13.5px; line-height: 1.6; color: var(--text); }
.noscript { margin: 0; padding: 12px 16px; text-align: center; font-size: 14px; background: var(--orange); color: #1A1A1A; }
.noscript a { color: inherit; font-weight: 700; }

/* drag overlay */
.drop {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background: rgba(26,26,26,.9);
  border: 4px dashed var(--orange);
  font-family: var(--font-head);
  font-size: 26px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--white);
  z-index: 10;
}
.drop[hidden] { display: none; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--black); color: var(--white); padding: 10px 18px; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35); z-index: 60; animation: rise .2s ease-out; max-width: 90vw;
}
.toast[hidden] { display: none; }

/* ---------- test mode ---------- */
.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.test-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-head); font-weight: 600; font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase;
  color: #bbb; background: #2a2a2a; border: 1px solid #444; border-radius: 0;
  padding: 6px 10px; cursor: pointer;
}
.test-toggle[hidden] { display: none; }
.test-toggle:hover { border-color: #888; color: var(--white); }
.test-toggle-state { min-width: 26px; text-align: left; }
.test-toggle-track { position: relative; width: 34px; height: 18px; background: #555; border-radius: 9px; transition: background .15s; }
.test-toggle-knob { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--white); transition: left .15s; }
.test-toggle[aria-pressed="true"] { color: var(--black); background: #FFD54F; border-color: #FFD54F; }
.test-toggle[aria-pressed="true"] .test-toggle-track { background: var(--black); }
.test-toggle[aria-pressed="true"] .test-toggle-knob { left: 18px; background: #FFD54F; }
.test-tag {
  display: inline-block; vertical-align: middle;
  font-family: var(--font-head); font-size: 11px; letter-spacing: 1.5px;
  color: var(--black); background: #FFD54F; padding: 2px 6px; margin-left: 6px;
}
.test-tag[hidden] { display: none; }

/* ---------- test checkout popup ---------- */
.checkout {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(20, 20, 20, .72);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: fadein .2s ease-out;
}
.checkout[hidden] { display: none; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.co-card {
  position: relative; width: 100%; max-width: 860px; max-height: 100%; overflow: auto;
  background: var(--white); box-shadow: 0 30px 80px rgba(0,0,0,.5);
  animation: rise .25s ease-out;
}
.co-test-bar {
  background: #FFD54F; color: var(--black);
  font-family: var(--font-head); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase;
  text-align: center; padding: 8px 40px;
}
.co-close {
  position: absolute; top: 4px; right: 8px; border: 0; background: transparent;
  font-size: 26px; line-height: 1; cursor: pointer; color: var(--black); padding: 4px 8px;
}
.co-body { display: grid; grid-template-columns: 1fr 1.15fr; }
.co-summary { background: var(--black); color: #ddd; padding: 24px; }
.co-brand img { height: 40px; width: auto; display: block; margin-bottom: 18px; }
.co-coin { width: 140px; height: 140px; display: block; background: #1E1E1E; border: 1px solid #333; margin-bottom: 14px; object-fit: cover; }
.co-item { font-size: 15px; color: var(--white); line-height: 1.4; }
.co-lines { margin-top: 18px; border-top: 1px solid #333; padding-top: 12px; font-size: 14px; }
.co-lines > div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; }
.co-lines > div small { display: block; font-size: 11.5px; color: #888; }
.co-lines > div > span:last-child { flex: 0 0 auto; }
.co-lines .co-total { border-top: 1px solid #333; margin-top: 8px; padding-top: 12px; font-family: var(--font-head); font-size: 20px; color: var(--white); letter-spacing: 1px; }
.co-note { margin-top: 12px; font-size: 12px; color: #999; }
.co-form { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.co-form[hidden] { display: none; }
.co-form h2, .co-done h2 { font-family: var(--font-head); font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dark); margin: 0 0 4px; font-size: 20px; }
.co-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 10px; }
.co-pay { font-size: 16px; padding: 14px; margin-top: 4px; }
.co-pay:disabled { opacity: .7; }
.co-secure { font-size: 12px; color: #666; margin: 0; text-align: center; }
.co-secure a { color: var(--orange-text); font-weight: 600; }
.co-done { grid-column: 2; padding: 40px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.co-done[hidden] { display: none; }
.co-check { width: 64px; height: 64px; border-radius: 50%; background: #2e7d32; color: var(--white); font-size: 36px; display: grid; place-items: center; }
.co-done p { margin: 0; color: var(--text); overflow-wrap: anywhere; }

/* ---------- the "?" beside a text field ---------- */
/* A small ring in the field's label. It opens the popup below: what to put in the field, with an example. */
.help-btn {
  position: relative; display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 6px; padding: 0; vertical-align: -4px;
  border: 1.5px solid currentColor; border-radius: 50%; background: none; cursor: pointer;
  font-family: var(--font-head); font-weight: 600; font-size: 11px; line-height: 1; letter-spacing: 0; text-transform: none; color: var(--orange-text);
  transition: background .15s, color .15s, border-color .15s;
}
.help-btn:hover, .help-btn:focus-visible { background: var(--orange); border-color: var(--orange); color: var(--white); }
/* The label with a ring in it lines the two up on one centre line, close together */
.label:has(.help-btn), .ff-label:has(.help-btn) { display: flex; align-items: center; gap: 5px; }
.label .help-btn, .ff-label .help-btn { margin-left: 0; vertical-align: 0; }
.help-body { gap: 14px; }
.help-list { margin: 0; padding: 0 0 0 20px; display: flex; flex-direction: column; gap: 7px; font-size: 14px; line-height: 1.45; color: var(--text); }
.help-list b { color: var(--text-dark); }
.help-example { padding: 12px 14px; background: var(--offwhite); border-left: 3px solid var(--orange); }
.help-example .label { margin-bottom: 4px; }
.help-example p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-dark); }
.help-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.help-actions .btn { flex: 1 1 auto; }
.help-actions .btn[hidden] { display: none; }

/* ---------- "email me this design" ---------- */
.send-card { max-width: 440px; }
.send-form, .send-done { padding: 28px 26px 24px; display: flex; flex-direction: column; gap: 12px; }
.send-form[hidden], .send-done[hidden] { display: none; }
.send-form h2, .send-done h2 { margin: 0; font-family: var(--font-head); font-weight: 600; font-size: 22px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dark); }
.send-coin { width: 132px; height: 132px; align-self: center; object-fit: cover; background: #1E1E1E; border: 1px solid var(--line); border-radius: 50%; pointer-events: none; user-select: none; -webkit-touch-callout: none; }
.send-lead { margin: 0; color: var(--text); }
.send-form .ff-check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.send-form .ff-check input { width: 18px; height: 18px; accent-color: var(--orange); flex: 0 0 auto; }
.send-form .ff-label em { color: #767676; font-style: normal; text-transform: none; letter-spacing: 0; }
.send-form .btn { padding: 14px; font-size: 15px; }
.send-done { align-items: center; text-align: center; }
.send-done p { margin: 0; overflow-wrap: anywhere; }

/* ---------- front / back ---------- */
.side-tabs { margin: 0 0 4px; }
.side-tabs button { padding: 10px 22px; }
.side-tabs button small { text-transform: none; letter-spacing: 0; }
.step h2 + .side-tabs + .group { margin-top: 12px; }
.back-intro { background: #fff7ef; border-left: 3px solid var(--orange); padding: 14px 16px; margin: 0 0 8px; }
.back-intro p { margin: 0 0 12px; font-size: 14px; line-height: 1.55; color: var(--text); }
.side-badge { position: absolute; left: 10px; top: 10px; padding: 3px 9px; font-family: var(--font-head); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--white); background: rgba(0,0,0,.65); border: 1px solid rgba(255,255,255,.25); pointer-events: none; }
.side-badge[hidden] { display: none; }
.preview-ai, .version img, .review-coin img, .co-coin, .send-coin { object-fit: contain; }
.preview-stage.wide { aspect-ratio: 2096 / 1024; max-width: none; }

/* ---------- coin shapes ---------- */
.shape-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); gap: 8px; }
.shape-chips button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  border: 2px solid transparent; background: var(--offwhite); border-radius: 0;
  padding: 6px 10px 6px 8px; cursor: pointer; text-align: left; transition: border-color .15s, background .15s;
  font-family: var(--font-head); font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-dark);
}
.shape-chips button svg { flex: 0 0 auto; width: 26px; height: 26px; color: #555; }
.shape-chips button:hover { border-color: #ccc; }
.shape-chips button.on { border-color: var(--orange); background: #fff7ef; }
.shape-chips button.on svg { color: var(--orange); }

/* ---------- the described coin ---------- */
.lead { margin: -6px 0 18px; font-size: 15px; line-height: 1.55; color: var(--text); }
.ff textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; line-height: 1.5; padding: 10px 12px; border: 1px solid #CFCAC2; border-radius: 0; background: var(--white); color: var(--text-dark); resize: vertical; min-height: 44px; }
.ff textarea:focus { outline: 2px solid var(--orange); outline-offset: -1px; border-color: var(--orange); }
.ff textarea.bad { border-color: #c62828; }
/* The stage holds one face, or both faces side by side from the back step on (front left, back right) */
.face { position: absolute; inset: 0; min-width: 0; overflow: hidden; }
.face[hidden] { display: none; }
.face img { width: 100%; height: 100%; display: block; object-fit: contain; }
.face img[hidden] { display: none; }
.face.same img { opacity: .55; }
.face-label { position: absolute; left: 8px; top: 8px; padding: 3px 8px; font-family: var(--font-head); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--white); background: rgba(0,0,0,.65); border: 1px solid rgba(255,255,255,.25); pointer-events: none; }
.face-label[hidden] { display: none; }
.face-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 28px; text-align: center; color: #aaa; font-size: 14px; line-height: 1.5; }
.face-empty[hidden] { display: none; }
.face-empty p { margin: 0; max-width: 260px; }
.face-empty b { color: var(--white); }
/* The progress overlay is see-through over a coin; over an empty face the hint underneath would only muddle it */
.preview-stage:has(.preview-busy:not([hidden])) .face-empty { visibility: hidden; }
.preview-stage.two { aspect-ratio: 2 / 1; max-width: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.preview-stage.two .face { position: relative; inset: auto; }
.preview-stage.two .face-empty { gap: 8px; padding: 12px; font-size: 12px; }
.preview-stage.two .face-empty p { max-width: 180px; }
.preview-stage.two .coin-mark { --c: 72px; }
.preview-stage.two .preview-busy[data-face="front"] { right: 50%; }
.preview-stage.two .preview-busy[data-face="back"] { left: 50%; }
/* Over half the stage there is room for the coin and its stage line, not for the reading matter under it */
.preview-stage.two .preview-busy { padding: 10px; gap: 6px; }
.preview-stage.two .preview-busy .progress-sub { display: none; }
/* ...so it goes under the stage instead, where the width of both faces holds it (see #progress-wide; a phone held
   upright keeps it in the box, below) */
.progress-wide { display: none; margin: 0; text-align: center; font-size: 12.5px; line-height: 1.45; color: #bbb; min-height: 2.9em; animation: mint-line .6s ease-out; }
.progress-wide strong { color: var(--orange); font-weight: 700; }
.preview-stage.two ~ .progress-wide:not([hidden]) { display: block; }
.preview-stage.two .preview-busy #progress-text { font-size: 11.5px; padding: 6px 9px; }
.preview-stage.two .mint-says { gap: 6px; }
.preview-stage.two .mint-nerd { width: 28px; height: 28px; }
.version.stale { opacity: .4; }

/* ---------- the waiting coin ---------- */
/* Until there is a render, a gold coin waits on the empty face. It is the loading coin's quieter twin, built by app.js
   from the same parts ("the mint" above): it hangs over its shadow in a pool of light, rocks to show one face, then
   turns over to show the other. Sized from --c, its diameter. */
.coin-mark { --c: 156px; position: relative; flex: 0 0 auto; width: var(--c); height: var(--c); margin-bottom: calc(var(--c) * .16); }
.coin-mark::before { content: ""; position: absolute; inset: -24%; border-radius: 50%; background: radial-gradient(circle, rgba(248,226,122,.3), rgba(248,226,122,0) 66%); animation: mint-glow 4s ease-in-out infinite; }
.coin-mark::after { content: ""; position: absolute; left: 12%; right: 12%; top: 108%; height: 9%; border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.7), rgba(0,0,0,0)); animation: coin-shadow 4s ease-in-out infinite; }
.coin-float { position: absolute; inset: 0; perspective: calc(var(--c) * 5); animation: mint-float 4s ease-in-out infinite; }
.coin-turn { --t: calc(var(--c) * .035); position: absolute; inset: 0; transform-style: preserve-3d; animation: coin-turn 11s ease-in-out infinite; }
.coin-mark .mint-face::after { animation-duration: 5.5s; }
.coin-mark .mint-spark { animation-duration: 3.6s; }
@keyframes coin-turn {
  0% { transform: rotateX(10deg) rotateY(-24deg); }
  30% { transform: rotateX(10deg) rotateY(24deg); }
  50% { transform: rotateX(10deg) rotateY(204deg); }
  80% { transform: rotateX(10deg) rotateY(156deg); }
  100% { transform: rotateX(10deg) rotateY(336deg); }
}
/* the shadow tightens as the coin rises and spreads as it sinks */
@keyframes coin-shadow { 0%, 100% { transform: scale(.84); opacity: .7; } 50% { transform: scale(1); opacity: 1; } }
.preview-stage.empty { background: radial-gradient(circle at 50% 38%, #3B2D11 0%, #1B1710 52%, #141414 76%); }
.ai-disclaimer { width: 100%; max-width: 400px; box-sizing: border-box; padding: 12px 14px; background: #2a2a2a; border-left: 3px solid var(--orange); color: #ccc; font-size: 13px; line-height: 1.5; }
.ai-disclaimer[hidden] { display: none; }
.ai-disclaimer p { margin: 0 0 10px; }
.ai-disclaimer strong { color: var(--white); }
#contact-coin[hidden] { display: none; }

/* ---------- responsive ---------- */
/* Keep this section last: it has to win over every base rule above. */

/* No double-tap zoom delay, no grey flash on tap */
button, a, input, textarea, label, [role="button"] { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
.only-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .only-touch { display: inline; }
  .only-mouse { display: none; }
}

/* Phones and upright tablets: one column. The coin sits on top at full width, the form follows, and each step's
   buttons stay pinned to the bottom of the screen so the next move is always under the thumb. */
@media (max-width: 860px) {
  .app { --pad-l: max(16px, env(safe-area-inset-left)); --pad-r: max(16px, env(safe-area-inset-right)); }
  body { font-size: 16px; }
  .builder { grid-template-columns: 1fr; }
  .preview-col { min-width: 0; }
  .preview { position: static; max-height: none; overflow: visible; gap: 10px; padding: 14px var(--pad-r) 16px var(--pad-l); }
  .panel, .app-header, .stepper { padding-left: var(--pad-l); padding-right: var(--pad-r); }
  .app-header { flex-wrap: wrap; }
  .brand-text h1 { font-size: 18px; }

  /* The coin never grows taller than the screen, which matters when the phone is held sideways */
  .preview-stage { box-shadow: none; max-width: 420px; max-width: min(420px, calc(100dvh - 150px)); }
  .preview-stage.two { max-width: 560px; max-width: min(560px, calc(2 * (100dvh - 150px))); }
  .preview-stage.two .face-empty { padding: 8px; }
  .preview-stage.two .preview-busy { padding: 8px; font-size: 12px; }
  .version { width: 56px; height: 56px; }

  /* Nothing rendered yet: a short banner instead of an empty square, so the form starts on the first screen */
  .preview-stage.empty { aspect-ratio: auto; max-width: none; background: transparent; border: 0; }
  .preview-stage.empty .face { position: static; }
  .preview-stage.empty .face-empty { position: static; flex-direction: row; justify-content: flex-start; gap: 14px; padding: 0; text-align: left; }
  .preview-stage.empty .face-empty p { max-width: none; }
  .preview-stage.empty .coin-mark { --c: 60px; margin: 4px 0 10px 4px; }
  .preview-stage.empty ~ .preview-spec, .preview-stage.empty ~ .preview-caption { display: none; }

  /* Once the coin is designed, the order steps only need a reminder of it; versions and fixes live on the design step */
  .builder:not([data-step="design"]) :is(.preview-actions, .versions-wrap, .ai-check, .ai-disclaimer, .preview-caption) { display: none; }
  .builder:not([data-step="design"]) .preview-stage.two { max-width: 300px; max-width: min(300px, calc(2 * (100dvh - 150px))); }
  /* A thank-you page without a render has nothing to show */
  .builder[data-step="result"] .preview-col:not(:has(.face img:not([hidden]))) { display: none; }

  /* The step's buttons: a bar fixed to the bottom of the screen, edge to edge. Fixed rather than sticky, so it is
     there even while the coin above the form fills the screen. */
  .step-actions {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 4; flex-wrap: nowrap; margin: 0;
    padding: 10px var(--pad-r) max(10px, env(safe-area-inset-bottom)) var(--pad-l);
    background: var(--white); border-top: 1px solid var(--line); box-shadow: 0 -8px 18px rgba(0,0,0,.07);
  }
  .step-actions .btn { line-height: 1.2; text-align: center; }
  .step-actions + .hint { margin-top: 14px; }
  /* A transform on the step would anchor the fixed bar to it while the animation plays, so the step only fades in */
  .step { animation-name: fadein; }
  /* A tapped field lands clear of that bar */
  input, textarea, .seg, .logo-drop { scroll-margin: 16px 0 96px; }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); width: max-content; max-width: calc(100vw - 24px); }

  /* The footer ends above the bar */
  .foot { padding: 10px var(--pad-r) calc(65px + max(10px, env(safe-area-inset-bottom))) var(--pad-l); }
  .hint { font-size: 14px; }
  .label, .ff-label { font-size: 12px; }
}

/* Fingers, on any screen size: 16px fields (smaller text makes iPhones zoom the page on tap) and 44px touch targets */
@media (max-width: 860px), (hover: none) and (pointer: coarse) {
  input[type="text"], input[type="email"], input[type="tel"], input[type="number"], textarea, .ff textarea { font-size: 16px; padding: 12px; }
  .btn, .btn.small, .seg button, .swatch-btn, .test-toggle { min-height: 44px; }
  .seg button { min-width: 44px; }
  .bg-swatch { width: 44px; height: 44px; }
  .bg-swatches { gap: 10px; }
  input[type="range"] { height: 44px; }
  .link { padding: 10px 6px; margin: -10px -6px; }
  .ai-check .link { display: inline-block; padding: 10px 0; margin: -4px 0 -8px; font-size: 13px; }
  .summary td .link { font-size: 14px; margin-left: 2px; min-width: 44px; text-align: left; }
  .co-close { top: 0; right: 0; width: 44px; height: 44px; padding: 0; }
  .details-form .ff-check, .send-form .ff-check { min-height: 44px; font-size: 15px; }
  .details-form .ff-check input, .send-form .ff-check input { width: 22px; height: 22px; }
  .stepper li.done { min-width: 44px; }
  .foot .foot-links { font-size: 12px; line-height: 1.5; }
  .foot a, .co-secure a { display: inline-block; padding: 9px 2px; }
}

/* Too narrow for every step name: numbers only, plus the name of the step you are on */
@media (max-width: 720px) {
  .stepper { padding: 0 max(6px, env(safe-area-inset-right)) 0 max(6px, env(safe-area-inset-left)); }
  .stepper li { margin-right: 0; padding: 12px 10px; justify-content: center; flex: 1 1 0; }
  .stepper li.current { flex: 0 0 auto; }
  .stepper li:not(.current) b { display: none; }
}

/* A phone held sideways: the screen is too short to stack the coin over the form, so they sit side by side again,
   with the coin pinned on the left. The min-width keeps an upright phone with its keyboard open out of this. */
@media (max-width: 860px) and (min-width: 560px) and (orientation: landscape) {
  .topbar { padding-top: 3px; padding-bottom: 3px; font-size: 11px; }
  .app-header { padding-top: 8px; padding-bottom: 8px; }
  .brand-logo { height: 36px; }
  .app-header .sub { display: none; }
  .stepper li { padding-top: 8px; padding-bottom: 8px; }

  .builder { grid-template-columns: minmax(200px, 34%) 1fr; }
  .builder[data-step="result"]:not(:has(.face img:not([hidden]))) { grid-template-columns: 1fr; }
  .preview { position: sticky; top: 0; max-height: 100dvh; overflow-y: auto; padding: 12px 12px 12px var(--pad-l); }
  .preview-stage, .preview-stage.two, .builder:not([data-step="design"]) .preview-stage.two { max-width: none; }
  .preview-stage:not(.two):not(.empty) { max-width: calc(100dvh - 96px); }
  .preview-stage.two .face-label { font-size: 9px; padding: 2px 5px; left: 4px; top: 4px; }
  .preview-stage.two .coin-mark { display: none; }
  .preview-actions .btn { font-size: 12px; letter-spacing: 1px; padding-left: 12px; padding-right: 12px; }
  .panel { --panel-l: 18px; padding-top: 16px; padding-left: var(--panel-l); }
  .builder[data-step="result"]:not(:has(.face img:not([hidden]))) .panel { --panel-l: var(--pad-l); }

  /* Beside the coin, the bar stays inside the form's column */
  .step-actions {
    position: sticky; left: auto; right: auto;
    margin: 20px calc(-1 * var(--pad-r)) 0 calc(-1 * var(--panel-l));
    padding: 8px var(--pad-r) max(8px, env(safe-area-inset-bottom)) var(--panel-l);
  }
  .foot { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}

/* A short screen: the popups drop the picture of the coin so the form fits */
@media (max-height: 500px) {
  .checkout { padding: 8px; }
  .send-coin { display: none; }
  .send-form, .send-done { padding: 18px 20px 16px; gap: 8px; }
}

/* ---------- phones: the coin studio ---------- */
/* Not a narrower copy of the desktop page: an app-like dark shell that fills the screen and never scrolls as a page.
   The coin stays in view at the top, the sections of the design form are tabs under it, and the step's button sits at
   the bottom. Keep this media query in step with `studio` in app.js. */
.tabs, .restart-icon, .sub-head, .btn.sub-nav { display: none; }
@keyframes sheet { from { transform: translateY(40%); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 559px), (max-width: 720px) and (orientation: portrait) {
  :root {
    --s-bg: #0E0E10; --s-card: #19191C; --s-raise: #242428; --s-line: #313137;
    --s-text: #C6C6CC; --s-strong: #F6F6F7; --s-dim: #8D8D96; --s-link: #FFA559;
  }
  html, body { height: 100%; overflow: hidden; }
  body { background: var(--s-bg); }
  .only-wide { display: none; }
  .only-narrow { display: inline; }
  .noscript { position: fixed; z-index: 100; top: 0; left: 0; right: 0; }

  /* ----- the shell: brand bar, coin, tabs, form, button ----- */
  /* The shell fills the screen and does not react to the on-screen keyboard: the phone slides the page for that */
  .app {
    position: fixed; left: 0; right: 0; top: 0; bottom: 0; height: 100dvh; min-height: 0; max-width: none;
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto minmax(0, 1fr); align-items: center;
    background: var(--s-bg); color: var(--s-text); box-shadow: none; color-scheme: dark;
  }
  .topbar { grid-column: 1 / -1; padding: calc(3px + env(safe-area-inset-top)) 8px 3px; font-size: 9px; letter-spacing: 1.4px; }
  .foot { display: none; }

  /* One row: the logo, and Start Over at the far end. No numbered steps up here: the row under the coin and each
     step's own heading and buttons say where they are. The header's box is dissolved so both sit on the shell's grid. */
  .app-header { display: contents; }
  .stepper { display: none; }
  .brand, .header-actions { grid-row: 2; height: 58px; display: flex; align-items: center; }
  .brand { grid-column: 1; padding-left: var(--pad-l); }
  /* The logo was drawn for a white page: on the dark shell its navy body sinks into the background, so it sits on a white plate */
  .brand-logo { box-sizing: content-box; height: 34px; padding: 5px 9px 5px 7px; border-radius: 12px; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.14); }
  .brand-text { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); }
  .header-actions { grid-column: 2; gap: 8px; padding-right: var(--pad-r); }
  .header-actions .btn.small, .header-actions .btn.small:hover { min-height: 38px; gap: 7px; padding: 0 15px 0 11px; border-radius: 19px; font-size: 12px; letter-spacing: 1.3px; background: var(--s-raise); color: var(--s-strong); box-shadow: inset 0 0 0 1px var(--s-line); }
  .restart-icon { display: block; width: 17px; height: 17px; color: var(--orange); }
  .test-toggle { min-height: 30px; padding: 3px 8px; font-size: 10px; letter-spacing: 1px; border-radius: 8px; }
  .test-toggle-label, .test-toggle-track { display: none; }
  .test-toggle::before { content: "Test"; }

  .builder { grid-column: 1 / -1; grid-row: 3; align-self: stretch; display: flex; flex-direction: column; min-height: 0; }

  /* ----- the coin ----- */
  .preview-col {
    flex: 0 0 auto; min-width: 0; height: clamp(190px, 38dvh, 400px);
    background: radial-gradient(120% 95% at 50% 32%, #2E2616 0%, #171618 58%, var(--s-bg) 100%);
    border-top: 1px solid var(--s-line);
  }
  .preview-col { transition: height .25s ease-out; }
  /* Shorter while there is nothing to show yet. Once a coin has been rendered it keeps its full height, so the form
     under it does not jump each time an edit takes the render off screen. */
  .preview-col:has(.preview-stage.empty):not(:has(.versions-wrap:not([hidden]))) { height: clamp(150px, 27dvh, 280px); }
  .builder[data-step="result"] .preview-col { height: clamp(150px, 28dvh, 260px); }
  .preview {
    position: static; height: 100%; max-height: none; overflow: visible;
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr) auto auto; align-items: center; gap: 0;
    padding: 12px var(--pad-r) 10px var(--pad-l); color: var(--s-dim);
  }
  .preview-stage, .preview-stage.two, .preview-stage.empty,
  .builder:not([data-step="design"]) .preview-stage.two {
    grid-column: 1 / -1; width: 100%; height: 100%; max-width: none; aspect-ratio: auto;
    background: transparent; border: 0; box-shadow: none;
  }
  .preview-stage.two { gap: 10px; }
  /* Each face is a square as large as its share of the stage allows, rounded like a card */
  .face, .preview-stage.empty .face { position: absolute; inset: 0; display: grid; place-items: center; container-type: size; overflow: visible; }
  .preview-stage.two .face { position: relative; inset: auto; }
  .preview-stage .face[hidden] { display: none; }
  .face img { width: min(100cqw, 100cqh); height: min(100cqw, 100cqh); border-radius: 16px; box-shadow: 0 14px 34px rgba(0,0,0,.6); }
  .face-label { left: 0; top: 0; padding: 2px 8px; border-radius: 8px; font-size: 9.5px; letter-spacing: 1.2px; background: rgba(14,14,16,.78); border-color: var(--s-line); }
  .face-empty, .preview-stage.empty .face-empty {
    position: absolute; inset: 0; flex-direction: column; justify-content: center; gap: 12px; padding: 4px 20px;
    text-align: center; font-size: 13px; line-height: 1.45; color: var(--s-dim);
  }
  .face-empty p, .preview-stage.empty .face-empty p { max-width: 280px; }
  .face-empty b { color: var(--s-strong); }
  .coin-mark, .preview-stage.empty .coin-mark { --c: clamp(60px, 12dvh, 112px); margin: 0 0 calc(var(--c) * .12); }
  .preview-stage.two .face-empty { gap: 8px; padding: 4px; font-size: 12px; }
  .preview-stage.two .coin-mark { --c: 58px; }
  .preview-busy { border-radius: 16px; padding: 10px 12px; gap: 6px; font-size: 13px; -webkit-backdrop-filter: none; backdrop-filter: none; } /* a blur under a moving coin is heavy work for a phone, and barely shows */
  .preview-stage.two .preview-busy { padding: 8px; font-size: 12px; }
  .preview-busy #progress-text { font-size: 12.5px; }
  .progress-sub { font-size: 11.5px; line-height: 1.4; min-height: 2.8em; }
  /* On the phone the line takes the spec line's row under both faces while the render runs (the versions row below
     keeps its place); the box over a face keeps it only when tall enough */
  .progress-wide { grid-column: 1 / -1; grid-row: 2; margin: 6px 0 0; font-size: 11px; line-height: 1.35; min-height: 2.7em; color: var(--s-dim); }
  .preview:has(.progress-wide:not([hidden])) .preview-spec { display: none; }
  @container (min-height: 270px) { .preview-stage.two .preview-busy .progress-sub { display: block; font-size: 10.5px; line-height: 1.35; min-height: 4.05em; } }
  .preview-spec { grid-column: 1 / -1; margin: 8px 0 0; font-size: 10.5px; letter-spacing: 1.4px; color: var(--s-dim); }
  .preview-caption { display: none; }

  /* Versions and "New Version" share one row under the coin */
  .versions-wrap { grid-column: 1; grid-row: 3; flex-direction: row; align-items: center; max-width: none; min-width: 0; margin-top: 6px; }
  .versions-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .versions { flex-wrap: nowrap; justify-content: flex-start; gap: 8px; min-width: 0; padding: 6px 8px 2px 0; overflow-x: auto; scrollbar-width: none; }
  .versions::-webkit-scrollbar { display: none; }
  .versions-split { height: 32px; background: var(--s-line); }
  .version { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 10px; border-color: var(--s-line); background: var(--s-card); }
  .version img { border-radius: 8px; }
  .version .num { border-radius: 0 6px 0 8px; }
  .version .flag { top: -6px; right: -6px; width: 16px; height: 16px; font-size: 10px; box-shadow: 0 0 0 2px var(--s-bg); }
  .preview-actions { grid-column: 2; grid-row: 3; margin: 6px 0 0 10px; }
  .preview-actions .btn.navy, .preview-actions .btn.navy:hover, .preview-actions .btn.navy:disabled:hover { min-height: 40px; padding: 0 16px; border-radius: 20px; font-size: 12px; letter-spacing: 1.2px; background: var(--s-raise); color: var(--s-strong); box-shadow: inset 0 0 0 1px var(--s-line); }
  .preview-actions .btn::before { content: "+"; font-size: 16px; line-height: 1; color: var(--orange); }
  .preview-actions .btn::after { content: none; }

  /* Past the design steps the coin is a small reminder beside its spec line */
  .builder[data-step="quote"] .preview-col { height: auto; background: var(--s-card); border-bottom: 1px solid var(--s-line); }
  .builder[data-step="quote"] .preview { display: flex; flex-direction: row; gap: 12px; height: auto; padding-top: 8px; padding-bottom: 8px; }
  .builder[data-step="quote"] .preview .preview-stage.two { flex: 0 0 112px; width: 112px; height: 54px; gap: 4px; }
  .builder[data-step="quote"] .face-label { display: none; }
  .builder[data-step="quote"] .preview-stage.two .face-empty { display: none; } /* the spec line beside it says "blank back" */
  .builder[data-step="quote"] .face img { border-radius: 8px; box-shadow: none; }
  .builder[data-step="quote"] .preview-spec { flex: 1 1 0; min-width: 0; margin: 0; text-align: left; font-size: 12px; color: var(--s-strong); }

  /* ----- the sections of a design step, walked through one at a time ----- */
  .tabs:not([hidden]) { flex: 0 0 auto; display: flex; padding: 0 calc(var(--pad-r) - 8px) 0 calc(var(--pad-l) - 8px); overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--s-line); background: var(--s-bg); }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button {
    flex: 1 0 auto; position: relative; min-height: 46px; padding: 0 8px; border: 0; background: none; cursor: pointer; white-space: nowrap;
    font-family: var(--font-head); font-size: 12.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--s-dim);
  }
  /* The line under the names fills up to the section on show, so the row reads as progress */
  .tabs button.past, .tabs button.on { color: var(--s-strong); }
  .tabs button.past::after, .tabs button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--orange); }
  .tabs button:first-child::after { border-radius: 2px 0 0 2px; }
  .tabs button.on::after { border-radius: 0 2px 2px 0; }
  .tabs button.on:first-child::after { border-radius: 2px; }
  /* On Result, a dot carries the proofreader's verdict */
  .tabs button i { display: inline-block; width: 6px; height: 6px; margin-left: 5px; border-radius: 50%; vertical-align: 2px; background: var(--orange); }
  .tabs button.ok i { background: #43a047; }
  .tabs button.warn i { background: #FFB300; }
  .tab-off, .sub-off, .step-actions .btn.sub-off { display: none; }
  .step-actions .btn.sub-nav:not([hidden]) { display: inline-flex; }
  .step-actions .btn.sub-next { order: 1; } /* the way on is always the right-hand button */
  /* What this section asks for, in a line */
  .sub-head:not(:empty) { display: flex; flex-direction: column; gap: 2px; margin: 0 0 14px; }
  .sub-head small { font-family: var(--font-head); font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--orange); }
  .sub-head strong { font-family: var(--font-head); font-weight: 600; font-size: 21px; letter-spacing: 1.6px; text-transform: uppercase; line-height: 1.25; color: var(--s-strong); }
  .group[data-tab="files"] .group-title { display: none; } /* the line above says it */

  /* ----- the form ----- */
  .panel {
    flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    display: flex; flex-direction: column; padding: 16px var(--pad-r) 0 var(--pad-l); background: var(--s-bg);
  }
  .step, .details-form { flex: 1 0 auto; display: flex; flex-direction: column; }
  .step h2 { flex-wrap: wrap; margin-bottom: 14px; font-size: 21px; color: var(--s-strong); }
  /* The design step is named by the step bar and the tabs; its heading stays for screen readers */
  .step[data-step="design"] > h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .lead { display: none; }
  .group { border-top: 0; margin-top: 0; padding-top: 0; }
  .group:not(.tab-off) ~ .group:not(.tab-off) { margin-top: 20px; }
  .group-title { margin-bottom: 10px; font-size: 13px; color: var(--s-strong); }
  .group-title .n { display: none; }
  .group-title::before { height: 13px; }
  .group-title em, .label em, .send-form .ff-label em { color: var(--s-dim); }
  .group:has(.label) .group-title { display: none; } /* the field's own label says the same */
  .label, .ff-label, .sublabel { font-size: 13px; color: var(--s-dim); }
  .hint { font-size: 13px; line-height: 1.5; color: var(--s-dim); }
  #design-hint { margin-top: 16px; color: var(--s-text); }
  .field.two, .details-form .ff-grid { grid-template-columns: 1fr; }
  .details-form .ff-section { color: var(--s-strong); }
  .link, .co-secure a { color: var(--s-link); }
  .ff-error { color: #FF8A80; }

  input[type="text"], input[type="email"], input[type="tel"], input[type="number"], textarea, .ff textarea {
    background: var(--s-card); color: var(--s-strong); border: 1px solid var(--s-line); border-radius: 12px;
  }
  input:focus, textarea:focus, .ff textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(245,130,32,.22); }
  input::placeholder, textarea::placeholder { color: #6C6C75; }
  input.bad, .ff textarea.bad { border-color: #EF5350; background: rgba(239,83,80,.1); }
  input:disabled, input:read-only { background: var(--s-raise); color: var(--s-dim); }
  input:-webkit-autofill { -webkit-text-fill-color: var(--s-strong); box-shadow: 0 0 0 100px var(--s-card) inset; caret-color: var(--s-strong); }
  .qty-input { max-width: none; }
  .size-row { grid-template-columns: 1fr; }
  .size-select {
    background-color: var(--s-card); color: var(--s-strong); border: 1px solid var(--s-line); border-radius: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23C6C6CC' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  }
  .size-select:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(245,130,32,.22); }
  .size-select.bad { border-color: #EF5350; background-color: rgba(239,83,80,.1); }
  .logo-link .btn.small { min-height: 44px; }
  /* An iPhone zooms the whole page in when a field with text under 16px is tapped, and leaves it zoomed */
  .logo-link input, .size-select { font-size: 16px; }

  .logo-drop { padding: 20px 14px; border-color: var(--s-line); border-radius: 14px; background: var(--s-card); }
  .logo-drop:hover, .logo-drop:focus, .logo-drop.over { border-color: var(--orange); background: rgba(245,130,32,.08); }
  .logo-empty { color: var(--s-text); }
  .logo-empty strong, .logo-meta strong { color: var(--s-strong); }
  .logo-empty span, .logo-meta span { color: var(--s-dim); }
  .logo-have img { border-color: var(--s-line); border-radius: 10px; }
  .logo-drop.bad { border-color: #EF5350; background: rgba(239,83,80,.1); }
  .ref, .ref-add { border-radius: 12px; border-color: var(--s-line); background: var(--s-card); }
  .ref img { border-radius: 11px; }
  .ref.bad { border-color: #EF5350; box-shadow: 0 0 0 2px #EF5350; }
  .ref-add { color: var(--s-strong); }
  .ref-add:hover, .ref-add:focus-visible { border-color: var(--orange); background: rgba(245,130,32,.08); }
  .ref-remove { border-color: var(--s-bg); background: var(--s-strong); color: #111113; }

  /* Choice chips share the row equally */
  .seg.wrap { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
  .seg.wrap button, .seg.wrap button:hover { min-height: 48px; padding: 6px 4px; line-height: 1.2; border: 1px solid var(--s-line); border-radius: 12px; background: var(--s-card); color: var(--s-strong); }
  .seg.wrap button.on, .seg.wrap button.on:hover { background: var(--orange); border-color: var(--orange); color: var(--white); }
  .estimate { border-left-width: 3px; border-radius: 12px; background: var(--s-card); }
  .estimate .big { color: var(--s-strong); }
  .estimate small { color: var(--s-dim); }
  .quote-title { color: var(--s-strong); }
  .quote-summary { color: var(--s-text); }
  .quote-more summary { color: var(--s-link); }
  .quote-lines { border-top-color: var(--s-line); }
  .quote-lines li { color: var(--s-text); }
  .quote-lines li small, .quote-notes { color: var(--s-dim); }
  .quote-lines .ql-free { color: var(--orange); }
  .estimate.reading .quote-notes::before { border-color: var(--s-line); border-top-color: var(--orange); }


  /* The Result tab: what the proofreader found, and the offer to have a designer fix it */
  .result-slot:not(.tab-off) { display: flex; flex-direction: column; gap: 12px; }
  .ai-check, .ai-disclaimer { max-width: none; border-radius: 12px; background: var(--s-card); }
  .ai-check { padding: 12px 14px; }

  #result .head { font-size: 22px; color: var(--s-strong); }
  #result .caption { color: var(--s-dim); }
  #result strong { color: var(--s-strong); }

  /* ----- buttons ----- */
  .btn { border-radius: 12px; }
  .btn.dark, .btn.dark:hover, .btn.dark:disabled:hover { background: var(--s-raise); color: var(--s-strong); box-shadow: inset 0 0 0 1px var(--s-line); }
  /* Generate is struck in gold */
  .btn.navy, .btn.navy:hover, .btn.navy:disabled:hover { background: linear-gradient(180deg, #FBE58A, #D7A328); color: #1F1600; }
  .btn:disabled { opacity: .38; }

  /* The step's buttons rest at the bottom of the form's column, over whatever scrolls beneath them */
  .step-actions {
    position: sticky; left: auto; right: auto; bottom: 0; order: 9; gap: 8px;
    margin: auto calc(-1 * var(--pad-r)) 0 calc(-1 * var(--pad-l));
    padding: 16px var(--pad-r) max(12px, env(safe-area-inset-bottom)) var(--pad-l);
    background: linear-gradient(to bottom, rgba(14,14,16,0), var(--s-bg) 16px); border-top: 0; box-shadow: none;
  }
  .step-actions .btn { flex: 1 1 0; min-height: 52px; padding: 0 14px; border-radius: 14px; font-size: 15px; }
  .step-actions .btn:last-child { margin-left: 0; }
  .step-actions .btn.back { flex: 0 0 auto; padding: 0 16px; }
  .step-actions + .hint { margin-top: 14px; }

  .toast { position: absolute; bottom: calc(92px + env(safe-area-inset-bottom)); border-radius: 12px; background: var(--s-strong); color: #111113; box-shadow: 0 12px 34px rgba(0,0,0,.6); }

  /* ----- popups ----- */
  .checkout { top: 0; height: 100dvh; padding: 0; align-items: stretch; background: rgba(0,0,0,.62); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); color-scheme: dark; }
  .co-card { max-width: none; max-height: none; height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; background: var(--s-card); color: var(--s-text); box-shadow: none; }
  .co-close { top: 0; right: 0; color: var(--s-strong); }
  .co-form h2, .co-done h2, .send-form h2, .send-done h2 { font-size: 20px; color: var(--s-strong); }
  .co-secure, .co-done p, .send-lead { color: var(--s-dim); }
  .checkout input[type="text"], .checkout input[type="email"], .checkout input[type="tel"], .checkout textarea { background: var(--s-bg); }
  /* The test checkout fills the screen, with the summary kept short so the card form is in reach */
  .co-test-bar { position: sticky; top: 0; z-index: 1; font-size: 11px; letter-spacing: 1px; padding: 12px 48px; }
  .co-card:not(.send-card) .co-close { position: fixed; z-index: 2; color: var(--black); }
  .co-body { grid-template-columns: 1fr; }
  .co-summary { display: grid; grid-template-columns: 72px 1fr; column-gap: 14px; align-items: center; padding: 14px 16px; background: #000; }
  .co-brand { display: none; }
  .co-coin { width: 72px; height: 72px; margin: 0; border-radius: 10px; }
  .co-lines, .co-note { grid-column: 1 / -1; }
  .co-lines { margin-top: 12px; padding-top: 8px; }
  .co-lines .co-total { font-size: 18px; margin-top: 4px; padding-top: 8px; }
  .co-form { padding: 18px 16px max(24px, env(safe-area-inset-bottom)); }
  .co-row { grid-template-columns: 1fr 1fr; }
  .co-row .ff:last-child { grid-column: 1 / -1; }
  .co-pay { min-height: 52px; border-radius: 14px; }
  .co-done { grid-column: 1; }
  /* The small popups slide up from the bottom as a sheet: only as tall as their form, scrolling once that fills the screen */
  .checkout.send { align-items: flex-end; }
  .send-card { height: auto; max-height: 100%; display: flex; flex-direction: column; border-radius: 22px 22px 0 0; box-shadow: 0 -20px 60px rgba(0,0,0,.6); animation: sheet .28s ease-out; }
  .send-card::before { content: ""; flex: 0 0 auto; align-self: center; width: 38px; height: 4px; margin-top: 8px; border-radius: 2px; background: var(--s-line); }
  .send-card .co-close { position: sticky; align-self: flex-end; flex: 0 0 auto; margin-bottom: -44px; }
  .send-form, .send-done { flex: 0 0 auto; padding: 14px 18px max(20px, env(safe-area-inset-bottom)); }
  .send-coin { width: 84px; height: 84px; border-color: var(--s-line); }
  .help-btn { width: 20px; height: 20px; font-size: 12px; color: var(--orange); }
  .help-btn::before { content: ""; position: absolute; inset: -11px; } /* a finger-sized tap area around the small ring */
  .help-list { color: var(--s-text); }
  .help-list b { color: var(--s-strong); }
  .help-example { background: var(--s-bg); }
  .help-example p { color: var(--s-strong); }
  .send-form .btn, .send-done .btn { border-radius: 14px; }

  /* ----- a very short screen (a phone held sideways): everything above the tabs steps aside for the form ----- */
  @media (max-height: 459px) { .topbar, .brand, .header-actions, .preview-col, .send-coin, .nerd { display: none; } }

  /* ----- the Coin Nerd's walk-through ----- */
  /* The sections already come one at a time here, with their own Back and Next, so he only says what to do in each:
     a light bubble on the dark shell, and a glow around the part he is talking about. */
  .step.guiding .group:not(.guide-on), .step.guiding .lead { opacity: 1; }
  .group.guide-on { padding-top: 6px; }
  .group.guide-on::before, .group.guide-on::after { inset: -6px -9px -12px; }
  .group.guide-on::after { background: rgba(245,130,32,.07); }
  @media (max-height: 459px) { .coach { display: none; } } /* a short screen leaves room for the field and little else */
  .group.guide-on ~ .group:not(.tab-off) { margin-top: 34px; }
  .step.guiding .sub-head:not(:empty) { margin-bottom: 20px; }
  .coach { margin-bottom: 14px; }
  .coach-says { padding: 10px 36px 11px 13px; color: #2A2A2E; background: var(--s-strong); box-shadow: 0 10px 26px rgba(0,0,0,.5); }
  .coach-text b { color: #111113; }
  .coach-says .coach-top, .coach-says .coach-actions { display: none; }
  .coach-close { color: #77777F; }
  .coach-close:hover { color: #111113; }
  .coach :focus-visible { outline-color: var(--orange); }
  .nerd-panel { color-scheme: light; }
}

/* The narrowest phones */
@media (max-width: 350px) {
  .topbar { font-size: 8px; letter-spacing: .8px; }
  .brand-logo { height: 30px; }
  .tabs button { font-size: 12px; letter-spacing: .8px; padding: 0 6px; }
  .step-actions { gap: 6px; }
  .step-actions .btn { font-size: 12.5px; letter-spacing: .6px; padding: 0 8px; }
  .step-actions .btn.back { padding: 0 10px; }
  .seg.wrap { gap: 6px; }
  .seg.wrap button { font-size: 12px; letter-spacing: .6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  /* The loading coin holds still, face on, and the ring alone shows the progress */
  .mint-coin, .mint-float, .mint::before, .mint::after, .mint-face::after, .mint-spark, .mint-scan::before, .mint-nerd { animation: none !important; }
  .coin-turn, .coin-float, .coin-mark::before, .coin-mark::after, .coach-face, .group.guide-on::before, .guide-pulse::before { animation: none !important; }
  .mint-coin, .coin-turn { transform: rotateX(9deg) rotateY(-16deg); }
  .mint-spark, .mint-scan { display: none; }
}
