/* RestioX AI Menu Builder landing page (/tools/ai-menu-builder, docs/menu-builder/SPEC.md).
   On top of assets/redesign/rx.css (tokens, buttons, cards, FAQ, CTA band), loaded through $page_rx_css. Light purple, white base,
   44 px touch targets, logical properties (RTL-safe), no horizontal overflow at 360 px. The hero picture moves with transform and
   opacity only and is still with reduced motion (rx.css switches every animation off then; the resting state is the finished picture). */

/* ── JavaScript or not: html.rx-js is set in the head before the body paints (no shift); mb-on by this page's own script ─────── */
.mb-nojs { display: none; }
html:not(.rx-js):not(.mb-on) .mb-js { display: none; }
html:not(.rx-js):not(.mb-on) .mb-nojs { display: block; }
.mb-card [hidden] { display: none !important; }
html.mb-off .mb-js { display: none; }
html.mb-off .mb-nojs { display: block; }
.mb-file__icon [data-mb-icon] { display: contents; }

/* ── Hero ──────────────────────────────────────────────────────────────────────────────────────────────────────────────── */
.mb-hero { padding-block: 28px 72px; }
.mb-crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; margin: 0 0 20px; padding: 0; list-style: none; font-size: 14px; line-height: 20px; color: var(--rx-ink-500); }
.mb-crumbs li { display: inline-flex; align-items: center; }
.mb-crumbs li + li::before { content: ""; width: 6px; height: 6px; margin-inline: 10px; border-top: 1.5px solid var(--rx-ink-400); border-inline-end: 1.5px solid var(--rx-ink-400); transform: rotate(45deg); }
[dir="rtl"] .mb-crumbs li + li::before { transform: rotate(-135deg); }
.mb-crumbs a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; color: var(--rx-ink-500); text-decoration: none; }
.mb-crumbs a:hover { color: var(--rx-violet-650); text-decoration: underline; }
.mb-crumbs span[aria-current] { color: var(--rx-ink-700); font-weight: 500; }
.mb-hero__head { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; min-width: 0; }
.mb-hero__title { max-width: 760px; }
.mb-hero__lead { max-width: 680px; color: var(--rx-ink-500); }
.mb-hero__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: center; }
.mb-hero__visual { margin-top: 16px; }
.mb-hero__text { min-width: 0; }
.mb-hero__visual { min-width: 0; }

/* ── The upload card ───────────────────────────────────────────────────────────────────────────────────────────────────── */
.mb-card { position: relative; z-index: 1; width: 100%; max-width: 680px; padding: 18px; background: var(--rx-white);
  border: 1px solid var(--rx-violet-200); border-radius: var(--rx-r-bento); box-shadow: var(--rx-shadow-card); }
.mb-card > * + * { margin-top: 14px; }
.mb-js > * + * { margin-top: 14px; }
.mb-drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 16px; min-height: 152px;
  justify-content: center; text-align: center; border: 2px dashed var(--rx-violet-300); border-radius: var(--rx-r-card); background: var(--rx-violet-50);
  transition: border-color .18s, background-color .18s; }
