/* GetBranded mockup tool. Loaded only on pages with the Mockup tool block. */
/* Layout: one screen, no scrolling. A square mockup on the left; a quiet panel of the same height on the right,
   read top to bottom: product, colour, artwork, then the two actions. Phones stack the panel under the mockup. */
.mk-app {
  --bg: #fbfaf9; --fg: #111010; --muted: #7a7372; --faint: #a9a2a1; --line: #e9e5e3; --panel: #ffffff;
  --stage-a: #ffffff; --stage-b: #ebe8e6; --chip: #f2efed; --ink: #111010; --ink-fg: #ffffff;
  --red: #ED1C24; --red-dark: #c5151c; --logo-bg: transparent;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --r: 22px; --gut: max(28px, env(safe-area-inset-left, 0px)); --gap: 48px; --side: 392px; --head: 76px; --padv: 58px;
}
.mk-app :where(button, input, a) { font: inherit; color: inherit; letter-spacing: normal; text-transform: none; line-height: inherit; }
.mk-app [hidden] { display: none !important; }
.mk-app *, .mk-app *::before, .mk-app *::after { box-sizing: border-box; }
.mk-app :focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

.mk-app {
  --s: min(calc(var(--avail, 100vh) - var(--padv) * 2), calc(var(--vw, 100vw) - var(--gut) * 2 - var(--side) - var(--gap)), 880px);
  height: var(--avail, 100vh); display: flex; flex-direction: column; justify-content: center; padding: 0 max(28px, env(safe-area-inset-right, 0px)) 0 var(--gut);
  background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased;
}

.mk { flex: none; min-height: 0; display: flex; justify-content: center; align-items: center; gap: var(--gap); }

