/*
 * Minha's Got That — one stylesheet for the whole site.
 *
 * The marketplace UI uses clear surfaces and restrained color, with the site's
 * teal/mustard identity as the desktop fallback. Apple and Android devices get
 * their own system typography, semantic hues and control shapes through the
 * platform tokens below, without changing the marketplace structure.
 */

:root {
  --ground: #F7F4EE;
  --surface: #FFFFFF;
  --line: #E4DED3;
  --line-soft: #EFEAE1;
  --ink: #1F4B4A;
  --ink-deep: #16302F;
  --text: #16302F;
  --text-soft: #3F4A48;
  --text-muted: #5C5A55;
  --mustard: #E0A526;
  --mustard-hover: #CF961C;
  --mustard-soft: #FBF1D9;
  --teal-soft: #E6EFEE;
  --sand: #F2EEE6;
  --rust: #B23A24;
  --radius: 16px;
  --radius-sm: 10px;
  --display: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --ink-rgb: 31,75,74;
  --focus-ring: var(--ink);
  --focus-rgb: var(--ink-rgb);
  --shadow-sm: 0 1px 2px rgba(22,48,47,0.06);
  --shadow-lg: 0 12px 32px rgba(22,48,47,0.10);

  /* The old names, kept so every page not yet redrawn still resolves them. */
  --kraft: var(--line-soft);
  --paper: var(--surface);
  --paper-edge: var(--line);
  --charcoal: var(--text);
  --faded-ink: var(--text-muted);
}

html[data-platform-family="apple"] {
  --focus-ring: #0066CC;
  --focus-rgb: 0,102,204;
  --radius-sm: 12px;
  --display: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --body: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
}

html[data-platform-family="android"] {
  --focus-ring: #00639B;
  --focus-rgb: 0,99,155;
  --radius-sm: 12px;
  --display: Roboto, 'Noto Sans', system-ui, sans-serif;
  --body: Roboto, 'Noto Sans', system-ui, sans-serif;
  --shadow-sm: 0 1px 2px rgba(25,28,32,0.08);
  --shadow-lg: 0 8px 24px rgba(25,28,32,0.16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body);
  color: var(--text);
  background: var(--ground);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.kraft-bg { background: var(--ground); }
.marker { font-family: var(--display); font-weight: 600; letter-spacing: 0; }
.mono { font-family: var(--body); }
.tilt { transform: none; }
img { max-width: 100%; }
:focus-visible { outline: 2.5px solid var(--focus-ring); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

a { color: var(--ink); }
a.link { color: var(--ink); text-decoration-color: rgba(var(--ink-rgb),0.4); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a.link:hover { color: var(--ink-deep); text-decoration-color: var(--ink); }
a.plain-link { color: inherit; text-decoration: none; }
/* The card link covers the whole card from inside it, rather than wrapping it,
   which leaves room for the trades badge — that one opens, it does not
   navigate, and nested inside an anchor it could do neither. */
.tag-link { text-decoration: none; color: inherit; display: block; }
.tag-link::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius); }

main { max-width: 1000px; margin: 0 auto; padding: 32px 20px 64px; }
main > h2, .section-title { font-family: var(--display); font-weight: 600; color: var(--text); }
h1, h2, h3 { line-height: 1.15; }

/* ---- Buttons -------------------------------------------------------------- */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--ink); color: #FFFFFF;
  border: 1.5px solid var(--ink); border-radius: 999px;
  padding: 11px 22px;
  font-family: var(--body); font-weight: 700; font-size: 1rem; letter-spacing: 0;
  text-decoration: none; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-primary:hover { background: var(--ink-deep); border-color: var(--ink-deep); color: #FFFFFF; }
button:disabled { opacity: 0.65; cursor: default; }
.btn-spinner {
  display: inline-block; width: 15px; height: 15px; flex: 0 0 auto;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; opacity: 0.85; animation: btn-spin 0.6s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--surface); color: var(--ink);
  border: 1.5px solid var(--ink); border-radius: 999px;
  padding: 11px 22px; font-family: var(--body); font-weight: 700; font-size: 1rem;
  text-decoration: none; cursor: pointer;
}
.btn-secondary:hover { background: var(--teal-soft); }
.btn-accent {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--mustard); color: var(--ink-deep); border: 0; border-radius: 999px;
  padding: 13px 24px; font-family: var(--body); font-weight: 700; font-size: 1rem; text-decoration: none;
}
.btn-accent:hover { background: var(--mustard-hover); color: var(--ink-deep); }
.btn-buy, .btn-toggle {
  flex: 1; text-align: center;
  padding: 9px 14px; border-radius: 999px; font-size: 0.85rem; font-weight: 600;
  border: 1.5px solid var(--line); cursor: pointer; text-decoration: none; font-family: var(--body);
}
.btn-buy { background: var(--mustard); color: var(--ink-deep); border-color: var(--mustard); }
.btn-toggle { background: var(--surface); color: var(--text); width: 100%; }
.btn-toggle:hover { border-color: var(--ink); }
.btn-danger { width: fit-content; padding: 10px 18px; border: 1.5px solid var(--rust); border-radius: 999px; color: #FFFFFF; background: var(--rust); cursor: pointer; font-family: var(--body); font-weight: 600; }
.btn-trade { display: inline-flex; align-items: center; justify-content: center; padding: 11px 20px; border: 1.5px solid var(--ink); border-radius: 999px; color: var(--ink); background: var(--surface); text-decoration: none; cursor: pointer; font-weight: 700; }
.btn-trade:hover { background: var(--teal-soft); }
.icon-btn { background: none; border: none; color: var(--rust); font-size: 1.2rem; cursor: pointer; line-height: 1; }

html[data-platform-family="apple"] :is(.btn-primary, .btn-secondary, .btn-accent, .btn-buy, .btn-toggle, .btn-danger, .btn-trade) { border-radius: 12px; }
html[data-platform-family="android"] :is(.btn-primary, .btn-secondary, .btn-accent, .btn-buy, .btn-toggle, .btn-danger, .btn-trade) { border-radius: 20px; font-weight: 500; }
html[data-platform-family="apple"] button:active, html[data-platform-family="apple"] [role="button"]:active { opacity: .72; }
html[data-platform-family="android"] button:active, html[data-platform-family="android"] [role="button"]:active { filter: brightness(.94); transform: scale(.985); }
html[data-platform-family="apple"] .display-control__toggle { border-radius: 14px; }
html[data-platform-family="android"] .display-control__toggle { border-radius: 50%; }

/* ---- The simple page header, on pages not yet redrawn --------------------- */
.site-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px;
  padding: 16px max(20px, calc((100% - 1000px) / 2));
  background: var(--surface); border-bottom: 1px solid var(--line); color: var(--text);
}
.site-header h1, .site-header .brand { margin: 0; font-family: var(--display); font-weight: 600; font-size: 1.6rem; color: var(--text); line-height: 1.1; }
.site-header .mono { color: var(--text-soft); }
.site-header a.link { color: var(--ink); }
.header-actions { display: flex; gap: 10px 18px; align-items: center; flex-wrap: wrap; }
.site-location { margin: 0; font-size: 0.85rem; color: var(--text-muted); }

/* ---- Cards (.tag), pills, meta --------------------------------------------- */
.tag {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; position: relative; box-shadow: var(--shadow-sm);
}
.string, .stamp-hole { display: none; }
.pill {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  text-decoration: none; color: var(--text); font-size: 0.85rem; font-weight: 600;
}
.pill:hover { border-color: var(--ink); }
.pill.active { background: var(--ink); color: #FFFFFF; border-color: var(--ink); }
.filter-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.meta { font-size: 0.85rem; color: var(--text-muted); margin: 4px 0; }
.muted { color: var(--text-muted); }
.household-badge { font-size: 0.8rem; }
.desc { font-size: 0.95rem; margin: 6px 0; }
.price { font-family: var(--display); font-weight: 600; font-size: 1.3rem; color: var(--text); }
.poster { font-size: 0.75rem; color: var(--text-muted); }
.error { color: var(--rust); }
.stamp {
  position: absolute; top: 14px; left: 14px;
  color: #FFFFFF; background: var(--ink-deep); border-radius: 999px;
  padding: 5px 12px; font-family: var(--body); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em;
}
.photo-wrap { position: relative; }
/* Sideways gestures on the big listing photo belong to the gallery
   (assets/gallery.js); up and down stay with the page. Without this the
   browser can claim a horizontal swipe for its own back-navigation. */
.photo-wrap.large { touch-action: pan-y; }
.photo-wrap img, .photo-wrap picture img { display: block; width: 100%; height: 200px; object-fit: cover; border-radius: var(--radius-sm); background: var(--line-soft); }
.photo-wrap picture { display: block; }
.tag-row { display: flex; justify-content: space-between; align-items: start; gap: 6px; }
.tag-row h3 { margin: 0; font-size: 1.05rem; }
.tag-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; border-top: 1px solid var(--line-soft); padding-top: 8px; }
.tag-actions { display: flex; gap: 8px; margin-top: 8px; }

/* ---- Trades considered: the badge and its note ----------------------------
   A <details>, so it opens with no JavaScript and answers the keyboard by
   itself. It sits above the card's stretched link, or a tap would open the
   listing instead of the note. */
