/* The grid menu: one look for every venue's menu (shops, restaurants, bays, salons, tickets).
   Rounded grey photo cards in a full-width grid, a variant strip that shows on hover, a zoom, and a popup with the
   size and colour choices and the Sponsor me / Pay now toggles. The list view keeps the receipt look (mono font,
   categories, items under them). Only design tokens from app.css are used, so light and dark both work. */

.container:has(.mg) { max-width: none; padding-inline: clamp(16px, 4vw, 48px); }

.mg {
  --mg-r: clamp(26px, 3.6vw, 40px);
  --mg-gap: clamp(12px, 2vw, 28px);
  --mg-min: 220px;
  --mg-photo: color-mix(in srgb, var(--text) 7%, var(--surface));
  display: grid; gap: var(--sp-16); grid-template-columns: minmax(0, 1fr); color: var(--text); min-width: 0;
}
@media (min-width: 1024px) { .mg { grid-template-columns: 230px minmax(0, 1fr); gap: clamp(24px, 3vw, 56px); align-items: start; } }
@media (min-width: 1024px) { .mg.mg-norail { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .mg { --mg-min: 150px; } }
@media (max-width: 400px) { .mg { --mg-min: 128px; } }

/* The venue's own header picture: one big, centred, full-width block above the categories and the grid, with large
   rounded corners. Wide (about 2.5 to 1 on a desktop, 2 to 1 on a phone), and never so tall it pushes the menu off screen. */
.mg-card { scroll-margin-top: 96px; }
.mg-banner { width: 100%; margin: 0 auto clamp(20px, 3vw, 40px); border-radius: clamp(24px, 3.4vw, 40px); overflow: hidden; background: var(--mg-photo, color-mix(in srgb, var(--text) 7%, var(--surface))); aspect-ratio: 2 / 1; max-height: 70vh; }
.mg-banner img { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 900px) { .mg-banner { aspect-ratio: 5 / 2; } }

/* ---------------------------------------------------------------- categories */
.mg-rail { min-width: 0; }
.mg-rail-h { margin: 0 0 var(--sp-12); font-size: 1.05rem; font-weight: 700; }
.mg-cats { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.mg-cat {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-12); width: 100%; min-height: 42px; padding: var(--sp-8) var(--sp-10);
  border: 0; border-radius: var(--sp-10); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.mg-cat:hover { background: var(--mg-photo); }
.mg-cat[aria-pressed="true"] { background: var(--mg-photo); font-weight: 700; }
.mg-cat:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.mg-cat-n { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.mg-cat-t { min-width: 0; overflow-wrap: anywhere; }
/* Filters from the venue's own choices (Size, Colour...), under the categories. */
.mg-facet { margin-top: var(--sp-22); padding-top: var(--sp-16); border-top: 1px solid var(--border); }
.mg-cats + .mg-facet, .mg-rail details > .mg-facet:first-child { margin-top: var(--sp-16); }
.mg-rail details > .mg-facet:first-child { padding-top: 0; border-top: 0; margin-top: 0; }
.mg-facet-h { margin: 0 0 var(--sp-12); font-size: 1.05rem; font-weight: 700; padding: 0 var(--sp-10); }
.mg-facet-chips { display: flex; flex-wrap: wrap; gap: var(--sp-8); padding: 0 var(--sp-10); }
.mg-fchip {
  min-height: 40px; padding: 0 var(--sp-14); border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text);
  font: inherit; cursor: pointer; max-width: 100%; overflow-wrap: anywhere;
}
.mg-fchip:hover { background: var(--mg-photo); }
.mg-fchip[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.mg-fchip:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* Phones and tablets: the categories collapse into one tidy dropdown above the grid. */
@media (max-width: 1023px) {
  .mg-rail-h { display: none; }
  .mg-rail details { border: 1px solid var(--border); border-radius: var(--sp-14); background: var(--surface); }
  .mg-rail summary { list-style: none; display: flex; gap: var(--sp-12); align-items: center; min-height: var(--tap); padding: 0 var(--sp-16); cursor: pointer; font-weight: 600; }
  .mg-rail summary .mg-cat-n { margin-left: auto; font-weight: 400; }
  .mg-rail summary::-webkit-details-marker { display: none; }
  .mg-rail summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--sp-14); }
  .mg-rail summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-top: -4px; flex: 0 0 auto; }
  .mg-rail details[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
  .mg-rail .mg-cats { padding: 0 var(--sp-8) var(--sp-8); }
  .mg-rail .mg-facet { padding: var(--sp-12) var(--sp-8) var(--sp-16); margin-top: 0; }
  .mg-rail .mg-facet-h, .mg-rail .mg-facet-chips { padding-left: var(--sp-8); padding-right: var(--sp-8); }
}
@media (min-width: 1024px) {
  .mg-rail { position: sticky; top: var(--sp-16); }
  .mg-rail summary { display: none; }
  .mg-rail details > .mg-cats { display: grid; }
}

/* ---------------------------------------------------------------- toolbar */
.mg-main { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-16); }
.mg-bar { display: flex; flex-wrap: wrap; gap: var(--sp-10) var(--sp-16); align-items: center; }
.mg-views { display: inline-flex; gap: var(--sp-6); }
.mg-view {
  width: 40px; height: 40px; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: var(--sp-10);
  background: var(--surface); color: var(--text); cursor: pointer;
}
.mg-view[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.mg-view:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.mg-view svg { width: 18px; height: 18px; display: block; }
.mg-search { flex: 1 1 200px; min-width: 0; max-width: 420px; }
.mg-search input, .mg-sort select {
  width: 100%; min-height: 44px; padding: 0 var(--sp-14); border: 1px solid var(--border); border-radius: var(--sp-12);
  background: var(--surface); color: var(--text); font: inherit;
}
.mg-search input:focus-visible, .mg-sort select:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.mg-sort { display: inline-flex; align-items: center; gap: var(--sp-10); margin-left: auto; color: var(--text-muted); font-size: .9rem; }
.mg-sort select { width: auto; min-width: 150px; color: var(--text); }
.mg-only { display: inline-flex; align-items: center; gap: var(--sp-8); min-height: 40px; cursor: pointer; font-size: .92rem; }
.mg-only input { width: 20px; height: 20px; accent-color: var(--primary); }
@media (max-width: 640px) {
  .mg-bar { gap: var(--sp-10); }
  .mg-search { order: 1; flex: 1 1 100%; max-width: none; }
  .mg-views { order: 2; }
  .mg-sort { order: 3; margin-left: 0; flex: 1 1 0; min-width: 0; }
  .mg-sort span { display: none; }
  .mg-sort select { flex: 1; width: 100%; min-width: 0; }
  .mg-only { order: 4; flex: 1 1 100%; }
}

/* ---------------------------------------------------------------- sections and the grid */
.mg-sec[hidden], .mg-card[hidden] { display: none; }
.mg-sec + .mg-sec { margin-top: clamp(20px, 3vw, 40px); }
.mg-sec-h { margin: 0 0 var(--sp-14); display: flex; align-items: baseline; gap: var(--sp-10); font-size: 1.15rem; font-weight: 700; overflow-wrap: anywhere; }
.mg-sec-n { color: var(--text-muted); font-size: .9rem; font-weight: 400; }
.mg-grid { display: grid; gap: clamp(20px, 3vw, 36px) var(--mg-gap); grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--mg-min)), 1fr)); }