.mb-drop:hover, .mb-drop.is-over { border-color: var(--rx-violet-600); background: var(--rx-violet-100); }
.mb-drop:focus-within { outline: 3px solid var(--rx-focus); outline-offset: 3px; }
.mb-drop:focus-within:has(.mb-drop__input:focus:not(:focus-visible)) { outline: none; }
/* the real file input covers the whole area: a click, a tap, a drop or the keyboard (Tab, then Space or Enter) all reach it */
.mb-drop__input { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; font-size: 0; }
.mb-drop__input::-webkit-file-upload-button { cursor: pointer; }
.mb-drop__icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; background: var(--rx-grad); color: var(--rx-white); box-shadow: 0 8px 18px -8px rgba(109, 40, 217, .6); }
.mb-drop__icon .rx-icon { width: 26px; height: 26px; }
.mb-drop__label { font-size: 17px; line-height: 24px; color: var(--rx-ink-900); }
.mb-drop__label strong { font-weight: 500; }
.mb-drop__pick { color: var(--rx-violet-650); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.mb-drop__coarse { display: none; }
@media (hover: none) and (pointer: coarse) { .mb-drop__fine { display: none; } .mb-drop__coarse { display: inline; } }
.mb-drop__hint, .mb-drop__limits { max-width: 440px; font-size: 14px; line-height: 20px; color: var(--rx-ink-500); }

.mb-files { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.mb-file { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 4px 4px 4px 12px; padding-inline: 12px 4px; border: 1px solid var(--rx-line); border-radius: 12px; background: var(--rx-white); }
.mb-file__icon { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--rx-violet-100); color: var(--rx-violet-650); }
.mb-file__icon .rx-icon { width: 18px; height: 18px; }
.mb-file__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; line-height: 22px; color: var(--rx-ink-900); }
.mb-file__size { flex: none; font-size: 13px; color: var(--rx-ink-500); font-variant-numeric: tabular-nums; }
.mb-file__remove { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 10px; background: none; color: var(--rx-ink-500); cursor: pointer; }
.mb-file__remove:hover { background: var(--rx-violet-50); color: var(--rx-violet-700); }
.mb-file__remove .rx-icon { width: 18px; height: 18px; }

.mb-paste { display: grid; gap: 6px; }
.mb-paste__text { min-height: 168px; padding: 12px 14px; resize: vertical; line-height: 24px; }
.mb-paste__count { justify-self: end; font-size: 13px; color: var(--rx-ink-500); font-variant-numeric: tabular-nums; }

.mb-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.mb-fields > .mb-field__note { grid-column: 1 / -1; margin-top: -4px; }
.mb-field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.mb-field__label { font-size: 15px; line-height: 22px; font-weight: 500; color: var(--rx-ink-900); }
.mb-field__req, .mb-field__opt { font-weight: 400; color: var(--rx-ink-500); }
.mb-field__control { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid #D6CBE6; border-radius: 12px; background: var(--rx-white);
  color: var(--rx-ink-900); font: 400 16px/24px var(--rx-font); transition: border-color .15s, box-shadow .15s; }
select.mb-field__control { padding-inline-end: 36px; -webkit-appearance: none; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%237E22CE' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 14px; background-position: right 14px center; }
[dir="rtl"] select.mb-field__control { background-position: left 14px center; }
.mb-field__control:hover { border-color: var(--rx-violet-300); }
.mb-field__control:focus { border-color: var(--rx-violet-600); box-shadow: 0 0 0 3px rgba(147, 51, 234, .18); outline: none; }
.mb-field__control[aria-invalid="true"] { border-color: #B42318; box-shadow: 0 0 0 3px rgba(180, 35, 24, .12); }
.mb-field__note { font-size: 13px; line-height: 19px; color: var(--rx-ink-500); }

.mb-status:empty, .mb-error:empty { display: none; }
.mb-status { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--rx-violet-50); color: var(--rx-violet-700); font-size: 15px; line-height: 22px; }
.mb-status.is-busy::before { content: ""; flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--rx-violet-200); border-top-color: var(--rx-violet-600); animation: mb-spin .8s linear infinite; }
@keyframes mb-spin { to { transform: rotate(360deg); } }
.mb-error { padding: 10px 12px; border-radius: 12px; background: var(--rx-overdue-bg); color: var(--rx-overdue-fg); font-size: 15px; line-height: 22px; }
.mb-error a { color: inherit; font-weight: 500; }
.mb-notice { padding: 12px 14px; border-radius: 12px; background: #FFF8D6; color: #5C4A00; font-size: 15px; line-height: 22px; }
.mb-submit.is-busy { opacity: .7; pointer-events: none; }

.mb-alt { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.mb-alt .rx-btn--sm { height: 44px; }
.mb-alt__link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding-inline: 4px; color: var(--rx-violet-650); font-size: 15px; font-weight: 500; text-decoration: none; }
.mb-alt__link:hover span { text-decoration: underline; text-underline-offset: 3px; }
.mb-alt__link .rx-icon { width: 18px; height: 18px; }
.mb-nojs__text { margin-bottom: 12px; font-size: 15px; line-height: 23px; color: var(--rx-ink-700); }
.mb-card__foot { display: flex; align-items: flex-start; gap: 8px; padding-top: 12px; border-top: 1px solid var(--rx-line); font-size: 13px; line-height: 20px; color: var(--rx-ink-500); }
.mb-card__foot .rx-icon { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--rx-violet-600); }
.mb-card__foot a { display: inline; }