/* Mockup */
.mk-stage { position: relative; flex: none; width: var(--s); height: var(--s); border-radius: var(--r); background: radial-gradient(110% 85% at 50% 40%, var(--stage-a) 0%, var(--stage-b) 100%); overflow: hidden; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fg) 5%, transparent); }
.mk-zoom { position: absolute; inset: 0; }
.mk-view { position: absolute; inset: 0; will-change: opacity, filter, transform; }
.mk-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.mk-stage canvas[data-mk-canvas] { pointer-events: none; }
.mk-stage canvas[data-mk-ghost] { pointer-events: none; opacity: 0; }
.mk-tip { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); z-index: 2; padding: 7px 14px; border-radius: 30px; background: color-mix(in srgb, var(--panel) 80%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; pointer-events: none; }
.mk-segs { display: inline-flex; padding: 4px; border-radius: 30px; gap: 2px; position: absolute; right: 16px; bottom: 16px; z-index: 2; background: color-mix(in srgb, var(--panel) 80%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 6px 24px rgba(0,0,0,.07); }
.mk-seg { padding: 7px 16px; border: 0; border-radius: 30px; background: transparent; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; transition: background .25s, color .25s; }
.mk-seg[aria-pressed="true"] { background: var(--ink); color: var(--ink-fg); }

/* Panel */
.mk-panel { flex: none; width: var(--side); max-height: var(--s); display: flex; flex-direction: column; min-height: 0; }
.mk-sec { flex: none; display: flex; flex-direction: column; gap: 14px; }
.mk-sec + .mk-sec { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.mk-sec--grow { flex: 0 1 auto; min-height: 0; }
.mk-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.mk-name { margin: 4px 0 0; font-size: 30px; line-height: 1.05; font-weight: 700; letter-spacing: -.035em; }
.mk-cats { display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.mk-cats::-webkit-scrollbar { display: none; }
.mk-cat { flex: none; padding: 0 0 10px; border: 0; background: none; font-size: 13px; font-weight: 600; color: var(--faint); cursor: pointer; position: relative; transition: color .2s; }
.mk-cat:hover { color: var(--fg); }
.mk-cat[aria-pressed="true"] { color: var(--fg); }
.mk-cat[aria-pressed="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--fg); border-radius: 2px; }
.mk-prods { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.mk-prod { position: relative; aspect-ratio: 1; padding: 6px; border: 0; border-radius: 16px; background: var(--chip); cursor: pointer; transition: transform .25s cubic-bezier(.3,0,.2,1), box-shadow .25s; }
.mk-prod:hover { transform: translateY(-2px); }
.mk-prod[aria-pressed="true"] { background: var(--panel); box-shadow: 0 0 0 1.5px var(--fg), 0 10px 24px rgba(0,0,0,.06); }
.mk-prod__img { display: block; width: 100%; height: 100%; border-radius: 11px; background: radial-gradient(circle at 50% 42%, #fff, #ece9e7); }
.mk-prod__img img { display: block; width: 100%; height: 100%; object-fit: contain; padding: 6%; }
.mk-prod__name { position: absolute; left: 0; right: 0; bottom: -20px; font-size: 11.5px; font-weight: 500; color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .2s; }
.mk-prod:hover .mk-prod__name, .mk-prod[aria-pressed="true"] .mk-prod__name { opacity: 1; }
.mk-prods { padding-bottom: 18px; }
.mk-colour { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mk-colour b { font-size: 13px; font-weight: 600; }
.mk-sws { display: flex; flex-wrap: wrap; gap: 10px; }
.mk-sw { width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 0; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0,0,0,.14); cursor: pointer; transition: transform .2s; }
.mk-sw:hover { transform: scale(1.1); }
.mk-sw[aria-pressed="true"] { box-shadow: inset 0 0 0 1px rgba(0,0,0,.14), 0 0 0 3px var(--bg), 0 0 0 4.5px var(--fg); }

/* Artwork */
.mk-row { display: flex; align-items: center; gap: 8px; }
.mk-upload { position: relative; flex: none; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px 0 12px; border-radius: 12px; background: var(--red); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .2s; }
.mk-upload:hover, .mk-upload.is-over { background: var(--red-dark); }
.mk-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.mk-input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--chip); font-size: 14px; }
.mk-input::placeholder { color: var(--faint); }
.mk-input:focus-visible { outline: 1.5px solid var(--fg); outline-offset: 0; }
.mk-wheel { position: relative; flex: none; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; background: conic-gradient(#ed1c24, #f0bf2a, #2e7a4c, #2350a3, #8a3ab9, #ed1c24); }
.mk-wheel::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--sw); box-shadow: 0 0 0 2px var(--bg); }
.mk-wheel input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.mk-add { flex: none; height: 44px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--chip); font-weight: 600; font-size: 14px; cursor: pointer; }
.mk-add:hover { background: color-mix(in srgb, var(--fg) 10%, var(--chip)); }
.mk-note { font-size: 12px; color: var(--faint); min-height: 1.4em; margin-top: -6px; }
.mk-note.is-error { color: var(--red); }
.mk-layers { flex: 0 1 auto; max-height: 216px; min-height: 44px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; scrollbar-width: thin; }
.mk-layers:empty::before { content: attr(data-empty); display: grid; place-items: center; text-align: center; padding: 14px 24px; flex: 1; min-height: 64px; border-radius: 14px; border: 1px dashed var(--line); font-size: 12.5px; color: var(--faint); }
.mk-layer { flex: none; display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 4px; border-radius: 12px; transition: background .2s; }
.mk-layer:hover { background: var(--chip); }
.mk-layer.is-on { background: var(--chip); }
.mk-layer__pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; }
.mk-layer__th { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.mk-layer.is-on .mk-layer__th { box-shadow: inset 0 0 0 1.5px var(--fg); }
.mk-layer__th img { max-width: 30px; max-height: 30px; object-fit: contain; }
.mk-layer__t { font-weight: 800; font-size: 14px; }
.mk-layer__name { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-layer__del { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 9px; background: transparent; color: var(--faint); cursor: pointer; opacity: 0; transition: opacity .2s, color .2s; }
.mk-layer:hover .mk-layer__del, .mk-layer.is-on .mk-layer__del, .mk-layer__del:focus-visible { opacity: 1; }
.mk-layer__del:hover { color: var(--red); }

.mk-actions { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.mk-actions .mk-btn--red { grid-column: 1 / -1; }
.mk-btn { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 52px; padding: 0 18px; border: 0; border-radius: 14px; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .2s, box-shadow .2s, transform .2s; }
.mk-btn--line { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.mk-btn--line:hover { box-shadow: inset 0 0 0 1.5px var(--fg); }
.mk-btn--red { background: var(--red); color: #fff; }
.mk-btn--red:hover { background: var(--red-dark); }
.mk-btn--red svg { transition: transform .25s; }
.mk-btn--red:hover svg { transform: translateX(3px); }
.mk-btn-soft { height: 40px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--chip); font-size: 14px; font-weight: 600; cursor: pointer; }

.mk-modal { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); background: rgba(12,10,10,.6); backdrop-filter: blur(6px); }
.mk-modal__card { width: min(500px, 100%); max-height: 100%; overflow: auto; padding: 18px; border-radius: var(--r); background: var(--panel); display: flex; flex-direction: column; gap: 12px; }
.mk-modal__card img { width: 100%; height: auto; border-radius: 12px; }
.mk-modal__card p { margin: 0; font-size: 13px; color: var(--muted); }
.mk-modal__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* Shorter laptop screens: tighten the spacing so it still fits. */
@media (min-aspect-ratio: 1/1) and (max-height: 780px) {
  .mk-app { --head: 64px; --padv: 38px; --side: 360px; }
  .mk-name { font-size: 25px; }
  .mk-sec + .mk-sec { margin-top: 16px; padding-top: 16px; }
  .mk-sec { gap: 11px; }
  .mk-actions { margin-top: 16px; }
  .mk-btn { height: 48px; }
}

/* Phones and tablets held upright: mockup on top, compact panel below. */
@media (max-width: 600px), (max-aspect-ratio: 1/1) {
  .mk-app { --gut: max(16px, env(safe-area-inset-left, 0px)); --head: 50px; --padv: 19px; }
  .mk-app { --s: min(calc(var(--vw, 100vw) - var(--gut) * 2), calc(var(--avail, 100vh) - var(--padv) * 2 - 330px), 620px); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
          .mk { flex: none; flex-direction: column; align-items: center; gap: 14px; }
  .mk-panel { width: max(var(--s), min(100%, 340px)); height: auto; max-height: none; }
  .mk-head, .mk-note, .mk-prod__name { display: none; }
  .mk-tip { font-size: 11px; top: 10px; }
  .mk-segs { right: 10px; bottom: 10px; padding: 3px; }
  .mk-seg { padding: 5px 12px; font-size: 12px; }
  .mk-sec { gap: 10px; }
  .mk-sec + .mk-sec { margin-top: 12px; padding-top: 12px; }
  .mk-cats { gap: 16px; }
  .mk-cat { padding-bottom: 8px; font-size: 12.5px; }
  .mk-prods { padding-bottom: 0; gap: 8px; grid-template-columns: repeat(4, 1fr); }
  .mk-prod { padding: 4px; border-radius: 12px; aspect-ratio: auto; height: 64px; }
  .mk-prod__img { border-radius: 9px; }
  .mk-colour b { display: none; }
  .mk-sws { gap: 8px; flex-wrap: nowrap; }
  .mk-sw { width: 26px; height: 26px; }
  .mk-upload span { display: none; }
  .mk-upload { padding: 0 12px; }
  .mk-layers { flex: none; flex-direction: row; align-items: center; overflow-x: auto; overflow-y: hidden; min-height: 0; height: 46px; scrollbar-width: none; }
  .mk-layers:empty::before { content: attr(data-empty); padding: 0 12px; display: block; line-height: 42px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mk-layer { padding: 3px; }
  .mk-layer__name { display: none; }
  .mk-layer__del { opacity: 1; width: 26px; }
  .mk-actions { margin-top: 12px; }
  .mk-btn { height: 46px; font-size: 14px; }
  .mk-sec--grow { flex: none; }
}
/* Phones turned sideways: side by side, compact panel. */
@media (min-aspect-ratio: 1/1) and (max-height: 560px) {
  .mk-app { --head: 46px; --padv: 14px; --side: 320px; --gap: 24px; --gut: max(16px, env(safe-area-inset-left, 0px)); }
    .mk-head, .mk-note, .mk-prod__name, .mk-colour b, .mk-upload span { display: none; }
  .mk-sec { gap: 8px; }
  .mk-sec + .mk-sec { margin-top: 8px; padding-top: 8px; }
  .mk-prods { padding-bottom: 0; gap: 6px; }
  .mk-prod { aspect-ratio: auto; height: 52px; padding: 3px; border-radius: 10px; }
  .mk-cat { padding-bottom: 6px; font-size: 12px; }
  .mk-sw { width: 24px; height: 24px; }
  .mk-sws { gap: 7px; flex-wrap: nowrap; }
  .mk-layers { flex: none; flex-direction: row; align-items: center; overflow-x: auto; overflow-y: hidden; height: 44px; min-height: 0; scrollbar-width: none; }
  .mk-layer__name { display: none; }
  .mk-layer__del { opacity: 1; }
  .mk-actions { margin-top: 8px; }
  .mk-btn { height: 42px; font-size: 13.5px; padding: 0 12px; }
  .mk-tip { font-size: 10.5px; top: 8px; padding: 5px 10px; }
}
/* More breathing room on computer screens. */
@media (min-aspect-ratio: 1/1) and (min-height: 700px) {
  .mk-app { --gap: 64px; }
  .mk-sec { gap: 18px; }
  .mk-sec + .mk-sec { margin-top: 28px; padding-top: 28px; }
  .mk-name { margin-top: 8px; }
  .mk-cats { gap: 22px; margin-top: 6px; }
  .mk-cat { padding-bottom: 12px; }
  .mk-prods { gap: 12px; padding-bottom: 22px; }
  .mk-sws { gap: 12px; }
  .mk-layers { gap: 6px; }
  .mk-actions { margin-top: 28px; gap: 12px; }
  .mk-tip { top: 22px; }
  .mk-segs { right: 22px; bottom: 22px; }
}
@media (prefers-reduced-motion: reduce) { .mk-app * { transition: none !important; } }
.mk-btn.is-done { background: var(--ink); color: var(--ink-fg); box-shadow: none; }

/* Logo colour switch: bottom left of the mockup. */
.mk-ink { position: absolute; left: 16px; bottom: 16px; z-index: 2; display: inline-flex; gap: 2px; padding: 4px; border-radius: 30px; background: color-mix(in srgb, var(--panel) 85%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 6px 24px rgba(0,0,0,.07); }
.mk-ink button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px 6px 8px; border: 0; border-radius: 30px; background: transparent; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; transition: background .2s, color .2s; }
.mk-ink button[aria-pressed="true"] { background: var(--ink); color: var(--ink-fg); }
.mk-ink__dot { display: block; width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); }
.mk-ink__dot--orig { background: conic-gradient(#ed1c24, #f0bf2a, #2e7a4c, #2350a3, #ed1c24); }
.mk-ink__dot--white { background: #fff; }
.mk-ink__dot--black { background: #111; }
.mk-ink button[aria-pressed="true"] .mk-ink__dot { box-shadow: 0 0 0 1.5px rgba(255,255,255,.6); }
@media (min-aspect-ratio: 1/1) and (min-height: 700px) { .mk-ink { left: 22px; bottom: 22px; } }

/* Dropping a logo from the computer. */
.mk-dropzone { position: absolute; inset: 10px; z-index: 3; display: grid; place-items: center; border: 2px dashed var(--red); border-radius: calc(var(--r) - 6px); background: rgba(255,255,255,.75); color: var(--red); font-size: 16px; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .2s; }
.mk.is-dropping .mk-dropzone { opacity: 1; }
.mk-prod img, .mk-saved img { -webkit-user-drag: none; user-select: none; }

/* The customer's list of mockups. */
.mk-saved { flex: none; margin-top: 18px; padding: 12px; border-radius: 14px; background: var(--chip); }
.mk-saved[hidden] { display: none; }
.mk-saved__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: 13.5px; }
.mk-saved__head span { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 4px; padding: 0 6px; border-radius: 20px; background: var(--red); color: #fff; font-size: 11.5px; }
.mk-saved__all { padding: 0; border: 0; background: none; font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.mk-saved__all.is-done { color: var(--red); }
.mk-saved__list { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 6px 6px 2px 0; margin: -6px 0 0; }
.mk-saved__list::-webkit-scrollbar { display: none; }
.mk-saved__item { position: relative; flex: none; }
.mk-saved__get { position: relative; display: block; width: 56px; height: 56px; padding: 0; border: 0; border-radius: 10px; background: #fff; overflow: hidden; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line); }
.mk-saved__get img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.mk-saved__dl { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(17,16,16,.55); color: #fff; opacity: 0; transition: opacity .2s; }
.mk-saved__get:hover .mk-saved__dl, .mk-saved__get:focus-visible .mk-saved__dl { opacity: 1; }
.mk-saved__x { position: absolute; top: -6px; right: -6px; display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: var(--ink); color: #fff; cursor: pointer; }
.mk-saved__x:hover { background: var(--red); }

/* Phones: the mockup runs nearly edge to edge, with a tidy panel underneath. */
@media (max-width: 600px), (max-aspect-ratio: 1/1) {
  .mk-app { --gut: max(10px, env(safe-area-inset-left, 0px)); --padv: 12px; height: auto; min-height: var(--avail, 100vh); justify-content: flex-start; padding: var(--padv) max(10px, env(safe-area-inset-right, 0px)) 24px var(--gut); }
  .mk-app { --s: min(calc(var(--vw, 100vw) - var(--gut) * 2), 640px); }
  .mk { gap: 18px; }
  .mk-panel { width: var(--s); padding: 0 4px; }
  .mk-stage { border-radius: 18px; }
  .mk-ink { left: 10px; bottom: 10px; padding: 3px; }
  .mk-ink button { padding: 5px 7px; }
  .mk-ink button span { display: none; }
  .mk-ink__dot { width: 16px; height: 16px; }
  .mk-tip { white-space: nowrap; max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis; }
  .mk-prods { grid-template-columns: repeat(5, 1fr); }
  .mk-prod { height: auto; aspect-ratio: 1; }
  .mk-sws { flex-wrap: wrap; }
  .mk-actions { grid-template-columns: 1fr 1fr; gap: 8px; }
  .mk-saved { margin-top: 12px; }
}

/* Products in one row that scrolls sideways, so the panel keeps the same height for every category. */
.mk-prods { display: flex !important; gap: 10px; overflow-x: auto; overflow-y: visible; scroll-snap-type: x proximity; scrollbar-width: none; padding: 2px 2px 24px; margin: -2px -2px 0; }
.mk-prods::-webkit-scrollbar { display: none; }
.mk-prod { flex: 0 0 calc((100% - 40px) / 5); height: auto !important; aspect-ratio: 1 !important; scroll-snap-align: start; }
.mk-prods.has-more { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.mk-prods.at-end { -webkit-mask-image: none; mask-image: none; }
/* The artwork section keeps its full height; only the list of layers shrinks to fit. */
.mk-sec--grow { flex: 0 0 auto; }
.mk-sec--grow .mk-layers { max-height: 150px; }
.mk-panel { overflow: visible; }
@media (max-width: 600px), (max-aspect-ratio: 1/1) {
  .mk-prods { gap: 8px; padding-bottom: 2px; }
  .mk-prod { flex-basis: calc((100% - 32px) / 5); }
}

/* The tool grows when the list of mockups is added, so the buttons never fall outside it. */
.mk-app { height: auto !important; min-height: var(--avail, 100vh); padding-top: var(--padv); padding-bottom: var(--padv); }

/* Product row: arrows when there are more products than fit. */
.mk-prodnav { position: relative; }
.mk-prodnav__btn { position: absolute; top: calc(50% - 12px); z-index: 2; display: grid; place-items: center; width: 34px; height: 34px; margin-top: -17px; padding: 0; border: 0; border-radius: 50%; background: var(--panel); color: var(--fg); box-shadow: 0 4px 14px rgba(0,0,0,.14), inset 0 0 0 1px var(--line); cursor: pointer; transition: transform .2s, background .2s; }
.mk-prodnav__btn:hover { transform: scale(1.08); background: var(--ink); color: var(--ink-fg); }
.mk-prodnav__btn[hidden] { display: none; }
.mk-prodnav__btn--prev { left: -12px; }
.mk-prodnav__btn--next { right: -12px; }
.mk-prods.has-more, .mk-prods.has-less { -webkit-mask-image: none; mask-image: none; }
.mk-prods.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.mk-prods.is-dragging .mk-prod { pointer-events: none; }
@media (max-width: 600px), (max-aspect-ratio: 1/1) {
  .mk-app { padding-top: 12px; padding-bottom: 24px; }
  .mk-prodnav__btn { top: 50%; width: 30px; height: 30px; margin-top: -15px; }
  .mk-prodnav__btn--prev { left: -6px; }
  .mk-prodnav__btn--next { right: -6px; }
}
.mk-panel { max-height: none !important; }

/* The panel never changes height: the artwork list and the mockup list have fixed heights and scroll. */
.mk-sec--grow .mk-layers { flex: none; height: 100px; max-height: none; min-height: 0; }
.mk-saved { height: 116px; box-sizing: border-box; }
.mk-saved__list { height: 64px; align-items: flex-start; }
.mk-saved__list:empty { display: flex; align-items: center; padding: 0; margin: 0; }
.mk-saved__list:empty::before { content: attr(data-empty); font-size: 12.5px; line-height: 1.45; color: var(--faint); }
.mk-saved__all:disabled { opacity: .4; cursor: default; text-decoration: none; }
@media (min-aspect-ratio: 1/1) and (max-height: 780px) {
  .mk-sec--grow .mk-layers { height: 52px; }
  .mk-saved { height: 104px; margin-top: 12px; }
  .mk-saved__list { height: 58px; }
  .mk-saved__get { width: 50px; height: 50px; }
}
@media (max-width: 600px), (max-aspect-ratio: 1/1) {
  .mk-sec--grow .mk-layers { height: 46px; }
  .mk-saved { height: 104px; }
  .mk-saved__list { height: 58px; }
  .mk-saved__get { width: 50px; height: 50px; }
}
/* Computer screens: the panel is never taller than the mockup beside it. */
@media (min-aspect-ratio: 1/1) and (min-height: 700px) {
  .mk-sec { gap: 14px; }
  .mk-sec + .mk-sec { margin-top: 20px; padding-top: 20px; }
  .mk-name { margin-top: 4px; }
  .mk-prods { padding-bottom: 20px; }
  .mk-sec--grow .mk-layers { height: 92px; }
  .mk-saved { margin-top: 14px; }
  .mk-actions { margin-top: 14px; }
  .mk-btn { height: 50px; }
}
@media (min-aspect-ratio: 1/1) and (min-height: 700px) {
  .mk-sec--grow .mk-layers { height: 98px; gap: 6px; }
  .mk-saved { margin-top: 10px; }
}

/* Computers: the panel is exactly as tall as the mockup, so both start and end on the same lines.
   The list of logos and text takes up whatever room is left, so nothing moves when things are added. */
@media (min-aspect-ratio: 1/1) {
  .mk { align-items: stretch; }
  .mk-panel { height: var(--s) !important; max-height: none !important; }
  .mk-sec--grow { flex: 1 1 auto !important; min-height: 0; }
  .mk-sec--grow .mk-layers { flex: 1 1 0; height: auto !important; min-height: 46px; }
  .mk-head { margin-top: -4px; }
}

/* Everything on one screen, no scrolling. */
.mk-app { height: var(--avail, 100vh) !important; min-height: 0 !important; overflow: hidden; }
@media (max-width: 600px), (max-aspect-ratio: 1/1) {
  /* The mockup takes the room the compact panel leaves (about 360px), up to the full width. */
  .mk-app { --s: max(200px, min(calc(var(--vw, 100vw) - var(--gut) * 2), calc(var(--avail, 100vh) - 24px - 372px), 640px)); padding-top: 10px; padding-bottom: 10px; justify-content: flex-start; }
  .mk { gap: 12px; }
  .mk-panel { width: min(100%, calc(var(--vw, 100vw) - var(--gut) * 2)); padding: 0; }
  .mk-sec { gap: 8px; }
  .mk-sec + .mk-sec { margin-top: 8px; padding-top: 8px; }
  .mk-cats { gap: 14px; }
  .mk-cat { padding-bottom: 6px; font-size: 12.5px; }
  .mk-prods { gap: 6px; padding-bottom: 0; }
  .mk-prod { flex-basis: calc((100% - 24px) / 5); padding: 3px; border-radius: 10px; }
  .mk-sw { width: 24px; height: 24px; }
  .mk-sws { gap: 7px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .mk-row { gap: 6px; }
  .mk-upload, .mk-input, .mk-add { height: 40px; }
  .mk-wheel { width: 32px; height: 32px; }
  .mk-sec--grow .mk-layers { height: 40px !important; }
  .mk-layer__th { width: 32px; height: 32px; }
  /* Mockup list: one slim row. */
  .mk-saved { height: 52px !important; margin-top: 8px !important; padding: 6px 8px; display: flex; align-items: center; gap: 8px; }
  .mk-saved__head { margin: 0; flex: none; display: contents; font-size: 12.5px; }
  .mk-saved__head b { order: 1; white-space: nowrap; }
  .mk-saved__list { order: 2; flex: 1; min-width: 0; height: 40px !important; margin: 0; padding: 4px 4px 0 0; align-items: center; }
  .mk-saved__all { order: 3; font-size: 12px; white-space: nowrap; }
  .mk-saved__get { width: 34px !important; height: 34px !important; border-radius: 8px; }
  .mk-saved__x { width: 16px; height: 16px; top: -5px; right: -5px; }
  .mk-saved__list:empty::before { content: "Add mockups to your list"; font-size: 12px; }
  /* Buttons: one row. */
  .mk-actions { grid-template-columns: 46px 1fr 1.4fr; gap: 6px; margin-top: 8px !important; }
  .mk-actions .mk-btn--red { grid-column: auto; }
  .mk-btn { height: 44px !important; padding: 0 10px; font-size: 13.5px; gap: 6px; }
  .mk-actions [data-mk-save] { padding: 0; font-size: 0; gap: 0; }
  .mk-actions [data-mk-save] svg { width: 19px; height: 19px; }
}
/* Short phones: slimmer rows so the mockup keeps as much room as possible. */
@media (max-aspect-ratio: 1/1) and (max-height: 740px) {
  .mk-app { --s: max(200px, min(calc(var(--vw, 100vw) - var(--gut) * 2), calc(var(--avail, 100vh) - 20px - 332px), 640px)); }
  .mk-prod { flex: 0 0 52px !important; }
  .mk-sec--grow .mk-layers { height: 36px !important; }
  .mk-upload, .mk-input, .mk-add { height: 36px; }
  .mk-saved { height: 46px !important; }
  .mk-saved__get { width: 30px !important; height: 30px !important; }
  .mk-btn { height: 40px !important; }
  .mk-actions { grid-template-columns: 40px 1fr 1.4fr; }
  .mk-tip { display: none; }
  .mk-ink, .mk-segs { bottom: 6px; }
  .mk-ink { left: 6px; }
  .mk-segs { right: 6px; }
  .mk-seg { padding: 4px 9px; font-size: 11.5px; }
  .mk-ink button { padding: 4px 5px; }
  .mk-ink__dot { width: 14px; height: 14px; }
}

/* ================= Phones: final layout =================
   A calm, evenly spaced column: the mockup on top, then the controls in tidy rows of the same rhythm.
   Everything fits on one screen. */
@media (max-width: 600px), (max-aspect-ratio: 1/1) {
  .mk-app {
    --gut: max(16px, env(safe-area-inset-left, 0px));
    --row: 12px;      /* the space between every row */
    --panel: 372px;   /* the height of the controls under the mockup */
    --s: max(190px, min(calc(var(--vw, 100vw) - var(--gut) * 2), calc(var(--avail, 100vh) - 32px - var(--row) - var(--panel)), 560px));
    padding: 16px max(16px, env(safe-area-inset-right, 0px)) 16px var(--gut) !important;
    justify-content: flex-start;
  }
  .mk { gap: var(--row) !important; align-items: center; }
  .mk-stage { border-radius: 20px; }
  .mk-panel { width: calc(var(--vw, 100vw) - var(--gut) * 2) !important; height: var(--panel) !important; padding: 0 !important; display: flex; flex-direction: column; gap: var(--row); }
  .mk-sec, .mk-sec--grow { gap: var(--row) !important; flex: none !important; }
  .mk-sec + .mk-sec { margin-top: 0 !important; padding-top: 0 !important; border-top: 0 !important; }
  .mk-head, .mk-tip { display: none !important; }

  /* Categories and products */
  .mk-cats { gap: 18px; border-bottom: 1px solid var(--line); }
  .mk-cat { padding: 0 0 9px !important; font-size: 13px !important; }
  .mk-prodnav { margin: 0; }
  .mk-prods { gap: 8px !important; padding: 2px !important; margin: -2px !important; }
  .mk-prod { flex: 0 0 56px !important; width: 56px; height: 56px !important; padding: 4px !important; border-radius: 12px !important; }
  .mk-prod__name { display: none !important; }
  .mk-prodnav__btn { width: 28px; height: 28px; margin-top: -14px; top: 50%; }
  .mk-prodnav__btn--prev { left: -8px; }
  .mk-prodnav__btn--next { right: -8px; }

  /* Colours */
  .mk-colour { gap: 10px; }
  .mk-colour b { display: block !important; flex: none; font-size: 12.5px; }
  .mk-sws { gap: 8px !important; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 4px; margin: -4px; }
  .mk-sw { width: 26px !important; height: 26px !important; flex: none; }

  /* Upload and text */
  .mk-row { gap: 8px !important; }
  .mk-upload { width: 44px; height: 44px !important; padding: 0 !important; justify-content: center; border-radius: 12px; }
  .mk-upload span { display: none !important; }
  .mk-input, .mk-add { height: 44px !important; border-radius: 12px; }
  .mk-wheel { width: 34px !important; height: 34px !important; }

  /* Logos and text added */
  .mk-sec--grow .mk-layers { height: 44px !important; gap: 8px !important; }
  .mk-layer { padding: 4px !important; }
  .mk-layer__th { width: 36px !important; height: 36px !important; }

  /* Mockup list: one tidy row */
  .mk-saved { height: 52px !important; margin: 0 !important; padding: 0 8px 0 14px !important; border-radius: 14px; display: flex !important; align-items: center; gap: 10px; }
  .mk-saved__head { display: contents !important; }
  .mk-saved__head b { order: 1; font-size: 13px; white-space: nowrap; }
  .mk-saved__head b span { margin-left: 6px; }
  .mk-saved__list { order: 2; flex: 1; min-width: 0; height: 52px !important; margin: 0 !important; padding: 0 !important; align-items: center !important; gap: 8px !important; }
  .mk-saved__list:empty::before { content: "Tap Add to keep mockups here" !important; font-size: 12.5px; }
  .mk-saved__item { padding: 6px 6px 0 0; }
  .mk-saved__get { width: 34px !important; height: 34px !important; border-radius: 8px !important; }
  .mk-saved__x { width: 16px !important; height: 16px !important; top: 0 !important; right: 0 !important; }
  .mk-saved__x svg { width: 8px; height: 8px; }
  .mk-saved__all { order: 3; flex: none; padding: 8px 10px; border-radius: 10px; background: var(--panel); text-decoration: none; font-size: 12.5px; box-shadow: inset 0 0 0 1px var(--line); }
  .mk-saved__all:disabled { opacity: .45; }

  /* Buttons: one row */
  .mk-actions { margin: 0 !important; display: grid; grid-template-columns: 48px 1fr 1.5fr !important; gap: 8px !important; }
  .mk-actions .mk-btn--red { grid-column: auto !important; }
  .mk-btn { height: 48px !important; padding: 0 12px !important; font-size: 14px !important; border-radius: 14px !important; gap: 8px !important; }
  .mk-actions [data-mk-save] { padding: 0 !important; font-size: 0 !important; gap: 0 !important; }
  .mk-actions [data-mk-save] svg { width: 20px; height: 20px; }

  /* On the mockup */
  .mk-ink { left: 10px !important; bottom: 10px !important; padding: 3px !important; }
  .mk-ink button { padding: 6px !important; }
  .mk-ink button span { display: none !important; }
  .mk-ink__dot { width: 16px !important; height: 16px !important; }
  .mk-segs { right: 10px !important; bottom: 10px !important; padding: 3px; }
  .mk-seg { padding: 6px 12px !important; font-size: 12px !important; }
}
/* Shorter phones: a little less space between rows. */
@media (max-aspect-ratio: 1/1) and (max-height: 740px) {
  .mk-app { --row: 9px; --panel: 350px; padding-top: 12px !important; padding-bottom: 12px !important; }
  .mk-prod { flex-basis: 52px !important; width: 52px; height: 52px !important; }
  .mk-upload { width: 42px; height: 42px !important; }
  .mk-input, .mk-add { height: 42px !important; }
  .mk-btn { height: 46px !important; }
  .mk-actions { grid-template-columns: 46px 1fr 1.5fr !important; }
}
/* Phones: equal breathing room above and below the tool. */
@media (max-width: 600px), (max-aspect-ratio: 1/1) {
  .mk-app { --padv: 24px; --s: max(180px, min(calc(var(--vw, 100vw) - var(--gut) * 2), calc(var(--avail, 100vh) - var(--padv) * 2 - var(--row) - var(--panel)), 560px)); padding-top: var(--padv) !important; padding-bottom: var(--padv) !important; justify-content: center !important; }
}
@media (max-aspect-ratio: 1/1) and (max-height: 740px) {
  .mk-app { --padv: 18px; }
}
.mk-saved__ico, .mk-saved__short { display: none; }
@media (max-width: 600px), (max-aspect-ratio: 1/1) {
  .mk-saved__long { display: none; }
  .mk-saved__short { display: inline; }
  .mk-saved__ico { display: block; }
  .mk-saved__all { display: inline-flex !important; align-items: center; gap: 6px; font-weight: 700; }
}
@media (max-aspect-ratio: 1/1) and (max-height: 740px) {
  .mk-ink { top: 8px !important; bottom: auto !important; left: 8px !important; }
  .mk-segs { bottom: 8px !important; right: 8px !important; }
}
.mk-saved__all span { display: inline; min-width: 0; height: auto; margin: 0; padding: 0; border-radius: 0; background: none; color: inherit; font-size: inherit; }
.mk-saved__all .mk-saved__short { display: none; }
@media (max-width: 600px), (max-aspect-ratio: 1/1) {
  .mk-saved__all .mk-saved__long { display: none; }
  .mk-saved__all .mk-saved__short { display: inline; }
}


/* Phones and tablets held upright: the mockup is the full width of the controls, and the page scrolls if the screen is short. */
@media (max-width: 600px), (max-aspect-ratio: 1/1) {
  .mk-app { --s: min(calc(var(--vw, 100vw) - var(--gut) * 2), 640px) !important; height: auto !important; min-height: var(--avail, 100vh) !important; overflow: visible; }
  .mk-panel { width: var(--s) !important; }
}