.mg-card { position: relative; min-width: 0; display: grid; gap: var(--sp-8); align-content: start; }
.mg-img {
  position: relative; display: block; width: 100%; aspect-ratio: 4 / 5; padding: 0; border: 0; border-radius: var(--mg-r);
  background: var(--mg-photo); overflow: hidden; cursor: zoom-in; color: var(--text);
}
.mg-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; transition: opacity .15s; }
.mg-img[data-fit="cover"] img { object-fit: cover; }
.mg-img:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.mg-ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.2rem; font-weight: 700; color: var(--text-muted); }
.mg-zoom-i {
  position: absolute; right: var(--sp-10); bottom: var(--sp-10); width: 34px; height: 34px; display: grid; place-items: center; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 86%, transparent); color: var(--text); opacity: 0; transition: opacity .15s; pointer-events: none;
}
.mg-zoom-i svg { width: 18px; height: 18px; display: block; }
@media (hover: hover) { .mg-img:hover .mg-zoom-i, .mg-img:focus-visible .mg-zoom-i { opacity: 1; } }
.mg-card.is-out .mg-img img, .mg-card.is-out .mg-ph { opacity: .4; filter: grayscale(.6); }
.mg-badge {
  position: absolute; left: var(--sp-10); top: var(--sp-10); z-index: 1; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700;
  background: var(--primary); color: var(--primary-ink);
}

