/* AI page creator (make.html). Reference: docs/design/mockups/ai-creator.html. Tokens from app.css only.
   .mk-chip / .mk-tile instead of the mockup's .chip / .tile: app.css already styles those for the gallery. */
body.make { background: var(--paper); }
.make [hidden] { display: none !important; }
.make-main { max-width: 560px; padding-top: var(--s-4); padding-bottom: var(--s-16); }
.make-head { margin-bottom: var(--s-5); }
.make-head h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(28px, 8vw, 38px); line-height: 1.1; }
.make-head h1:lang(hi) { line-height: 1.3; }
.make-head p { margin-top: var(--s-1); color: var(--ink-2); font-size: var(--fs-sm); }
.make fieldset { border: 0; margin: 0 0 var(--s-6); padding: 0; min-width: 0; }
.make legend { padding: 0; }
.label-row { display: flex; width: 100%; align-items: baseline; justify-content: space-between; gap: var(--s-2); margin: 0 0 var(--s-2); }
.label-row .label { margin: 0; }
.meta-r { font-size: var(--fs-xs); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.meta-r.is-hit { color: var(--sindoor-deep); font-weight: 700; }
.mk-chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.mk-chip {
  position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s-4); border-radius: var(--r-pill);
  border: 1.5px solid var(--line-strong); background: var(--card); font-size: var(--fs-sm); font-weight: 650; color: var(--ink); cursor: pointer;
  user-select: none; -webkit-user-select: none;
}
.mk-chip input { position: absolute; opacity: 0; pointer-events: none; }
.mk-chip:has(input:checked) { background: var(--sindoor-soft); border-color: var(--sindoor); font-weight: 700; }
.mk-chip:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.mk-chip[aria-disabled='true'] { opacity: 0.5; }
.mk-other { margin-top: var(--s-3); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.pair > div { min-width: 0; }
@media (max-width: 339px) { .pair { grid-template-columns: 1fr; } }
.facts { display: grid; gap: var(--s-2); }
.fact { display: grid; grid-template-columns: 24px 1fr; gap: var(--s-3); align-items: center; }
.fact.rm { grid-template-columns: 24px 1fr 44px; }
.fact-n { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--paper-deep); font-size: var(--fs-xs); font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.fact .counter { grid-column: 2; margin: 0; text-align: right; }
.facts-foot { margin-top: var(--s-1); }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn .i { width: 22px; height: 22px; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
.mk-tile { position: relative; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; background: var(--paper-deep); }
.mk-tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tile-add { display: grid; place-content: center; justify-items: center; gap: var(--s-1); width: 100%; padding: 0; border: 2px dashed var(--line-strong); background: var(--paper); color: var(--ink); font: inherit; font-size: var(--fs-sm); font-weight: 650; cursor: pointer; }
.tile-add .i { width: 28px; height: 28px; color: var(--sindoor-deep); }
.tile-x { position: absolute; top: 0; right: 0; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; background: none; cursor: pointer; }
.tile-x span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: rgb(27 15 38 / 0.62); color: #fff; }
.tile-x .i { width: 18px; height: 18px; }
.mk-tile.up img { opacity: 0.6; }
.tile-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgb(255 255 255 / 0.6); }
.tile-bar i { display: block; height: 100%; background: var(--sindoor); transform-origin: left; transform: scaleX(var(--p, 0)); }
.mk-tile.ok .tile-bar { opacity: 0; }
.mk-tile.fail { box-shadow: inset 0 0 0 2px var(--danger); }
.retry { position: absolute; inset: 0; margin: auto; width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 0; background: var(--card); color: var(--danger); display: grid; place-items: center; box-shadow: var(--sh-1); cursor: pointer; }
.retry .i { width: 22px; height: 22px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 2px; border-radius: var(--r-pill); background: var(--paper-deep); }
.seg label { position: relative; display: grid; place-items: center; min-height: 44px; border-radius: var(--r-pill); font-weight: 650; font-size: var(--fs-sm); color: var(--ink-2); cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--card); color: var(--ink); box-shadow: var(--sh-1); }
.seg label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.quota-line { flex-basis: 100%; min-height: 1.4em; margin: 0; text-align: center; font-size: var(--fs-xs); color: var(--ink-3); }
.quota-line.last { color: var(--sindoor-deep); font-weight: 700; }
.btn-soft { opacity: 0.72; }
.notice-q, .notice-e { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-4); border-radius: var(--r-md); font-size: var(--fs-sm); line-height: 1.5; color: var(--ink); }
.notice-q { background: var(--marigold-soft); }
.notice-q .i { width: 22px; height: 22px; color: var(--gold-ink); margin-top: 1px; }
.notice-e { flex-basis: 100%; background: var(--sindoor-soft); box-shadow: inset 4px 0 0 var(--danger); margin: 0 0 var(--s-1); }
.notice-stack { display: grid; gap: var(--s-3); flex-basis: 100%; }
.notice-stack .text-link { justify-self: center; }