.trade-badge {
  display: inline-block; padding: 4px 11px; border-radius: 999px;
  background: var(--mustard); color: var(--ink-deep);
  font-family: var(--body); font-size: 0.75rem; font-weight: 700;
}
.trade-explainer { position: relative; z-index: 1; display: inline-block; max-width: 100%; }
.trade-explainer > summary { cursor: pointer; list-style: none; user-select: none; }
.trade-explainer > summary::-webkit-details-marker { display: none; }
.trade-explainer > summary:hover,
.trade-explainer[open] > summary { background: var(--ink); color: #FFFFFF; }
.trade-explainer > summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.trade-explainer-hint { margin-left: 5px; opacity: 0.75; font-weight: 700; }
.trade-explainer-body {
  position: absolute; top: calc(100% + 7px); left: 0; z-index: 20;
  width: max-content; max-width: min(19rem, 78vw);
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); box-shadow: var(--shadow-lg);
  font-size: 0.85rem; line-height: 1.5; text-transform: none; text-align: left; color: var(--text-soft);
}
.trade-explainer-body p { margin: 0; }
.trade-explainer-body p + p { margin-top: 8px; }
.trade-explainer-note { padding-top: 8px; border-top: 1px solid var(--line-soft); }
@media (max-width: 560px) {
  .trade-explainer-body { left: auto; right: 0; }
}

/* ---- Forms ---------------------------------------------------------------- */
.login-wrap { max-width: 440px; margin: 0 auto; text-align: center; padding: 64px 20px; }
.login-wrap h1 { color: var(--text); font-family: var(--display); font-size: 2.3rem; margin-bottom: 6px; }
.login-card { display: grid; gap: 12px; text-align: left; margin-top: 16px; }
.login-card.tag { padding: 26px; }
.login-card input { padding: 11px 13px; border: 1px solid #D8D0C2; border-radius: var(--radius-sm); width: 100%; margin-top: 4px; font-family: inherit; font-size: 1rem; }
.listing-form { display: grid; gap: 14px; max-width: 520px; }
.listing-form :is(.barcode-scanner, .product-images, .video-progress)[hidden] { display:none; }
.listing-form label { display: grid; gap: 5px; font-size: 0.9rem; font-weight: 600; }
.listing-form input, .listing-form select, .listing-form textarea {
  padding: 11px 13px; border: 1px solid #D8D0C2; border-radius: var(--radius-sm); font-family: inherit; font-size: 1rem; font-weight: 400;
  background: var(--surface); color: var(--text);
}
.listing-form input:focus, .listing-form select:focus, .listing-form textarea:focus, .login-card input:focus {
  outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(var(--ink-rgb),0.15);
}
.listing-form .row { display: flex; gap: 10px; flex-wrap: wrap; }
.listing-form .row label { flex: 1 1 120px; }
.trade-toggle { grid-template-columns: auto 1fr; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-weight: 500 !important; }
.trade-toggle input { width: auto; margin: 0; }
.ship-fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; background: var(--surface); }
.ship-fieldset legend { padding: 0 6px; font-weight: 600; }
.ship-fieldset .hint { font-size: 0.8rem; color: var(--text-muted); margin: 8px 0 0; }
.ship-fieldset.is-off { opacity: 0.45; }
/* Barcode box and the product match it produces. */
.product-match { display: grid; gap: 6px; }
.product-barcode { align-items: flex-end; }
.product-barcode label { flex: 1 1 220px; }
.product-barcode .btn-toggle { flex: 0 0 auto; margin-bottom: 2px; }
.product-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.product-images label { position: relative; display: block; cursor: pointer; border: 2px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #FFFFFF; }
.product-images label:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 2px rgba(var(--ink-rgb),0.2); }
.product-images input { position: absolute; top: 6px; left: 6px; margin: 0; width: auto; }
.product-images img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; }
.product-images .product-none { display: flex; align-items: center; justify-content: center; min-height: 96px; font-size: 0.8rem; text-align: center; padding: 8px; }
.gallery-thumb { position: relative; }
.gallery-thumb-tag { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(var(--ink-rgb),0.85); color: #FFFFFF; font-size: 0.6rem; font-weight: 700; text-align: center; padding: 2px 0; letter-spacing: 0.02em; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; margin: 0; }
.pickup-note { border: 1.5px dashed var(--rust); border-radius: 6px; padding: 10px 12px; margin-bottom: 18px; }
.hint { font-size: 0.85rem; color: var(--text-muted); }
.legal-accept { display: grid !important; grid-template-columns: auto 1fr; gap: 10px; align-items: start; margin: 12px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-size: 0.9rem; line-height: 1.45; font-weight: 400 !important; }
.legal-accept input { width: auto; margin: 3px 0 0; }
.legal-unpublished { display: block; margin: -6px 0 12px; font-size: 0.8rem; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.feedback-item { display: block; margin-bottom: 14px; padding: 14px 16px; }
.feedback-item p { margin: 0 0 6px; }

@media (pointer: coarse) {
  button, .btn-primary, .btn-secondary, .btn-accent, .btn-buy, .btn-toggle, .btn-danger, .btn-trade,
  .site-header .header-actions a, .mk-account > a {
    min-height: 44px;
  }
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea {
    min-height: 44px;
  }
  .pill { display: inline-flex; align-items: center; min-height: 40px; }
  main { padding-bottom: 92px; }
}

/* ---- Buy / shipping flow -------------------------------------------------- */
.buy-page { max-width: 560px; }
.buy-summary { display: flex; gap: 14px; align-items: center; margin-bottom: 24px; }
.buy-summary img { width: 84px; height: 84px; object-fit: cover; border-radius: var(--radius-sm); }
.fulfillment-choice { display: grid; gap: 14px; }
.choice-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px 20px; border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--surface); cursor: pointer; text-align: left; font-size: 1.1rem; font-weight: 700;
  color: var(--text); font-family: var(--body);
}
.choice-card:hover { border-color: var(--ink); }
.choice-sub { font-size: 0.85rem; color: var(--text-muted); font-weight: 400; }
#pickupForm, #shipSection .listing-form, #shipForm { margin-top: 18px; }
.rate-option {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  margin-bottom: 8px; background: var(--surface); font-size: 0.9rem; cursor: pointer;
}
.rate-option input { margin-right: 8px; }

