/* builder.css - the card builder page (uses the colours from site.css) */
main.wide { max-width: 1440px; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

/* ---------- the three columns ---------- */
.builder {
  display: grid; gap: 20px; align-items: start;
  grid-template-columns: 280px minmax(0, 1fr) minmax(0, 1.05fr);
  grid-template-areas: "picker details preview";
}
.picker { grid-area: picker; }
.details { grid-area: details; }
.preview { grid-area: preview; }
.panel, .picker {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  padding: 18px; animation: enter .4s ease-out both;
}
.details { animation-delay: .05s; }
.preview { animation-delay: .1s; position: sticky; top: 84px; }
.picker { position: sticky; top: 84px; max-height: calc(100vh - 104px); overflow: auto; }
h2 { font-size: 17px; margin: 0; }

/* ---------- picker ---------- */
.picker-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.picker .picker-close { display: none; }
.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 0; background: none; color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: var(--bg); }
.search { display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 42px; margin-bottom: 10px;
          border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; color: var(--muted); transition: border-color .15s, box-shadow .15s; }
.search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(31, 95, 191, .12); background: #fff; }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font: inherit; color: var(--ink); }

.group { border-top: 1px solid var(--line); }
.group:first-child { border-top: 0; }
.group-head {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 4px;
  font: inherit; font-weight: 600; color: var(--ink); background: none; border: 0; cursor: pointer; text-align: left;
}
.group-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); flex: none; }
.group:nth-child(3n+2) .group-icon { background: var(--orange-soft); color: var(--orange); }
.field.guided input, .field.guided select, .field.guided textarea { animation: guided 1.4s ease-out; }   /* filled by the chat's form guide */
@keyframes guided { 0% { box-shadow: 0 0 0 3px var(--blue-soft); border-color: var(--blue); } 100% { box-shadow: 0 0 0 0 transparent; } }
.group-icon.has-pic, .order-icon.has-pic { background: none; overflow: hidden; }   /* a group picture (Admin -> Design groups) instead of the icon */
.group-icon.has-pic img, .order-icon.has-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.group-name { flex: 1; }
.group-count { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--bg); border-radius: 999px; padding: 1px 8px; }
.chevron { color: var(--muted); transition: transform .2s ease; }
.group.open .chevron { transform: rotate(90deg); }
.group-items { list-style: none; margin: 0; padding: 0 0 8px; display: grid; grid-template-rows: 1fr; transition: grid-template-rows .25s ease; }
.group:not(.open) .group-items { display: none; }
.design {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 9px 10px 9px 46px; margin: 1px 0;
  font: inherit; font-size: 15px; color: var(--ink); text-align: left; background: none; border: 0; border-radius: 9px; cursor: pointer;
  transition: background .15s, color .15s;
}
.design:hover { background: var(--bg); }
.design.selected { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.design-title { flex: 1; }
.design-pic { flex: none; width: 40px; height: 40px; border-radius: 9px; object-fit: cover; background: var(--bg); }
.design-pic-none { display: grid; place-items: center; font-size: 16px; font-weight: 700; color: var(--muted); }
.design-sides { font-size: 12px; font-weight: 500; color: var(--muted); }
.design.selected .design-sides { color: var(--blue); }

/* ---------- details ---------- */
.empty { text-align: center; padding: 36px 12px; }
.empty-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); }
.empty-icon .ico { width: 28px; height: 28px; }
.empty h2 { margin-bottom: 6px; }
.empty .btn { max-width: 240px; margin-top: 18px; }
.builder.none { grid-template-areas: "picker details details"; }   /* nothing picked: the empty box fills both columns */