/* generating */
.gen { display: grid; justify-items: center; text-align: center; padding-top: var(--s-8); }
.ghost-phone { width: 160px; height: 300px; border-radius: 24px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--sh-1); padding: var(--s-6) var(--s-4); display: grid; align-content: start; gap: var(--s-3); }
.ghost-phone i { display: block; height: 12px; border-radius: 6px; background: var(--paper-deep); }
.gen h1 { margin-top: var(--s-8); font-family: var(--font-display); font-weight: 400; font-size: 28px; line-height: 1.2; overflow-wrap: anywhere; }
.gen h1:lang(hi) { line-height: 1.4; }
.gen .sub { margin-top: var(--s-2); color: var(--ink-2); font-size: var(--fs-sm); }
.bar { width: 100%; max-width: 320px; height: 6px; margin-top: var(--s-6); border-radius: var(--r-pill); background: var(--paper-deep); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--sindoor); transform-origin: left; transform: scaleX(var(--p, 0)); }
.steps { width: 280px; max-width: 100%; margin: var(--s-6) 0 0; padding: 0; list-style: none; text-align: left; display: grid; gap: var(--s-3); }
.steps li { display: grid; grid-template-columns: 18px 1fr; gap: var(--s-3); align-items: center; font-size: var(--fs-sm); color: var(--ink-3); }
.steps .dot { width: 8px; height: 8px; margin: auto; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.steps .done { color: var(--ink-2); }
.steps .done .i { width: 18px; height: 18px; color: var(--leaf); stroke-width: 2.4; }
.steps .cur { color: var(--ink); font-weight: 700; }
.steps .cur .dot { background: var(--ink); box-shadow: none; }
.gen .text-link { margin-top: var(--s-6); }

.make .topbar-back { white-space: nowrap; }

/* ready */
.chip-draft { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 var(--s-3) 0 10px; border-radius: var(--r-pill); background: var(--paper-deep); font-size: var(--fs-xs); font-weight: 700; color: var(--ink-2); }
.chip-draft[hidden] { display: none; }
.chip-draft .i { width: 14px; height: 14px; }
body.is-ready { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
body.is-ready main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.mk-ready { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.mk-stage { flex: 1; min-height: 0; padding: 0 var(--s-2) var(--s-2); }
.mk-frame { position: relative; height: 100%; border-radius: var(--r-lg); overflow: hidden; background: var(--paper-deep); }
.mk-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; opacity: 0; }
.mk-frame iframe.is-in { opacity: 1; }
.ribbon { position: absolute; top: 0; right: 0; width: 120px; height: 120px; overflow: hidden; pointer-events: none; }
.ribbon span { position: absolute; top: 26px; right: -34px; width: 160px; height: 24px; display: grid; place-items: center; transform: rotate(45deg); background: var(--ink); color: var(--paper); font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.mk-dock { flex: none; background: var(--card); border-top: 1px solid var(--line); padding: var(--s-3) var(--s-4) max(var(--s-3), env(safe-area-inset-bottom)); }

/* notice block */
.notice { display: grid; justify-items: center; text-align: center; max-width: 320px; margin: 0 auto; padding-top: var(--s-16); }
.notice .ic { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--paper-deep); color: var(--ink-2); }
.notice .ic .i { width: 28px; height: 28px; }
.notice h1 { margin-top: var(--s-4); font-family: var(--font-display); font-weight: 400; font-size: 24px; line-height: 1.2; }
.notice h1:lang(hi) { line-height: 1.4; }
.notice p { margin-top: var(--s-2); color: var(--ink-2); font-size: var(--fs-sm); }
.notice .acts { display: grid; gap: var(--s-2); width: 100%; margin-top: var(--s-6); justify-items: center; }

/* publish (docs/design/ai-checkout-share.md A): dock button when payments are off, sheet, toast */
.mk-publish-off { --btn-bg: var(--paper-deep); --btn-bd: var(--paper-deep); --btn-fg: var(--ink-2); box-shadow: none; cursor: default; }
.chip-live { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 var(--s-3) 0 10px; border-radius: var(--r-pill); background: var(--leaf-soft); font-size: var(--fs-xs); font-weight: 700; color: var(--leaf); }
.chip-live .i { width: 14px; height: 14px; stroke-width: 2.4; }
.pay-sheet .sheet-head h2 { outline: none; overflow-wrap: anywhere; }
.pay-sheet .sheet-head h2:lang(hi) { line-height: 1.4; }
.pay-price { display: flex; align-items: baseline; gap: var(--s-3); margin-top: var(--s-2); font-variant-numeric: tabular-nums; }
.pay-price b { font-family: var(--font-display); font-weight: 400; font-size: 40px; line-height: 1.1; color: var(--ink); }
.pay-price s { font-size: var(--fs-md); color: var(--ink-3); }
.pay-once, .pay-meta, .pay-methods { font-size: var(--fs-xs); color: var(--ink-3); }
.pay-meta { margin-top: var(--s-1); color: var(--ink-2); font-weight: 650; }
.pay-list { display: grid; gap: var(--s-3); margin: var(--s-6) 0 0; padding: 0; list-style: none; }
.pay-list li { display: flex; align-items: center; gap: var(--s-3); font-size: var(--fs-sm); font-weight: 600; line-height: 1.35; }
.pay-go { margin-top: var(--s-6); }
.pay-methods { margin-top: var(--s-2); text-align: center; }
.pay-confirm { margin-top: var(--s-6); }
.pay-confirm h3 { font-size: var(--fs-md); }
.pay-confirm p { margin-top: var(--s-1); font-size: var(--fs-sm); color: var(--ink-2); }
.pay-bar { height: 4px; margin-top: var(--s-4); border-radius: var(--r-pill); background: var(--paper-deep); overflow: hidden; }
.pay-bar i { display: block; height: 100%; background: var(--sindoor); transform-origin: left; transform: scaleX(0); }
.pay-status:empty { display: none; }
.pay-status p { margin-top: var(--s-4); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--paper-deep); font-size: var(--fs-sm); line-height: 1.45; color: var(--ink); }
.pay-status[data-kind='warn'] p { background: var(--marigold-soft); }
.pay-status[data-kind='error'] p { background: var(--sindoor-soft); box-shadow: inset 4px 0 0 var(--danger); }
.pay-status .text-link { margin-top: var(--s-1); }
.pay-fine { margin-top: var(--s-5); padding-top: var(--s-5); border-top: 1px solid var(--line); font-size: var(--fs-xs); line-height: 1.5; color: var(--ink-3); }
.pay-fine a { color: var(--ink-2); font-weight: 650; }
.mk-toast {
  position: fixed; z-index: 60; left: 50%; bottom: calc(var(--s-20) + var(--s-3) + env(safe-area-inset-bottom));
  width: max-content; max-width: calc(100vw - 32px); padding: var(--s-3) var(--s-5); border-radius: var(--r-md);
  background: var(--ink); color: var(--paper); font-size: var(--fs-sm); font-weight: 650; line-height: 1.45; text-align: center;
  box-shadow: var(--sh-2); transform: translateX(-50%); opacity: 0;
}
.mk-toast.is-on { opacity: 1; }

/* live (docs/design/ai-checkout-share.md B) */
.live { display: grid; justify-items: center; text-align: center; padding-top: var(--s-8); }
.live-badge { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--leaf); color: #fff; }
.live-badge .i { width: 32px; height: 32px; stroke-width: 2.6; }
.live h1 { margin-top: var(--s-4); font-family: var(--font-display); font-weight: 400; font-size: clamp(28px, 8vw, 36px); line-height: 1.15; outline: none; overflow-wrap: anywhere; }
.live h1:lang(hi) { line-height: 1.35; }
.live-url { width: 100%; min-height: 44px; padding: var(--s-2) var(--s-4); border: 0; border-radius: var(--r-sm); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.live-actions { display: grid; gap: var(--s-2); width: 100%; margin-top: var(--s-6); }
.live-preview { width: 100%; margin-top: var(--s-6); text-align: left; }
.wa-tile { display: grid; place-items: center; aspect-ratio: 1200 / 630; padding: var(--s-4) var(--s-6); background: var(--tbg, var(--night)); color: var(--tfg, var(--paper)); text-align: center; }
.wa-tile span { font-family: var(--font-display); font-size: var(--fs-lg); line-height: 1.2; overflow-wrap: anywhere; }
.live-more { display: grid; justify-items: center; margin-top: var(--s-6); }
.live-more .text-link[aria-busy='true'] { cursor: progress; opacity: 0.72; }
.live-ref { display: flex; align-items: center; justify-content: center; gap: var(--s-1); max-width: 100%; margin-top: var(--s-4); font-size: var(--fs-xs); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.live-ref code { font: inherit; color: var(--ink-2); user-select: all; -webkit-user-select: all; overflow-wrap: anywhere; }
.live-ref .icon-btn .i { width: 18px; height: 18px; }

@media (min-width: 760px) {
  :root { --gutter: 24px; }
  .pay-sheet .sheet-panel { width: min(440px, calc(100% - 48px)); }
}
@media (min-width: 1024px) {
  body.is-ready { height: auto; display: block; overflow: visible; }
  .mk-ready { display: grid; grid-template-columns: 1fr; gap: var(--s-8); max-width: 1160px; margin: 0 auto; padding: var(--s-6) var(--gutter); align-items: start; }
  .mk-ready:has(.mk-dock:not([hidden])) { grid-template-columns: 1fr 400px; }
  .mk-stage { position: sticky; top: 84px; display: grid; justify-items: center; padding: 0; }
  .mk-frame { width: 390px; height: 780px; }
  .mk-dock { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: var(--s-5); }
}

/* Motion: transform and opacity only, single-shot; nothing moves under reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .mk-chip { transition: background-color var(--d-fast) ease, border-color var(--d-fast) ease, transform var(--d-press) var(--ease-out); }
  .mk-chip:active { transform: scale(0.97); }
  [data-state].is-leaving { opacity: 0; transition: opacity 150ms ease-in; }
  [data-state].is-entering { animation: mk-in var(--d-base) var(--ease-out) both; }
  .fact.is-new { animation: mk-rise 200ms var(--ease-out) both; }
  .mk-tile.is-new { animation: mk-pop 200ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 30ms); }
  .mk-tile img { transition: opacity var(--d-fast) ease; }
  .tile-bar { transition: opacity var(--d-fast) ease; }
  .bar i { transition: transform 2s linear; }
  .bar.is-done i { transition: transform var(--d-base) var(--ease-out); }
  .steps .is-new .i { animation: mk-tick 200ms var(--ease-out) both; }
  .mk-frame iframe { transition: opacity var(--d-base) var(--ease-out); }
  .pay-sheet::backdrop { animation-duration: var(--d-base); }
  .pay-sheet .sheet-panel { animation-duration: var(--d-base); }
  .pay-main.is-leaving { opacity: 0; transition: opacity 150ms ease-in; }
  .pay-main.is-entering { animation: pay-in 200ms var(--ease-out) both; }
  .pay-status > * { animation: pay-in var(--d-fast) var(--ease-out) both; }
  .pay-bar i { transition: transform 2s linear; }
  .pay-bar.is-done i { transition: transform var(--d-base) var(--ease-out); }
  .mk-toast { transform: translate(-50%, 4px); transition: opacity var(--d-fast) ease, transform var(--d-fast) var(--ease-out); }
  .mk-toast.is-on { transform: translate(-50%, 0); }
  .live > * { animation: mk-rise var(--d-base) var(--ease-out) both; }
  .live > :nth-child(2) { animation-delay: 40ms; }
  .live > :nth-child(3) { animation-delay: 80ms; }
  .live > :nth-child(4) { animation-delay: 120ms; }
  .live > :nth-child(5) { animation-delay: 160ms; }
  .live > :nth-child(n + 6) { animation-delay: 200ms; }
  .live > .live-badge { animation: live-badge var(--d-base) var(--ease-out) both; }
  .live-badge .i { stroke-dasharray: 24; animation: live-tick var(--d-base) var(--ease-out) var(--d-base) both; }
}
@keyframes pay-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes live-badge { from { opacity: 0; transform: scale(0.9); } }
@keyframes live-tick { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }
@keyframes mk-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes mk-rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes mk-pop { from { opacity: 0; transform: scale(0.96); } }
@keyframes mk-tick { from { opacity: 0; transform: scale(0.8); } }