/* ── The transformation picture ─────────────────────────────────────────────────────────────────────────────────────────── */
.mb-vis { position: relative; width: 100%; max-width: 560px; margin-inline: auto; aspect-ratio: 560 / 460; }
.mb-vis__svg { display: block; width: 100%; height: 100%; overflow: visible; }
@supports not (aspect-ratio: 1 / 1) { .mb-vis { height: 0; padding-bottom: 82.14%; } .mb-vis__svg { position: absolute; inset: 0; } }
.mb-vis .mb-v-hl, .mb-vis .mb-v-pill, .mb-vis .mb-v-out, .mb-vis .mb-v-row, .mb-vis .mb-v-scan, .mb-vis .mb-v-drop, .mb-vis .mb-v-links { transform-box: fill-box; }
.mb-v-hl { transform-origin: 0 50%; }
.mb-v-pill { transform-origin: 50% 50%; }
.mb-v-out { transform-origin: 50% 100%; }
/* resting state = the finished picture; the scan band and the arriving file are only seen while they move */
.mb-v-scan, .mb-v-drop { opacity: 0; }
.mb-vis.is-playing .mb-v-scan { animation: mb-scan 1.5s cubic-bezier(.45, .05, .55, .95) .35s both; }
.mb-vis.is-playing .mb-v-hl { animation: mb-hl .42s var(--rx-ease) both; animation-delay: calc(.52s + var(--i) * .15s); }
.mb-vis.is-playing .mb-v-pill { animation: mb-pop .36s var(--rx-ease) both; animation-delay: calc(.66s + var(--i) * .15s); }
.mb-vis.is-playing .mb-v-links { animation: mb-fade .5s ease-out 1.75s both; }
.mb-vis.is-playing .mb-v-phone { animation: mb-rise .6s var(--rx-ease) 1.95s both; }
.mb-vis.is-playing .mb-v-row { animation: mb-rise-sm .45s var(--rx-ease) both; animation-delay: calc(2.25s + var(--i) * .12s); }
.mb-vis.is-playing .mb-v-print { animation: mb-rise .6s var(--rx-ease) 2.2s both; }
.mb-vis.is-playing .mb-v-qr { animation: mb-rise .6s var(--rx-ease) 2.45s both; }
.mb-vis.is-replay .mb-v-drop { animation: mb-drop 1s var(--rx-ease) 0s both; }
.mb-vis.is-replay .mb-v-scan { animation-delay: .7s; }
@keyframes mb-scan { 0% { opacity: 0; transform: translateY(0); } 12% { opacity: 1; } 88% { opacity: 1; } 100% { opacity: 0; transform: translateY(340px); } }
@keyframes mb-hl { from { opacity: 0; transform: scaleX(0); } to { opacity: 1; transform: none; } }
@keyframes mb-pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes mb-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes mb-rise { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes mb-rise-sm { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes mb-drop { 0% { opacity: 0; transform: translateY(-26px); } 30% { opacity: 1; } 70% { opacity: 1; transform: translateY(46px) scale(.9); } 100% { opacity: 0; transform: translateY(70px) scale(.6); } }

/* ── How it works ─────────────────────────────────────────────────────────────────────────────────────────────────────── */
.mb-flow { margin: 0; padding: 0; list-style: none; }
.mb-flow__top { display: flex; align-items: center; justify-content: space-between; }
.mb-flow__top .rx-card__icon { margin-bottom: 0; }
.mb-flow__n { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--rx-violet-100); color: var(--rx-violet-700); font-size: 15px; font-weight: 500; order: 2; }
.mb-flow__step:hover { transform: none; }
.mb-more { max-width: 760px; margin: 32px auto 0; text-align: center; font-size: 16px; line-height: 26px; color: var(--rx-ink-500); }

/* ── Two boxes side by side ───────────────────────────────────────────────────────────────────────────────────────────── */
.mb-two { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.mb-box { padding: 24px; background: var(--rx-white); border: 1px solid var(--rx-line); border-radius: var(--rx-r-card); min-width: 0; }
.mb-box > .rx-h3 { margin-bottom: 16px; }
.mb-box__note { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rx-line); font-size: 15px; line-height: 24px; color: var(--rx-ink-500); }
.mb-nots { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.mb-nots li { display: flex; align-items: flex-start; gap: 12px; font-size: 16px; line-height: 26px; color: var(--rx-ink-700); }
.mb-nots .rx-icon { flex: none; width: 22px; height: 22px; margin-top: 2px; color: var(--rx-violet-600); }
.mb-two + .rx-callout { margin-top: 24px; }

/* ── Formats and limits ───────────────────────────────────────────────────────────────────────────────────────────────── */
.mb-limits { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin: 0; }
.mb-limit { margin: 0; padding: 22px; border: 1px solid var(--rx-line); border-radius: var(--rx-r-card); background: var(--rx-white); }
.mb-limit dt { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 18px; line-height: 26px; font-weight: 500; color: var(--rx-ink-900); }
.mb-limit dt .rx-icon { width: 22px; height: 22px; color: var(--rx-violet-600); }
.mb-limit dd { margin: 0; font-size: 15px; line-height: 24px; color: var(--rx-ink-500); }

/* ── Before and after ─────────────────────────────────────────────────────────────────────────────────────────────────── */
.mb-ba { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: stretch; max-width: 980px; margin-inline: auto; }
.mb-ba__side { margin: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mb-ba__label { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--rx-violet-700); }
.mb-ba__arrow { display: grid; place-items: center; color: var(--rx-violet-600); }
.mb-ba__arrow .rx-icon { transform: rotate(90deg); }
[dir="rtl"] .mb-ba__arrow .rx-icon { transform: rotate(90deg) scaleX(-1); }
.mb-paper { flex: 1; padding: 24px 22px; border-radius: 10px; background: #FFFDF8; border: 1px solid #EADFCF; box-shadow: 0 10px 24px -14px rgba(88, 28, 135, .25);
  font-family: Georgia, 'Times New Roman', serif; color: #3B3328; }
.mb-paper p { margin: 0; }
.mb-paper__title { margin-bottom: 14px !important; text-align: center; font-size: 22px; line-height: 28px; letter-spacing: .02em; }
.mb-paper__sec { margin-top: 14px !important; margin-bottom: 6px !important; font-size: 15px; line-height: 22px; font-style: italic; color: #6B5A43; }
.mb-paper__row { display: flex; justify-content: space-between; gap: 12px; font-size: 16px; line-height: 26px; }
.mb-paper__row span:last-child { white-space: nowrap; }
.mb-paper__desc { font-size: 14px; line-height: 20px; color: #7A6B57; }
.mb-paper__row--smudge span:last-child { filter: blur(.6px); opacity: .8; }
.mb-draft { flex: 1; padding: 18px; border-radius: var(--rx-r-card); background: var(--rx-white); border: 1px solid var(--rx-violet-200); box-shadow: var(--rx-shadow-card); }
.mb-draft__sec { margin: 0 0 8px; font-size: 15px; line-height: 22px; font-weight: 500; color: var(--rx-violet-700); }
.mb-draft__sec:not(:first-child) { margin-top: 14px; }
.mb-draft__list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.mb-draft__list li { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--rx-line); border-radius: 10px; background: var(--rx-violet-50); }
.mb-draft__name { min-width: 0; font-size: 15px; line-height: 22px; color: var(--rx-ink-900); }
.mb-draft__name small { display: block; font-size: 13px; line-height: 19px; color: var(--rx-ink-500); }
.mb-draft__name .mb-flag { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: var(--rx-r-pill); background: #FFF1C2; color: #6B4E00; font-size: 12px; line-height: 18px; }
.mb-draft__price { flex: none; text-align: end; font-size: 15px; line-height: 22px; font-weight: 500; color: var(--rx-violet-700); font-variant-numeric: tabular-nums; }
.mb-ba__note { max-width: 760px; margin: 24px auto 0; text-align: center; font-size: 15px; line-height: 24px; color: var(--rx-ink-500); }
.mb-shots { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 40px; }
.mb-shot { margin: 0; }
.mb-shot img { display: block; width: 100%; max-width: var(--mb-shot-max-sm, 100%); margin-inline: auto; height: auto; border-radius: var(--rx-r-card); border: 1px solid var(--rx-line); box-shadow: var(--rx-shadow-card); background: var(--rx-white); }
.mb-shot figcaption { margin-top: 10px; font-size: 14px; line-height: 20px; color: var(--rx-ink-500); text-align: center; }

/* ── QR or PDF, related ───────────────────────────────────────────────────────────────────────────────────────────────── */
.mb-pair .rx-card:hover { transform: none; }
.mb-pair .rx-card__title a { color: var(--rx-ink-900); text-decoration: underline; text-decoration-color: var(--rx-violet-300); text-underline-offset: 4px; }
.mb-pair .rx-card__title a:hover { color: var(--rx-violet-700); text-decoration-color: currentColor; }
.mb-related__title { margin-bottom: 24px; text-align: center; }

/* ── Privacy ──────────────────────────────────────────────────────────────────────────────────────────────────────────── */
.mb-privacy { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.mb-privacy li { display: flex; align-items: flex-start; gap: 14px; padding: 20px; background: var(--rx-white); border: 1px solid var(--rx-line); border-radius: var(--rx-r-card); }
.mb-privacy__icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--rx-violet-100); color: var(--rx-violet-650); }
.mb-privacy__title { margin: 0 0 4px; font-size: 17px; line-height: 24px; font-weight: 500; color: var(--rx-ink-900); }
.mb-privacy p { font-size: 15px; line-height: 24px; color: var(--rx-ink-500); }

/* ── Wider screens ────────────────────────────────────────────────────────────────────────────────────────────────────── */
@media (min-width: 600px) {
  .mb-card { padding: 22px; }
  .mb-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .mb-limits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mb-privacy { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mb-shots { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .mb-shot img { max-width: min(100%, var(--mb-shot-max, 100%)); }
  .mb-shot--wide { grid-column: 1 / -1; } /* a wide screen gets its own row; the phone and the print page sit side by side under it */
}
@media (min-width: 768px) {
  .mb-hero { padding-block: 32px 88px; }
  .mb-two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .mb-ba { grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr); gap: 12px; }
  .mb-ba__arrow .rx-icon { transform: none; }
  [dir="rtl"] .mb-ba__arrow .rx-icon { transform: scaleX(-1); }
  .mb-hero__visual .mb-vis { max-width: 520px; }
}
@media (min-width: 1024px) {
  .mb-hero { padding-block: 36px 104px; }
  .mb-hero__grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); grid-template-areas: "head vis" "card vis"; column-gap: 48px; row-gap: 24px; align-items: start; }
  .mb-hero__head { grid-area: head; }
  .mb-hero__text { grid-area: card; }
  .mb-hero__visual { grid-area: vis; align-self: center; margin-top: 0; }
  .mb-hero__title { font-size: clamp(40px, calc(16px + 2.25vw), 48px); line-height: 1.16; }
  .mb-limits { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
  .mb-hero__grid { column-gap: 64px; }
}
@media (max-width: 1023px) {
  .mb-hero__visual .mb-vis { max-width: 440px; }
}
@media (max-width: 400px) {
  .mb-drop { padding: 18px 12px; }
  .mb-alt { gap: 2px 10px; }
}

/* ── Reduced motion: rx.css already stops every animation and transition; the spinner turns into a still ring ───────────── */
@media (prefers-reduced-motion: reduce) {
  .mb-status.is-busy::before { border-color: var(--rx-violet-400); }
}

/* ── Print: the page prints as text, without the upload card ──────────────────────────────────────────────────────────── */
@media print {
  .mb-card, .mb-hero__visual { display: none; }
}