.chosen { display: none; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 14px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.chosen-name { flex: 1; }
.link-btn { font: inherit; font-size: 14px; font-weight: 600; color: var(--blue); background: none; border: 0; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.link-btn:hover { background: rgba(31, 95, 191, .1); }

.steps { list-style: none; display: flex; gap: 6px; margin: 0 0 20px; padding: 0; counter-reset: step; }
.steps li { flex: 1; min-width: 0; }
.steps button {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 6px;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); background: var(--bg);
  border: 0; border-radius: 9px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background .2s, color .2s;
}
.steps .num { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; background: #fff; flex: none; }
.steps .done button { background: #e7f4ec; color: var(--good); }
.steps .done .num { background: var(--good); color: #fff; }
.steps .current button { background: var(--blue-soft); color: var(--blue); }
.steps .current .num { background: var(--blue); color: #fff; }
.steps button:disabled { cursor: default; }

.step-body { animation: enter .3s ease-out both; min-height: 120px; }
.step-body h3 { font-size: 15px; margin: 0 0 14px; }
.field select, .field textarea {
  width: 100%; padding: 11px 13px; font: inherit; color: var(--ink); background: #f8fafc;
  border: 1px solid var(--line); border-radius: 10px; transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 80px; }
.field select:focus, .field textarea:focus { outline: none; background: #fff; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(31, 95, 191, .12); }
.field .opt { font-weight: 400; color: var(--muted); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

.drop {
  display: flex; align-items: center; gap: 14px; padding: 14px; border: 1.5px dashed #c7cfdb; border-radius: 12px;
  background: #f8fafc; cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--blue); background: var(--blue-soft); }
.drop input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.drop .thumb { width: 56px; height: 56px; border-radius: 10px; flex: none; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); color: var(--muted); overflow: hidden; }
.drop .thumb img { width: 100%; height: 100%; object-fit: contain; }
.drop strong { display: block; font-size: 14px; }
.drop span { font-size: 13px; color: var(--muted); }
.or { display: flex; align-items: center; gap: 10px; margin: 10px 0; font-size: 12px; color: var(--muted); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.summary { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.summary dt, .summary dd { margin: 0; padding: 9px 12px; border-top: 1px solid var(--line); font-size: 14px; }
.summary dt { color: var(--muted); }
.summary dd { font-weight: 600; word-break: break-word; display: flex; justify-content: space-between; gap: 8px; }
.summary dt:first-of-type, .summary dd:first-of-type { border-top: 0; }
.summary .edit { font-size: 13px; font-weight: 600; }

.nav-btns { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; margin-top: 20px; }
.nav-btns .btn { margin: 0; }
.ghost-btn { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.ghost-btn:hover { background: var(--bg); box-shadow: none; }
.btn.orange { background: var(--orange); }
.btn.orange:hover { background: #d97614; box-shadow: 0 6px 16px rgba(240, 138, 36, .3); }
a.btn { text-decoration: none; }
.btn .ico { width: 18px; height: 18px; }

/* ---------- preview ---------- */
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.pill { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--bg); color: var(--muted); }
.pill.ready { background: var(--orange-soft); color: var(--orange); }
.shot { position: relative; border-radius: 12px; background: repeating-conic-gradient(#f1f3f6 0 25%, #fff 0 50%) 0 0 / 18px 18px; padding: 12px; min-height: 160px; display: grid; place-items: center; overflow: hidden; }
.shot img { max-width: 100%; max-height: 70vh; display: block; opacity: 0; transition: opacity .35s ease; filter: drop-shadow(0 8px 18px rgba(16, 24, 40, .18)); }
.shot img.show { opacity: 1; }
.shot-skeleton { position: absolute; inset: 12px; }
.shot.busy::after {
  content: "Building your card..."; position: absolute; inset: auto 0 18px; text-align: center;
  font-size: 13px; font-weight: 600; color: var(--blue);
}
.result-btns { display: grid; gap: 10px; margin-top: 14px; }
.result-btns .btn { margin: 0; }
.result-btns p { margin: 0; text-align: center; }

/* ---------- Section 1: welcome (no card picked) ---------- */
.welcome, .about-design { margin-top: 28px; animation: enter .45s ease-out both; }
.welcome h3, .about-design h3 { font-size: 18px; margin: 0 0 14px; }
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(20px, 4vw, 48px); align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: clamp(20px, 4vw, 40px); box-shadow: var(--shadow);
}
.tag-orange { display: inline-block; font-size: 13px; font-weight: 600; color: #b8600c; background: var(--orange-soft); border-radius: 999px; padding: 4px 12px; }
.hero h2 { font-size: clamp(24px, 3vw, 34px); line-height: 1.2; margin: 14px 0 10px; }
.hero p { color: var(--muted); margin: 0; font-size: 17px; }
.hero-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.hero-btns .btn { width: auto; margin: 0; padding: 12px 20px; white-space: nowrap; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #e8edf4; }
.video video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.video-soon { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(140deg, #e8f0fc, #f3f5f8 55%, #fff1e3); }
.play { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; background: var(--orange); color: #fff; box-shadow: 0 10px 28px rgba(240, 138, 36, .35); position: relative; z-index: 2; }
.play .ico { width: 28px; height: 28px; margin-left: 3px; }
.video-cap { position: absolute; left: 16px; bottom: 14px; font-size: 13px; font-weight: 600; color: var(--muted); z-index: 2; }
.video-demo { position: absolute; inset: 0; }
.video-demo i { position: absolute; width: 34%; aspect-ratio: 85.6 / 54; border-radius: 10px; background: #fff; box-shadow: 0 10px 24px rgba(16, 24, 40, .12); border-top: 10px solid var(--blue); }
.video-demo i:nth-child(1) { left: 8%; top: 14%; transform: rotate(-8deg); animation: float 6s ease-in-out infinite; }
.video-demo i:nth-child(2) { right: 8%; top: 10%; border-top-color: var(--orange); animation: float 7s ease-in-out -2s infinite; }
.video-demo i:nth-child(3) { left: 33%; bottom: 10%; border-top-color: #0f6e56; animation: float 8s ease-in-out -4s infinite; }
.video.pulse { animation: shake .4s; }

.block { margin-top: 28px; }
.how { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; counter-reset: how; }
.how li { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; animation: enter .45s ease-out both; }
.how li:nth-child(2) { animation-delay: .05s; } .how li:nth-child(3) { animation-delay: .1s; } .how li:nth-child(4) { animation-delay: .15s; }
.how li::after { counter-increment: how; content: counter(how); position: absolute; top: 14px; right: 16px; font-size: 13px; font-weight: 700; color: var(--line); }
.how span:not(.how-ic) { color: var(--muted); font-size: 14px; }
.how-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); margin-bottom: 8px; }
.how-ic.orange { background: var(--orange-soft); color: var(--orange); }

.types { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.type {
  display: flex; flex-direction: column; gap: 10px; padding: 14px; text-align: left; font: inherit; color: var(--ink); cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); transition: transform .15s, border-color .15s, box-shadow .15s;
}
.type:hover { transform: translateY(-2px); border-color: #c7d6ee; box-shadow: 0 10px 28px rgba(16, 24, 40, .1); }
.type-shot { display: block; aspect-ratio: 16 / 10; border-radius: 10px; background: var(--bg); overflow: hidden; padding: 12px; }
.type-shot img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 14px rgba(16, 24, 40, .16)); }
.type-head { display: flex; align-items: center; gap: 10px; }
.type-head strong { flex: 1; }
.type-list { font-size: 14px; color: var(--muted); }

.two { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.faq { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.faq details { border-top: 1px solid var(--line); }
.faq details:first-child { border-top: 0; }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s; flex: none; }
.faq details[open] summary::after { transform: rotate(225deg) translate(-2px, -2px); }
.faq summary:hover { background: var(--bg); }
.faq details p { margin: 0; padding: 0 18px 16px; color: var(--muted); animation: enter .25s ease-out both; }
.disclaimer { background: var(--orange-soft); border: 1px solid #f6cfa5; border-radius: 16px; padding: 18px 20px; color: #6b3a06; }
.disclaimer h3 { display: flex; align-items: center; gap: 8px; color: #8a4a08; }
.disclaimer p { margin: 0 0 10px; }
.disc-links a { color: #8a4a08; font-weight: 600; }

/* ---------- Section 2: about this design (card picked) ---------- */
.about-design {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px;
  grid-template-areas: "main side" "asks side";
}
.about-main, .about-side, .about-asks { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); }
.about-main { grid-area: main; }
.about-side { grid-area: side; }
.about-asks { grid-area: asks; }
.about-main h2 { font-size: 22px; margin: 4px 0 8px; }
.about-main p { margin: 0; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip { font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--bg); color: var(--muted); }
.chip.orange { background: var(--orange-soft); color: #b8600c; }
.about-side h3 { display: flex; align-items: center; gap: 8px; color: var(--blue); }
.about-side ul { margin: 0; padding-left: 18px; color: #344054; }
.about-side li { margin: 6px 0; }
.about-asks ol { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; counter-reset: ask; }
.about-asks li { counter-increment: ask; display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); font-weight: 600; font-size: 14px; }
.about-asks li::before { content: counter(ask); width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: #fff; font-size: 11px; }

/* ---------- not logged in: the note above the builder ---------- */
.guest-note {
  display: flex; align-items: center; gap: 12px; margin: 0 0 18px; padding: 12px 16px; font-size: 15px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.guest-note > span:nth-child(2) { flex: 1; }
.guest-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--orange); flex: none; box-shadow: 0 0 0 4px var(--orange-soft); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px var(--orange-soft); } }

/* ---------- the strip: picked card, price, balance, Top up ---------- */
.order {
  display: flex; align-items: center; gap: 16px; margin: 0 0 18px; padding: 12px 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.order-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); flex: none; }
.order-icon .ico { width: 22px; height: 22px; }
.order-card { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.order-price, .order-balance { display: flex; flex-direction: column; text-align: right; }
.order-k { font-size: 12px; color: var(--muted); }
.order-v { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-v small { font-size: 13px; font-weight: 500; color: var(--muted); }
.order-amount { font-size: 16px; font-weight: 700; color: var(--orange); }
.order-sep { width: 1px; align-self: stretch; background: var(--line); }
.topup-btn { width: auto; margin: 0; padding: 9px 16px; }
.bump { animation: bump .5s ease; }
@keyframes bump { 30% { transform: scale(1.12); color: var(--good); } }

/* ---------- the Top up pop-up ---------- */
.topup-now { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 14px; margin-bottom: 16px; border-radius: 12px; background: var(--bg); }
.topup-balance { font-size: 22px; font-weight: 700; }
.amounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.amount {
  padding: 12px 6px; font: inherit; font-weight: 700; font-size: 17px; color: var(--ink); cursor: pointer;
  background: #fff; border: 1.5px solid var(--line); border-radius: 11px; transition: border-color .15s, background .15s, color .15s, transform .1s;
}
.amount:hover { border-color: #c7cfdb; }
.amount:active { transform: scale(.97); }
.amount.on { border-color: var(--orange); background: var(--orange-soft); color: #b8600c; }
.money-in { display: flex; align-items: center; gap: 6px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.money-in:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(31, 95, 191, .12); background: #fff; }
.money-in b { color: var(--muted); }
.money-in input { border: 0 !important; box-shadow: none !important; background: none !important; padding-left: 0 !important; }

/* ---------- the Register / Log in pop-up ---------- */
.auth-overlay {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px;
  background: rgba(238, 241, 245, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fade .2s ease both;
}
.auth-modal {
  position: relative; width: min(440px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  background: rgba(255, 255, 255, .92); border: 1px solid var(--line); border-radius: 18px; padding: 28px;
  box-shadow: 0 24px 60px rgba(16, 24, 40, .18); animation: pop .28s cubic-bezier(.2, .9, .3, 1.2) both;
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.auth-close { position: absolute; top: 14px; right: 14px; }
.auth-modal h2 { font-size: 21px; margin: 0 40px 6px 0; }
.auth-lead { margin: 0 0 18px; }
.auth-tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; margin-bottom: 18px; background: var(--bg); border-radius: 11px; }
.auth-tabs button { position: relative; z-index: 1; padding: 9px; font: inherit; font-weight: 600; color: var(--muted); background: none; border: 0; border-radius: 8px; cursor: pointer; transition: color .2s; }
.auth-tabs button[aria-selected="true"] { color: var(--blue); }
.auth-tab-bar { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(16, 24, 40, .1); transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.auth-tabs.login .auth-tab-bar { transform: translateX(100%); }
.auth-pane { animation: enter .25s ease-out both; }
.auth-pane .btn { margin-top: 4px; }
.auth-modal.shake { animation: shake .3s; }

/* ---------- tablet: designs on the left, sample under the form ---------- */
@media (max-width: 1180px) {
  .builder { grid-template-columns: 260px minmax(0, 1fr); grid-template-areas: "picker details" "picker preview"; }
  .preview { position: static; }
  .builder.none { grid-template-areas: "picker details" "picker details"; }
  .how { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero, .two, .about-design { grid-template-columns: minmax(0, 1fr); }
  .about-design { grid-template-areas: "main" "side" "asks"; }
}

/* ---------- phone: details, then sample; designs slide up as a sheet ---------- */
@media (max-width: 760px) {
  .builder, .builder.none { grid-template-columns: minmax(0, 1fr); grid-template-areas: "details" "preview"; gap: 14px; }
  .how { grid-template-columns: minmax(0, 1fr); }
  .hero-btns .btn { flex: 1; }
  .panel { padding: 16px; border-radius: 14px; }
  .pick-btn { display: inline-flex; }
  .chosen { display: flex; }
  .chosen[hidden] { display: none !important; }
  .picker {
    position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; top: auto; max-height: 82vh;
    border-radius: 20px 20px 0 0; padding: 14px 16px 24px; transform: translateY(105%);
    transition: transform .3s cubic-bezier(.2, .8, .2, 1); animation: none;
  }
  .picker::before { content: ""; display: block; width: 42px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 10px; }
  .picker.open { transform: none; }
  .picker .picker-close { display: grid; }
  .sheet-backdrop { position: fixed; inset: 0; z-index: 39; background: rgba(16, 24, 40, .35); animation: fade .2s ease both; }
  .nav-btns { position: sticky; bottom: 0; background: var(--panel); padding: 12px 0 4px; margin-top: 12px; }
  .row2 { grid-template-columns: 1fr; }
  .steps .txt { display: none; }
  .preview.folded .shot, .preview.folded #preview-info { display: none; }
  .preview .fold { display: inline-flex; }
  .guest-note { flex-wrap: wrap; font-size: 14px; padding: 12px 14px; }
  .order {                                     /* row 1: card and price; row 2: balance and Top up */
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "icon card price" "bal bal btn"; gap: 10px 12px; padding: 12px; margin-bottom: 14px;
  }
  .order-icon { grid-area: icon; width: 34px; height: 34px; }
  .order-card { grid-area: card; }
  .order-price { grid-area: price; }
  .order-sep { display: none; }
  .order-balance { grid-area: bal; flex-direction: row; align-items: baseline; gap: 6px; text-align: left; align-self: center; }
  .topup-btn { grid-area: btn; padding: 8px 14px; }
  .order-balance, .topup-btn { border-top: 1px solid var(--line); padding-top: 10px; }
  .topup-btn { border-top: 0; margin-top: 4px; }
  .order-v { font-size: 15px; }
  .order-v small { display: block; font-size: 12px; }
  .auth-overlay { place-items: end center; padding: 0; }
  .auth-modal { width: 100%; border-radius: 20px 20px 0 0; padding: 22px 18px 26px; max-height: 92vh; animation-name: rise; }
  @keyframes rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
}
@media (min-width: 761px) { .sheet-backdrop { display: none !important; } .fold { display: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- each box's title row and its (i) help ---------- */
.field-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.field-head label, .field-head .field-title { cursor: pointer; }
.info { position: relative; display: inline-flex; }
.info-btn {
  width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; color: var(--muted); background: transparent; transition: color .15s, background .15s;
}
.info-btn .ico { width: 17px; height: 17px; }
.info-btn:hover, .info-btn:focus-visible, .info.open .info-btn { color: var(--blue); background: var(--blue-soft); outline: none; }
/* support making a card for a customer: the banner at the top of the builder */
.for-customer { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; margin: 0 0 14px; padding: 12px 16px; border-radius: 14px;
  background: #fff4e6; border: 1px solid #f5c98f; color: #7a4308; font-size: 14px; }
.for-customer.bad { background: #fdecec; border-color: #f2b8b8; color: #8f1d1d; }
.for-customer span { flex: 1 1 320px; }
.fc-fee { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.fc-fee input { width: 90px; padding: 6px 8px; font: inherit; border: 1px solid #f0b46a; border-radius: 8px; background: #fff; }
.step-body { position: relative; z-index: 5; }   /* the open tips sit above the buttons and the order strip */
.tip {
  position: absolute; z-index: 30; left: -8px; top: calc(100% + 10px); width: max-content; max-width: min(290px, 78vw);
  transform: translateY(-4px); opacity: 0; visibility: hidden; pointer-events: none;
  display: flex; flex-direction: column; gap: 5px; padding: 11px 13px; border-radius: 12px;
  background: #1d2939; color: #fff; font-size: 13px; font-weight: 400; line-height: 1.45;
  box-shadow: 0 12px 28px rgba(16, 24, 40, .25); transition: opacity .15s, transform .15s, visibility .15s;
}
.tip::after { content: ""; position: absolute; bottom: 100%; left: 14px; border: 6px solid transparent; border-bottom-color: #1d2939; }
.tip strong { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #fdba74; }
.tip-k { color: #cbd5e1; }
.tip-ex { font-family: ui-monospace, Consolas, monospace; background: rgba(255, 255, 255, .1); padding: 3px 7px; border-radius: 6px; align-self: flex-start; }
.info:hover .tip, .info-btn:focus-visible + .tip, .info.open .tip { opacity: 1; visibility: visible; transform: none; }
.row2 > .field:nth-child(2n) .tip { left: auto; right: -8px; }   /* a box in the right column: the tip opens to the left */
.row2 > .field:nth-child(2n) .tip::after { left: auto; right: 14px; }
@media (max-width: 760px) { .row2 > .field:nth-child(2n) .tip { right: auto; left: -8px; } .row2 > .field:nth-child(2n) .tip::after { right: auto; left: 14px; } }
.field.has-error select, .field.has-error textarea { border-color: var(--bad); }
.field.has-error .field-head { color: var(--bad); }

/* ---------- the list of mistakes under the form ---------- */
.note.err-list { display: block; }
.err-list ul { margin: 8px 0 0; padding-left: 18px; color: var(--ink); font-size: 14px; }
.err-list li { margin: 4px 0; }
.err-link { font: inherit; font-weight: 600; color: var(--bad); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 760px) {                 /* phone: the tip spans the whole box, so it never runs off the screen */
  .field-head { position: relative; }
  .info { position: static; }
  .tip, .row2 > .field:nth-child(2n) .tip { left: 0; right: 0; width: auto; max-width: none; }
  .tip::after { display: none; }
}

/* ---------- Photo step: the "Remove background" switch ---------- */
.cut-switch { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: #f5f7fa; cursor: pointer; position: relative; }
.cut-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cut-slider { flex: none; width: 40px; height: 23px; border-radius: 999px; background: #c7cfdb; position: relative; transition: background .2s; }
.cut-slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .25); transition: transform .2s; }
.cut-switch input:checked + .cut-slider { background: var(--blue); }
.cut-switch input:checked + .cut-slider::after { transform: translateX(17px); }
.cut-switch input:focus-visible + .cut-slider { box-shadow: 0 0 0 4px rgba(31, 95, 191, .2); }
.cut-text { display: flex; flex-direction: column; }
.cut-text strong { font-size: 14px; }
.cut-text small { font-size: 12.5px; color: var(--muted); }

/* ---------- Check step: how the card should look ---------- */
.look { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.look h4 { margin: 0 0 10px; font-size: 15px; }
.look-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.look-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px; font: inherit; color: var(--ink);
             background: #fff; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.look-tile:hover { border-color: #c7d6ee; }
.look-tile.on { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31, 95, 191, .14); }
.look-tile strong { font-size: 14px; }
.look-tile small { font-size: 12px; color: var(--muted); }
.look-def { position: absolute; top: 6px; right: 6px; font-style: normal; font-size: 10.5px; font-weight: 600; color: var(--good); background: #e7f6ee; padding: 1px 6px; border-radius: 999px; }
.look-pv { width: 100%; height: 60px; border-radius: 8px; display: grid; place-items: center; margin-bottom: 6px; overflow: hidden; }
.look-card { width: 58px; height: 37px; border-radius: 5px; background: linear-gradient(135deg, var(--blue) 62%, var(--orange) 62%); }
.look-tile.flat .look-pv { background: #f1f4f8; }
.look-tile.scanned .look-pv { background: #ece9e2; }
.look-tile.scanned .look-card { transform: rotate(-3deg); filter: saturate(.7); box-shadow: 1px 2px 0 rgba(0, 0, 0, .12); }
.look-tile.background .look-pv { background: repeating-linear-gradient(0deg, #8a6243 0 9px, #7c5638 9px 10px); }
.look-tile.background .look-card { transform: perspective(140px) rotateX(26deg) rotate(-9deg); box-shadow: 4px 6px 8px rgba(0, 0, 0, .35); }
.look-k { margin: 14px 0 8px; font-size: 13px; font-weight: 600; }
.look-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.look-chips button { font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.look-chips button.on { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); font-weight: 600; }
.look-note { display: block; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.bg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.bg-tile { position: relative; display: flex; flex-direction: column; gap: 5px; padding: 5px; font: inherit; font-size: 12.5px; color: var(--ink); text-align: left;
           background: #fff; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.bg-tile img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 8px; background: #e5e9f0; display: block; }
.bg-tile span { padding: 0 3px 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bg-tile:hover { border-color: #c7d6ee; }
.bg-tile.on { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31, 95, 191, .14); }
.bg-check { position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal;
            font-size: 13px; font-weight: 700; color: #fff; background: var(--blue); box-shadow: 0 0 0 2px #fff; }
.look.has-error .look-tiles { outline: 2px solid var(--bad); outline-offset: 4px; border-radius: 14px; }
.look-err { display: block; color: var(--bad); font-style: normal; font-size: 13px; margin-top: 8px; }
@media (max-width: 760px) {
  .look-tiles { gap: 6px; }
  .look-tile { padding: 8px 4px; }
  .look-tile small { display: none; }
  .bg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* texts from Admin -> Site content */
.hero-copy { color: var(--muted); font-size: 17px; }
.hero-copy p { margin: 0 0 8px; }
.disclaimer a { color: #8a4a08; font-weight: 600; }
.about-design[data-off] { display: none !important; }   /* "About this design" switched off in the admin */

/* ---------- while generating: "AI generating" over the sample, a bar that fills up, and the locked form ---------- */
.shot.generating::after { content: none; }      /* the meter says it instead of "Building your card..." */
.shot.generating .shot-skeleton { opacity: .55; }
.gen-meter {
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 18px;
  background: rgba(255, 255, 255, .72); backdrop-filter: blur(2px); animation: enter .25s ease-out both;
}
.gen-meter[hidden] { display: none; }
.gen-bar {
  position: relative; width: 14px; height: min(170px, 70%); border-radius: 999px; overflow: hidden;
  background: var(--blue-soft); border: 1px solid var(--line);
}
.gen-fill {
  position: absolute; left: 0; right: 0; bottom: 0; height: 0%; border-radius: 999px;
  background: linear-gradient(to top, var(--blue), #4f8de6); transition: height .25s linear;
}
.gen-words { display: grid; gap: 2px; min-width: 150px; }
.gen-what { font-size: 13px; font-weight: 600; color: var(--blue); letter-spacing: .02em; }
.gen-what::before { content: "✦ "; color: var(--orange); }
.gen-pct { font-size: 34px; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.gen-stage { font-size: 12px; color: var(--muted); }
.field small.random-note { display: block; margin-top: 4px; color: var(--muted); }
#back-btn:disabled { opacity: .45; cursor: not-allowed; }
.locked .steps button, .locked .summary .edit { pointer-events: none; opacity: .55; }
@media (prefers-reduced-motion: reduce) { .gen-fill { transition: none; } .gen-meter { animation: none; } }

.summary .join-err { color: var(--bad); font-style: normal; font-size: 12px; }

/* click the card picture: that side, bigger, in the middle (builder.js openBig) */
.shot img.show { cursor: zoom-in; }
.shot.busy img, .shot.generating img { cursor: default; }
body.lb-open { overflow: hidden; }
.lightbox {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px;
  background: rgba(16, 24, 40, .78); opacity: 0; transition: opacity .2s ease; cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox.open { opacity: 1; }
.lb-stage { display: grid; place-items: center; max-width: 100%; max-height: 100%; }
.lb-pic {
  display: block; max-width: min(1100px, calc(100vw - 32px)); max-height: calc(100vh - 32px); width: auto; height: auto;
  object-fit: contain; border-radius: 10px; box-shadow: 0 24px 60px rgba(0, 0, 0, .45); cursor: default;
  transform: scale(.92); transition: transform .22s ease;
}
.lightbox.open .lb-pic { transform: scale(1); }
.lb-close {
  position: fixed; top: 14px; right: 14px; width: 42px; height: 42px; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, .92); color: #101828; font-size: 18px; line-height: 1; cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}
.lb-close:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .lightbox, .lb-pic { transition: none; } }

/* the signature step: pick a sample (Admin -> Signatures) or upload your own */
.sig-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin: 6px 0 4px; }
.sig-pick {
  position: relative; display: grid; place-items: center; height: 72px; padding: 8px; border-radius: 10px; cursor: pointer;
  background: #fff; border: 1.5px solid #dfe3ea; transition: border-color .15s, box-shadow .15s;
}
.sig-pick:hover { border-color: #b9c2d0; }
.sig-pick.on { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(240, 138, 36, .18); }
.sig-pick:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.sig-pick img { max-width: 100%; max-height: 52px; object-fit: contain; }
.sig-tag { position: absolute; top: -8px; right: 6px; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: var(--orange); color: #fff; }
.field-title .req { color: var(--bad); font-weight: 500; font-size: 13px; }