/* The little strip under the photo: colours or photo variants, and the plus button. */
.mg-strip { display: flex; align-items: center; gap: var(--sp-8); min-height: 40px; }
.mg-sws { display: flex; flex-wrap: wrap; gap: var(--sp-8); min-width: 0; flex: 1; }
.mg-sw {
  position: relative; width: 34px; height: 34px; padding: 0; border: 2px solid transparent; border-radius: 999px; background: var(--mg-photo);
  cursor: pointer; overflow: hidden; flex: 0 0 auto; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 18%, transparent);
}
.mg-sw[data-kind="photo"] { border-radius: var(--sp-10); }
.mg-sw img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mg-sw::before { content: ""; position: absolute; inset: -6px; } /* a 46px tap target around a 34px swatch */
.mg-sw[aria-pressed="true"], .mg-sw:hover { border-color: var(--text); }
.mg-sw:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.mg-sw.is-off { opacity: .35; cursor: not-allowed; }
.mg-more { color: var(--text-muted); font-size: .85rem; align-self: center; }
.mg-plus {
  margin-left: auto; flex: 0 0 auto; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 999px;
  background: transparent; color: var(--text); cursor: pointer;
}
.mg-plus:hover { background: var(--mg-photo); }
.mg-plus:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.mg-plus svg { width: 20px; height: 20px; display: block; }
.mg-card[data-state] .mg-plus { background: var(--primary); color: var(--primary-ink); }
.mg-card[data-state] .mg-plus .i-plus { display: none; }
.mg-card:not([data-state]) .mg-plus .i-edit { display: none; }
/* On a mouse, the strip stays out of the way until the card is hovered or focused. Touch always shows it. */
@media (hover: hover) and (pointer: fine) {
  .mg-card:not([data-state]) .mg-sws { opacity: 0; transition: opacity .15s; }
  .mg-card:hover .mg-sws, .mg-card:focus-within .mg-sws { opacity: 1; }
}

.mg-name {
  margin: 0; font-size: 1rem; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.mg-name-a { color: inherit; text-decoration: none; }
.mg-name-a:hover, .mg-name-a:focus-visible { text-decoration: underline; }
.mg-meta a { color: var(--text-muted); text-decoration: underline; }
.mg-price { margin: 0; font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--sp-8); }
.mg-price small { font-size: .8rem; font-weight: 400; color: var(--text-muted); }
.mg-meta { margin: 0; font-size: .82rem; color: var(--text-muted); overflow-wrap: anywhere; }
.mg-rate { margin: 0; font-size: .82rem; color: var(--text-muted); display: flex; gap: var(--sp-6); align-items: center; }
.mg-stars { letter-spacing: 1px; color: var(--text); }
.mg-tag {
  justify-self: start; max-width: 100%; padding: 3px 12px; border-radius: 999px; font-size: .82rem; font-weight: 600;
  background: var(--primary); color: var(--primary-ink); overflow-wrap: anywhere;
}
.mg-tag[hidden] { display: none; }
.mg-empty { margin: var(--sp-24, 24px) 0; color: var(--text-muted); text-align: center; }
.mg-more-btn { justify-self: center; min-height: var(--tap); padding: 0 var(--sp-24, 24px); }

