/* The mug designer (mugdesigner.js) - used on the website and in Canvas prep, so it brings its own
   look and only borrows each page's colours where it can. */
.md-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.md-seg { display: inline-flex; border: 1px solid rgba(128,128,128,.45); border-radius: 10px; overflow: hidden; }
.md-seg button { border: 0; background: transparent; color: inherit; padding: 8px 12px; font: inherit; font-size: 14px; cursor: pointer; }
.md-seg button + button { border-left: 1px solid rgba(128,128,128,.3); }
.md-seg button.on { background: #2563eb; color: #fff; }
.md-canvas-wrap { position: relative; }
.md-canvas { display: block; width: 100%; height: auto; border-radius: 6px; background: #fff; touch-action: none; cursor: pointer;
  box-shadow: 0 0 0 1px rgba(128,128,128,.35), 0 6px 18px rgba(0,0,0,.12); }
.md-ends { display: flex; justify-content: space-between; font-size: 12px; opacity: .7; margin-top: 4px; }
.md-label { font-size: 13px; opacity: .8; }
.md-swatches { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.md-swatches button { width: 24px; height: 24px; border-radius: 50%; border: 1px solid rgba(128,128,128,.6); padding: 0; cursor: pointer; }
.md-swatches button.on { outline: 3px solid #2563eb; outline-offset: 1px; }
.md-swatches input[type=color] { width: 30px; height: 26px; padding: 0; border: 0; background: none; cursor: pointer; }
.md-panel { border: 1px solid rgba(128,128,128,.35); border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.md-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0; }
.md-row .md-text { flex: 1; min-width: 180px; font-size: 16px; }
.md-row .md-size, .md-row .md-zoom { width: 160px; }
.md-check { display: inline-flex; gap: 4px; align-items: center; font-size: 14px; }
.md-hint { font-size: 13px; opacity: .75; margin-top: 4px; }
.md-picker { border: 1px solid rgba(128,128,128,.35); border-radius: 12px; padding: 10px; margin: 8px 0; }
.md-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; margin-top: 6px; }
.md-thumbs button { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: none; aspect-ratio: 1; }
.md-thumbs button:hover { border-color: #2563eb; }
.md-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.md-3d { margin-top: 10px; }
.md-3d-stage { width: 100%; border-radius: 12px; overflow: hidden; background: linear-gradient(#f3eee7, #e6ded2); touch-action: pan-y; }
.md-3d .md-bar { justify-content: space-between; }
.md-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 8px; }
.md-tabs button { border: 1px solid rgba(128,128,128,.45); border-radius: 999px; background: transparent; color: inherit;
  padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer; }
.md-tabs button.on { background: #2563eb; border-color: #2563eb; color: #fff; }
.md-gallery { border: 1px solid rgba(128,128,128,.35); border-radius: 12px; padding: 10px; margin: 8px 0; }
.md-gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.md-gal-card { display: flex; flex-direction: column; gap: 6px; padding: 6px; border: 2px solid rgba(128,128,128,.25); border-radius: 10px;
  background: transparent; color: inherit; font: inherit; font-size: 14px; cursor: pointer; text-align: center; }
.md-gal-card:hover, .md-gal-card:focus-visible { border-color: #2563eb; }
.md-gal-card canvas { width: 100%; height: auto; border-radius: 4px; box-shadow: 0 0 0 1px rgba(128,128,128,.3); }
.md-stickers { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 6px; }
.md-stickers button { padding: 6px; border: 2px solid transparent; border-radius: 10px; background: rgba(128,128,128,.08); cursor: pointer; aspect-ratio: 1; }
.md-stickers button:hover { border-color: #2563eb; }
.md-stickers img { width: 100%; height: 100%; object-fit: contain; display: block; }
.md-sicon { width: 36px; height: 36px; }
.md-row .md-ssize, .md-row .md-srot { width: 140px; }
.md-credit { font-size: 11px; opacity: .65; margin-top: 8px; }
.md-credit a { color: inherit; }
.md .hidden, .md-seg.hidden, .md-picker.hidden, .md-gallery.hidden, .md-side.hidden, .md-shape.hidden, .md-swatches.hidden { display: none !important; }