/* ---- Listing photos (add-item.php) ---------------------------------------- */
.photo-picker { display: grid; gap: 8px; }
.photo-picker img { max-width: 100%; max-height: 240px; border-radius: var(--radius-sm); object-fit: cover; }
.photo-picker-buttons { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.photo-picker-buttons input[type="file"] { flex: 1 1 220px; max-width: 100%; }
.photo-picker-buttons .btn-toggle { width: auto; padding: 9px 16px; white-space: nowrap; }
.photo-picker .hint { margin: 4px 0 0; }
.photo-action svg { display:none; }
.listing-help > summary { display:none; }
.photo-picker-buttons .btn-toggle--scan { border-color: var(--ink); color: var(--ink); }
.photo-picker-buttons .btn-toggle--scan:hover { background: var(--teal-soft); }
.photo-picker-buttons .photo-or { font-size: 0.8rem; color: var(--muted); }
/* Live barcode scanner: the camera fills a card, a lighter band marks where the
   bars should sit, and the status line says what is happening. */
.barcode-scanner { display: grid; gap: 8px; }
.barcode-scanner__view { position: relative; width: 100%; max-height: 320px; aspect-ratio: 4 / 3; border-radius: var(--radius-sm); overflow: hidden; background: #111; }
.barcode-scanner__view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.barcode-scanner__view::after { content: ""; position: absolute; left: 10%; right: 10%; top: 38%; bottom: 38%; border: 2px solid rgba(255,255,255,0.85); border-radius: 6px; box-shadow: 0 0 0 999px rgba(0,0,0,0.35); pointer-events: none; }
.barcode-scanner .btn-toggle { width: auto; padding: 9px 16px; }
@media (max-width: 600px) and (pointer: coarse) {
  .photo-picker-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .photo-picker-buttons #photoInput { grid-column: 1 / -1; width: 100%; min-height: 48px; flex: none; }
  .photo-picker-buttons .btn-toggle { min-height: 48px; padding: 10px 12px; white-space: normal; }
  .photo-picker-buttons .photo-or { display: none; }
  .barcode-scanner .photo-picker-buttons { grid-template-columns: 1fr; }
  html[data-listing-device="ios"] .photo-picker-buttons #scanBarcodeBtn,
  html[data-listing-device="android"] .photo-picker-buttons #scanBarcodeBtn { grid-column: 1 / -1; }
}

/* ---- Walkaround video ----------------------------------------------------- */
.video-picker { display: grid; gap: 6px; margin-top: 14px; }
.video-picker input[type="file"] { max-width: 100%; }
.video-picker p { margin: 0; font-size: 0.9rem; }
.video-progress { height: 6px; border-radius: 3px; overflow: hidden; background: var(--line-soft); }
.video-progress__bar { height: 100%; width: 0; background: var(--ink); transition: width 120ms linear; }
.listing-video { margin: 0; display: grid; gap: 8px; }
.listing-video iframe { width: 100%; aspect-ratio: 16 / 9; max-width: 100%; border: 0; border-radius: var(--radius); background: var(--ink-deep); }
.listing-video figcaption { margin: 0; font-size: 0.85rem; color: var(--text-muted); }
.listing-video--portrait { max-width: 480px; }
.listing-video--portrait .cover__player { aspect-ratio: 3 / 4; }

/*
 * A walkaround plays under a layer of blurred boxes over faces and licence
 * plates (assets/video-cover.js). The layer never takes a click: the player's
 * own controls sit beneath it. backdrop-filter blurs the Stream iframe beneath
 * it; a browser without backdrop-filter gets a solid box instead, since a box
 * that hides nothing is the one outcome not allowed.
 */
.cover { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--ink-deep); }
.cover__player { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
.cover__layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.cover__layer--veiled { background: rgba(10, 30, 32, 0.8); -webkit-backdrop-filter: blur(32px); backdrop-filter: blur(32px); }
.cover__layer--veiled .cover__box { display: none; }
.cover__box { position: absolute; border-radius: 10px; background: rgba(10, 30, 32, 0.25); -webkit-backdrop-filter: blur(24px) saturate(0.6); backdrop-filter: blur(24px) saturate(0.6); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .cover__box, .cover__layer--veiled { background: var(--ink-deep); }
}
.cover__notice { position: absolute; inset: auto 12px 12px; margin: 0; padding: 10px 14px; border-radius: var(--radius); background: var(--ink-deep); color: #fff; font-size: 0.9rem; }
.cover__notice[hidden], .cover__box[hidden] { display: none; }
.cover__fullscreen { position: absolute; top: 10px; left: 10px; padding: 6px 12px; border: 1px solid rgba(255, 255, 255, 0.55); border-radius: 999px; background: rgba(10, 30, 32, 0.7); color: #fff; font: inherit; font-size: 0.85rem; cursor: pointer; }
.cover__fullscreen[hidden] { display: none; }
.cover:fullscreen { display: grid; place-items: center; }
.cover:fullscreen .cover__player { width: 100vw; height: 100vh; aspect-ratio: auto; }
.video-check { padding: 16px 18px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface); }
.video-check p { margin: 0 0 6px; }
.video-check__progress { color: var(--text-muted); font-size: 0.9rem; }

/* ---- Gallery manager (owners, on the listing page) ------------------------ */
.gallery-manager { margin-top: 20px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.gallery-manager h3 { margin: 0 0 12px; font-size: 1.05rem; }
.gallery-upload-form { display: grid; gap: 8px; }
.gallery-upload-form input[type="file"] { max-width: 100%; }
.gallery-upload-form .btn-primary { justify-self: start; }
.gallery-remove-list { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; margin-top: 12px; padding: 6px; }
.gallery-remove-list .gallery-tile { position: relative; aspect-ratio: 1; }
.gallery-remove-list form { position: static; margin: 0; }
.gallery-remove-list img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.gallery-remove, .gallery-cover {
  position: absolute; top: -6px; width: 26px; height: 26px; padding: 0; border-radius: 50%; cursor: pointer; line-height: 24px;
}
.gallery-remove { right: -6px; border: 1px solid var(--rust); background: var(--rust); color: #FFFFFF; font-size: 1.1rem; }
.gallery-cover { left: -6px; border: 1px solid var(--mustard); background: var(--mustard); color: var(--ink-deep); font-size: 0.9rem; }
.gallery-cover:hover { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }

/* ---- My orders ------------------------------------------------------------ */
.order-list { display: grid; gap: 18px; max-width: 760px; margin-top: 20px; }
.order-card { padding: 18px 20px; }
.order-head { display: flex; gap: 14px; align-items: flex-start; }
.order-thumb { width: 68px; height: 68px; object-fit: cover; border-radius: var(--radius-sm); flex: 0 0 auto; }
.order-title { flex: 1 1 auto; min-width: 0; }
.order-title h3 { margin: 0 0 2px; font-size: 1.05rem; }
.order-title .meta { margin: 0 0 6px; }
.order-money { text-align: right; flex: 0 0 auto; display: grid; gap: 2px; }
.order-money .price { font-size: 1.15rem; }
.order-ship-cost { font-size: 0.75rem; color: var(--text-muted); }
.status-badge {
  display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em;
  padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); text-transform: uppercase;
}
.status-badge.ok { background: var(--ink); color: #FFFFFF; border-color: var(--ink); }
.status-badge.warn { background: var(--mustard); color: var(--ink-deep); border-color: var(--mustard); }
.status-badge.bad { background: var(--rust); color: #FFFFFF; border-color: var(--rust); }
.status-badge.muted { background: transparent; color: var(--text-muted); }
.order-details { display: grid; grid-template-columns: 96px 1fr; gap: 4px 12px; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line-soft); font-size: 0.85rem; }
.order-details dt { color: var(--text-muted); }
.order-details dd { margin: 0; word-break: break-word; }
.order-actions { display: flex; gap: 8px; margin-top: 14px; }
.order-actions form { margin: 0; }

/* ---- Trades --------------------------------------------------------------- */
.trade-page { max-width: 880px; }
.trade-target { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.trade-target img { width: 110px; height: 88px; object-fit: cover; border-radius: var(--radius-sm); }
.trade-target h2 { margin: 3px 0 0; font-family: var(--display); }
.trade-form { max-width: 680px; }
.trade-choices { display: grid; gap: 10px; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.trade-choices legend { padding: 0 7px; font-weight: 600; }
.trade-choice { grid-template-columns: auto 64px 1fr !important; align-items: center; gap: 12px !important; padding: 8px; border: 1.5px solid transparent; border-radius: var(--radius-sm); background: var(--ground); cursor: pointer; }
.trade-choice:has(input:checked) { border-color: var(--ink); }
.trade-choice input { width: auto; }
.trade-choice img { width: 64px; height: 52px; object-fit: cover; border-radius: 6px; }
.trade-choice span { display: grid; gap: 2px; }
.trade-choice small { color: var(--text-muted); }
.trade-list { display: grid; gap: 12px; }
.trade-listing { display: grid; grid-template-columns: 72px 1fr auto; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; }
.trade-listing:hover { border-color: var(--ink); }
.trade-listing img { width: 72px; height: 58px; object-fit: cover; border-radius: 8px; }
.trade-listing > span:nth-child(2) { display: grid; gap: 3px; }
.trade-listing small { color: var(--text-muted); }
.trade-summary { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 22px; }
.trade-summary > section { align-self: stretch; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.trade-summary > section > img { width: 100%; height: 190px; object-fit: cover; margin: 8px 0 4px; border-radius: var(--radius-sm); }
.trade-summary h2 { margin: 6px 0 0; font-family: var(--display); font-size: 1.2rem; }
.trade-swap { color: var(--ink); font-size: 1.4rem; }
.trade-offered-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 8px; }
.trade-offered-grid div { display: grid; gap: 5px; font-size: 0.85rem; }
.trade-offered-grid img { width: 100%; height: 90px; object-fit: cover; border-radius: 8px; }
.trade-message { max-width: 640px; margin: 22px 0; padding: 14px 18px; border-left: 4px solid var(--mustard); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--surface); font-style: italic; }
.trade-actions { display: grid; grid-template-columns: auto minmax(250px, 380px); gap: 24px; align-items: start; margin-top: 20px; }
.trade-actions form:first-child { display: flex; gap: 8px; }
.trade-cash-only { font-size: 1.35rem; margin: 6px 0; }
.trade-danger { margin-top: 26px; padding: 16px; border: 1px solid rgba(178,58,36,0.4); border-radius: var(--radius); background: rgba(178,58,36,0.04); }
.trade-danger textarea { width: 100%; box-sizing: border-box; }
.trade-refund-note { font-size: 0.9rem; color: var(--text-muted); }

/* ---- Admin ---------------------------------------------------------------- */
.admin-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.9rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.admin-table th, .admin-table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line-soft); }
.admin-table th { color: #FFFFFF; background: var(--ink); }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: var(--mustard-soft); }
.feature-controls { max-width: 900px; }
.feature-warning { margin-bottom: 24px; padding: 14px 18px; border-left: 4px solid var(--mustard); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--surface); }
.feature-warning p { margin: 4px 0 0; }
.feature-control-card { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.feature-control-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.feature-control-head h2 { margin: 2px 0 0; font-family: var(--display); }
.feature-kicker { color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; font-weight: 700; letter-spacing: 0.06em; }
.feature-state { display: inline-block; min-width: 54px; padding: 5px 11px; border-radius: 999px; text-align: center; font: 700 0.75rem var(--body); text-transform: uppercase; }
.feature-state.on { color: #FFFFFF; background: var(--ink); }
.feature-state.off { color: #FFFFFF; background: var(--text-muted); }
.feature-checks { display: grid; gap: 0; margin: 20px 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.feature-checks > div { display: grid; grid-template-columns: minmax(180px, 0.8fr) 1.2fr; gap: 16px; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }
.feature-checks > div:last-child { border-bottom: 0; }
.feature-checks dt { color: var(--text-muted); }
.feature-checks dd { margin: 0; font-weight: 700; }
.check-ok { color: var(--ink); }
.check-bad { color: var(--rust); }
.feature-change-form { display: grid; gap: 13px; max-width: 540px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.feature-change-form label { display: grid; gap: 5px; }
.feature-change-form input[type="text"] { padding: 10px 12px; border: 1px solid #D8D0C2; border-radius: var(--radius-sm); background: var(--surface); font-family: inherit; }
.feature-ack { grid-template-columns: auto 1fr !important; align-items: start; }
.feature-ack input { margin-top: 3px; }
.feature-section-title { margin-top: 38px; font-family: var(--display); }
.deployment-control-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.deployment-control-grid section { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.deployment-control-grid h3 { margin: 12px 0 5px; }
.deployment-control-grid p { margin: 0; color: var(--text-muted); font-size: 0.85rem; }
.content-controls { max-width: 900px; }
.content-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 26px; }
.content-jump a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: var(--surface); text-decoration: none; font-size: 0.85rem; font-weight: 600; }
.content-jump a:hover { border-color: var(--ink); }
.content-group-list { display: grid; gap: 20px; }
.content-group { scroll-margin-top: 20px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.content-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.content-group-head h2 { margin: 0; font-family: var(--display); }
.content-form { max-width: 720px; }
.content-form label small { color: var(--text-muted); font-size: 0.75rem; }
.content-form button { width: fit-content; }
.content-restore { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.content-restore summary { color: var(--ink); cursor: pointer; font-weight: 600; }
.content-history { margin-top: 38px; }
.content-history article { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); background: var(--surface); }
.content-history article > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.content-history article p { margin: 8px 0 0; overflow-wrap: anywhere; }
.content-history del { color: var(--rust); }
.content-history ins { color: var(--ink); text-decoration: none; }
.legal-editor { max-width: 760px; }
.legal-editor textarea { min-height: 280px; resize: vertical; line-height: 1.5; }
.legal-page { max-width: 820px; }
.legal-document { padding: 32px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }

/* ================================================================== */
/* The marketplace: storefront, listing and brochure pages (mk-)        */
/* ================================================================== */

.mk-wrap { max-width: 1312px; margin: 0 auto; padding: 0 32px; }

/* Top bar and header */
.mk-topbar { background: var(--ink-deep); color: #E9F0EE; font-size: 0.82rem; }
.mk-topbar .mk-wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 8px; padding-bottom: 8px; }
.mk-topbar a { color: #E9F0EE; text-decoration: none; }
.mk-topbar a:hover { text-decoration: underline; }
.mk-topbar nav { display: flex; gap: 24px; }
.mk-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.mk-header .mk-wrap { display: flex; align-items: center; gap: 28px; padding-top: 16px; padding-bottom: 16px; }
.mk-brand-group { flex-shrink:0; }
.mk-mobile-tagline { display:none; }
.mk-brand { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; flex-shrink: 0; }
.mk-brand svg { flex-shrink: 0; }
.mk-brand span { font-family: var(--display); font-size: 1.55rem; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; }
.mk-search { flex-grow: 1; display: flex; align-items: stretch; height: 48px; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--surface); min-width: 0; }
.mk-search select { border: 0; border-right: 1px solid var(--line); background: var(--ground); padding: 0 14px; font-family: inherit; font-size: 0.9rem; color: var(--text); }
.mk-search input { flex-grow: 1; min-width: 0; border: 0; padding: 0 18px; font-family: inherit; font-size: 1rem; color: var(--text); background: transparent; }
.mk-search input:focus { outline: none; }
.mk-search:focus-within { box-shadow: 0 0 0 3px rgba(var(--ink-rgb),0.15); }
.mk-search button { border: 0; background: var(--ink); color: #FFFFFF; padding: 0 22px; font-family: inherit; font-size: 0.95rem; font-weight: 700; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.mk-search button:hover { background: var(--ink-deep); }
.mk-search-toggle { display: none; }
.mk-account { display: flex; align-items: center; gap: 18px; flex-shrink: 0; font-weight: 600; font-size: 0.95rem; }
.mk-account a { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 7px; }
.mk-account a:hover { color: var(--ink); }
.mk-account .btn-secondary, .mk-account .btn-primary { padding: 9px 18px; font-size: 0.9rem; color: var(--ink); }
.mk-account .btn-primary { color: #FFFFFF; }
/*
 * Signed in, the account links are six, not two, and the page never grows past
 * its wrapper, so the search takes a row of its own rather than being squeezed.
 */
.mk-header--member .mk-wrap { flex-wrap: wrap; gap: 12px 20px; }
.mk-header--member .mk-search { order: 3; flex-basis: 100%; }
.mk-header--member .mk-account { margin-left: auto; }
.mk-greeting { color: var(--text-muted); font-weight: 500; }
.mk-catnav { background: var(--surface); border-bottom: 1px solid var(--line); }
.mk-catnav .mk-wrap { display: flex; gap: 26px; overflow-x: auto; scrollbar-width: none; font-size: 0.9rem; font-weight: 500; }
.mk-catnav .mk-wrap::-webkit-scrollbar { display: none; }
.mk-catnav a { color: var(--text); text-decoration: none; padding: 13px 0; border-bottom: 2.5px solid transparent; white-space: nowrap; }
.mk-catnav a:hover { color: var(--ink); }
.mk-catnav a.active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 700; }
.mk-catnav-group { position: relative; display: flex; align-items: center; }
.mk-catnav-sub { display: none; position: absolute; z-index: 5; top: 100%; left: -10px; min-width: 170px; padding: 6px 10px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 20px rgba(20, 35, 33, 0.12); }
.mk-catnav-group:hover .mk-catnav-sub, .mk-catnav-group:focus-within .mk-catnav-sub { display: grid; }
.mk-catnav-sub a { padding: 7px 0; border-bottom: 0; font-size: 0.82rem; }
/* Phone-width category picker; swapped in for .mk-catnav below 600px. */
.mk-catpick { display: none; align-items: center; gap: 10px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.mk-catpick label { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.mk-catpick select { flex: 1; min-width: 0; min-height: 44px; padding: 8px 12px; font-family: inherit; font-size: 1rem; color: var(--text); background: var(--ground); border: 1.5px solid var(--ink); border-radius: 999px; }
/* Not the plain pages' 1000px main: the storefront spans its own wrapper. */
.mk-main { max-width: none; margin: 0; padding: 0 0 88px; }
.mk-flash { margin: 20px 0 0; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--teal-soft); color: var(--ink-deep); font-weight: 500; }
.mk-flash.error { background: rgba(178,58,36,0.08); color: var(--rust); }

/* Hero */
.mk-hero { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px; align-items: center; padding: 56px 0 48px; }
.mk-home-intro { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:24px 0 8px; border-bottom:1px solid var(--line); }
.mk-home-intro h1 { margin:0; font-family:var(--display); font-size:2rem; line-height:1.15; font-weight:600; }
.mk-home-intro p { margin:4px 0 0; color:var(--text-muted); font-size:.88rem; }
.mk-home-how { flex:0 0 auto; color:var(--ink); font-size:.88rem; font-weight:600; text-decoration:none; }
.mk-home-how:hover { text-decoration:underline; text-underline-offset:3px; }
.mk-home-page #justListed { padding-top:24px; }
.mk-mobile-grid-title { display:none; }
.mk-home-page #justListed .mk-grid { grid-template-columns:repeat(5,minmax(0,1fr)); gap:16px; }
.mk-home-page #justListed .mk-card-foot { display:none; }
.mk-hero-copy { display: flex; flex-direction: column; gap: 20px; }
.mk-kicker { align-self: flex-start; background: var(--mustard-soft); color: #6E4A06; font-size: 0.82rem; font-weight: 700; padding: 6px 14px; border-radius: 999px; }
.mk-hero h1 { margin: 0; font-family: var(--display); font-size: clamp(2.4rem, 4.4vw, 4rem); line-height: 1.03; font-weight: 600; letter-spacing: -0.02em; }
.mk-hero p { margin: 0; font-size: 1.15rem; line-height: 1.55; color: var(--text-soft); max-width: 34rem; }
.mk-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.mk-hero-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; height: 440px; }
.mk-hero-photos > * { min-height: 0; }
.mk-hero-photos img, .mk-hero-photos picture { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 20px; background: var(--line-soft); }
.mk-hero-photos .mk-stack { display: grid; grid-template-rows: 1fr 1fr; gap: 14px; min-height: 0; }
.mk-hero-photos a { display: block; min-height: 0; }
/* The About page stacks bare pictures, not links; a grid item would otherwise grow to the photo. */
.mk-hero-photos .mk-stack > * { min-height: 0; }

/* Trust strip */
.mk-trust { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px 28px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; list-style: none; margin: 0; }
.mk-trust li { display: flex; gap: 14px; align-items: flex-start; }
.mk-icon { width: 42px; height: 42px; flex-shrink: 0; border-radius: 12px; background: var(--teal-soft); color: var(--ink); display: flex; align-items: center; justify-content: center; }
.mk-trust strong { display: block; font-size: 1rem; }
.mk-trust span { display: block; font-size: 0.9rem; line-height: 1.45; color: var(--text-muted); }

/* Sections */
.mk-section { padding-top: 64px; display: flex; flex-direction: column; gap: 22px; }
.mk-section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.mk-section-head h2 { margin: 0; font-family: var(--display); font-size: 2.1rem; font-weight: 600; letter-spacing: -0.01em; }
.mk-section-head p { margin: 4px 0 0; color: var(--text-muted); }
.mk-sort { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; }
.mk-sort select { border: 1px solid #D8D0C2; border-radius: var(--radius-sm); padding: 9px 12px; font-family: inherit; font-size: 0.9rem; background: var(--surface); color: var(--text); }
.mk-sort button { padding: 9px 16px; }
.mk-page-title { padding-top: 40px; display: flex; flex-direction: column; gap: 6px; }
.mk-page-title h1 { margin: 0; font-family: var(--display); font-size: 2.6rem; font-weight: 600; letter-spacing: -0.02em; }
.mk-page-title p { margin: 0; color: var(--text-muted); }

/* Category tiles */
.mk-cats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; list-style: none; margin: 0; padding: 0; }
.mk-cats a { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--text); }
.mk-cats img, .mk-cats picture { display: block; width: 100%; aspect-ratio: 5 / 6; height: auto; object-fit: cover; border-radius: var(--radius); background: var(--line-soft); }
.mk-cats a:hover img { opacity: 0.92; }
.mk-cats span { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.mk-cats strong { font-size: 1rem; }
.mk-cats small { font-size: 0.82rem; color: var(--text-muted); }

/* Listing cards */
.mk-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; list-style: none; margin: 0; padding: 0; }
.mk-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: visible; transition: box-shadow 0.15s ease, border-color 0.15s ease; }
.mk-card:hover { border-color: #CFC6B6; box-shadow: var(--shadow-lg); }
.mk-card-photo { position: relative; aspect-ratio: 1 / 1; background: var(--line-soft); border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.mk-card-photo img, .mk-card-photo picture { display: block; width: 100%; height: 100%; object-fit: cover; }
.mk-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 5px; flex-grow: 1; }
.mk-card-price { font-family: var(--display); font-size: 1.45rem; font-weight: 600; line-height: 1.1; }
.mk-card h3 { margin: 0; font-size: 0.97rem; font-weight: 500; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.mk-card-meta { font-size: 0.82rem; color: var(--text-muted); }
.mk-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line-soft); font-size: 0.8rem; color: var(--text-soft); }
.mk-card-foot .mk-delivery { display: inline-flex; align-items: center; gap: 6px; }
/* What a deleted listing's address shows (partials/listing-gone.php). */
.mk-gone { display: flex; flex-direction: column; gap: 14px; max-width: 720px; padding: 56px 0 8px; }
.mk-gone h1 { margin: 0; font-family: var(--display); font-size: clamp(2.2rem, 4vw, 3.2rem); line-height: 1.05; font-weight: 600; letter-spacing: -0.02em; }
.mk-gone p { margin: 0; font-size: 1.1rem; line-height: 1.6; color: var(--text-soft); }
.mk-empty { padding: 40px; text-align: center; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); color: var(--text-muted); }

/* Bands */
.mk-band { margin-top: 72px; background: var(--ink); color: #FFFFFF; border-radius: 24px; padding: 48px 52px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; align-items: center; }
.mk-band h2 { margin: 0; font-family: var(--display); font-size: 2.4rem; line-height: 1.08; font-weight: 600; }
.mk-band p { margin: 0; font-size: 1.05rem; line-height: 1.55; color: #D6E4E2; }
.mk-pair { margin-top: 64px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.mk-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 32px; display: flex; flex-direction: column; gap: 12px; }
.mk-panel h2, .mk-panel h3 { margin: 0; font-family: var(--display); font-size: 1.75rem; font-weight: 600; }
.mk-panel p { margin: 0; line-height: 1.55; color: var(--text-soft); }
.mk-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.mk-chip { display: inline-block; background: var(--sand); color: var(--text); border-radius: 999px; padding: 7px 14px; font-size: 0.85rem; font-weight: 600; text-decoration: none; }
.mk-chip.teal { background: var(--teal-soft); color: var(--ink); }
.mk-chip.pickup { background: transparent; border: 1.5px solid var(--ink); color: var(--ink); }

/* Listing page */
.mk-crumbs { padding-top: 20px; font-size: 0.88rem; color: var(--text-muted); display: flex; gap: 8px; flex-wrap: wrap; }
.mk-crumbs a { text-decoration: none; }
.mk-crumbs a:hover { text-decoration: underline; }
.mk-listing { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 44px; align-items: start; padding-top: 18px; }
/*
 * The photo on top, the thumbnails in one row beneath it that scrolls
 * sideways: a listing with twenty photos is no taller than one with three.
 * Arrows sit on the photo for quick thumbing (and swipe, and the arrow keys).
 */
.mk-gallery { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; min-width: 0; }
.mk-gallery .photo-wrap.large img, .mk-gallery .photo-wrap.large picture img { height: auto; max-height: 680px; aspect-ratio: 3 / 4; border-radius: 20px; object-fit: cover; }
.mk-gallery .gallery-thumbs { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; padding: 2px 2px 8px; scrollbar-width: thin; }
.mk-gallery .gallery-thumbs > * { scroll-snap-align: start; }
.gallery-thumb { width: 76px; height: 92px; padding: 0; overflow: hidden; cursor: pointer; border: 1px solid var(--line); border-radius: 12px; background: var(--line-soft); flex-shrink: 0; }
.gallery-thumb--video { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: var(--ink-deep); border-color: var(--ink-deep); color: #FFFFFF; text-decoration: none; font-size: 0.8rem; font-weight: 600; }
.gallery-thumb--video:hover { background: var(--ink); color: #FFFFFF; }
.gallery-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.88); color: var(--ink-deep); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18); cursor: pointer; }
.gallery-arrow:hover, .gallery-arrow:focus-visible { background: #FFFFFF; }
.gallery-arrow--prev { left: 12px; }
.gallery-arrow--next { right: 12px; }
.gallery-count { position: absolute; right: 12px; bottom: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(22, 48, 47, 0.78); color: #FFFFFF; font-size: 0.8rem; font-weight: 600; pointer-events: none; }
.gallery-thumb.active { border: 2.5px solid var(--ink); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mk-aside { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 16px; }
.mk-aside h1 { margin: 0; font-family: var(--display); font-size: 2.3rem; line-height: 1.1; font-weight: 600; letter-spacing: -0.01em; }
.mk-price { font-family: var(--display); font-size: 2.6rem; font-weight: 600; line-height: 1; }
.mk-buttons { display: flex; flex-direction: column; gap: 10px; }
.mk-buttons .btn-primary, .mk-buttons .btn-trade { padding: 16px 24px; font-size: 1.05rem; border-radius: 14px; width: 100%; }
.mk-note { font-size: 0.85rem; color: var(--text-muted); text-align: center; margin: 0; }
.mk-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.mk-box-row { padding: 16px 18px; display: flex; gap: 14px; }
.mk-box-row + .mk-box-row { border-top: 1px solid var(--line-soft); }
.mk-box-row svg { flex-shrink: 0; margin-top: 1px; }
.mk-box-row strong { display: block; font-size: 0.97rem; }
.mk-box-row span { display: block; font-size: 0.9rem; color: var(--text-muted); line-height: 1.45; }
.mk-seller { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.mk-avatar { width: 50px; height: 50px; flex-shrink: 0; border-radius: 999px; background: var(--ink); color: #FFFFFF; font-family: var(--display); font-size: 1.35rem; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.mk-seller div { flex-grow: 1; min-width: 0; }
.mk-seller small { display: block; font-size: 0.8rem; color: var(--text-muted); }
.mk-seller strong { display: block; font-size: 1rem; }
.mk-checks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; font-size: 0.9rem; color: var(--text-soft); }
.mk-checks li { display: flex; gap: 10px; align-items: flex-start; }
.mk-checks svg { flex-shrink: 0; margin-top: 2px; }
.mk-sold-note { margin: 0; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--sand); font-weight: 600; }
.share-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.share-label { font-size: 0.9rem; font-weight: 700; margin-right: 2px; }
.share-btn { font-size: 0.85rem; font-weight: 600; padding: 8px 14px; border-radius: 999px; border: 0; background: var(--sand); color: var(--text); text-decoration: none; cursor: pointer; font-family: var(--body); }
.share-btn:hover { background: var(--teal-soft); color: var(--ink); }
.mk-owner { border: 1.5px dashed #CFC6B6; border-radius: var(--radius); background: var(--surface); padding: 16px 18px; }
.mk-owner summary { cursor: pointer; font-weight: 700; }
.mk-owner-body { display: grid; gap: 10px; margin-top: 14px; }
.mk-owner-body form { margin: 0; }
.mk-owner-body .btn-toggle { width: 100%; }
.mk-owner-cost { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.mk-owner-cost label { display: grid; gap: 4px; font-size: 0.85rem; font-weight: 600; flex: 1 1 140px; }
.mk-owner-cost input { padding: 9px 11px; border: 1px solid #D8D0C2; border-radius: var(--radius-sm); font-family: inherit; }
.mk-owner-cost .btn-toggle { width: auto; flex: 0 0 auto; }
.mk-owner .btn-delete { background: var(--rust); color: #FFFFFF; border-color: var(--rust); }
.mk-detail { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 44px; padding-top: 52px; align-items: start; }
.mk-detail h2 { margin: 0 0 14px; font-family: var(--display); font-size: 1.75rem; font-weight: 600; }
.mk-detail p.mk-desc { margin: 0; font-size: 1.05rem; line-height: 1.65; color: #2E3B3A; white-space: pre-line; }
.mk-facts { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.mk-facts div { display: flex; justify-content: space-between; gap: 16px; padding: 13px 18px; border-bottom: 1px solid var(--line-soft); }
.mk-facts div:last-child { border-bottom: 0; }
.mk-facts dt { color: var(--text-muted); }
.mk-facts dd { margin: 0; font-weight: 600; text-align: right; }
.mk-video { padding-top: 44px; }
.mk-video h2 { margin: 0 0 14px; font-family: var(--display); font-size: 1.75rem; font-weight: 600; }

/* Brochure pages */
.mk-intro { padding: 64px 0 32px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.mk-intro h1 { margin: 0; font-family: var(--display); font-size: clamp(2.3rem, 4.2vw, 3.7rem); line-height: 1.05; font-weight: 600; letter-spacing: -0.02em; }
.mk-intro p { margin: 0; font-size: 1.15rem; line-height: 1.55; color: var(--text-soft); max-width: 44rem; }
.mk-jump { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.mk-eyebrow { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #8A5A08; }
.mk-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; list-style: none; margin: 0; padding: 0; counter-reset: step; }
.mk-steps.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mk-steps li { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.mk-steps li::before { counter-increment: step; content: counter(step); width: 40px; height: 40px; border-radius: 999px; background: var(--ink); color: #FFFFFF; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.mk-steps strong { font-size: 1.1rem; }
.mk-steps span { font-size: 0.95rem; line-height: 1.55; color: var(--text-soft); }
.mk-promises { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; list-style: none; margin: 0; padding: 0; }
.mk-promises li { background: var(--ground); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.mk-promises b { font-family: var(--display); font-size: 1.9rem; font-weight: 600; color: var(--ink); }
.mk-promises strong { font-size: 1.08rem; }
.mk-promises span { font-size: 0.95rem; line-height: 1.55; color: var(--text-soft); }
.mk-card-block { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 48px; display: flex; flex-direction: column; gap: 28px; }
.mk-card-block > header { display: flex; flex-direction: column; gap: 10px; max-width: 48rem; }
.mk-card-block h2 { margin: 0; font-family: var(--display); font-size: 2.3rem; line-height: 1.1; font-weight: 600; }
.mk-card-block p { margin: 0; font-size: 1.05rem; line-height: 1.6; color: var(--text-soft); }
.mk-about { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; align-items: center; padding: 64px 0 56px; }
.mk-about h1 { margin: 0; font-family: var(--display); font-size: clamp(2.3rem, 4.2vw, 3.6rem); line-height: 1.05; font-weight: 600; letter-spacing: -0.02em; }
.mk-about-copy { display: flex; flex-direction: column; gap: 18px; }
.mk-about-copy p { margin: 0; font-size: 1.1rem; line-height: 1.6; color: var(--text-soft); white-space: pre-line; }
.mk-safety { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 32px; list-style: none; margin: 0; padding: 0; }
.mk-safety li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; }
.mk-safety-icon { width: 28px; height: 28px; display: grid; place-items: center; color: var(--ink); }
.mk-safety-icon svg { display: block; }
.mk-safety strong { display: block; }
.mk-safety span { display: block; font-size: 0.95rem; line-height: 1.5; color: var(--text-soft); }
.mk-safety-icon span { color: var(--ink); }
.mk-safety-more { margin-top: 12px; }
.mk-safety-more > summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; font-weight: 600; }
.mk-safety-more__close, .mk-safety-more[open] .mk-safety-more__open { display: none; }
.mk-safety-more[open] .mk-safety-more__close { display: inline; }
.mk-safety-more > ul { margin-top: 12px; }
.mk-callout { margin-top: 72px; background: var(--mustard-soft); border-radius: 24px; padding: 40px 48px; display: flex; justify-content: space-between; align-items: center; gap: 32px; flex-wrap: wrap; }
.mk-callout h2 { margin: 0; font-family: var(--display); font-size: 2rem; font-weight: 600; }
.mk-callout p { margin: 4px 0 0; color: #4A3A12; }
.mk-band .mk-callout-dark p { color: #D6E4E2; }

/* Footer, on every page */
.site-footer { margin-top: 0; background: var(--ink-deep); color: #D6E4E2; font-size: 0.9rem; }
.site-footer .mk-wrap { padding-top: 48px; padding-bottom: 28px; display: flex; flex-direction: column; gap: 32px; }
.site-footer a { color: #D6E4E2; text-decoration: none; }
.site-footer a:hover { color: #FFFFFF; text-decoration: underline; }
.mk-footer-cols { display: grid; grid-template-columns: 1.6fr repeat(4, minmax(0, 1fr)); gap: 28px; }
.mk-footer-cols > div { display: flex; flex-direction: column; gap: 9px; }
.mk-footer-cols strong { color: #FFFFFF; font-size: 0.95rem; }
.mk-footer-brand { font-family: var(--display); font-size: 1.45rem; font-weight: 600; color: #FFFFFF; }
.mk-footer-base { border-top: 1px solid #2E4B4A; padding-top: 18px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 0.8rem; }
/* The while-we-are-building notice. Readable, not shouting. */
.site-notice { margin: 0; color: #F0D48A; }
.site-version { opacity: 0.7; }
.mobile-app-nav { display:none; }
.mobile-app-more { position:relative; min-width:0; }
.mobile-app-more > summary { list-style:none; cursor:pointer; }
.mobile-app-more > summary::-webkit-details-marker { display:none; }
.mobile-app-more__menu { position:absolute; right:4px; bottom:calc(100% + 9px); display:grid; min-width:190px; padding:7px; border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--surface); box-shadow:var(--shadow-lg); }
.mobile-app-more__menu a { display:flex; align-items:center; min-height:44px; padding:8px 12px; border-radius:var(--radius-sm); color:var(--text); text-decoration:none; font-size:.84rem; }
.mobile-app-more__menu a:hover, .mobile-app-more__menu a:focus-visible { background:var(--teal-soft); color:var(--ink); }
.mobile-app-nav__item { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; min-width:0; min-height:48px; padding:4px 2px; border:0; border-radius:var(--radius-sm); background:transparent; color:var(--text-muted); text-decoration:none; font:inherit; font-size:.63rem; line-height:1.1; white-space:nowrap; }
.mobile-app-nav__item svg { flex:0 0 auto; }
.mobile-app-nav__item[aria-current="page"], .mobile-app-more[open] > .mobile-app-nav__item { background:var(--teal-soft); color:var(--ink); }
.mobile-app-nav__item:active { background:var(--teal-soft); }
.product-barcode-manual > summary { display:flex; align-items:center; min-height:44px; width:fit-content; color:var(--ink); cursor:pointer; font-size:.82rem; text-decoration:underline; }
.product-barcode-manual[open] > summary { margin-bottom:8px; }
.display-control { position:fixed; right:14px; bottom:calc(14px + env(safe-area-inset-bottom)); z-index:1000; font-family:var(--body); }
.display-control > summary { list-style:none; }
.display-control > summary::-webkit-details-marker { display:none; }
.display-control__toggle { display:grid; place-items:center; width:46px; height:46px; border:1px solid var(--line); border-radius:50%; background:var(--mustard-soft); color:var(--ink); box-shadow:var(--shadow-lg); cursor:pointer; font-size:.9rem; font-weight:700; }
.display-control__panel { position:absolute; right:0; bottom:54px; display:flex; align-items:center; gap:5px; padding:7px; border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--surface); box-shadow:var(--shadow-lg); }
.display-control__panel button { min-width:40px; height:40px; padding:0 8px; border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--surface); color:var(--text); cursor:pointer; font:inherit; font-size:1rem; }
.display-control__panel button:last-child { font-size:.78rem; }
.display-control__panel button:disabled { opacity:.45; cursor:default; }
.display-control__panel output { min-width:48px; text-align:center; color:var(--text); font-size:.8rem; font-variant-numeric:tabular-nums; }
.display-control button:focus-visible, .display-control summary:focus-visible { outline:2px solid var(--ink); outline-offset:2px; }
@media print { .display-control { display:none !important; } }

@media (max-width: 760px) {
  body:has(.mobile-app-nav) { padding-bottom:calc(72px + env(safe-area-inset-bottom)); }
  .mobile-app-nav { position:fixed; inset:auto 0 0; z-index:950; display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); align-items:center; gap:2px; padding:5px 8px calc(5px + env(safe-area-inset-bottom)); border-top:1px solid var(--line); background:rgba(255,255,255,.94); -webkit-backdrop-filter:blur(18px); backdrop-filter:blur(18px); }
  .mobile-app-nav--shopper { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .mk-account { display:none; }
  .mk-header .mk-wrap { gap:8px; padding-top:8px; padding-bottom:8px; }
  .mk-brand-group { flex:1; min-width:0; }
  .mk-brand span { font-size:clamp(1rem, 4.6vw, 1.25rem); white-space:normal; }
  .mk-search-ready .mk-search-toggle { display:inline-flex; align-items:center; justify-content:center; flex:0 0 44px; width:44px; height:44px; padding:0; border:1px solid var(--line); border-radius:50%; background:var(--surface); color:var(--ink); cursor:pointer; }
  .mk-search-ready .mk-search:not(.is-open) { display:none; }
  .display-control { bottom:calc(78px + env(safe-area-inset-bottom)); }
}
@media (max-width: 760px) and (pointer: coarse) {
  .mobile-app-nav__item { min-height:50px; }
}
html[data-platform-family="apple"] .mobile-app-nav { background:rgba(255,255,255,.82); -webkit-backdrop-filter:saturate(180%) blur(20px); backdrop-filter:saturate(180%) blur(20px); }
html[data-platform-family="android"] .mobile-app-nav { background:rgba(255,255,255,.96); box-shadow:0 -2px 10px rgba(22,48,47,.08); }

@media (max-width: 1100px) {
  .mk-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mk-home-page #justListed .mk-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mk-cats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mk-trust { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mk-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mk-footer-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mk-account .mk-greeting { display: none; }
}
@media (max-width: 860px) {
  .mk-wrap { padding: 0 16px; }
  .mk-topbar nav { display: none; }
  .mk-header .mk-wrap { flex-wrap: wrap; gap: 12px 16px; }
  .mk-search { order: 3; flex-basis: 100%; height: 46px; }
  .mk-search select { display: none; }
  .mk-account { margin-left: auto; gap: 12px; font-size: 0.9rem; }
  .mk-hero, .mk-about { grid-template-columns: 1fr; gap: 28px; padding-top: 32px; }
  .mk-hero-photos { height: 300px; }
  .mk-listing, .mk-detail { grid-template-columns: 1fr; gap: 28px; }
  .mk-aside { position: static; }
  .gallery-thumb { width: 64px; height: 78px; }
  .gallery-arrow { width: 40px; height: 40px; }
  .mk-band, .mk-pair { grid-template-columns: 1fr; padding: 32px 24px; }
  .mk-pair { padding: 0; }
  .mk-promises, .mk-safety { grid-template-columns: 1fr; }
  .mk-card-block { padding: 28px 22px; }
  .mk-callout { padding: 28px 24px; }
  .mk-home-page #justListed .mk-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .mk-topbar { display:none; }
  .mk-catnav { display: none; }
  .mk-catpick { display:flex; padding:4px 16px; }
  .mk-catpick select { min-height:40px; padding:4px 10px; }
  .mk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .mk-home-page #justListed .mk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap:12px; }
  .mk-home-intro { display:block; padding:0; border:0; }
  .mk-home-intro p { display:none; }
  .mk-mobile-tagline { display:block; margin:2px 0 0; font-size:.75rem; line-height:1.3; font-weight:400; color:var(--text-muted); }
  .mk-home-intro h1 { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
  .mk-home-how { display:none; }
  .mk-desktop-grid-title { display:none; }
  .mk-mobile-grid-title { display:inline; }
  .mk-home-page #justListed { padding-top:8px; gap:8px; }
  .mk-home-page #justListed .mk-section-head { flex-wrap:nowrap; align-items:center; gap:8px; }
  .mk-home-page #justListed .mk-section-head h2 { font-size:1rem; font-weight:500; }
  .mk-home-page #justListed .mk-sort { flex:1; min-width:0; gap:8px; }
  .mk-home-page #justListed .mk-sort label { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .mk-home-page #justListed .mk-sort select { flex:1; min-width:0; width:0; min-height:40px; padding:4px 8px; font-size:1rem; }
  .mk-home-page #justListed .mk-sort button { min-height:40px; padding:4px; border:0; border-radius:0; background:transparent; box-shadow:none; font-size:.85rem; font-weight:400; }
  .mk-home-page #justListed .mk-sort button:hover { color:var(--ink-deep); text-decoration:underline; }
  .mk-home-page #justListed .mk-mobile-toolbar > div,
  .mk-home-page #justListed .mk-mobile-toolbar .mk-catpick label { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
  .mk-home-page #justListed .mk-mobile-toolbar .mk-catpick { flex:1; min-width:0; padding:0; border:0; background:transparent; gap:4px; }
  .mk-home-page #justListed .mk-mobile-toolbar .mk-catpick select { width:0; }
  .mk-home-page #justListed .mk-card-body { padding:8px 10px; gap:4px; }
  .mk-home-page #justListed .mk-card-meta { font-size:.75rem; line-height:1.35; }
  .mk-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .mk-card-body { padding: 10px 12px 12px; }
  .mk-card-price { font-size: 1.2rem; }
  .mk-card h3 { font-size: 0.88rem; }
  .mk-card-foot { display: none; }
  .mk-trust { grid-template-columns: 1fr; padding: 18px; }
  .mk-steps, .mk-steps.three { grid-template-columns: 1fr; }
  .mk-footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mk-brand span { font-size: 1.25rem; }
  .mk-account .btn-secondary { display: none; }
  .mk-section-head h2 { font-size: 1.7rem; }
  .mk-page-title h1 { font-size: 2rem; }
  .mk-aside h1 { font-size: 1.8rem; }
  .mk-price { font-size: 2.1rem; }
}

@media (max-width: 560px) {
  main { padding: 24px 16px 48px; }
  .site-header { padding: 14px 16px; }
  .legal-document { padding: 20px; }
  .admin-table { display: block; overflow-x: auto; white-space: nowrap; }
  .trade-listing { grid-template-columns: 58px 1fr; }
  .trade-listing img { width: 58px; height: 52px; }
  .trade-listing .status-badge { grid-column: 2; justify-self: start; }
  .trade-summary { grid-template-columns: 1fr; }
  .trade-swap { justify-self: center; }
  .trade-summary > section > img { height: 210px; }
  .trade-actions { grid-template-columns: 1fr; }
  .feature-control-card { padding: 18px; }
  .feature-checks > div { grid-template-columns: 1fr; gap: 2px; }
  .deployment-control-grid { grid-template-columns: 1fr; }
  .content-group { padding: 17px; }
  .content-group-head { align-items: flex-start; flex-direction: column; }
  .gallery-remove-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .order-head { flex-wrap: wrap; }
  .order-money { text-align: left; }
  .order-details { grid-template-columns: 1fr; gap: 2px; }
  .order-details dt { margin-top: 6px; }
}

@media (max-width: 600px) {
  :is(.compact-admin-page, .listing-editor-page) .site-header { padding:6px 16px; gap:6px 10px; position:relative; }
  :is(.compact-admin-page, .listing-editor-page) .site-header h1 { flex:1; min-width:0; font-size:1.1rem; line-height:1.25; }
  :is(.compact-admin-page, .listing-editor-page) main { padding-top:12px; }
  .listing-editor-page .site-header a { display:inline-flex; align-items:center; min-height:40px; font-size:.8rem; }
  .listing-editor-page .listing-form { gap:10px; }
  .listing-editor-page .listing-form :is(input:not([type="checkbox"]):not([type="hidden"]), select, textarea) { min-width:0; max-width:100%; padding:8px 10px; font-size:1rem; }
  .listing-editor-page .listing-form :is(input:not([type="checkbox"]):not([type="hidden"]), select) { min-height:44px; }
  .listing-editor-page .listing-form .row label { min-width:0; }
  .listing-editor-page .photo-picker { gap:6px; }
  .listing-editor-page .photo-picker-buttons { display:grid; grid-template-columns:minmax(0, 1fr) 44px 44px; gap:6px; }
  .listing-editor-page .photo-picker-buttons input#photoInput { grid-column:auto; width:100%; }
  .listing-editor-page .photo-picker-buttons button#scanBarcodeBtn { grid-column:auto; }
  .listing-editor-page .photo-picker-buttons .btn-toggle { width:100%; min-height:44px; padding:8px 10px; white-space:normal; }
  .listing-editor-page .photo-picker-buttons .photo-action { display:inline-flex; align-items:center; justify-content:center; width:44px; height:44px; padding:0; }
  .listing-editor-page .photo-action svg { display:block; }
  .listing-editor-page .photo-action span { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
  .listing-editor-page .photo-or { display:none; }
  .listing-editor-page .barcode-scanner .photo-picker-buttons { grid-template-columns:1fr; }
  .listing-editor-page .barcode-scanner .photo-picker-buttons input[type="file"] { width:100%; }
  .listing-editor-page .listing-help > summary { display:flex; align-items:center; min-height:40px; color:var(--ink); font-size:.85rem; cursor:pointer; }
  .listing-editor-page .listing-help > summary::before { content:'+'; margin-right:8px; }
  .listing-editor-page .listing-help[open] > summary::before { content:'-'; }
  .listing-editor-page #analyzeStatus:empty, .listing-editor-page #productStatus:empty,
  .listing-editor-page [data-video-status]:empty { display:none; }
  .listing-editor-page .video-picker { margin-top:0; gap:4px; }
  .listing-editor-page .video-picker p { font-size:.85rem; }
  .compact-admin-page .site-header .header-actions { gap:0; }
  .compact-admin-page .admin-header-back { display:inline-flex; align-items:center; justify-content:center; width:40px; min-height:40px; font-size:0; margin-left:0 !important; }
  .compact-admin-page .admin-header-back::before { content:'\2190'; font-size:1.3rem; }
  .admin-header-menu > summary { display:flex; align-items:center; justify-content:center; min-height:40px; padding:4px 12px; border:1px solid var(--line); border-radius:var(--radius-sm); font-size:.85rem; cursor:pointer; list-style:none; }
  .admin-header-menu > summary::-webkit-details-marker { display:none; }
  .admin-header-menu nav { position:absolute; top:100%; right:16px; z-index:1000; display:flex; flex-direction:column; width:min(280px, calc(100vw - 32px)); max-height:60vh; overflow-y:auto; padding:8px; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius-sm); box-shadow:var(--shadow-lg); }
  .admin-header-menu nav a { display:flex; align-items:center; min-height:44px; padding:8px 10px; margin-left:0 !important; font-size:.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  .video-progress__bar { transition: none; }
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---- My home (home inventory) ------------------------------------------- */
.home-page { display: flex; flex-direction: column; gap: 20px; padding-bottom: 40px; }
.home-page--narrow { max-width: 720px; }
.home-title { padding-top: 28px; }
.home-title h1 { font-size: 2.2rem; }
.home-title .mk-eyebrow a { color: inherit; text-decoration: none; }
.home-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); }
.home-summary > div { display: flex; flex-direction: column; gap: 2px; }
.home-summary span { font-size: 0.78rem; color: var(--text-muted); }
.home-summary strong { font-size: 1.4rem; font-family: var(--display); font-weight: 600; }
.home-replace { color: var(--ink); }
.home-missing { grid-column: 1 / -1; margin: 0; padding-top: 8px; border-top: 1px solid var(--line-soft); font-size: 0.85rem; color: var(--rust); }
.home-actions { display: flex; gap: 8px; }
.home-actions .btn-primary { flex-grow: 1; }
.btn-primary.btn-accent { background: var(--mustard); border-color: var(--mustard); color: var(--ink-deep); }
.btn-primary.btn-accent:hover { background: var(--mustard-hover); border-color: var(--mustard-hover); color: var(--ink-deep); }
.home-section-head h2 { font-size: 1.2rem; }
.home-section-head p { font-size: 0.85rem; display: flex; gap: 14px; flex-wrap: wrap; }
.home-section-head p a { color: var(--ink); }
.home-rooms, .home-entries { display: flex; flex-direction: column; gap: 10px; }
.home-room-list, .home-entry-list { display: flex; flex-direction: column; gap: 8px; }
.home-room, .home-entry-card { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-height: 64px; color: var(--text); text-decoration: none; }
.home-room:hover, .home-entry-card:hover { border-color: var(--ink); }
.home-room-initial, .home-entry-photo { width: 48px; height: 48px; flex-shrink: 0; border-radius: 10px; background: var(--teal-soft); color: var(--ink); display: flex; align-items: center; justify-content: center; font-weight: 700; overflow: hidden; }
.home-entry-photo img { width: 100%; height: 100%; object-fit: cover; }
.home-room-body, .home-entry-body { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.home-room-body strong, .home-entry-body strong { font-size: 0.98rem; }
.home-room-body small, .home-entry-body small { font-size: 0.8rem; color: var(--text-muted); }
.home-entry-body .mk-chip { align-self: flex-start; padding: 3px 10px; font-size: 0.75rem; margin-top: 2px; }
.home-room-value, .home-entry-value { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.home-room-value strong, .home-entry-value strong { color: var(--ink); }
.home-room-value small, .home-entry-value small { font-size: 0.75rem; color: var(--text-muted); }
.home-form { max-width: none; gap: 14px; }
.home-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; }
.home-card h2 { margin: 0; font-size: 0.95rem; font-weight: 700; }
.home-form .row > label { flex: 1 1 160px; }
.home-ai-note { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 8px 10px; background: var(--mustard-soft); border-radius: 8px; color: var(--text-soft); }
.home-ai-note svg { flex-shrink: 0; margin-top: 2px; }
.home-photo-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.home-photo-preview { display: flex; flex-direction: column; gap: 4px; font-size: 0.72rem; font-weight: 500; color: var(--text-muted); cursor: pointer; }
.home-photo-preview img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--teal-soft); }
.home-photo-preview input { margin: 0; }
.home-submit { min-height: 50px; font-size: 1.05rem; }
.home-entry-top { display: flex; justify-content: space-between; align-items: center; padding-top: 20px; }
.home-back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); text-decoration: none; font-weight: 600; }
.home-edit { font-weight: 700; color: var(--ink); }
.home-gallery { position: relative; background: var(--teal-soft); border-radius: var(--radius); overflow: hidden; min-height: 220px; }
.home-gallery-slide { margin: 0; position: relative; }
.home-gallery-slide img { display: block; width: 100%; max-height: 520px; object-fit: contain; background: var(--teal-soft); }
.home-gallery-slide figcaption { position: absolute; left: 12px; bottom: 12px; background: rgba(255,255,255,0.92); border-radius: 999px; padding: 4px 10px; font-size: 0.78rem; font-weight: 600; color: var(--ink); }
.home-gallery-remove { position: absolute; top: 10px; right: 10px; margin: 0; }
.home-gallery-remove .icon-btn { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,0.92); border: 0; font-size: 1.2rem; cursor: pointer; color: var(--rust); }
.home-gallery .gallery-arrow { position: absolute; top: 50%; transform: translateY(-50%); }
.home-gallery .gallery-arrow--prev { left: 10px; }
.home-gallery .gallery-arrow--next { right: 10px; }
.home-gallery-empty { min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--ink); font-size: 0.85rem; }
.home-add-photos { margin: -8px 0 0; }
.home-add-photos label { cursor: pointer; }
.home-entry-head h1 { margin: 0; font-size: 1.6rem; font-family: var(--display); font-weight: 600; line-height: 1.2; }
.home-entry-head p { margin: 4px 0 0; font-size: 0.88rem; color: var(--text-soft); }
.home-money { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.home-money > div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.home-money span { font-size: 0.75rem; color: var(--text-muted); }
.home-money strong { font-size: 1.25rem; font-family: var(--display); font-weight: 600; }
.home-money small { font-size: 0.75rem; color: var(--text-muted); }
.home-facts dd { overflow-wrap: anywhere; }
.home-receipts { gap: 10px; }
.home-receipt { display: flex; align-items: center; gap: 12px; }
.home-receipt form { margin: 0; }
.home-receipt-icon { width: 44px; height: 52px; border-radius: 6px; background: var(--sand); color: var(--text-muted); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.home-receipt-body { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.home-receipt-body small { font-size: 0.78rem; color: var(--text-muted); overflow-wrap: anywhere; }
.home-receipt > a { font-weight: 700; color: var(--ink); padding: 8px; }
.home-receipt .icon-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--rust); cursor: pointer; font-size: 1.1rem; }
.home-receipt-add { margin: 0; }
.home-receipt-pick { display: flex; flex-direction: column; gap: 2px; padding: 12px; border: 1.5px dashed var(--ink); border-radius: 10px; color: var(--ink); font-weight: 700; cursor: pointer; }
.home-receipt-pick small { font-weight: 400; color: var(--text-muted); font-size: 0.78rem; }
.home-leave { display: flex; flex-direction: column; gap: 10px; padding-top: 6px; }
.home-leave .btn-primary { min-height: 46px; }
.home-leave .hint { margin: 0; text-align: center; }
.home-leave .row { display: flex; gap: 8px; }

/* Room videos (home-room-video.php) */
.home-video-newroom { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin: 4px 0 0; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.home-video-newroom label { flex: 1 1 220px; }
.home-video-tips { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 0.88rem; color: var(--text-soft); }
.home-video-progress { display: grid; gap: 8px; }
.home-video-consent { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; background: var(--mustard-soft); border-radius: var(--radius-sm); font-size: 0.88rem; color: var(--text-soft); cursor: pointer; }
.home-video-consent input { width: 20px; height: 20px; margin: 2px 0 0; flex-shrink: 0; }
.home-receipt-pick[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.home-video-recorder { display: grid; gap: 10px; }
.home-video-live { display: grid; gap: 10px; }
.home-video-live video { display: block; width: 100%; max-height: 60vh; object-fit: contain; border-radius: var(--radius-sm); background: var(--ink-deep); }
.home-video-live.is-recording video { outline: 4px solid var(--rust); outline-offset: -4px; }
.home-video-rec-actions { display: flex; gap: 8px; }
.home-video-rec-actions .btn-primary { flex-grow: 1; }
.home-video-live.is-recording [data-home-video-rec] { background: var(--rust); border-color: var(--rust); }
.home-video-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--ink-deep); }
.home-video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.home-video-step { display: flex; justify-content: space-between; gap: 12px; margin: 0; font-size: 0.9rem; }
.home-video-step strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.home-video-player video { display: block; width: 100%; max-height: 70vh; border-radius: var(--radius); background: var(--ink-deep); }
.home-video-player-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 10px 0 0; }
.home-video-player-actions .hint { margin: 0; }
.home-video-found { gap: 12px; }
.home-video-item { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.home-video-thumb { display: block; width: 100%; align-self: start; border: 0; padding: 0; border-radius: 10px; background-color: var(--teal-soft); background-repeat: no-repeat; cursor: pointer; }
.home-video-thumb:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.home-video-fields { display: grid; gap: 8px; min-width: 0; }
.home-video-fields .row { display: flex; gap: 8px; flex-wrap: wrap; }
.home-video-fields .row > label { flex: 1 1 120px; }
.home-video-fields .hint { margin: 0; }
.home-video-add { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); }
.home-video-add input { width: 20px; height: 20px; margin: 0; }
.home-video-dismiss { justify-self: start; background: none; border: 0; padding: 4px 0; color: var(--text-muted); font-size: 0.85rem; text-decoration: underline; cursor: pointer; }
.home-video-done, .home-video-delete { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.home-video-done summary, .home-video-delete summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.home-video-done ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.home-video-delete form { display: grid; gap: 8px; margin-top: 8px; justify-items: start; }
.home-video-delete .hint { margin: 0; }
@media (max-width: 520px) {
  .home-video-item { grid-template-columns: minmax(0, 1fr); }
  .home-video-thumb { max-width: 260px; }
}
.home-leave .row form { flex-grow: 1; margin: 0; display: flex; }
.home-leave .row .btn-secondary { flex-grow: 1; min-height: 44px; }
.home-delete { margin: 12px 0 0; text-align: center; }
.home-delete-btn { background: none; border: 0; color: var(--text-muted); font: inherit; font-size: 0.82rem; text-decoration: underline; cursor: pointer; }
@media (max-width: 600px) {
  .home-summary { padding: 14px; }
  .home-summary strong { font-size: 1.15rem; }
  .home-title h1 { font-size: 1.8rem; }
}

/* ---- No zoom on tapping a field (touch screens) ---------------------------
   iPhone Safari zooms the whole page in when a text field, dropdown or text
   area under 16px gets focus, and leaves it zoomed. The admin pages had 13px
   fields (role, category, cost, the report filters), so after one tap the
   header's Menu button sat past the right edge until the page was dragged
   back (owner, 2026-11-14). 16px is the size Safari leaves alone; !important
   because several admin forms size their fields inline or with narrower
   selectors. Last in the file so nothing later undoes it. */
@media (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="hidden"]),
  select,
  textarea { font-size: max(16px, 1em) !important; }
}