/* ---------------------------------------------------------------- list view: the receipt look */
.mg[data-view="list"] .mg-grid { display: block; }
.mg[data-view="list"] .mg-sec { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.mg[data-view="list"] .mg-sec-h { font-size: 1rem; border-bottom: 1px dashed var(--border); padding-bottom: var(--sp-8); }
.mg[data-view="list"] .mg-card {
  grid-template-columns: 64px minmax(0, 1fr) auto; grid-template-areas: "img name plus" "img price plus" "img meta plus" "img tag plus";
  column-gap: var(--sp-14); row-gap: 2px; align-items: center; padding: var(--sp-10) 0; border-bottom: 1px dashed var(--border);
}
.mg[data-view="list"] .mg-img { grid-area: img; width: 64px; border-radius: var(--sp-18); aspect-ratio: 1; align-self: start; }
.mg[data-view="list"] .mg-zoom-i, .mg[data-view="list"] .mg-sws, .mg[data-view="list"] .mg-rate { display: none; }
.mg[data-view="list"] .mg-strip { grid-area: plus; min-height: 0; }
.mg[data-view="list"] .mg-name { grid-area: name; font-size: .95rem; }
.mg[data-view="list"] .mg-price { grid-area: price; font-size: .92rem; }
.mg[data-view="list"] .mg-meta { grid-area: meta; }
.mg[data-view="list"] .mg-tag { grid-area: tag; }
.mg[data-view="list"] .mg-badge { display: none; }

/* ---------------------------------------------------------------- the popup */
.mg-dialog {
  position: fixed; inset: 0; margin: auto; height: fit-content;
  padding: 0; border: 0; color: var(--text); background: var(--surface); overflow: hidden;
  width: min(940px, 94vw); max-height: min(92dvh, 860px); border-radius: var(--radius-lg, 28px);
}
.mg-dialog:not([open]) { display: none; }
.mg-dialog::backdrop { background: rgba(0, 0, 0, .6); }
.mg-sheet { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); max-height: inherit; min-height: 0; }
.mg-sheet-x {
  position: absolute; top: var(--sp-10); right: var(--sp-10); z-index: 3; width: 44px; height: 44px; border-radius: 999px; font-size: 1.6rem; line-height: 1;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}
.mg-sheet-x:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.mg-sheet-pic { position: relative; background: var(--mg-photo); min-height: 0; }
.mg-sheet-pic img { display: block; width: 100%; height: 100%; max-height: 38dvh; object-fit: contain; }
.mg-sheet-pic .mg-ph { position: relative; min-height: 180px; }
.mg-thumbs { display: flex; flex-wrap: wrap; gap: var(--sp-6); padding: var(--sp-8); }
.mg-thumbs button { width: 44px; height: 44px; padding: 0; border: 2px solid transparent; border-radius: var(--sp-14); overflow: hidden; background: var(--surface); cursor: pointer; }
.mg-thumbs button[aria-pressed="true"] { border-color: var(--text); }
.mg-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; max-height: none; }
.mg-sheet-body { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; }
.mg-sheet-scroll { overflow-y: auto; padding: var(--sp-16) var(--sp-20, 20px) var(--sp-8); display: grid; gap: var(--sp-14); align-content: start; min-height: 0; overscroll-behavior: contain; }
.mg-sheet-name { margin: 0; padding-right: 48px; font-size: 1.25rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.mg-sheet-price { margin: 0; font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; display: flex; flex-wrap: wrap; gap: 2px var(--sp-10); align-items: baseline; }
.mg-sheet-price small { font-size: .85rem; font-weight: 400; color: var(--text-muted); }
.mg-sheet-desc { margin: 0; color: var(--text-muted); font-size: .95rem; line-height: 1.5; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
.mg-grp { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: var(--sp-8); }
.mg-grp legend { padding: 0; font-weight: 700; font-size: .95rem; }
.mg-grp-hint { font-weight: 400; color: var(--text-muted); font-size: .85rem; margin-left: var(--sp-6); }
.mg-grp.is-bad legend { color: #b42318; }
.mg-chips { display: flex; flex-wrap: wrap; gap: var(--sp-8); }
.mg-chip { position: relative; display: inline-flex; align-items: center; gap: var(--sp-8); min-height: 44px; padding: 0 var(--sp-14); border: 1px solid var(--border); border-radius: 999px; background: var(--surface); cursor: pointer; max-width: 100%; }
.mg-chip input { position: absolute; opacity: 0; width: 100%; height: 100%; inset: 0; margin: 0; cursor: pointer; }
.mg-chip:has(input:checked) { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.mg-chip:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.mg-chip.is-off { opacity: .45; cursor: not-allowed; }
.mg-chip.is-off input { cursor: not-allowed; }
.mg-chip-dot { width: 22px; height: 22px; border-radius: 999px; flex: 0 0 auto; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 25%, transparent); overflow: hidden; }
.mg-chip-dot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mg-chip-t { overflow-wrap: anywhere; }
.mg-chip small { color: inherit; opacity: .75; }
.mg-err { margin: 0; color: #b42318; font-weight: 600; font-size: .9rem; }
.mg-err[hidden] { display: none; }
:root[data-theme="dark"] .mg-err, :root[data-theme="dark"] .mg-grp.is-bad legend { color: #fda29b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mg-err, :root:not([data-theme="light"]) .mg-grp.is-bad legend { color: #fda29b; } }

.mg-sheet-foot { padding: var(--sp-12) var(--sp-20, 20px) calc(var(--sp-14) + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); background: var(--surface); display: grid; gap: var(--sp-10); }
.mg-sum { margin: 0; font-size: .92rem; color: var(--text-muted); overflow-wrap: anywhere; }
.mg-verbs { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: var(--sp-10); }
.mg-verb {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-8); min-height: 52px; padding: 0 var(--sp-14); min-width: 0; line-height: 1.2;
  border: 1px solid var(--border); border-radius: var(--sp-14); background: var(--surface); cursor: pointer; font-weight: 600;
}
.mg-verb:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.mg-verb:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.mg-verb.is-off { opacity: .5; cursor: not-allowed; }
/* The toggle is drawn here, not borrowed from app.css, because the shop's order page is its own document. */
.mg-tg { position: relative; display: inline-flex; flex: 0 0 auto; }
.mg-tg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.mg-track { position: relative; width: 48px; height: 28px; border-radius: 999px; border: 2px solid var(--text-muted); background: transparent; transition: background .15s, border-color .15s; }
.mg-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 999px; background: var(--text-muted); transition: transform .15s, background .15s; }
.mg-tg input:checked + .mg-track { background: var(--primary); border-color: var(--primary); }
.mg-tg input:checked + .mg-track::after { transform: translateX(20px); background: var(--primary-ink); }
.mg-tg input:focus-visible + .mg-track { outline: 3px solid var(--focus); outline-offset: 2px; }
.mg-tg input:disabled { cursor: not-allowed; }
.mg-add { grid-column: 1 / -1; min-height: 56px; border: 0; border-radius: 999px; background: var(--primary); color: var(--primary-ink); font: inherit; font-weight: 700; font-size: 1.05rem; cursor: pointer; }
.mg-add:hover { filter: brightness(.94); }
.mg-add:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.mg-add:disabled { opacity: .5; cursor: not-allowed; }
.mg-verb-note { grid-column: 1 / -1; margin: 0; font-size: .82rem; color: var(--text-muted); }

/* Wide screens, and phones on their side: the photo beside the choices, so the toggles never get pushed off the bottom. */
@media (min-width: 820px), (max-height: 520px) and (min-width: 560px) {
  .mg-sheet { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .mg-sheet-pic { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; overflow: hidden; }
  .mg-sheet-pic img { max-height: min(86dvh, 820px); min-height: 0; }
}
@media (max-height: 520px) and (min-width: 560px) {
  .mg-dialog { width: min(940px, 96vw); max-height: 94dvh; }
  .mg-sheet-pic img { max-height: 70dvh; }
  .mg-sheet-scroll { padding-top: var(--sp-12); gap: var(--sp-10); }
}
@media (min-width: 820px) and (min-height: 521px) { .mg-sheet-pic img { min-height: 360px; } }
/* Phones: a bottom sheet. */
@media (max-width: 639px) {
  .mg-dialog { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: var(--radius-lg, 28px) var(--radius-lg, 28px) 0 0; max-height: 94dvh; }
  .mg-sheet-pic img { max-height: 30dvh; }
  .mg-verb { padding: 0 var(--sp-12); font-size: .92rem; }
}
/* Small phones: three switches still fit two to a row, and a long label wraps rather than being clipped. */
@media (max-width: 420px) {
  .mg-verbs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mg-verb { padding: 0 var(--sp-10); font-size: .88rem; }
  .mg-track { width: 44px; height: 26px; }
  .mg-track::after { width: 16px; height: 16px; }
  .mg-tg input:checked + .mg-track::after { transform: translateX(18px); }
}

/* ---------------------------------------------------------------- the zoom */
/* Centred on the screen both ways. A page's own reset (margin: 0) removes the dialog's automatic margins, so the centring is stated here. */
.mg-zoom { position: fixed; inset: 0; margin: auto; padding: 0; border: 0; background: var(--surface); color: var(--text); width: fit-content; height: fit-content; max-width: 96vw; max-height: 94dvh; border-radius: var(--radius-lg, 28px); overflow: auto; }
.mg-zoom:not([open]) { display: none; }
.mg-zoom::backdrop { background: rgba(0, 0, 0, .75); }
.mg-zoom img { display: block; max-width: 96vw; max-height: calc(94dvh - 70px); width: auto; height: auto; object-fit: contain; background: var(--mg-photo); }
.mg-zoom-cap { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-12); padding: var(--sp-10) var(--sp-16); }
.mg-zoom-cap strong { overflow-wrap: anywhere; }
.mg-zoom-nav { display: inline-flex; gap: var(--sp-8); flex: 0 0 auto; }
.mg-zoom-nav button, .mg-zoom-x { width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 1.3rem; cursor: pointer; }
.mg-zoom-x { position: absolute; top: var(--sp-8); right: var(--sp-8); }
.mg-zoom button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.mg [hidden], .mg-dialog [hidden], .mg-zoom [hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { .mg *, .mg-dialog, .mg-zoom { transition: none !important; animation: none !important; } }

/* ---------------------------------------------------------------- the customer's own sponsor links */
.mg-form { min-width: 0; }
.ask-links { min-width: 0; }
.ask-row { display: grid; gap: var(--sp-8); padding: var(--sp-12) 0; border-top: 1px dashed var(--border); min-width: 0; }
.ask-what { display: grid; gap: 2px; min-width: 0; }
.ask-what strong { overflow-wrap: anywhere; }
.ask-act { display: flex; flex-wrap: wrap; gap: var(--sp-8); align-items: center; min-width: 0; }
.ask-url { flex: 1 1 220px; min-width: 0; font-size: .85rem; }
.ask-act .btn { flex: 0 0 auto; min-height: 44px; padding: 0 var(--sp-16); }

/* The sticky pay / save bar runs edge to edge across the page's side gutters (which are wider than a card's padding). */
.mg-form .pick-bar { margin-inline: calc(clamp(16px, 4vw, 48px) * -1); padding-inline: clamp(16px, 4vw, 48px); }
.mg-form .pick-bar .pick-actions { max-width: 760px; margin-inline: auto; width: 100%; }
.mg-form .pick-bar #order-total { max-width: 760px; margin-inline: auto; width: 100%; }

/* Personalise it: the shop's questions for this product, asked before it goes in the cart. */
.mg-ask { gap: var(--sp-6); }
.mg-ask-note { margin: 0 0 var(--sp-4); padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--text); font-size: .9rem; line-height: 1.4; }
.mg-ask-lbl { font-weight: 600; font-size: .92rem; margin-top: var(--sp-4); }
.mg-ask-in { min-height: 48px; width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; font: inherit; background: var(--surface); color: var(--text); }
.mg-ask-in.is-bad { border-color: #b42318; box-shadow: 0 0 0 3px rgba(180, 35, 24, .15); }
