/* ============================================================
   Gallery public CSS — shared across all gallery views.
   Views: home (folder grid), folder (image grid), image (viewer),
          favorites, paywall.
   ============================================================ */

/* ---------- fonts — declared via views/partials/_font-face.php ---------- */

/* ---------- variables ---------- */
:root {
  --gold:    #d5a63a;
  --gold-dk: #b88c2f;
  --text:    #2b2b2b;
  --muted:   #666;
  --border:  #e6e6e6;
  --bg:      #f9f9f9;
  --white:   #ffffff;
  --radius:  8px;
  --logo-h:  28px;
  --page-margin: 20px;
  --thumb-gap:   8px;
  --thumb-min:   330px;
  --thumb-max:   440px;
  --section-spacing: 2em;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
html { overscroll-behavior: none; }
body {
  font-family: 'Avenir LT Std', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  background: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   HEADER — shared base styles
   gallery-view-home: logo centered
   gallery-view-folder / gallery-view-image / gallery-view-favorites: logo left
   ============================================================ */
.gallery-header {
  position: relative;
  padding: 24px var(--page-margin) 32px;
  padding-top: calc(24px + env(safe-area-inset-top, 0px));
  padding-left: calc(var(--page-margin) + env(safe-area-inset-left, 0px));
  padding-right: calc(var(--page-margin) + env(safe-area-inset-right, 0px));
}
.gallery-header .logo-link {
  display: inline-block;
  color: inherit;
  text-decoration: none;
}
.gallery-header .logo {
  max-height: var(--logo-h);
  height: auto;
  width: auto;
  display: inline-block;
}
.gallery-header .logo-placeholder {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.02em;
  color: var(--text);
}

/* Breadcrumb trail — sits under the header. An open gallery's root crumb
   points at the true unscoped view (?all=1); a roster gallery's root
   crumb never offers that (see partials/_breadcrumb.php's docblock). */
.gallery-breadcrumb {
  padding: 0 var(--page-margin) 16px;
  padding-left: calc(var(--page-margin) + env(safe-area-inset-left, 0px));
  padding-right: calc(var(--page-margin) + env(safe-area-inset-right, 0px));
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
body.gallery-view-home .gallery-breadcrumb { justify-content: center; }
.gallery-breadcrumb .crumb-link { color: var(--muted); text-decoration: none; }
.gallery-breadcrumb .crumb-link:hover { color: var(--gold-dk); text-decoration: underline; }
.gallery-breadcrumb .crumb-current { color: var(--text); font-weight: 600; }
.gallery-breadcrumb .crumb-sep { color: var(--border); }

/* Home view: centered logo */
body.gallery-view-home .gallery-header { text-align: center; }
/* Folder / image / favorites: logo left */
body.gallery-view-folder .gallery-header,
body.gallery-view-favorites .gallery-header { text-align: left; }

/* On mobile/tablet: small centered logo up top, then the gallery-switcher's
   links (normally a click-to-reveal dropdown) shown directly underneath as a
   plain, always-visible list, then the rest of the icons (favorites, share,
   cart, account) as one toolbar row — same grouping checkout.php gets for free.
   .header-icons stays a single flex-wrap row (not `display: contents`) so
   the icons don't get dissolved into one-per-line; only .gallery-nav-block
   is forced to flex-basis:100% so the switcher wraps onto its own line
   above them, via `order` below, without touching the PHP markup.
   920px (not 640): .header-icons is absolutely positioned over the header on
   desktop, so on mid-width viewports (phone landscape, iPads) a wide wordmark
   logo + long folder title overlapped — stack instead of overlay there too. */
@media (max-width: 920px) {
  body.gallery-view-folder .gallery-header,
  body.gallery-view-image .gallery-header,
  body.gallery-view-favorites .gallery-header,
  body.gallery-view-person .gallery-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: calc(env(safe-area-inset-top, 0px) + 12px);
    padding-bottom: 12px;
  }
  /* Keep header-icons as ONE toolbar row (same as checkout) instead of
     dissolving it into individually-stacked icons — only the gallery-switcher
     (when present) breaks onto its own full-width line above the icon row,
     via flex-wrap + order below, so it doesn't crowd out the other icons. */
  body.gallery-view-folder .gallery-header .header-icons,
  body.gallery-view-image .gallery-header .header-icons,
  body.gallery-view-favorites .gallery-header .header-icons,
  body.gallery-view-person .gallery-header .header-icons {
    position: static;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    margin-bottom: 8px;
  }
  body.gallery-view-folder .gallery-header .logo-link,
  body.gallery-view-image .gallery-header .logo-link,
  body.gallery-view-favorites .gallery-header .logo-link,
  body.gallery-view-person .gallery-header .logo-link {
    order: -2;
  }
  body.gallery-view-folder .gallery-header .logo,
  body.gallery-view-image .gallery-header .logo,
  body.gallery-view-favorites .gallery-header .logo,
  body.gallery-view-person .gallery-header .logo {
    max-height: 18px;
    /* Wide wordmark logos would otherwise stay tiny in height but stretch
       across the screen at this aspect ratio — cap width too so "small"
       holds regardless of the logo's shape. */
    max-width: 140px;
    width: auto;
  }
  body.gallery-view-folder .gallery-header .logo-placeholder,
  body.gallery-view-image .gallery-header .logo-placeholder,
  body.gallery-view-favorites .gallery-header .logo-placeholder,
  body.gallery-view-person .gallery-header .logo-placeholder {
    font-size: 15px;
  }
  body.gallery-view-home .gallery-header .gallery-nav-block,
  body.gallery-view-folder .gallery-header .gallery-nav-block,
  body.gallery-view-image .gallery-header .gallery-nav-block,
  body.gallery-view-favorites .gallery-header .gallery-nav-block,
  body.gallery-view-person .gallery-header .gallery-nav-block {
    order: -1;
    width: 100%;
    justify-content: center;
    margin: 8px 0 4px;
  }
  /* The click-to-reveal trigger button is redundant once the links are
     always shown — hide it and force the link list open and inline. */
  body.gallery-view-home .gallery-header .gallery-trigger,
  body.gallery-view-folder .gallery-header .gallery-trigger,
  body.gallery-view-image .gallery-header .gallery-trigger,
  body.gallery-view-favorites .gallery-header .gallery-trigger,
  body.gallery-view-person .gallery-header .gallery-trigger {
    display: none;
  }
  body.gallery-view-home .gallery-header .gallery-dropdown,
  body.gallery-view-folder .gallery-header .gallery-dropdown,
  body.gallery-view-image .gallery-header .gallery-dropdown,
  body.gallery-view-favorites .gallery-header .gallery-dropdown,
  body.gallery-view-person .gallery-header .gallery-dropdown {
    display: flex !important;
    position: static;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px 16px;
    width: 100%;
    min-width: 0;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
  }
  body.gallery-view-home .gallery-header .gallery-dropdown-item,
  body.gallery-view-folder .gallery-header .gallery-dropdown-item,
  body.gallery-view-image .gallery-header .gallery-dropdown-item,
  body.gallery-view-favorites .gallery-header .gallery-dropdown-item,
  body.gallery-view-person .gallery-header .gallery-dropdown-item {
    /* !important: outranks .header-icons button:not(#account-panel *):not(...)
       whose :not(#account-panel *) clause carries ID-level specificity and
       would otherwise squeeze these to the 16px icon-button size */
    width: auto !important;
    height: auto !important;
    min-width: 0;
    padding: 4px 0;
    justify-content: center;
  }
  body.gallery-view-home .gallery-header .gallery-dropdown-item .label,
  body.gallery-view-folder .gallery-header .gallery-dropdown-item .label,
  body.gallery-view-image .gallery-header .gallery-dropdown-item .label,
  body.gallery-view-favorites .gallery-header .gallery-dropdown-item .label,
  body.gallery-view-person .gallery-header .gallery-dropdown-item .label {
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
  }
}

/* ---------- header icon group ---------- */
.header-icons {
  position: absolute;
  top: calc(15px + env(safe-area-inset-top, 0px));
  right: calc(var(--page-margin) + env(safe-area-inset-right, 0px));
  display: flex;
  align-items: center;
  gap: 18px;
}
.header-icons a:not(#account-panel *),
.header-icons button:not(#account-panel *):not(.gallery-trigger):not(.gallery-dropdown-item) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}
.header-icons a:not(#account-panel *):hover,
.header-icons button:not(#account-panel *):hover { color: var(--muted); }
.header-icons svg { width: 16px; height: 16px; display: block; }
.header-icons .header-icon-wrap { position: relative; display: inline-flex; }
.header-icons .gallery-trigger { width: auto; height: auto; }
/* Selections count sits on the heart, like the cart badge: chosen count gold, total grey */
.header-icons .sel-count-badge {
  position: absolute;
  top: -7px;
  left: 100%;
  transform: translateX(-6px);
  height: 13px;
  padding: 0 3px;
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.header-icons .sel-count-badge[aria-hidden="true"] { display: none; }
.header-icons .sel-count-badge #person-sel-count { color: var(--gold); }
.header-icons .sel-count-badge .sel-count-max { color: var(--muted); }
.header-icons .sel-count-badge.is-over { border-color: #e03; }
.header-icons .gallery-trigger:hover { color: var(--gold); }

/* Favorites icon — gold when active */
/* Nothing chosen yet: the heart is greyed out and not clickable (no link to an empty page) */
.header-icons .header-icon-wrap-favorites:not(.has-favorites):not(.has-picks) > a,
.viewer-nav-icons .nav-icon-wrap-favorites:not(.has-favorites):not(.has-picks) > a { pointer-events: none; cursor: default; opacity: .3; }
.header-icons .header-icon-wrap-favorites.has-favorites > a,
.header-icons .header-icon-wrap-favorites.has-picks > a { color: var(--gold); }
.header-icons .header-icon-wrap-favorites.has-favorites > a svg,
.header-icons .header-icon-wrap-favorites.has-picks > a svg {
  fill: var(--gold);
  stroke: var(--gold);
}

/* Cart badge */
.header-icons .header-icon-wrap-cart .nav-icon-badge {
  position: absolute;
  top: -5px;
  left: 0;
  right: auto;
  transform: translateX(-50%);
  min-width: 12px;
  height: 12px;
  padding: 0 3px;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--gold);
  color: #fff;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 400;
  line-height: 1;
  pointer-events: none;
}
.header-icons .header-icon-wrap-cart .nav-icon-badge.is-visible { display: inline-flex; }

/* ---------- ratio toggle pill ---------- */
.ratio-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--muted);
  border-radius: 999px;
  margin-right: 4px;
}
.ratio-pill .ratio-btn {
  color: #fff;
  opacity: 0.6;
  width: 16px;
  height: 16px;
  padding: 0;
}
.ratio-pill .ratio-btn.ratio-active { opacity: 1; }
.ratio-pill .ratio-btn:hover { opacity: 0.9; }
body.thumb-ratio-4-5 .thumb-card { aspect-ratio: 4/5; }

/* ---------- ID search popup (folder view header) ---------- */
.header-search-trigger-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.header-search-trigger-wrap .header-search-trigger {
  width: 16px; height: 16px; padding: 0; border: 0; background: none;
  color: inherit; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center;
}
.header-search-trigger-wrap .header-search-trigger:hover { color: var(--muted); }
.header-search-trigger-wrap .header-search-popup {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 10px;
  padding: 10px;
  min-width: 220px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 100;
}
.header-search-trigger-wrap.is-open .header-search-popup { display: block; }
.header-search-popup input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: #fff;
}
.header-search-popup input::placeholder { color: var(--muted); }
.header-search-popup input:focus { outline: none; border-color: var(--gold); }
.thumb-card.is-hidden-by-search { display: none !important; }

/* ---------- gallery folder/section dropdown (folder + image views) ---------- */
.gallery-nav-block {
  position: relative;
  overflow: visible;
  display: flex;
  align-items: center;
}
.gallery-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  line-height: 1;
  color: var(--text);
  cursor: pointer;
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  width: auto;
  height: auto;
}
.gallery-trigger:hover { color: var(--gold); }
.gallery-trigger .arrow { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; line-height: 1; transition: transform .2s ease; }
.gallery-trigger .arrow svg { width: 11px; height: 11px; display: block; }
.gallery-trigger .gallery-name { white-space: nowrap; }

/* Person name spans — no colour distinction, inherits text colour */
.gallery-dropdown-item .name-sn,
.gallery-dropdown-item .name-fn,
.thumb-info h3 .name-sn,
.thumb-info h3 .name-fn { color: inherit; }
.gallery-nav-block.is-open .gallery-trigger .arrow { transform: rotate(90deg); }
.gallery-dropdown {
  display: none;
  position: absolute;
  right: 0;
  left: auto;
  top: 100%;
  margin: 12px 0 0;
  min-width: 280px;
  max-width: calc(100vw - 16px);
  max-height: 360px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 100;
}
.gallery-nav-block.is-open .gallery-dropdown { display: block; }
.gallery-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border: 0;
  width: 100%;
  min-width: 100%;
  background: none;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.45;
  -webkit-appearance: none;
  appearance: none;
}
.gallery-dropdown-item:hover { background: rgba(0,0,0,.04); }
.gallery-dropdown-item.is-current { color: var(--gold); font-weight: 700; }
.gallery-dropdown-item .label {
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
  text-transform: uppercase;
}
.gallery-dropdown-item .count {
  flex-shrink: 0;
  color: var(--muted);
  font-weight: 400;
  font-size: 13px;
  text-transform: uppercase;
}
/* A one-class child's row: name, then their class (or a siblings set's names) quieter beneath */
.gallery-dropdown-item:has(.label-wrap) { padding: 6px 0; }
.gallery-dropdown-item .label-wrap { flex: 1 1 0%; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.gallery-dropdown-item .label-wrap .label { flex: none; }
.gallery-dropdown-item .sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .04em;
  color: var(--muted);
}
.gallery-dropdown-item.is-current .sub { color: var(--muted); }
/* Person-switcher: grouped by person */
.xgal-person-group + .xgal-person-group {
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding-top: 2px;
}
.xgal-person-hdr {
  padding: 10px 0 2px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--gold);
  line-height: 1;
  user-select: none;
}
.xgal-person-group:first-child .xgal-person-hdr { padding-top: 2px; }
.xgal-person-group .gallery-dropdown-item { padding: 6px 0 6px 8px; font-size: 12px; }
.xgal-person-group .gallery-dropdown-item::before {
  content: '>';
  color: var(--gold);
  font-weight: 700;
  margin-right: 7px;
  flex-shrink: 0;
}

/* ============================================================
   MAIN content area
   ============================================================ */
.gallery-main {
  flex: 1;
  width: 100%;
  padding: 20px var(--page-margin) 32px;
  margin: 0;
}
/* Home view: centered/constrained content */
body.gallery-view-home .gallery-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 0 32px;
}

/* ---------- group / gallery-name header (line / LABEL / line) ---------- */
.group-header,
.gallery-name-header {
  display: flex;
  align-items: center;
  margin: var(--section-spacing) 0 var(--section-spacing);
  gap: 1em;
  width: 100%;
}
.group-header .line,
.gallery-name-header .line {
  flex: 1;
  min-width: 0;
  height: 1px;
  background: var(--border);
}
/* When a group tag is present, align lines to the name row, not the full label */
.gallery-name-header:has(.section-group-tag) {
  align-items: flex-start;
}
.gallery-name-header:has(.section-group-tag) .line {
  margin-top: 0.65em;
}
.group-header .label,
.gallery-name-header .label {
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text);
  white-space: nowrap;
}
.group-header .label i {
  font-style: normal;
  font-weight: 400;
  color: var(--muted);
}
.group-bullet {
  color: var(--gold);
  margin-right: 0.3em;
}
.group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--gold);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  vertical-align: middle;
  margin-left: 0.45em;
}

/* Filename-grouped section headers inside thumb-grid */
.thumb-grid .thumb-grid-span {
  grid-column: 1 / -1;
}

/* ---------- thumbnail grid ---------- */
.thumb-grid {
  display: grid;
  gap: var(--thumb-gap);
  margin-bottom: var(--section-spacing);
  width: 100%;
  touch-action: pan-y;
}

/* ---------- HOME view: folder card ---------- */
.thumb-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  box-sizing: border-box;
  cursor: pointer;
}
.thumb-card:link,
.thumb-card:visited { text-decoration: none; color: inherit; }
.thumb-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: opacity .2s;
}
.thumb-card:hover .thumb-bg,
.thumb-card.is-hover .thumb-bg { opacity: 0.2; }
.thumb-bg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-border { position: absolute; inset: 0; pointer-events: none; }

/* Home view card info (name + date below image) */
.thumb-spacer { flex: 1; min-height: 0; }
.thumb-info {
  position: relative;
  z-index: 1;
  margin: 0 27px 20px 27px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 13px 14px 15px;
  background: rgba(255,255,255,.8);
  color: var(--text);
  text-align: center;
}
body.gallery-view-home .thumb-card { display: flex; flex-direction: column; }
.thumb-grid--albums .thumb-card   { display: flex; flex-direction: column; }
.thumb-info h3 {
  margin: 0;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text);
}
.thumb-info h4 {
  margin: 4px 0 0;
  font-weight: 400;
  font-size: 12px;
  line-height: 1.3;
  color: var(--muted);
}
.thumb-info h5 {
  margin: 2px 0 0;
  font-weight: 400;
  font-size: 11px;
  color: var(--muted);
}
body.gallery-view-home .thumb-card:hover .thumb-info { background: rgba(255,255,255,.8); }

/* ---------- FOLDER view: hover overlay ---------- */
.thumb-favorite-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 5;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.thumb-card.is-favorited .thumb-favorite-badge { display: flex; }
.thumb-card.is-favorited:hover .thumb-favorite-badge { display: none; }
.thumb-favorite-badge svg { width: 14px; height: 14px; fill: var(--gold); stroke: var(--gold); transform: translateY(1px); }

.thumb-shortlist-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.thumb-card:hover .thumb-shortlist-badge { display: none; }
.thumb-shortlist-badge svg { width: 14px; height: 14px; fill: var(--gold); }

.thumb-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s;
}
.thumb-card:hover .thumb-overlay,
.thumb-card.is-hover .thumb-overlay { opacity: 1; }
.thumb-overlay-center {
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--section-spacing);
}
.thumb-overlay-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
}
.thumb-overlay-circle svg { width: 28px; height: 28px; color: #fff; }
.thumb-overlay-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold);
}
.thumb-overlay-bottom {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 10px;
  pointer-events: auto;
}
.thumb-overlay-bottom a,
.thumb-overlay-bottom button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}
.thumb-overlay-bottom a:hover,
.thumb-overlay-bottom button:hover { color: var(--gold); }
.thumb-overlay-bottom svg { width: 20px; height: 20px; display: block; }
.thumb-overlay-bottom button[data-tooltip="Favourite"] svg { width: 22px; height: 22px; }
.thumb-overlay-bottom button[data-tooltip="Favourite"].is-favorite svg { fill: var(--gold); stroke: var(--gold); }

/* ── Tooltip on overlay buttons ── */
.thumb-overlay-bottom [data-tooltip] {
  position: relative;
}
.thumb-overlay-bottom [data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.75);
  color: #fff;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .04em;
  white-space: nowrap;
  padding: 3px 7px;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s ease;
}
.thumb-overlay-bottom [data-tooltip]:hover::after {
  opacity: 1;
}

/* Yearbook badge (school portrait) */
.thumb-yearbook-badge {
  position: absolute;
  bottom: 12px; right: 12px;
  z-index: 5;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.thumb-yearbook-badge svg { width: 22px; height: 22px; color: var(--text); }

/* ============================================================
   IMAGE VIEWER (gallery-view-image)
   ============================================================ */
body.gallery-view-image {
  overflow: hidden;
  height: 100vh;
}

/* Top bar */
.viewer-nav {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 20px var(--page-margin);
  background: #fff;
  overflow: visible;
}
.viewer-nav-icons {
  display: flex;
  align-items: center;
  gap: 32px;
  overflow: visible;
}
.viewer-nav-icons .gallery-nav-block { margin: 0; }
.viewer-nav-icons a,
.viewer-nav-icons button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  padding: 0; border: 0; background: none;
  color: var(--text); cursor: pointer; text-decoration: none;
}
.viewer-nav-icons .gallery-trigger { width: auto; height: auto; }
.viewer-nav-icons a:hover,
.viewer-nav-icons button:hover { color: var(--muted); }
.viewer-nav-icons .gallery-trigger:hover { color: var(--gold); }
.viewer-nav-icons svg { width: 16px; height: 16px; display: block; }
.viewer-nav-icons .nav-icon-wrap { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.viewer-nav-icons .nav-icon-wrap > a { display: inline-flex; }
.viewer-nav-icons .nav-icon-badge {
  position: absolute;
  bottom: -2px; right: -2px;
  min-width: 12px; height: 12px;
  padding: 0 3px;
  display: none;
  align-items: center; justify-content: center;
  background: var(--gold);
  color: #fff;
  border-radius: 50%;
  font-size: 9px; font-weight: 400; line-height: 1;
  pointer-events: none;
}
.viewer-nav-icons .nav-icon-badge.is-visible { display: inline-flex; }
.viewer-nav-icons .nav-icon-wrap-favorites.has-favorites > a,
.viewer-nav-icons .nav-icon-wrap-favorites.has-picks > a { color: var(--gold); }
.viewer-nav-icons .nav-icon-wrap-favorites.has-favorites > a svg,
.viewer-nav-icons .nav-icon-wrap-favorites.has-picks > a svg { fill: var(--gold); stroke: var(--gold); }
.viewer-nav-icons .nav-icon-wrap-cart .nav-icon-badge { top: -5px; bottom: auto; left: 0; right: auto; transform: translateX(-50%); }
.viewer-nav-position { font-size: 13px; color: var(--muted); flex-shrink: 0; margin-left: 16px; }
.viewer-nav-position .num { color: #444; }

/* Commerce body */
body.purchase-open .viewer-nav,
body.gallery-view-image.purchase-open .gallery-header,
body.purchase-open .commerce-bottom { display: none; }
.commerce-body {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}
body.purchase-open .commerce-body { flex: 1; margin: 15px 0; min-height: 0; }

/* Purchase panel */
.purchase-panel { width: 0; flex-shrink: 0; overflow: hidden; display: flex; flex-direction: column; transition: width .25s ease; }
.commerce-body.purchase-open .purchase-panel { width: 50%; min-width: 0; flex: 1; overflow: hidden; display: flex; }
.purchase-panel-inner { width: 100%; min-width: 0; flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.purchase-panel-header {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px;
  cursor: pointer;
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em;
  color: var(--text); width: 100%; text-align: left;
  border: 0; border-top: 2px dashed var(--border); border-bottom: 2px dashed var(--border);
  background: transparent;
}
.purchase-panel-header .caret { display: inline-block; width: 1em; flex-shrink: 0; transition: transform .2s ease; }
.purchase-panel.collapsed .purchase-panel-header .caret { transform: rotate(-90deg); }
.purchase-panel.collapsed .purchase-panel-content { display: none; }
.purchase-panel-content { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px 12px calc(16px + 1em + 8px); }
.purchase-section-label { font-size: 11px; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.purchase-option-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 2px dashed var(--border);
  font-size: 15px; color: var(--text);
}
.purchase-option-row:last-child { border-bottom: 0; }
.purchase-option-row .label-wrap { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; text-align: left; }
.purchase-option-row .info-icon { color: var(--muted); cursor: help; }
.purchase-option-row .right-group { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.purchase-option-row .base-price { min-width: 56px; text-align: right; color: var(--text); }
.purchase-option-row .controls-wrap { display: flex; align-items: center; gap: 0; }
.purchase-option-row .qty-btn,
.purchase-option-row .qty-input,
.purchase-option-row .digital-cb { width: 38px; height: 38px; margin: 0; padding: 0; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; }
.purchase-option-row .qty-btn,
.purchase-option-row .qty-input { border: 1px solid var(--border); background: #fff; appearance: none; -webkit-appearance: none; }
.purchase-option-row .qty-btn { color: var(--text); cursor: pointer; font-size: 20px; line-height: 1; }
.purchase-option-row .qty-minus { border-left: none; border-right: none; }
.purchase-option-row .qty-plus { margin-left: -1px; }
.purchase-option-row .qty-btn:hover { color: var(--gold); border-color: var(--gold); }
.purchase-option-row .qty-input { text-align: center; font-size: 15px; padding: 0; }
.purchase-option-row .qty-input::-webkit-inner-spin-button,
.purchase-option-row .qty-input::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.purchase-option-row .qty-input[type=number] { -moz-appearance: textfield; }
.purchase-option-row .digital-cb { cursor: pointer; border: 1px solid var(--border); background: #fff; appearance: none; -webkit-appearance: none; }
.purchase-option-row .digital-cb:checked {
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath stroke='%23d5a63a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' fill='none' d='M2 8l4 4 8-10'/%3E%3C/svg%3E");
  background-size: 50%; background-repeat: no-repeat; background-position: center;
}
.purchase-option-row .line-total-wrap { min-width: 56px; text-align: left; color: var(--muted); font-weight: normal; }
.purchase-panel-footer {
  flex-shrink: 0; padding: 14px 16px;
  border-top: 1px solid var(--border);
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center;
}
.purchase-panel-footer .save-default { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; color: var(--muted); grid-column: 1; grid-row: 1; }
.purchase-panel-footer .total-wrap { margin: 0; font-size: 15px; color: var(--text); grid-column: 2; grid-row: 1; text-align: center; }
.purchase-panel-footer .total-wrap .amount { font-weight: 700; color: var(--gold); }
.purchase-panel-footer .footer-actions { display: contents; }
.purchase-panel-footer .footer-actions .btn:first-child { grid-column: 1; grid-row: 2; }
.purchase-panel-footer .footer-actions .btn:last-child { grid-column: 2; grid-row: 2; justify-self: end; }
.purchase-panel-footer .btn { padding: 8px 16px; border: 1px solid var(--border); background: #fff; font: inherit; font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; color: var(--text); cursor: pointer; }
.purchase-panel-footer .btn:hover { border-color: var(--gold); color: var(--gold); }
.purchase-panel-footer .btn-primary { background: var(--gold); border-color: var(--gold); color: #fff; }
.purchase-panel-footer .btn-primary:hover { background: var(--gold-dk); border-color: var(--gold-dk); }
.purchase-panel-footer .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* Commerce main */
.commerce-main { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.commerce-main-image-area { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 var(--page-margin) 0; overflow: hidden; position: relative; touch-action: pan-y; }
.commerce-body.purchase-open .commerce-main { flex: 1; }
.commerce-body.purchase-open .commerce-main-image-area { padding: 0; }
body.purchase-open .image-nav-arrow { display: none; }
.image-nav-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 10;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  padding: 0; border: 1px solid var(--border); border-radius: 50%;
  background: rgba(255,255,255,.9); color: var(--text); cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
}
.image-nav-arrow:hover { border-color: var(--gold); color: var(--gold); background: #fff; }
.image-nav-arrow:disabled { opacity: 0.35; cursor: not-allowed; }
.image-nav-arrow svg { width: 24px; height: 24px; }
.image-nav-arrow.prev { left: calc(var(--page-margin) + 2px + env(safe-area-inset-left, 0px)); }
.image-nav-arrow.next { right: calc(var(--page-margin) + 2px + env(safe-area-inset-right, 0px)); }
.commerce-image-wrap {
  position: relative; width: 100%; height: 100%;
  max-width: 100%; max-height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
}
.commerce-image-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center; display: block; transition: opacity .5s ease; }
.commerce-image-wrap .viewer-img-next { opacity: 0; z-index: 1; pointer-events: none; }
.commerce-image-wrap.is-crossfade .viewer-img-next { opacity: 1; }
.commerce-image-wrap.is-crossfade img:first-of-type { opacity: 0; }

/* Commerce bottom */
.commerce-bottom {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: center;
  padding: 18px var(--page-margin) max(18px, env(safe-area-inset-bottom, 18px));
  gap: 4px;
}
.commerce-filename-tray { display: flex; flex-direction: column; align-items: center; width: fit-content; max-width: 100%; }
.commerce-actions-tray { display: flex; flex-direction: column; align-items: center; width: fit-content; max-width: 100%; }
.commerce-filename { font-size: 15px; font-weight: 400; color: var(--muted); text-transform: uppercase; letter-spacing: 0.02em; }
.commerce-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 24px 32px; }
.commerce-actions a,
.commerce-actions button {
  display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0;
  background: none; font: inherit; font-size: 12px; font-weight: 700;
  letter-spacing: 0.02em; color: var(--text); cursor: pointer;
  text-decoration: none; text-transform: uppercase;
}
.commerce-actions a:hover,
.commerce-actions button:hover { color: var(--gold); }
.commerce-actions svg { width: 18px; height: 18px; flex-shrink: 0; }
#strip-favorites-link.in-favorites,
#strip-favorites-link.in-favorites:hover { color: var(--gold); }
#strip-favorites-link.in-favorites svg { fill: var(--gold); stroke: var(--gold); }

/* Action dropdown */
.action-dropdown-wrap { position: relative; display: inline-flex; isolation: isolate; }
.action-dropdown-wrap .action-dropdown {
  display: none;
  flex-direction: column;
  position: absolute;
  left: 50%; transform: translateX(-50%);
  bottom: 100%; margin-bottom: 6px;
  min-width: 160px; padding: 6px 0;
  background: #fff; border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 10000;
  white-space: nowrap;
}
.action-dropdown-wrap.is-open .action-dropdown { display: flex; }
.action-dropdown-wrap.dropdown-below .action-dropdown { bottom: auto; top: 100%; margin-bottom: 0; margin-top: 6px; }
.action-dropdown-item {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 16px;
  border: 0; background: none; font: inherit; font-size: 12px; font-weight: 700;
  letter-spacing: 0.02em; text-transform: uppercase; color: var(--text);
  cursor: pointer; text-align: left; box-sizing: border-box; white-space: nowrap;
  flex-shrink: 0;
}
.action-dropdown-item:hover { background: rgba(0,0,0,.05); color: var(--gold); }
/* The download sizes sat flush left — the icon-button reset was winning on padding. */
.action-dropdown-wrap .action-dropdown .action-dropdown-item { padding: 9px 22px 9px 20px !important; }
/* Header/viewer icon buttons are 16px squares; menu items inside them are full-width rows. */
.header-icons .action-dropdown .action-dropdown-item,
.viewer-nav-icons .action-dropdown .action-dropdown-item { width: 100% !important; height: auto !important; justify-content: flex-start !important; }

/* Proofing + yearbook pills */
.yearbook-pill { display: none; align-items: center; }
body.gallery-yearbook .yearbook-pill { display: inline-flex; }
.proofing-pill { display: inline-flex; align-items: center; }
.proofing-pill .proofing-pill-btn {
  display: inline-grid; grid-template-columns: 1fr auto; align-items: stretch;
  gap: 0; padding: 0; border: 0; background: none;
  font-size: 10px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase;
  color: var(--text); cursor: pointer;
}
.proofing-pill-left {
  display: flex; align-items: center; padding: 4px 6px;
  background: #e2e2e2;
  border: 1px solid #c5c5c5; border-right: none;
}
.proofing-pill .proofing-pill-btn:hover .proofing-pill-left,
.proofing-pill .proofing-pill-btn.is-selected .proofing-pill-left {
  color: #fff; background: var(--gold); border-color: var(--gold); border-right-color: transparent;
}
.proofing-count-pill {
  display: flex; align-items: center; justify-content: center;
  padding: 4px 6px; margin-left: -1px; box-sizing: border-box;
  min-width: 3em;
  background: #fff; border: 1px solid #c5c5c5; border-left: none;
  font-size: 10px; line-height: 1;
}
.proofing-pill .proofing-pill-btn:hover .proofing-count-pill,
.proofing-pill .proofing-pill-btn.is-selected .proofing-count-pill {
  border-color: var(--gold);
}
.proofing-count-pill .num { font-weight: 700; color: var(--text); }
.proofing-count-pill .proofing-count-sep { margin: 0 0.15em; color: var(--muted); font-weight: 400; }
/* When no selection limit is set, hide the separator and max */
.proofing-pill-btn.is-unlimited .proofing-count-sep,
.proofing-pill-btn.is-unlimited #proofing-max { display: none; }
.yearbook-pill-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none;
  font: inherit; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase;
  color: var(--text); cursor: pointer;
}
.yearbook-pill-btn:hover { color: var(--gold); }
.yearbook-pill-btn.is-flagged { color: var(--gold); }
.yearbook-pill-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Fullscreen */
body.is-fullscreen .viewer-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 20; background: rgba(255,255,255,.85); opacity: 1; pointer-events: auto; transition: opacity .35s ease; padding-top: env(safe-area-inset-top, 0px); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
body.is-fullscreen.fullscreen-footer-idle .viewer-nav { opacity: 0; pointer-events: none; }
body.is-fullscreen .purchase-panel { display: none; }
body.is-fullscreen .commerce-body { position: fixed; inset: 0; width: 100%; height: 100%; display: flex; flex-direction: column; background: #111; }
body.is-fullscreen .commerce-main { flex: 1 1 0; min-height: 0; min-width: 0; width: 100%; position: relative; display: flex; flex-direction: column; }
body.is-fullscreen .commerce-main-image-area { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 0; }
body.is-fullscreen .commerce-image-wrap { max-height: 100%; max-width: 100%; height: 100%; width: 100%; display: flex; align-items: center; justify-content: center; }
body.is-fullscreen .commerce-image-wrap img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
body.is-fullscreen .commerce-bottom { position: absolute; bottom: 0; left: 0; right: 0; z-index: 15; padding: 0 var(--page-margin) 0; display: flex; flex-direction: column; align-items: center; gap: 8px; opacity: 1; pointer-events: auto; transition: opacity .35s ease; }
body.is-fullscreen.fullscreen-footer-idle .commerce-bottom { opacity: 0; pointer-events: none; }
body.is-fullscreen .commerce-filename-tray { width: fit-content; max-width: 100%; background: rgba(255,255,255,.92); border-radius: 6px; padding: 12px 20px; box-sizing: border-box; text-align: center; }
body.is-fullscreen .commerce-actions-tray { width: fit-content; max-width: 100%; background: rgba(255,255,255,.92); border-radius: 16px 16px 0 0; padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px)); box-sizing: border-box; }

/* ============================================================
   FAVORITES VIEW
   ============================================================ */
.favorites-section,
.final-selection,
.yearbook-section { width: 100%; }

/* Section headers now use the shared group-header style */
.fav-section-header,
.favorites-section-header {
  cursor: pointer; user-select: none;
}
.fav-section-header:hover .group-bullet,
.favorites-section-header:hover .group-bullet { color: var(--gold-dk, #b8892a); }
.fav-section-header:hover .favorites-section-label,
.fav-section-header:hover .final-selection-label,
.fav-section-header:hover .shortlist-section-label,
.fav-section-header:hover .yearbook-section-label { color: var(--gold); }

/* Select + Survey buttons inside the Favorites section header */
.fav-select-actions {
  display: inline-flex; gap: 6px; align-items: center; margin-left: 12px;
}
.fav-hdr-btn {
  font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 20px; border: 1px solid var(--border, #e4e5e8);
  background: var(--bg-card, #fff); color: var(--muted, #888); cursor: pointer;
  line-height: 1.5; transition: color .15s, border-color .15s, background .15s;
  white-space: nowrap;
}
.fav-hdr-btn:hover:not(:disabled) { color: var(--text); border-color: var(--text); }
.fav-hdr-btn.active               { background: var(--gold, #c8a97a); color: #fff; border-color: var(--gold, #c8a97a); }
.fav-hdr-btn:disabled             { opacity: .38; cursor: default; }

/* Favorites: selection circles always visible and directly clickable */
.fav-circle {
  display: block !important; /* override the body.select-mode gate */
  pointer-events: auto !important;
  cursor: pointer;
  z-index: 10;
}
.fav-circle:hover { background: rgba(0,0,0,0.45); }

/* Dim unselected favorites when something is chosen — disabled per UX preference */
/* body.fav-has-selection #favorites-thumb-grid .thumb-card:not(.is-selected) { opacity: 0.5; } */

.favorites-section-label,
.final-selection-label,
.yearbook-section-label,
.shortlist-section-label {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text); white-space: nowrap; transition: color .2s;
}

/* Section headers carry no bullet or count — title and lines only */
.group-bullet, .group-count { display: none; }

.favorites-content,
.final-selection-content,
.yearbook-content,
.shortlist-content { overflow: hidden; }
.favorites-section.is-collapsed .favorites-content,
.final-selection.is-collapsed .final-selection-content,
.yearbook-section.is-collapsed .yearbook-content,
.shortlist-section.is-collapsed .shortlist-content { display: none; }

/* Collapsed: full-width rounded container with the title riding the top
   border like a fieldset legend; expanded: title + lines (default) */
.fav-section.is-collapsed .group-header,
.favorites-section.is-collapsed .group-header {
  position: relative;
  border: 1px solid var(--border, #e4e5e8);
  border-radius: 8px;
  min-height: 55px;
  margin-top: 12px; /* room for the raised legend */
}
.fav-section.is-collapsed .group-header .line,
.favorites-section.is-collapsed .group-header .line { display: none; }
.fav-section.is-collapsed .group-header .label,
.favorites-section.is-collapsed .group-header .label {
  position: absolute; top: 0; left: 50%;
  transform: translate(-50%, -50%);
  background: #fff; /* page background — masks the border, no visible chip */
  padding: 0 14px;
  line-height: 1.4;
}
.final-selection-strip {
  display: grid; gap: var(--thumb-gap);
  margin: var(--section-spacing) 0 var(--section-spacing);
  width: 100%;
}
.final-selection-empty { font-size: 13px; color: var(--muted); font-style: italic; }
.thumb-overlay-bottom button[title="Remove from favorites"]:hover { color: #c00; }
.thumb-overlay-bottom button[title="Remove from favorites"] svg { width: 18px; height: 18px; }

/* ——— Selection card image wrapper + note icon ——— */
.sel-card-img-wrap {
  position: relative;
}
.sel-note-icon-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 10;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  border: 1.5px solid rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 1px 5px rgba(0,0,0,0.15);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.sel-note-icon-btn svg {
  width: 15px;
  height: 15px;
  stroke: #555;
  flex-shrink: 0;
  transition: stroke 0.15s;
}
.sel-note-icon-btn:hover {
  background: #fff;
  border-color: rgba(0,0,0,0.3);
  transform: scale(1.1);
}
.sel-note-icon-btn.has-note {
  background: var(--gold, #c8a97a);
  border-color: var(--gold, #c8a97a);
}
.sel-note-icon-btn.has-note svg { stroke: #fff; }

/* ——— Selection note field ——— */
.sel-note-area {
  padding: 12px 0 0;
  width: 100%;
}
.sel-note-input {
  display: none;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--border, #ddd);
  border-radius: 0;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: #fff;
  resize: vertical;
}
.sel-note-input:focus {
  outline: none;
  border-color: var(--gold, #c8a97a);
}

/* ——— Submit bar ——— */
.selections-submit-bar {
  padding: 20px 0 var(--section-spacing);
}
.selections-submit-inner {
  display: flex;
  justify-content: center;
}
.sel-submit-btn {
  padding: 8px 28px;
  background: #fff;
  border: 1px solid var(--gold, #c8a97a);
  border-radius: 0;
  color: var(--gold, #c8a97a);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.sel-submit-btn:hover {
  background: var(--gold, #c8a97a);
  color: #fff;
}
.sel-submit-btn:disabled { opacity: 0.5; cursor: default; }
.selections-submit-note {
  margin: 4px 0 0; font-size: 12px; color: var(--muted); font-style: italic;
}
.sel-verified-note {
  flex: 1 1 auto; font-size: 12px; color: var(--muted); font-style: italic;
}

/* ============================================================
   EMAIL PROMPT STRIP
   ============================================================ */
.email-prompt-strip {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 900;
  background: #fff; border-top: 2px solid #000;
  transform: translateY(100%);
  transition: transform .3s ease;
  pointer-events: none;
}
.email-prompt-strip.is-visible {
  transform: translateY(0);
  pointer-events: auto;
}
.email-prompt-inner {
  max-width: 700px; margin: 0 auto;
  padding: 16px 20px 18px;
}
.email-prompt-msg {
  margin: 0 0 12px; font-size: 14px; color: var(--text);
}
.email-prompt-fields {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.ep-field {
  flex: 1 1 160px; min-width: 0;
  padding: 8px 12px; border: 1px solid var(--border);
  font: inherit; font-size: 14px; color: var(--text); background: #fff; outline: none;
}
.ep-field:focus { border-color: var(--gold); }
.ep-btn {
  flex-shrink: 0; padding: 8px 18px;
  font: inherit; font-size: 14px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; cursor: pointer;
}
.ep-btn-send {
  background: var(--gold); border: 1px solid var(--gold); color: #fff;
}
.ep-btn-send:hover { background: var(--gold-dk); border-color: var(--gold-dk); }
.ep-btn-send:disabled { opacity: 0.6; cursor: default; }
.ep-btn-skip {
  background: none; border: 1px solid var(--border); color: var(--muted);
}
.ep-btn-skip:hover { border-color: var(--text); color: var(--text); }
.email-prompt-note {
  margin: 8px 0 0; font-size: 12px; color: var(--muted); font-style: italic; min-height: 1em;
}
/* Hide behind fullscreen / purchase panel */
body.is-fullscreen .email-prompt-strip,
body.purchase-open .email-prompt-strip { display: none; }

/* ============================================================
   FOOTER
   ============================================================ */
.page-footer {
  margin-top: auto;
  padding: 8px var(--page-margin) 16px;
  background: #fff;
  width: 100%;
  box-sizing: border-box;
}
.footer-inner { width: 100%; margin: 0 auto; }
body.gallery-view-home .footer-inner { max-width: 1200px; }
.footer-border { border-top: 2px solid #000; width: 100%; margin: 0 auto 6px auto; }
.footer-sections {
  width: 100%; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
}
.footer-section { display: flex; justify-content: center; align-items: center; min-width: 0; }
.footer-logo-wrap,
.footer-address-wrap,
.footer-contact-wrap { display: flex; justify-content: center; align-items: center; }
.footer-logo { display: flex; align-items: center; justify-content: center; }
.footer-logo img { max-height: calc(var(--logo-h) * 0.75); height: auto; width: auto; }
.footer-logo .footer-biz-name { font-size: 13px; font-weight: 700; letter-spacing: 0.02em; }
.footer-address { font-size: 13px; text-align: left; }
.footer-address div { margin: 1px 0; }
.footer-contact {
  display: grid; grid-template-columns: auto 1fr;
  column-gap: 8px; row-gap: 2px;
  font-size: 13px; text-align: left;
}
.footer-contact .k { font-weight: 700; text-align: left; }
.footer-contact .v { text-align: left; }

/* ============================================================
   PAYWALL
   ============================================================ */
body.gallery-view-paywall {
  min-height: 100vh;
  background: #f4f5f6;
  padding: 40px 20px 60px;
  display: block;
}
body.gallery-view-paywall .shell { width: min(960px, 100%); margin: 0 auto; display: grid; gap: 32px; }
body.gallery-view-paywall header { display: flex; justify-content: center; align-items: center; }
body.gallery-view-paywall header img { max-height: 26px; }
.paywall-card { background: #fff; border-radius: 10px; box-shadow: 0 18px 40px -34px rgba(21,26,35,.28); overflow: hidden; display: flex; flex-direction: column; }
.paywall-main { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* No cover set: just the sign-in side, card narrowed to it */
.paywall-card--solo { max-width: 460px; width: 100%; margin-left: auto; margin-right: auto; }
.paywall-card--solo .paywall-main { grid-template-columns: 1fr; }
.gallery-preview { position: relative; background: #0f1218; }
.gallery-preview::before { content: ""; display: block; padding-bottom: 100%; }
.gallery-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gallery-preview .label { position: absolute; top: 18px; left: 18px; background: rgba(12,15,21,.82); color: #fff; padding: 7px 14px; border-radius: 999px; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 8px; }
.gallery-preview .label svg { width: 14px; height: 14px; }
.paywall-summary { padding: 32px; display: grid; gap: 18px; }
.paywall-summary header { display: grid; gap: 12px; justify-content: unset; }
.paywall-summary h1 { margin: 0; font-size: 20px; letter-spacing: 0.04em; text-transform: uppercase; }
.paywall-summary p { margin: 0; color: #6e7279; }
.paywall-meta { display: grid; gap: 10px; font-size: 13px; }
.paywall-meta .row { display: flex; justify-content: space-between; color: #6e7279; }
.paywall-meta .row span:last-child { color: #212325; font-weight: 600; }
.balance-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 18px; border-radius: 10px; background: #f9f9f9; }
.balance-card .copy { display: grid; gap: 6px; }
.balance-card label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #6e7279; }
.balance-card strong { font-size: 24px; color: var(--gold); letter-spacing: 0.02em; }
.balance-card button { flex-shrink: 0; width: 38px; height: 38px; border-radius: 9px; border: none; background: var(--gold); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 8px 18px -15px rgba(213,166,58,.56); transition: transform .18s ease, box-shadow .18s ease; }
.balance-card button:hover { transform: translateY(-1px); box-shadow: 0 10px 26px -18px rgba(213,166,58,.6); }
.balance-card button svg { transition: transform .25s ease; }
.balance-card button.is-open svg { transform: rotate(90deg); }
.payment-wrap { background: #fff; padding: 0; display: grid; gap: 0; overflow: hidden; transition: background .3s ease, padding .3s ease; }
.payment-wrap.open { background: rgba(245,246,248,.92); padding: 24px 32px 28px; overflow: visible; }
.payment-panel { display: grid; gap: 18px; }
.payment-panel .amount { display: flex; flex-direction: column; gap: 6px; }
.payment-panel .amount label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #6e7279; }
.payment-panel .amount strong { font-size: 30px; font-weight: 700; color: var(--gold); letter-spacing: 0.01em; }
.gateway-details { max-height: 0; overflow: hidden; transition: max-height .3s ease, opacity .25s ease; opacity: 0; }
.gateway-details.open { max-height: 520px; opacity: 1; margin-top: 18px; }
.pay-form { display: grid; gap: 14px; }
.pay-field { display: grid; gap: 6px; }
.pay-field label { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.01em; color: #6e7279; }
.pay-field input { border: 1px solid #e8e9ec; border-radius: 8px; padding: 11px 13px; font-family: inherit; font-size: 14px; transition: border-color .2s, box-shadow .2s; }
.pay-field input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(213,166,58,.18); outline: none; }
.pay-form-grid { display: grid; gap: 12px; }
.pay-form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pay-form-grid.three .pay-field.full { grid-column: 1 / -1; }
.pay-form-actions { display: flex; gap: 12px; margin-top: 18px; }
.pay-form-actions button { flex: 1; border-radius: 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; cursor: pointer; padding: 12px 16px; border: none; }
.pay-form-actions .confirm { background: var(--gold); color: #fff; }
.pay-form-actions .confirm:hover { background: var(--gold-dk); }
.pay-form-actions .cancel { background: #fff; border: 1px solid #e8e9ec; color: #6e7279; }
.paywall-card-footer { background: #fff; padding: 20px 32px; display: flex; justify-content: space-between; align-items: center; color: #6e7279; font-size: 12px; }
.paywall-card-footer a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; border: 1px solid #e8e9ec; background: #fff; transition: border-color .2s, color .2s; }
.paywall-card-footer a:hover { border-color: var(--gold); color: var(--gold-dk); }
.paywall-pay-error { color: #c00; font-size: 13px; margin: 8px 0 0; }

/* Email-gate specific */
.gate-email-form { display: grid; gap: 14px; }
.gate-email-form .pay-form-actions button { max-width: 160px; }
.paywall-subscribed { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 24px 0; text-align: center; color: #6e7279; }
.paywall-subscribed strong { color: #212325; }

/* ============================================================
   PERSON VIEW
   ============================================================ */
body.gallery-view-person .gallery-main { padding: 32px 40px 48px; display: flex; flex-direction: column; gap: 48px; }
.person-section { display: flex; flex-direction: column; }
.person-section.is-collapsed .thumb-grid { display: none; }

/* Two-line section label: person name + group tag */
.section-person-name {
  display: block;
  line-height: 1.1;
  text-align: center;
}
.section-group-tag {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--gold, #c9a84c);
  margin-top: 3px;
  white-space: nowrap;
  text-align: center;
}
/* When using two-line labels, allow the label to wrap */
.gallery-name-header .label:has(.section-group-tag) {
  white-space: normal;
  line-height: 1;
}

/* Section collapsible header toggle button */
.gallery-name-header[role="button"] { cursor: pointer; user-select: none; }
.section-toggle-btn { background: none; border: none; cursor: pointer; color: var(--muted); padding: 2px; margin-left: 8px; transition: transform .2s ease; }
.person-section.is-collapsed .section-toggle-btn { transform: rotate(180deg); }

/* Section badges (count pills next to header label) */
.section-badge { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; padding: 2px 7px; border-radius: 999px; background: var(--gold); color: #fff; margin-left: 10px; vertical-align: middle; }
.section-badge:empty { display: none; }
.section-badge-yearbook { background: #3b82f6; }

/* Proofing/selections pill — hidden when not a proofing gallery */
.proofing-pill[aria-hidden="true"] { display: none; }

/* Selections pill in header */
.person-selections-pill[aria-hidden="true"] { display: none; }
.person-selections-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--gold); color: #fff; letter-spacing: 0.04em; transition: background .2s ease; }
.person-selections-pill.is-over { background: #e03; }

/* Thumb selection badge (like favorite badge but different icon) */
.thumb-selection-badge { position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); display: flex; align-items: center; justify-content: center; z-index: 2; pointer-events: none; }
.thumb-selection-badge svg { width: 14px; height: 14px; stroke: #fff; }
/* Submitted (final) pick: darker badge with a ring; the select button reads as locked */
.thumb-selection-badge.is-locked { background: #2b2b2b; box-shadow: 0 0 0 2px var(--gold); }
.thumb-overlay button.is-selected.is-locked { opacity: .7; cursor: not-allowed; }
.thumb-card:has(.thumb-selection-badge) .thumb-selection-badge { display: flex; }

/* Over-limit warning */
.selections-over-limit[aria-hidden="true"] { display: none; }
.selections-over-limit { font-size: 12px; color: #e03; margin-top: 10px; padding: 8px 12px; background: #fff0f0; border-radius: 6px; }
.selections-over-limit.is-payable { color: #7a5a00; background: #fff8e0; }
.selections-submit-row { margin-top: 16px; }
.selections-submit-row button { padding: 10px 28px; border: none; border-radius: 8px; background: var(--gold); color: #fff; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; cursor: pointer; }
.selections-submit-row button:disabled { background: var(--muted); cursor: default; }

/* Section empty message */
.section-empty-msg { font-size: 13px; color: var(--muted); font-style: italic; padding: 1em 0; margin: 0; }
/* Inside a thumb grid the message spans the whole row, its icon inline with the text */
.thumb-grid > .section-empty-msg { grid-column: 1 / -1; }
.section-empty-msg svg { display: inline-block; }
.section-loading { font-size: 13px; color: var(--muted); padding: 1.5em 0; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 820px) {
  .paywall-main { grid-template-columns: 1fr; }
  .gallery-preview { min-height: 280px; }
  .payment-wrap { padding: 18px 24px 0; }
  .paywall-card-footer { flex-direction: column; gap: 8px; align-items: flex-start; }
}
@media (max-width: 640px) {
  .footer-sections { grid-template-columns: 1fr; gap: 12px; }
  .footer-section { justify-content: center; }
  .page-footer { padding: 12px; }
  .footer-border { margin: 16px auto 6px auto; }
  .thumb-grid { gap: 16px; }
  .thumb-card { width: 100%; }
  .header-icons { gap: 18px; }

  /* Stack header: icons row on top, logo centered below — no overlap */
  .gallery-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: calc(env(safe-area-inset-top, 0px) + 12px);
    padding-bottom: 20px;
  }
  .header-icons {
    position: static;
    align-self: stretch;
    justify-content: flex-end;
    padding: 6px 0 10px;
    gap: 20px;
  }
  .gallery-header .logo-link {
    display: block;
    text-align: center;
  }
}

/* ── Event FMF first-visit prompt ─────────────────────────────────────── */

.event-fmf-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.event-fmf-modal {
  background: #fff;
  border-radius: 12px;
  max-width: 420px;
  width: 100%;
  padding: 28px 24px 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
}
.event-fmf-modal h2 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 700;
}
.event-fmf-lead {
  margin: 0 0 20px;
  font-size: 14px;
  color: #555;
  line-height: 1.5;
}
.event-fmf-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.event-fmf-opt {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fafafa;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: background .15s, border-color .15s;
}
.event-fmf-opt:hover {
  background: #fff;
  border-color: var(--accent, #d5a63a);
}
.event-fmf-opt:disabled {
  opacity: .6;
  cursor: wait;
}

/* ── Face search modal ────────────────────────────────────────────────── */

#face-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: inherit;
  padding: 0;
  border-radius: 50%;
  transition: background .15s;
}
#face-search-btn:hover { background: rgba(0,0,0,.07); }
#face-search-btn svg { width: 20px; height: 20px; }

.face-search-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.face-search-modal[hidden] { display: none; }

.face-search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
}

.face-search-panel {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px 36px;
  width: 100%;
  max-width: 460px;
  margin: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,.25);
  text-align: center;
}
.face-search-panel h2 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 0 0 8px;
  color: #111;
}
.face-search-panel p {
  font-size: .9rem;
  color: #666;
  margin: 0 0 28px;
  line-height: 1.5;
}

.face-search-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #999;
  border-radius: 50%;
  transition: background .15s, color .15s;
}
.face-search-close:hover { background: #f0f0f0; color: #333; }
.face-search-close svg { width: 16px; height: 16px; }

.face-search-input-area {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.face-search-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: #f5f5f5;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  font-family: inherit;
}
.face-search-upload-btn:hover { background: #ebebeb; border-color: #ccc; }
.face-search-upload-btn svg { width: 18px; height: 18px; }

.face-search-camera-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  margin: 0 auto;
  max-width: 380px;
}
.face-search-camera-wrap video {
  width: 100%;
  display: block;
  border-radius: 12px;
}

.face-search-shutter {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  border: 3px solid #fff;
  box-shadow: 0 0 0 3px rgba(255,255,255,.5);
  cursor: pointer;
  transition: transform .1s;
}
.face-search-shutter:active { transform: translateX(-50%) scale(.9); }
.face-search-shutter span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #fff;
}

.face-search-preview-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.face-search-preview-wrap img {
  width: 100%;
  max-width: 320px;
  border-radius: 12px;
  object-fit: cover;
  aspect-ratio: 1;
}

.face-search-retake {
  background: transparent;
  border: none;
  color: #888;
  font-size: .85rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-family: inherit;
}
.face-search-retake:hover { color: #333; }

.face-search-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, opacity .15s;
}
.face-search-submit:hover { background: #333; }
.face-search-submit:disabled { opacity: .5; cursor: default; }
.face-search-submit svg { width: 18px; height: 18px; }

.face-search-status {
  margin-top: 16px;
  font-size: .88rem;
  color: #666;
  min-height: 20px;
}

/* ── Face results bar ─────────────────────────────────────────────────── */

.face-results-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #f8f6f0;
  border: 1px solid #e8e3d8;
  border-radius: 8px;
  font-size: .88rem;
  color: #555;
  margin-bottom: 16px;
}
.face-results-bar strong { color: #111; }
.face-results-bar button {
  margin-left: auto;
  background: transparent;
  border: none;
  font-size: .85rem;
  color: #888;
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
  padding: 0;
}
.face-results-bar button:hover { color: #333; }

/* ── Select mode ──────────────────────────────────────────────────────────── */

/* Select button: radio-dot icon turns gold when active */
#folder-select-btn[aria-pressed="true"] { color: var(--gold); }

/* In select mode: suppress hover overlay, change cursor */
body.select-mode .thumb-card { cursor: default; }
body.select-mode .thumb-card .thumb-overlay { opacity: 0 !important; }

/* Touch devices: always show action icons at bottom of each thumbnail */
@media (hover: none) and (pointer: coarse) {
  .thumb-overlay {
    opacity: 1;
  }
  /* Hide the magnifier + label — just show the action row */
  .thumb-overlay-center { display: none; }

  /* Subtle gradient so icons read against any image */
  .thumb-overlay-bottom {
    background: linear-gradient(to top, rgba(255,255,255,.75) 0%, rgba(255,255,255,0) 100%);
    padding: 24px 8px 8px;
    gap: 18px;
    pointer-events: auto;
  }
  .thumb-overlay-bottom a,
  .thumb-overlay-bottom button {
    width: 36px;
    height: 36px;
    color: var(--text);
  }
  .thumb-overlay-bottom svg { width: 20px; height: 20px; }
  .thumb-overlay-bottom button[data-tooltip="Favourite"] svg { width: 22px; height: 22px; }

  /* Suppress tooltips on touch — they don't work anyway */
  .thumb-overlay-bottom [data-tooltip]::after { display: none; }

  /* Keep hidden in select mode */
  body.select-mode .thumb-card .thumb-overlay { opacity: 0 !important; }
}

/* Radio-dot circle — top-left of each card */
.thumb-select-circle {
  display: none;
  position: absolute;
  top: 9px;
  left: 9px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.9);
  background: rgba(0,0,0,0.22);
  backdrop-filter: blur(2px);
  box-sizing: border-box;
  z-index: 4;
  transition: background 0.13s, border-color 0.13s;
  pointer-events: none;
}
body.select-mode .thumb-select-circle { display: block; }

/* Selected: 1px gold dotted outline outside the card */
.thumb-card.is-selected {
  outline: 1px dotted var(--gold, #c8a97a);
  outline-offset: 2px;
}

/* Selected: filled gold dot */
.thumb-card.is-selected .thumb-select-circle {
  background: var(--gold);
  border-color: var(--gold);
}
.thumb-card.is-selected .thumb-select-circle::after {
  content: '';
  display: block;
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: #fff;
}
/* Dim unselected when something is chosen */
/* Dimming disabled — all images stay full opacity regardless of selection state */
/* body.select-mode.has-selection .thumb-card:not(.is-selected) { opacity: 0.5; } */
body.select-mode .thumb-card.is-selected { opacity: 1; }

/* ── Header select toolbar ────────────────────────────────────────────────── */

/* Hide regular icons and show the select bar when active */
body.select-mode .gallery-header .header-icons { display: none; }
body.select-mode .gallery-header .logo-link    { display: none; }
body.select-mode .header-select-bar            { display: flex; }

.header-select-bar {
  display: none;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 0 4px;
  flex-wrap: wrap;
}
.select-bar-cancel {
  background: none;
  border: none;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  padding: 5px 8px;
  border-radius: 5px;
  white-space: nowrap;
}
.select-bar-cancel:hover { color: var(--text); }
.select-bar-count {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  min-width: 80px;
}
.select-bar-all {
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  padding: 5px 10px;
  white-space: nowrap;
}
.select-bar-all:hover { border-color: var(--gold); color: var(--gold); }
.select-bar-dl {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px 3px 10px;
  position: relative;
}
.select-bar-dl-legend {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #888);
  margin-right: 4px;
  white-space: nowrap;
}
.select-bar-fav-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.13s, color 0.13s;
}
.select-bar-fav-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.select-bar-fav-btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.select-bar-fav-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.select-bar-dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.13s, color 0.13s, background 0.13s;
}
.select-bar-dl-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.select-bar-dl-btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.select-bar-dl-btn.select-bar-dl-primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}
.select-bar-dl-btn.select-bar-dl-primary:hover:not(:disabled) {
  background: var(--gold-dk);
  border-color: var(--gold-dk);
}
.select-bar-dl-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ══════════════════════════════════════════════════════════════
   PURCHASE PAGE  (gallery-variants style)
   ══════════════════════════════════════════════════════════════ */

/* Purchase page — normal document flow, matches v7 spec */
.gallery-view-purchase { background: var(--body-bg); }

/* ── v7: two-column body ─────────────────────────────────────────────── */
.pv-body {
  max-width: 1000px;
  width: 100%;
  margin: 28px auto 80px;
  padding: 0 20px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 680px) { .pv-body { grid-template-columns: 1fr; } }

/* ── Image pane ──────────────────────────────────────────────────────── */
.pv-image-pane { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pv-main-image { width: 100%; background: var(--bg); border-radius: var(--radius); overflow: hidden; position: relative; }
.pv-main-image img { width: 100%; height: auto; display: block; }
.pv-filename { font-family: ui-monospace,'SF Mono',monospace; font-size: 11px; color: var(--muted); text-align: center; }
.pv-thumb-strip { display: flex; gap: 6px; overflow-x: auto; padding: 0 2px 4px; scrollbar-width: thin; }
.pv-thumb-strip::-webkit-scrollbar { height: 4px; }
.pv-thumb-strip::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.pv-thumb { flex-shrink: 0; width: 54px; height: 54px; border-radius: 6px; border: 2px solid transparent; cursor: pointer; transition: border-color 0.15s; background: var(--bg); overflow: hidden; }
.pv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-thumb.active { border-color: var(--gold); }
.pv-thumb:hover:not(.active) { border-color: rgba(213,166,58,0.4); }
.pv-nav-arrows { display: flex; justify-content: space-between; gap: 10px; }
.pv-arrow { flex: 1; padding: 8px; background: var(--white); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; color: var(--muted); font: inherit; font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 6px; transition: border-color 0.15s, color 0.15s; }
.pv-arrow:hover { border-color: var(--gold); color: var(--gold-dk); }
.pv-arrow svg { width: 16px; height: 16px; }

/* ── Sidebar ─────────────────────────────────────────────────────────── */
.pv-sidebar { display: flex; flex-direction: column; gap: 14px; }

/* ── Panel ───────────────────────────────────────────────────────────── */
.pv-panel { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }

/* ── Action buttons row ──────────────────────────────────────────────── */
.pv-action-btns { display: flex; gap: 8px; }
.pv-action-btn { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 9px 6px 8px; background: none; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 12px; cursor: pointer; color: var(--muted); transition: border-color 0.15s, color 0.15s; white-space: nowrap; }
.pv-action-btn-row { display: flex; align-items: center; gap: 5px; }
.pv-action-btn:hover { border-color: var(--gold); color: var(--gold-dk); }
.pv-action-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.pv-action-btn.active { border-color: var(--gold); color: var(--gold-dk); }
.pv-action-btn.pv-btn-fav.active svg { fill: var(--gold); stroke: var(--gold); }
.pv-action-btn.pv-btn-yearbook.active svg { fill: var(--gold); stroke: var(--gold); }
.sel-count-badge { font-size: 10px; font-weight: 700; letter-spacing: 0.02em; background: var(--gold); color: #fff; padding: 1px 6px; border-radius: 999px; line-height: 1.5; display: none; }
.pv-btn-select.active .sel-count-badge { display: inline-block; }

/* ── Packages panel ──────────────────────────────────────────────────── */
.pkg-panel-head { display: flex; align-items: center; padding: 13px 16px; cursor: pointer; user-select: none; border-bottom: 1px solid transparent; gap: 8px; transition: background 0.12s, border-color 0.15s; }
.pkg-panel-head:hover { background: #fafaf8; }
.pkg-panel-head.open { border-bottom-color: var(--border); }
.pkg-panel-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); flex: 1; }
.pkg-count { font-size: 10px; font-weight: 700; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 2px 8px; color: var(--muted); letter-spacing: 0; text-transform: none; }
.pkg-chevron { width: 14px; height: 14px; color: var(--muted); transition: transform 0.2s; flex-shrink: 0; }
.pkg-panel-head.open .pkg-chevron { transform: rotate(180deg); }
.pkg-featured { padding: 4px 8px 0; }
/* Packages beyond the featured three show once the panel is opened */
.pkg-featured:not(.show-all) .pkg-option.pkg-extra { display: none; }
.pkg-extras { display: none; padding: 0 8px; }
.pkg-extras.open { display: block; padding: 0 8px; }

/* When extras are open, match the featured card's gap to the extras gap */
.pv-panel:has(.pkg-extras.open) .pkg-featured .pkg-option { margin-bottom: 8px; }
.pkg-option { display: flex; align-items: flex-start; gap: 10px; padding: 12px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; margin-bottom: 8px; transition: border-color 0.15s, background 0.15s; }
.pkg-option:last-child { margin-bottom: 14px; }
.pkg-option:hover { border-color: var(--gold); background: #fffdf7; }
.pkg-option.selected { border-color: var(--gold); background: rgba(213,166,58,0.06); }
.pkg-type-pill { display: inline-block; margin-left: 6px; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; background: var(--gold); color: #fff; padding: 2px 6px; border-radius: 3px; vertical-align: middle; }
.pkg-type-pill--plus { background: transparent; color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }

/* ── Variant (shared by pkg-option & variant-option) ────────────────── */
.variant-radio { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); flex-shrink: 0; margin-top: 2px; display: flex; align-items: center; justify-content: center; transition: border-color 0.15s; }
.pkg-option.selected .variant-radio,
.variant-option.selected .variant-radio { border-color: var(--gold); background: var(--gold); }
.pkg-option.selected .variant-radio::after,
.variant-option.selected .variant-radio::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.variant-name { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.variant-desc { font-size: 11px; color: var(--muted); line-height: 1.4; }
.variant-delivery { font-size: 10px; font-weight: 600; margin-top: 4px; }
.variant-delivery.instant { color: #2e7d5a; }
.variant-delivery.fulfilled { color: var(--gold-dk); }
.variant-price { font-size: 15px; font-weight: 800; color: var(--text); white-space: nowrap; flex-shrink: 0; margin-top: 1px; }
.variant-details { flex: 1; }

/* ── Panel CTA ───────────────────────────────────────────────────────── */
.panel-cta { padding: 12px 16px; border-top: 1px solid var(--border); }
.cta-price-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.cta-price-label { font-size: 11px; color: var(--muted); font-weight: 600; }
.cta-price-val { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }

/* ── Or divider ──────────────────────────────────────────────────────── */
.or-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.or-divider::before, .or-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Buy-All bundle cards ─────────────────────────────────────────────── */
.pv-buyall-panel .pkg-panel-head { padding: 10px 14px 8px; border-bottom: 1px solid var(--border); }
.buyall-card { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.buyall-card:last-child { border-bottom: none; }
.buyall-card-scope { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold); margin-bottom: 2px; }
.buyall-card-name { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.buyall-card-count { font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.buyall-card-desc { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.buyall-card-meta { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.buyall-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.buyall-card-price { font-size: 15px; font-weight: 700; color: var(--text); }
.buyall-add-btn { padding: 6px 14px; font-size: 12px; font-weight: 600; }

/* ── Standard package cards (in pkg-panel) ────────────────────────────── */
.pkg-card { padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.12s; }
.pkg-card:last-child { border-bottom: none; }
.pkg-card:hover { background: #fffdf5; }
.pkg-card.pkg-selected { background: rgba(213,166,58,0.07); outline: 1.5px solid var(--gold); }
.pkg-card-name { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.pkg-card-desc { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.pkg-card-items { margin: 4px 0 6px 14px; padding: 0; list-style: disc; font-size: 11px; color: var(--muted); }
.pkg-card-items li { margin-bottom: 2px; }
.pkg-card-price { font-size: 14px; font-weight: 700; color: var(--text); }

/* ── Tab bar ─────────────────────────────────────────────────────────── */
.panel-tabs { display: flex; border-bottom: 1px solid var(--border); }
.panel-tab { flex: 1; padding: 10px 6px; font: inherit; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); background: none; border: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color 0.15s, border-color 0.15s; }
.panel-tab:hover { color: var(--text); }
.panel-tab.active { color: var(--text); border-bottom-color: var(--text); }
.panel-body { padding: 14px 16px; }
.tab-section { display: none; }
.tab-section.active { display: block; }

/* ── Variant options (digital) ───────────────────────────────────────── */
.variant-option { display: flex; align-items: flex-start; gap: 10px; padding: 12px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; margin-bottom: 8px; transition: border-color 0.15s, background 0.15s; position: relative; }
.variant-option:last-child { margin-bottom: 0; }
.variant-option:hover { border-color: var(--gold); background: #fffdf7; }
.variant-option.selected { border-color: var(--gold); background: rgba(213,166,58,0.06); }
.variant-option .variant-radio { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); flex-shrink: 0; margin-top: 2px; display: flex; align-items: center; justify-content: center; transition: border-color 0.15s; }

/* ── Section label ───────────────────────────────────────────────────── */
.section-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 8px; }

/* ── Size options (prints) ───────────────────────────────────────────── */
.size-options { display: flex; flex-direction: column; gap: 1px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.size-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--white); cursor: pointer; transition: background 0.1s; user-select: none; }
.size-opt:hover { background: #fafaf8; }
.size-opt.selected { background: #fffbf0; }
.size-opt + .size-opt { border-top: 1px solid var(--border); }
.size-radio { width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--border); flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: border-color 0.1s; }
.size-opt.selected .size-radio { border-color: var(--gold); background: var(--gold); }
.size-opt.selected .size-radio::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #fff; display: block; }
.size-info { flex: 1; }
.size-name { font-size: 12px; font-weight: 700; }
.size-sub { font-size: 10px; color: var(--muted); margin-top: 1px; }
.size-price { font-size: 13px; font-weight: 800; color: var(--text); flex-shrink: 0; }
.size-opt-locked { opacity: 0.5; cursor: not-allowed; }
.size-opt-locked:hover { background: var(--white); }
.size-opt-locked .size-radio { border-color: var(--border); }
.size-locked-note { color: var(--muted); display: flex; align-items: center; gap: 4px; }
.size-locked-note svg { flex-shrink: 0; }

/* ── Quantity row ────────────────────────────────────────────────────── */
.qty-row { margin-bottom: 10px; }
.qty-row-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.qty-row-top .section-label { margin: 0; }
.qty-stepper { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; width: fit-content; }
.qty-btn { width: 32px; height: 32px; border: none; background: var(--bg); cursor: pointer; font-size: 16px; font-weight: 300; color: var(--text); display: flex; align-items: center; justify-content: center; transition: background 0.12s; }
.qty-btn:first-child { border-right: 1px solid var(--border); }
.qty-btn:last-child { border-left: 1px solid var(--border); }
.qty-btn:hover { background: #e8e8e8; }
.qty-display { width: 34px; text-align: center; font-size: 13px; font-weight: 800; }

/* ── Retouch row ─────────────────────────────────────────────────────── */
/* Laid out like a package card: tick + name + price on the top line, the sub-line under both */
.retouch-row { display: grid; grid-template-columns: auto 1fr auto; column-gap: 10px; row-gap: 1px; align-items: start; margin-top: 16px; padding: 11px 12px; background: var(--bg); border-radius: 8px; border: 1px solid var(--border); cursor: pointer; margin-bottom: 10px; transition: border-color 0.15s, background 0.15s; user-select: none; }
.retouch-row.checked { background: rgba(213,166,58,0.06); border-color: rgba(213,166,58,0.35); }
.retouch-check { grid-column: 1; grid-row: 1; margin-top: 1px; width: 17px; height: 17px; border-radius: 4px; border: 2px solid var(--border); background: var(--white); flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: background 0.12s, border-color 0.12s; }
.retouch-row.checked .retouch-check { background: var(--gold); border-color: var(--gold); }
.retouch-check svg { width: 8px; height: 8px; color: #fff; display: none; }
.retouch-row.checked .retouch-check svg { display: block; }
.retouch-info { display: contents; }
.retouch-label { grid-column: 2; grid-row: 1; font-size: 13px; font-weight: 700; }
.retouch-sub { grid-column: 2 / 4; grid-row: 2; font-size: 10px; color: var(--muted); }
.retouch-price { grid-column: 3; grid-row: 1; font-size: 13px; font-weight: 700; white-space: nowrap; color: var(--muted); flex-shrink: 0; transition: color 0.15s; }
.retouch-row.checked .retouch-price { color: var(--gold-dk); }
/* Locked state: retouching already in the cart for this image */
.retouch-row.retouch-locked { cursor: default; }

/* ── Delivery note ───────────────────────────────────────────────────── */
.delivery-note { display: flex; align-items: flex-start; gap: 6px; padding: 8px 10px; border-radius: 7px; font-size: 11px; color: var(--muted); line-height: 1.5; margin-bottom: 12px; background: var(--bg); border: 1px solid var(--border); }
.delivery-note.immediate { background: rgba(46,125,90,0.06); border-color: rgba(46,125,90,0.2); color: #2e7d5a; }
.delivery-note svg { width: 12px; height: 12px; flex-shrink: 0; margin-top: 1px; }

/* ── Add-ons ─────────────────────────────────────────────────────────── */
.addons-grid { display: flex; flex-direction: column; gap: 6px; }
.addon-card {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: 8px; padding: 10px;
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
  user-select: none; background: var(--white);
}
.addon-card:hover { border-color: var(--gold); background: #fffdf7; }
.addon-card.selected { border-color: var(--gold); background: rgba(213,166,58,0.06); }
.addon-main { flex: 1; min-width: 0; }
.addon-name { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.addon-sub  { font-size: 11px; color: var(--muted); line-height: 1.4; }
.addon-price { font-size: 14px; font-weight: 800; color: var(--text); white-space: nowrap; flex-shrink: 0; text-align: right; }
.addon-price-from { font-size: 10px; font-weight: 400; font-style: italic; color: var(--muted); }
.addon-check { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: border-color 0.15s, background 0.15s; }
.addon-check svg { width: 9px; height: 9px; color: #fff; display: none; }
.addon-card.selected .addon-check { background: var(--gold); border-color: var(--gold); }
.addon-card.selected .addon-check svg { display: block; }
/* Size variant pills inside addon cards */
.addon-variant-pills {
  display: flex; flex-wrap: wrap; gap: 5px;
  width: 100%; padding: 6px 0 2px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
}
.addon-variant-pill {
  padding: 4px 10px; border-radius: 20px;
  border: 1.5px solid var(--border);
  background: none; font: inherit;
  font-size: 11px; font-weight: 700;
  letter-spacing: .02em; cursor: pointer;
  color: var(--text); transition: border-color .15s, background .15s;
}
.addon-variant-pill:hover { border-color: var(--gold); }
.addon-variant-pill.selected {
  border-color: var(--gold);
  background: rgba(213,166,58,0.12);
  color: var(--text);
}
/* Square thumbnail */
.addon-thumb-btn { flex-shrink: 0; background: none; border: none; padding: 0; cursor: pointer; border-radius: 6px; overflow: hidden; display: block; width: 52px; height: 52px; position: relative; }
.addon-thumb-btn img { width: 52px; height: 52px; object-fit: cover; display: block; transition: opacity 0.15s; }
.addon-thumb-btn:hover img { opacity: 0.82; }
.addon-thumb-placeholder { flex-shrink: 0; width: 52px; height: 52px; border-radius: 6px; background: var(--bg); border: 1px solid var(--border); }
/* Thumbnail multi-image badge */
.addon-thumb-multi { position: relative; }
.addon-thumb-multi::after { content: ''; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; width: 18px; height: 4px; background: rgba(255,255,255,0.85); border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,0.18); pointer-events: none; }
/* Keepsake lightbox — crossfade slideshow */
.ks-lb-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.86); z-index: 9000; align-items: center; justify-content: center; }
.ks-lb-overlay.is-open { display: flex; }
.ks-lb-inner { position: relative; max-width: 90vw; max-height: 90vh; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ks-lb-stage { position: relative; max-width: 88vw; max-height: 80vh; }
.ks-lb-img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: 88vw; max-height: 80vh; object-fit: contain; border-radius: 6px; box-shadow: 0 8px 40px rgba(0,0,0,0.5); opacity: 0; transition: opacity 0.7s ease; pointer-events: none; }
.ks-lb-img.ks-lb-active { opacity: 1; pointer-events: auto; position: relative; }
.ks-lb-footer { display: flex; align-items: center; gap: 10px; }
.ks-lb-nav { background: none; border: none; color: rgba(255,255,255,0.75); font-size: 36px; line-height: 1; cursor: pointer; padding: 0 6px; transition: color 0.15s; }
.ks-lb-nav:hover { color: #fff; }
.ks-lb-dots { display: flex; gap: 6px; align-items: center; }
.ks-lb-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.35); cursor: pointer; transition: background 0.2s, transform 0.2s; }
.ks-lb-dot.active { background: #fff; transform: scale(1.25); }
.ks-lb-caption { color: rgba(255,255,255,0.8); font-size: 13px; font-weight: 600; }
.ks-lb-close { position: absolute; top: -36px; right: -4px; background: none; border: none; color: #fff; font-size: 28px; line-height: 1; cursor: pointer; opacity: 0.7; padding: 4px 8px; }
.ks-lb-close:hover { opacity: 1; }

/* ── Add to cart button ──────────────────────────────────────────────── */
.btn-cart { display: block; width: 100%; padding: 12px; background: var(--text); color: #fff; border: none; border-radius: 8px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; transition: background 0.15s; margin-top: 12px; letter-spacing: 0.01em; }
.btn-cart:hover { background: var(--gold); }
.btn-cart.in-cart { background: #2e7d5a; }

/* ── Credit reminder ─────────────────────────────────────────────────── */
.credit-reminder { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; font-size: 12px; color: var(--muted); line-height: 1.6; }

/* ── Toast ───────────────────────────────────────────────────────────── */
.pv-toast { position: fixed; bottom: 60px; left: 50%; transform: translateX(-50%) translateY(8px); background: var(--text); color: #fff; font-size: 13px; font-weight: 600; padding: 10px 20px; border-radius: 20px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 100; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.pv-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.pv-toast a, .pv-toast a:visited { color: var(--gold); text-decoration: none; font-weight: 700; }
.pv-toast a:hover { text-decoration: underline; }
.pv-toast-error { background: #c0392b; }

/* Empty/loading states */
.pv-loading { padding: 24px 0; color: var(--muted); font-size: 13px; text-align: center; }
.pv-no-pricing { padding: 16px; font-size: 12px; color: var(--muted); line-height: 1.6; }

/* ══════════════════════════════════════════════════════════════
   CHECKOUT PAGE
   ══════════════════════════════════════════════════════════════ */
.gallery-view-checkout .gallery-header { background: #fff; }

.co-layout {
  max-width: 1200px;
  width: 100%;
  margin: 32px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 28px;
  align-items: start;
}
.co-layout > div { min-width: 0; }
@media (max-width: 860px) {
  .co-layout { grid-template-columns: 1fr; }
}

.co-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}
.co-card:last-child { margin-bottom: 0; }
.co-card-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.co-card-head h2 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.co-card-body { padding: 0 20px; }

/* Order items */
.co-item-header {
  display: grid;
  grid-template-columns: 60px 1fr 100px 110px;
  gap: 12px 16px;
  padding: 12px 0 8px;
  border-bottom: 2px solid var(--border);
}
.co-col-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--muted);
}
.co-col-label.right { text-align: right; }
.co-item {
  display: grid;
  grid-template-columns: 60px 1fr 100px 110px;
  gap: 12px 16px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.co-item:last-child { border-bottom: 0; }
.co-thumb {
  width: 56px; height: 56px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg);
  flex-shrink: 0;
}
.co-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.co-info { min-width: 0; }
.co-filename {
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 10px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 3px;
}
.co-variant-name { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.co-variant-meta { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.co-delivery-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 600;
  padding: 2px 6px; border-radius: 20px;
}
.co-delivery-badge.instant { background: rgba(46,125,90,0.1); color: #2e7d5a; }
.co-delivery-badge.fulfilled { background: rgba(213,166,58,0.12); color: var(--gold-dk); }
.co-qty-col { display: flex; align-items: center; justify-content: center; }
.co-qty-stepper {
  display: inline-flex; align-items: center;
  border: 1px solid var(--border); border-radius: 6px;
  overflow: hidden; height: 28px;
}
.co-qty-btn {
  width: 28px; height: 28px; border: none; background: none;
  cursor: pointer; font-size: 16px; font-weight: 400;
  color: var(--muted); display: flex; align-items: center; justify-content: center;
  transition: background 0.12s;
}
.co-qty-btn:hover { background: var(--bg); color: var(--text); }
.co-qty-val {
  min-width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.co-price-col { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.co-price { font-size: 14px; font-weight: 700; }
.co-price-orig { font-size: 11px; color: var(--muted); text-decoration: line-through; }
.co-remove-btn {
  font-size: 11px; color: var(--muted); background: none; border: none;
  cursor: pointer; text-decoration: underline; text-align: right;
  padding: 2px 0;
}
.co-remove-btn:hover { color: #c0392b; }
.co-empty {
  padding: 40px 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.co-item-locked { opacity: 0.5; }
.co-locked-note { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); margin-top: 3px; }
.co-locked-note svg { flex-shrink: 0; }

/* Summary card */
.co-summary { display: flex; flex-direction: column; gap: 16px; }
.co-coupon-row { display: flex; gap: 8px; margin-bottom: 12px; }
.co-coupon-input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 6px;
  font: inherit; font-size: 13px;
}
.co-coupon-btn {
  padding: 8px 14px;
  background: none;
  border: 1px solid var(--border); border-radius: 6px;
  font: inherit; font-size: 13px; cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.co-coupon-btn:hover { border-color: var(--gold); color: var(--gold-dk); }
.co-summary-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.co-summary-row {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--muted);
}
.co-summary-row.total {
  padding-top: 10px;
  border-top: 2px solid var(--border);
  font-size: 15px; font-weight: 800;
  color: var(--text);
}
.co-summary-row.credit .value,
.co-summary-row.discount .value { color: #2e7d5a; }

/* Payment form */
.co-form-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.co-form-field label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.co-form-field input {
  padding: 9px 10px;
  border: 1px solid var(--border); border-radius: 6px;
  font: inherit; font-size: 13px;
  transition: border-color 0.15s;
}
.co-form-field input:focus { outline: none; border-color: var(--gold); }
.co-form-row { display: grid; gap: 8px; margin-bottom: 10px; }
.co-form-row.two { grid-template-columns: 1fr 1fr; }
.co-form-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.co-form-row .co-form-field { margin-bottom: 0; }
.co-pay-btn {
  display: block; width: 100%;
  padding: 13px;
  background: var(--gold); color: #fff;
  border: none; border-radius: 8px;
  font: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 12px;
}
.co-pay-btn:hover { background: var(--gold-dk, #b8892e); }
.co-pay-btn.free { background: #2e7d5a; }
.co-pay-btn.free:hover { background: #245f45; }
.co-pay-btn:disabled { background: var(--border); color: var(--muted); cursor: not-allowed; }
.co-pay-btn:disabled:hover { background: var(--border); }
.co-secure-note {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--muted);
  justify-content: center;
}
.co-secure-note svg { width: 11px; height: 13px; flex-shrink: 0; }
.co-note { font-size: 11px; color: var(--muted); line-height: 1.6; padding: 0 2px; }

/* ── Masonry layout toggle ── */
/* Masonry: CSS grid with 1px implicit rows + JS span calculation.
   grid-template-columns and row-gap are set inline by updateGrid()/applyMasonrySpans().
   Each card's grid-row-end is set from the image's naturalWidth/naturalHeight. */
body.thumb-masonry .thumb-grid {
  display: grid;
  grid-auto-rows: 1px;
  row-gap: 0;
}
body.thumb-masonry .thumb-card {
  aspect-ratio: unset;
  overflow: hidden;
  margin-bottom: var(--thumb-gap);
  break-inside: unset;
}
body.thumb-masonry .thumb-card[data-portrait] { grid-row: unset; }
body.thumb-masonry .thumb-card .thumb-bg {
  position: relative !important; inset: unset !important;
  aspect-ratio: unset; width: 100%; height: 100%;
}
body.thumb-masonry .thumb-card .thumb-bg img {
  display: block; position: static;
  width: 100%; height: 100%;
  object-fit: cover;
}
body.thumb-masonry .thumb-grid-span { grid-column: 1 / -1; grid-row-end: auto; }
/* Album tiles stay square under masonry: spans are only set on image cards, so 1px rows would collapse them. */
body.thumb-masonry .thumb-grid--albums { grid-auto-rows: auto; row-gap: var(--thumb-gap); }
body.thumb-masonry .thumb-grid--albums .thumb-card { aspect-ratio: 1; margin-bottom: 0; }
body.thumb-masonry .thumb-grid--albums .thumb-card .thumb-bg { position: absolute !important; inset: 0 !important; height: auto; }
/* Masonry toggle active state */
#masonry-toggle[aria-pressed="true"] { color: var(--gold); }

/* ── Visitor account panel ─────────────────────────────────────────────────── */
.header-icon-wrap-account { position: relative; }
.header-icon-wrap-account.is-authed #header-account-btn { color: var(--gold); }

#account-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 300px;
  background: var(--bg, #fff);
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.14);
  z-index: 9000;
  overflow: hidden;
}
#account-panel[hidden] { display: none; }
#account-panel-inner { padding: 20px; }

.acct-state { display: flex; flex-direction: column; gap: 10px; }
.acct-state[hidden] { display: none; }

/* ── Watermark overlay — step-and-repeat diagonal ───────────────────────────
   Applied when body.gallery-watermarked is set.

   Technique: the ::after pseudo-element is expanded well beyond the image
   bounds (inset: -150%) then rotated, so the repeating tile pattern
   fills the visible area at an angle. overflow:hidden on the parent clips it
   back to the image frame.

   Two background layers at half-offset create a staggered (half-brick) pattern
   where each row's centre sits in the gap of the row above.

   --wm-image   : url(...) of the watermark (set per-page via inline <style>)
   --wm-size    : tile width (default 120px)
   --wm-row-h   : row height for stagger offset (default 80px)
   --wm-angle   : rotation angle (default -30deg)
   --wm-opacity : overall opacity 0-1 (default 0.18)

   For "positioned" mode, _watermark-style.php emits an inline <style> block
   that overrides inset, background-*, and transform on the same pseudo-elements.
──────────────────────────────────────────────────────────────────────────── */
:root {
  --wm-size:    120px;
  --wm-row-h:   80px;
  --wm-angle:   -30deg;
  --wm-opacity: 0.18;
}

/* ── Image protect overlay — covers rendered image area (sized by JS)
   • blocks right-click / drag on the underlying <img>
   • carries the watermark ::after when gallery-watermarked is active    */
.img-protect-overlay {
  position: absolute;
  z-index: 5;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  cursor: default;
  overflow: hidden;
}

/* Watermark tiled pattern on the overlay */
.gallery-watermarked .img-protect-overlay {
  position: absolute;
  overflow: hidden;
}
.gallery-watermarked .img-protect-overlay::after {
  content: '';
  position: absolute;
  inset: -150%;
  background-image: var(--wm-image);
  background-repeat: repeat;
  background-size: var(--wm-size) auto;
  background-position: 0 0;
  opacity: var(--wm-opacity);
  transform: rotate(var(--wm-angle));
  pointer-events: none;
  z-index: 6;
}

/* Purchase view — container naturally sizes to image, ::after works fine */
.gallery-watermarked .pv-main-image {
  position: relative;
  overflow: hidden;
}
.gallery-watermarked .pv-main-image::after {
  content: '';
  position: absolute;
  inset: -150%;
  background-image: var(--wm-image);
  background-repeat: repeat;
  background-size: var(--wm-size) auto;
  background-position: 0 0;
  opacity: var(--wm-opacity);
  transform: rotate(var(--wm-angle));
  pointer-events: none;
  z-index: 2;
}


.acct-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--muted, #888);
  text-transform: uppercase;
  margin-bottom: 4px;
  display: block;
}
.acct-hint {
  font-size: 13px;
  color: var(--muted, #888);
  margin: 0;
}
.acct-greeting {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #111);
  margin: 0;
}
.acct-error {
  font-size: 12px;
  color: #c0392b;
  margin: 0;
}
.acct-error[hidden] { display: none; }

.acct-form { display: flex; flex-direction: column; gap: 8px; }
.acct-form[hidden] { display: none; }

.acct-row { display: flex; gap: 6px; align-items: center; }
.acct-input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(0,0,0,.18);
  border-radius: 6px;
  font-size: 14px;
  background: var(--bg, #fff);
  color: var(--text, #111);
  outline: none;
  transition: border-color .15s;
}
.acct-input:focus { border-color: var(--gold, #c8a84b); }
.acct-input-half { width: calc(50% - 4px); flex: none; }

.acct-btn {
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.acct-btn:hover { opacity: .82; }
.acct-btn-primary { background: var(--gold, #c8a84b); color: #fff; }
.acct-btn-outline { background: transparent; border: 1px solid rgba(0,0,0,.18); color: var(--text, #111); }
.acct-btn-full { width: 100%; }
.acct-btn-arrow {
  width: 36px; height: 36px; padding: 0; flex-shrink: 0;
  background: none; border: none; cursor: pointer;
  color: var(--muted, #888); display: inline-flex; align-items: center; justify-content: center;
  transition: color .15s;
}
.acct-btn-arrow svg { width: 16px; height: 16px; display: block; }
.acct-btn-arrow:hover { color: var(--gold, #c8a84b); }
.acct-btn-arrow-sq {
  border: 1px solid rgba(0,0,0,.15);
  border-radius: 6px;
  color: var(--text, #111);
  flex-shrink: 0;
}

.acct-link {
  background: none;
  border: 0;
  padding: 0;
  font-size: 12px;
  color: var(--muted, #888);
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
}
.acct-link:hover { color: var(--text, #111); }

.acct-dashboard-link { margin-top: 4px; }

.acct-spinner {
  display: block;
  width: 22px;
  height: 22px;
  margin: 10px auto;
  border: 3px solid rgba(0,0,0,.1);
  border-top-color: var(--gold, #c8a84b);
  border-radius: 50%;
  animation: acct-spin .7s linear infinite;
}
@keyframes acct-spin { to { transform: rotate(360deg); } }

@media (prefers-color-scheme: dark) {
  #account-panel { background: #1c1c1e; border-color: rgba(255,255,255,.12); }
  .acct-input { background: #2c2c2e; border-color: rgba(255,255,255,.15); color: #f5f5f5; }
  .acct-btn-outline { border-color: rgba(255,255,255,.2); color: #f5f5f5; }
}
@media (max-width: 400px) {
  #account-panel { width: calc(100vw - 32px); right: -8px; }
}

/* ── Multi-image package tray ──────────────────────────────────────── */
.pkg-tray {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 300;
  background: rgba(20, 18, 14, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255,255,255,.12);
  color: #f5f0e8;
  padding: 0 16px;
}
.pkg-tray-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1000px;
  margin: 0 auto;
  flex-wrap: wrap;
}
.pkg-tray-row {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1000px;
  margin: 0 auto;
  flex-wrap: wrap;
  padding: 10px 0;
}
.pkg-tray-divider {
  border-top: 1px solid rgba(255,255,255,.1);
  margin: 0;
}
.pkg-tray-info {
  flex-shrink: 0;
  min-width: 120px;
}
.pkg-tray-name {
  font-size: 13px;
  font-weight: 700;
  color: #f5f0e8;
}
.pkg-tray-progress {
  font-size: 11px;
  color: rgba(245,240,232,.55);
  margin-top: 2px;
}
.pkg-tray-slots {
  display: flex;
  gap: 8px;
  flex: 1;
  overflow-x: auto;
  padding-bottom: 2px;
}
.pkg-tray-slot {
  flex-shrink: 0;
  width: 54px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.pkg-tray-slot img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 4px;
  border: 2px solid rgba(255,255,255,.15);
  transition: border-color .15s;
}
.pkg-tray-slot:hover img,
.pkg-tray-slot:hover .pkg-tray-slot-empty { border-color: var(--gold, #c8a84b); }
.pkg-tray-slot-empty {
  width: 54px;
  height: 54px;
  border-radius: 4px;
  border: 2px dashed rgba(255,255,255,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.35);
  transition: border-color .15s;
}
.pkg-tray-slot-label {
  font-size: 9px;
  color: rgba(245,240,232,.5);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 58px;
}
.pkg-tray-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.pkg-tray-complete-btn {
  padding: 8px 14px;
  background: var(--gold, #c8a84b);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
}
.pkg-tray-complete-btn:hover { filter: brightness(1.1); }
.pkg-tray-hint {
  font-size: 11px;
  color: rgba(245,240,232,.45);
  white-space: nowrap;
}
.pkg-tray-dismiss {
  background: none;
  border: none;
  color: rgba(245,240,232,.4);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  padding: 0;
}
.pkg-tray-dismiss:hover { color: rgba(245,240,232,.8); }

/* ── Purchase UI: multi-image package row extras ──────────────────── */
.pv-pkg-multi-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  background: #e8f0fe;
  color: #2563eb;
  border-radius: 3px;
  padding: 1px 5px;
  vertical-align: middle;
  margin-left: 6px;
}
.pv-pkg-slots-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}
.pv-pkg-slot-chip {
  font-size: 10px;
  padding: 2px 7px;
  border: 1px solid var(--border, #e8e4de);
  border-radius: 10px;
  color: var(--muted, #888);
  background: var(--bg, #fafaf8);
}
.pv-pkg-add-to-btn {
  font-size: 11px;
  padding: 6px 12px;
}
.pv-pkg-add-to-btn:disabled {
  opacity: .45;
  cursor: default;
}

/* ── Admin: package image mode form rows ──────────────────────────── */
.pricing-inline-form-stacked {
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  gap: 8px !important;
}
.pricing-inline-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pricing-image-mode-row {
  align-items: center;
  padding: 4px 0;
}
.pricing-field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted, #888);
  min-width: 78px;
}
.pricing-radio-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  cursor: pointer;
}
.pricing-radio-hint {
  font-size: 10px;
  color: var(--muted, #888);
}
.pricing-mode-multi {
  background: #e8f0fe;
  color: #2563eb;
}

/* ══════════════════════════════════════════════════════════════
   SURVEY MODE  (gallery-compare.js)
   ══════════════════════════════════════════════════════════════ */

/* Full-screen overlay base */
.gal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: #0d0d0d;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Shared toolbar ── */
.sv-toolbar,
.cmp-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  background: rgba(0,0,0,.55);
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
  height: 48px;
}
.sv-hint,
.cmp-hint {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: rgba(255,255,255,.45);
  overflow: hidden;
  flex-wrap: nowrap;
  line-height: 1;
}
.cmp-hint-sep {
  color: rgba(255,255,255,.18);
  margin: 0 4px;
  user-select: none;
}
.sv-hint kbd,
.cmp-hint kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  color: rgba(255,255,255,.7);
  letter-spacing: .02em;
}
.sv-exit,
.cmp-exit-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.7);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
  line-height: 1;
}
.sv-exit:hover,
.cmp-exit-btn:hover { background: rgba(255,255,255,.16); color: #fff; }

/* ── Survey grid ── */
.sv-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(var(--sv-cols, 2), 1fr);
  gap: 3px;
  padding: 3px;
  overflow: hidden;
}
.sv-cell {
  position: relative;
  overflow: hidden;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  user-select: none;
  border-radius: 2px;
}
.sv-cell.is-zoomed         { cursor: grab; }
.sv-cell.is-zoomed:active  { cursor: grabbing; }

.sv-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: center center;
  pointer-events: none;
  display: block;
  will-change: transform;
}

.sv-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(0,0,0,.65);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  border-radius: 50%;
  font-size: 13px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s, background .15s;
  z-index: 2;
}
.sv-cell:hover .sv-remove { opacity: 1; }
.sv-remove:hover { background: rgba(200,50,50,.75); }

.sv-label {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.55);
  color: rgba(255,255,255,.75);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  max-width: 85%;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
  z-index: 2;
}
.sv-cell:hover .sv-label { opacity: 1; }

/* Survey toast (F / S feedback) */
.sv-toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: rgba(26,28,32,.88); color: #fff; font-size: 13px; font-weight: 600;
  padding: 8px 20px; border-radius: 24px; pointer-events: none; z-index: 10010;
  white-space: nowrap; letter-spacing: .01em;
  animation: sv-toast-in .18s ease;
}
@keyframes sv-toast-in { from { opacity:0; transform: translateX(-50%) translateY(8px); } to { opacity:1; transform: translateX(-50%) translateY(0); } }


.select-bar-survey-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 5px;
  border: 1px solid var(--border, #e6e6e6);
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: var(--text, #2b2b2b);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .13s, color .13s;
}
.select-bar-survey-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.select-bar-survey-btn:hover:not(:disabled) { border-color: var(--gold, #d5a63a); color: var(--gold, #d5a63a); }
.select-bar-survey-btn:disabled { opacity: .35; cursor: not-allowed; }

/* ══════════════════════════════════════════════════════════════
   COMPARE MODE  (gallery-compare.js)
   ══════════════════════════════════════════════════════════════ */

.cmp-panels {
  flex: 1;
  display: flex;
  overflow: hidden;
}
.cmp-panel {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
  background: #0a0a0a;
}
.cmp-panel + .cmp-panel {
  border-left: 2px solid rgba(255,255,255,.12);
}
.cmp-panel:active { cursor: grabbing; }

.cmp-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: center center;
  pointer-events: none;
  display: block;
  will-change: transform;
}

.cmp-header {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 2;
  pointer-events: none;
}
.cmp-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
}
.cmp-badge-pick {
  background: #7c5cbf;
  color: #fff;
}
.cmp-filename {
  font-size: 12px;
  color: rgba(255,255,255,.65);
  background: rgba(0,0,0,.5);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Status badges: favorites / selection / yearbook in compare header */
.cmp-status-badges {
  display: inline-flex; gap: 4px; align-items: center; margin-left: 2px; flex-shrink: 0;
}
.cmp-status-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,.5);
}
.cmp-status-badge svg { width: 12px; height: 12px; }
.cmp-badge-fav  { color: #e05a6a; }
.cmp-badge-sel  { color: var(--gold, #c8a97a); }
.cmp-badge-yb   { color: #7cb8e0; }
.cmp-pos {
  flex-shrink: 0;
  font-size: 12px;
  color: rgba(255,255,255,.65);
  background: rgba(0,0,0,.5);
  padding: 2px 8px;
  border-radius: 4px;
}

.cmp-nav {
  display: none; /* merged into cmp-action-bar */
}
.cmp-nav-btn {
  height: 40px;
  padding: 0 14px;
  background: rgba(0,0,0,.6);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  border-radius: 20px;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.cmp-nav-btn:hover { background: rgba(255,255,255,.18); }
.cmp-nav-promote {
  font-size: 11px;
  letter-spacing: .06em;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(180,140,60,.75);
  border-color: rgba(213,166,58,.8);
  color: #fff;
  padding: 0 18px;
}
.cmp-nav-promote:hover { background: rgba(213,166,58,.95); }

/* Single unified bottom bar for each panel */
.cmp-action-bar {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  align-items: center;
  z-index: 3;
  pointer-events: all;
}
.cmp-action-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s, transform .1s;
  flex-shrink: 0;
}
.cmp-action-btn svg { width: 16px; height: 16px; pointer-events: none; }
.cmp-action-btn:hover { background: rgba(255,255,255,.18); color: #fff; transform: scale(1.08); }
.cmp-action-btn.is-active { background: rgba(0,0,0,.7); }
.cmp-action-fav.is-active { color: #e05a6a; }
.cmp-action-sel.is-active { color: var(--gold, #c8a97a); }
.cmp-action-yb.is-active  { color: #7cb8e0; }

/* ============================================================
   MOBILE IMAGE VIEWER — auto fullscreen, X-only header, icon-only actions
   Targets touch devices in both portrait and landscape.
   ============================================================ */
@media (max-width: 640px), (hover: none) and (pointer: coarse) and (max-height: 500px) {
  /* White background throughout — image buffer area + body */
  body.is-fullscreen .commerce-body { background: #fff !important; }

  /* Floating X — no bar, just a dark circle top-right */
  body.is-fullscreen .gallery-header {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 12px);
    right: calc(var(--page-margin) + 2px + env(safe-area-inset-right, 0px));
    left: auto; bottom: auto;
    z-index: 30;
    background: none;
    display: flex;
    padding: 0;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  body.is-fullscreen .gallery-header .header-icons > *:not(#close-to-gallery-btn) { display: none !important; }
  body.is-fullscreen .gallery-header .logo-link { display: none; }

  /* Close button — always prominent in image view */
  body.gallery-view-image #close-to-gallery-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 20px; border: 1px solid #e0e0e0;
    background: #fff; color: #333; font-size: 12px; font-weight: 600;
    letter-spacing: .02em; cursor: pointer; white-space: nowrap;
    width: auto; height: auto;
  }
  body.gallery-view-image #close-to-gallery-btn::before {
    content: '←'; font-size: 13px; line-height: 1;
  }
  body.gallery-view-image #close-to-gallery-btn svg { display: none; }
  body.gallery-view-image #close-to-gallery-btn:hover { border-color: #999; color: #000; }

  body.is-fullscreen #close-to-gallery-btn {
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    background: rgba(0,0,0,.5);
    border: none;
    border-radius: 10px;
  }
  body.is-fullscreen #close-to-gallery-btn svg { width: 18px; height: 18px; stroke-width: 3.5; }

  /* Bottom — floating pill, centered, rounded all sides */
  body.is-fullscreen .commerce-bottom {
    padding: 0 16px calc(env(safe-area-inset-bottom, 0px) + 16px) !important;
  }
  body.is-fullscreen .commerce-filename-tray { display: none; }
  body.is-fullscreen .commerce-actions-tray {
    background: rgba(255,255,255,.3) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-radius: 20px !important;
    width: auto !important;
    padding: 14px 28px !important;
  }
  body.is-fullscreen .commerce-actions a,
  body.is-fullscreen .commerce-actions button { color: var(--text); }

  /* Strip text labels — font-size:0 hides text nodes, SVG restored */
  body.is-fullscreen .commerce-actions { gap: 0 28px; font-size: 0; }
  body.is-fullscreen .commerce-actions svg { width: 22px; height: 22px; font-size: initial; }
  body.is-fullscreen .commerce-actions .proofing-pill-left { display: none; }
  body.is-fullscreen .commerce-actions a,
  body.is-fullscreen .commerce-actions button {
    min-width: 44px; min-height: 44px;
    justify-content: center; padding: 0; font-size: 0;
  }
  /* Restore font size inside dropdowns */
  body.is-fullscreen .commerce-actions .action-dropdown { font-size: 13px; }
  body.is-fullscreen .commerce-actions .action-dropdown-item {
    font-size: 12px !important;
    color: var(--text) !important;
    font-weight: 700;
    letter-spacing: 0.02em;
  }
}

/* ── Keepsake Designer ────────────────────────────────────────────────────────── */

body.gallery-view-canvas {
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.kd-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  gap: 12px;
}

.kd-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.kd-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}
.kd-header-icon svg { width: 18px; height: 18px; display: block; }
.kd-header-icon:hover { color: var(--gold); }
.kd-header-icon.has-favorites { color: var(--gold); }
.kd-header-icon.has-favorites svg { fill: var(--gold); stroke: var(--gold); }

.kd-header-icon-wrap { position: relative; display: inline-flex; }
.kd-header-icon-wrap .nav-icon-badge {
  position: absolute;
  top: -5px;
  right: -7px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: var(--gold);
  color: var(--white);
  font-size: 9px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}
.kd-header-icon-wrap .nav-icon-badge.is-visible { display: inline-flex; }

.kd-header-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}
.kd-header-logo img { max-height: 22px; width: auto; display: block; }
.kd-header-logo span { font-size: 13px; font-weight: 700; letter-spacing: 0.02em; }

/* Account partial inside kd-header (replaces .header-icons context) */
.kd-header .header-icon-wrap { position: relative; display: inline-flex; }
.kd-header .header-icon-wrap button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text);
  padding: 0;
  transition: color 0.15s;
}
.kd-header .header-icon-wrap button:hover { color: var(--gold); }
.kd-header .header-icon-wrap svg { width: 18px; height: 18px; display: block; }

/* Layout: sidebar + main stacked above filmstrip */
.kd-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 190px 1fr 200px;
  grid-template-rows: 1fr;
  overflow: hidden;
}
/* No-sidebar variant — used when product is pre-loaded from purchase page */
.kd-layout--no-sidebar {
  grid-template-columns: 1fr 200px;
}

/* ── Left sidebar: collapsible product list ── */
.kd-sidebar {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.kd-cat-group { border-bottom: 1px solid var(--border); }

.kd-cat-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--bg);
  border: none;
  cursor: pointer;
  color: var(--muted);
  transition: color 0.15s;
}
.kd-cat-header:hover { color: var(--text); }
.kd-cat-chevron {
  width: 14px; height: 14px;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.kd-cat-group.is-open .kd-cat-chevron { transform: rotate(180deg); }

.kd-product-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
}
.kd-cat-group.is-open .kd-product-list { display: block; }

.kd-product-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  cursor: pointer;
  border-top: 1px solid var(--border);
  transition: background 0.1s;
}
.kd-product-item:hover { background: #fafafa; }
.kd-product-item.is-selected { background: #fdf7eb; }
.kd-product-item-name { font-size: 12px; font-weight: 600; }
.kd-product-item-price { font-size: 11px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }

/* ── Main area ── */
.kd-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.kd-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
}
.kd-empty-state svg { width: 64px; height: 64px; opacity: 0.3; }

.kd-designer {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Product bar (minimal, centre top) */
.kd-product-bar {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 20px 4px;
  flex-shrink: 0;
}
.kd-product-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
}
.kd-product-lab {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 5px;
}

/* Instructions under title */
.kd-instructions {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 0 auto;
  padding: 0;
}

/* ── Right controls panel ── */
.kd-controls {
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--bg);
}

.kd-panel-section {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.kd-panel-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

/* Side tabs inside controls panel */
.kd-side-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.kd-side-tab {
  flex: 1;
  padding: 9px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  color: var(--muted);
  transition: color 0.15s, border-color 0.15s;
}
.kd-side-tab.is-active { color: var(--text); border-bottom-color: var(--gold); }

/* Template strip: vertical stack in right panel */
.kd-template-strip {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kd-tpl-thumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  width: 100%;
  text-align: left;
}
.kd-tpl-thumb:hover { border-color: #ccc; }
.kd-tpl-thumb.is-active { border-color: var(--gold); background: #fdf7eb; }
.kd-tpl-svg { width: 44px; height: 30px; display: block; flex-shrink: 0; }
.kd-tpl-thumb-label {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Color picker in controls panel */
.kd-color-options { display: flex; flex-wrap: wrap; gap: 6px; }
.kd-color-swatch {
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  background: var(--white);
  transition: border-color 0.15s, background 0.15s;
}
.kd-color-swatch.is-active { border-color: var(--gold); background: #fdf7eb; }

/* Qty + price row */
.kd-order-row { display: flex; align-items: center; gap: 12px; }
.kd-qty-wrap { display: flex; align-items: center; gap: 6px; }
.kd-qty-btn {
  width: 26px; height: 26px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--white);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: background 0.1s;
}
.kd-qty-btn:hover { background: var(--white); border-color: #ccc; }
.kd-qty-val { font-size: 14px; font-weight: 700; min-width: 20px; text-align: center; }
.kd-price { font-size: 15px; font-weight: 700; margin-left: auto; }

/* Add to cart */
.kd-add-btn {
  width: 100%;
  padding: 9px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: var(--radius);
  border: none;
  background: var(--border);
  color: var(--muted);
  cursor: not-allowed;
  transition: background 0.2s, color 0.2s;
}
.kd-add-btn.is-ready,
.kd-add-btn:not(:disabled) {
  background: var(--gold);
  color: var(--white);
  cursor: pointer;
}
.kd-add-btn.is-ready:hover { background: var(--gold-dk); }

.kd-lab-btn {
  width: 100%;
  padding: 7px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--muted);
  cursor: not-allowed;
  transition: border-color 0.2s, color 0.2s;
}
.kd-lab-btn:not(:disabled) {
  border-color: #aaa;
  color: var(--text);
  cursor: pointer;
}
.kd-lab-btn:not(:disabled):hover { border-color: var(--gold); color: var(--gold); }

/* Canvas */
.kd-canvas-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  position: relative;
  background: #fff;
  overflow-y: auto;
}

.kd-canvas {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  background: #ffffff;
  max-height: 100%;
  max-width: 100%;
}

/* Layout variants — explicit width/height set by JS via resizeCanvas() */
.kd-canvas--row { display: flex; flex-direction: row; gap: 2px; }
.kd-canvas--col { display: flex; flex-direction: column; }
.kd-canvas--grid { display: grid; }

/* Fixed-zone products (coasters, hinged frame, etc.): each zone is its own card */
.kd-canvas--fixed {
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
  gap: 12px;
}
.kd-canvas--fixed .kd-zone {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
/* Single-zone products (puzzle, etc.): zone must fill the sized canvas */
.kd-canvas--fixed.kd-canvas--row .kd-zone:only-child {
  flex: 1 1 100%;
  width: 100%;
  height: 100%;
}
/* Page-template products (8x10 memory mate, …): the canvas is the finished page —
   the template layer paints background, frames and text; spots sit on their frames */
.kd-canvas--fixed.kd-canvas--template {
  display: block;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .18);
}
.kd-tpl-page { position: absolute; inset: 0; pointer-events: none; }
.kd-tpl-page svg { display: block; width: 100%; height: 100%; }
.kd-tpl-faces { position: absolute; inset: 0; pointer-events: none; z-index: 8; }
.kd-tpl-faces svg { display: block; width: 100%; height: 100%; }
.kd-canvas--fixed.kd-canvas--template .kd-zone { border: 0; border-radius: 0; }
.kd-zone-guides { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.kd-zone-guides svg { display: block; width: 100%; height: 100%; }
.kd-zone .kd-zone-clear-btn, .kd-zone .kd-zone-flip-btn { z-index: 21; }
.kd-canvas--fixed .kd-zone.kd-zone--guides { border-radius: 0; border-color: transparent; }
/* Print package: zones sit in a wrapping row with labels below each */
.kd-canvas--package {
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 20px 16px;
  padding: 16px 4px;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: unset !important;
  transition: gap 0.2s ease;
}
/* When a group is expanded the strip row tightens up */
.kd-canvas--package.kd-canvas--has-expanded {
  gap: 10px 8px;
}
.kd-canvas--package .kd-zone {
  position: relative;
  flex: none !important;
  border-radius: 6px;
  overflow: hidden;
}

/* Group wrapper */
.kd-zone-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  position: relative;
  transition: opacity 0.2s ease;
}
/* Compact strip: all groups shrink together, keep normal opacity */
.kd-canvas--has-expanded .kd-zone-group {
  opacity: 1;
}
/* Expanded group: slightly highlighted in the strip */
.kd-canvas--has-expanded .kd-zone-group--expanded .kd-zone--pkg-rep {
  border-color: var(--text, #2b2b2b);
}

/* Stack shadow cards (visible only when collapsed + qty > 1) */
.kd-zone-stack-shadow {
  position: absolute;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  top: 0;
  left: 0;
  pointer-events: none;
  overflow: hidden;
  transition: width 0.22s ease, height 0.22s ease;
}

/* Representative (collapsed) tile */
.kd-zone--pkg-rep {
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  z-index: 2;  /* sits above shadow cards */
  transition: width 0.22s ease, height 0.22s ease;
}
.kd-zone-group--stacked .kd-zone--pkg-rep {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Qty badge top-left */
.kd-zone-qty-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 10px;
  pointer-events: none;
  z-index: 3;
}
.kd-zone-qty-badge--ind {
  left: auto;
  right: 6px;
  background: rgba(0,0,0,0.35);
  font-weight: 500;
}

/* Expand/collapse toggle */
.kd-zone-group-expand-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 28px;
  height: 20px;
  margin-top: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-secondary, #f5f5f5);
  cursor: pointer;
  color: var(--muted);
  transition: background 0.12s, color 0.12s;
  z-index: 2;
}
.kd-zone-group-expand-btn:hover { background: var(--border); color: var(--text); }
.kd-zone-group-expand-btn svg { width: 12px; height: 12px; pointer-events: none; }

/* Row of individual tiles — full width, left-aligned, below all rep tiles */
.kd-zone-group-ind-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  padding-top: 14px; /* extra room for the connector arrow */
  width: 100%;
  flex: 0 0 100%;
  position: relative;
}
/* Upward-pointing caret connecting the row back to its parent tile */
.kd-zone-group-ind-row::before {
  content: '';
  position: absolute;
  top: 2px;
  left: var(--ind-arrow-x, 50%);
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid var(--border, #e0e0e0);
  pointer-events: none;
}
.kd-zone--pkg-ind {
  border: 1px solid var(--border);
  border-radius: 5px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  opacity: 0.85;
  transition: opacity 0.12s;
}
.kd-zone--pkg-ind:hover { opacity: 1; }
.kd-zone-label {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 5;
}

/* Template overlay — floats above photo zones; pointer-events:none passes clicks through.
   mix-blend-mode:multiply: white→transparent, grey→darkened margin, black→guide lines. */
.kd-canvas-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 20;
  mix-blend-mode: multiply;
  object-fit: fill;
}

/* Circle-shaped products (e.g. circle keychain): clip canvas to a circle.
   The crop sent to the lab is always the square bounding box — the lab die-cuts.
   overflow: hidden !important overrides kd-canvas--fixed's overflow: visible. */
.kd-canvas--circle {
  border-radius: 50% !important;
  overflow: hidden !important;
  position: relative;
}
.kd-canvas--circle::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--border);
  pointer-events: none;
  z-index: 5;
}

/* Variant size picker in the designer right panel */
.kd-variant-pills {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kd-variant-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.kd-variant-row:hover { border-color: var(--gold); }
.kd-variant-row.is-active { border-color: var(--gold); background: #fffbf0; }
.kd-variant-row-radio {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  transition: border-color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kd-variant-row.is-active .kd-variant-row-radio {
  border-color: var(--gold);
  background: var(--gold);
  box-shadow: inset 0 0 0 3px #fff;
}
.kd-variant-row-label {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.kd-variant-row-price {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.kd-variant-row.is-active .kd-variant-row-price { color: var(--gold-dk); }
.kd-layout-pills { display: flex; flex-direction: column; gap: 4px; }
.kd-layout-thumb { display: flex; flex-shrink: 0; }
.kd-layout-thumb svg { display: block; }
.kd-zoom-slider.kd-spacing-slider { width: 100%; }
/* Section builder: +N buttons, then the row as proportional chips */
.kd-sec-add { display: flex; gap: 6px; margin-bottom: 8px; }
.kd-sec-btn { flex: 1; padding: 6px 0; border: 1.5px solid var(--border); border-radius: 2px; background: #fff; font-size: 13px; font-weight: 600; cursor: pointer; }
.kd-sec-btn:hover:not(:disabled) { border-color: var(--gold); }
.kd-sec-btn:disabled { opacity: .4; cursor: default; }
.kd-sec-row { display: flex; gap: 3px; }
.kd-sec-chip { position: relative; display: flex; align-items: center; justify-content: center; min-width: 0; height: 30px; background: #ececec; font-size: 12px; font-weight: 600; color: var(--muted); }
.kd-sec-del { position: absolute; top: 1px; right: 2px; border: 0; background: none; font-size: 13px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 2px; }
.kd-sec-del:hover { color: var(--text); }
.kd-sec-link, .kd-sec-unlink { display: flex; align-items: center; justify-content: center; flex: none; width: 18px; height: 18px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: #fff; color: var(--muted); cursor: pointer; }
.kd-sec-link { align-self: center; }
.kd-sec-linkgap { flex: none; width: 18px; }
.kd-sec-unlink { margin-left: 6px; }
.kd-sec-link:hover, .kd-sec-unlink:hover { border-color: var(--gold); color: var(--text); }
.kd-sec-link svg, .kd-sec-unlink svg { width: 10px; height: 10px; }
.kd-zone.kd-zone--fit { background: #fff; }
/* Editing an ordered keepsake: photos, sections, size and quantity stay as bought */
.kd-sec--locked .kd-sec-link, .kd-sec--locked .kd-sec-unlink, .kd-sec--locked .kd-sec-del, .kd-sec--locked .kd-sec-linkgap { display: none; }
.kd-editing .kd-filmstrip-bar, .kd-editing .kd-order-row, .kd-editing #kd-spacing-section,
.kd-editing #kd-variants-section, .kd-editing #kd-orient-section, .kd-editing #kd-custom-fields-section,
.kd-editing .kd-zone-clear-btn, .kd-editing .kd-zone-flip-btn, .kd-editing .kd-zone-remove-btn { display: none !important; }
.kd-snap { position: absolute; pointer-events: none; z-index: 4; }
.kd-snap-v { top: 0; bottom: 0; width: 0; border-left: 1px solid #e0457b; }
.kd-snap-h { left: 0; right: 0; height: 0; border-top: 1px solid #e0457b; }
.kd-sec-grid { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.kd-sec-shape { display: flex; flex-wrap: wrap; gap: 2px; min-width: 0; }
.kd-sec-select { flex: 1 1 52px; min-width: 0; height: 26px; padding: 0 2px; border: 1px solid var(--border); border-radius: 2px; background: #fff; font-size: 11px; color: var(--text); }
.kd-sec-mirror { flex: 1 1 100%; height: 26px; padding: 0 6px; border: 1px solid var(--border); border-radius: 2px; background: #fff; font-size: 11px; color: var(--text); cursor: pointer; }
.kd-sec-mirror:hover { border-color: var(--gold); }
.kd-sec-mirror.is-on { border-color: var(--gold); background: var(--gold); color: #fff; }
.kd-zone.kd-zone--mirror { pointer-events: none; }

/* Orientation toggle */
.kd-orient-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.kd-orient-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 8px 8px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.kd-orient-btn svg { width: 22px; height: 22px; }
.kd-orient-btn:hover { border-color: var(--gold); color: var(--text); }
.kd-orient-btn.is-active {
  border-color: var(--gold);
  background: #fffbf0;
  color: var(--gold-dk);
}

/* Zone */
.kd-zone {
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  cursor: pointer;
  transition: box-shadow 0.15s;
  user-select: none;
  background: #f5f5f5;
}
.kd-zone--photo { background: #ffffff; }
.kd-zone--logo  { background: #fff3e0; cursor: default; }
.kd-zone.is-drag-over { box-shadow: inset 0 0 0 3px var(--gold); }
/* Brand images are transparent: the page shows through round them */
.kd-zone.kd-zone--brand { background: transparent; }
.kd-film-card.kd-film-card--brand { background: #fff; }
.kd-film-card.kd-film-card--brand img { object-fit: contain; padding: 4px; box-sizing: border-box; }
.kd-zone--has-image { cursor: grab; }
.kd-zone--digital { cursor: default !important; }
.kd-zone--digital .kd-zone-handle { display: none; }
.kd-zone-digital-badge {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 5;
}
.kd-zone--has-image.is-panning { cursor: grabbing !important; }
.kd-zone--has-image.is-panning * { pointer-events: none; }
.kd-zone--active { box-shadow: inset 0 0 0 2px var(--gold) !important; }

/* Zoom bar — always in flow to prevent canvas layout shift; visibility toggled by JS */
.kd-zoom-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 0 4px;
  flex-shrink: 0;
  visibility: hidden;
}
.kd-zoom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--white);
  cursor: pointer;
  color: var(--text);
  flex-shrink: 0;
  padding: 0;
  transition: border-color 0.15s, color 0.15s;
}
.kd-zoom-btn:hover { border-color: #aaa; color: var(--text); }
.kd-zoom-btn svg { width: 13px; height: 13px; display: block; }
.kd-zoom-slider {
  width: 140px;
  cursor: pointer;
  accent-color: var(--gold);
  height: 4px;
}

/* Zone placeholder */
.kd-zone-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #6b9ec8;
  pointer-events: none;
}
.kd-zone-placeholder svg { width: 28px; height: 28px; opacity: 0.6; }
.kd-zone-placeholder span { font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }

/* Logo zone */
.kd-zone-logo-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #c8972b;
  pointer-events: none;
}
.kd-zone-logo-inner svg { width: 20px; height: 20px; opacity: 0.6; }
.kd-zone-logo-inner span { font-size: 9px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }

.kd-zone-logo-inner--has-logo { padding: 8%; }
.kd-zone-logo-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

/* Clear button on assigned zone */
.kd-zone-assigned-label {
  display: none;
}
.kd-zone-clear-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.5);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0;
  transition: opacity 0.15s;
}
.kd-zone:hover .kd-zone-clear-btn { opacity: 1; }
.kd-zone-clear-btn svg { width: 12px; height: 12px; stroke-width: 3; }
/* Quarter-turn for a brand image — beside the clear button */
.kd-zone-rot-btn {
  position: absolute; top: 4px; right: 30px; z-index: 21;
  width: 22px; height: 22px; border-radius: 50%; border: none; padding: 0;
  background: rgba(0,0,0,0.5); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.15s;
}
.kd-zone:hover .kd-zone-rot-btn, .kd-zone--active .kd-zone-rot-btn { opacity: 1; }
.kd-zone-rot-btn svg { width: 12px; height: 12px; }
@media (hover: none) {
  .kd-zone--brand .kd-zone-rot-btn { opacity: 1; width: 30px; height: 30px; right: 36px; }
  .kd-zone--brand .kd-zone-rot-btn svg { width: 15px; height: 15px; }
}

/* Flip orientation button — bottom-right corner, visible on hover */
.kd-zone-flip-btn {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.45);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 5;
}
.kd-zone:hover .kd-zone-flip-btn { opacity: 1; }
.kd-zone-flip-btn svg { width: 12px; height: 12px; }

/* Back fixed panel */
.kd-back-fixed {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kd-back-fixed-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  text-align: center;
  padding: 24px;
}
.kd-back-fixed-inner p { margin: 0; font-size: 13px; }
.kd-back-fixed-inner span { font-size: 11px; opacity: 0.7; }

/* Instructions (inside product bar) */
.kd-instructions {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  padding: 0;
}

/* ── Filmstrip bar ── */
.kd-filmstrip-bar {
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  flex-shrink: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.kd-filmstrip-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  flex-shrink: 0;
  width: 52px;
}
.kd-filmstrip-label svg { width: 16px; height: 16px; }

.kd-filmstrip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  flex: 1;
  padding: 10px 16px;
  align-items: center;
  min-height: 100px;
}
.kd-filmstrip::-webkit-scrollbar { height: 4px; }
.kd-filmstrip::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.kd-filmstrip-tabs {
  display: flex;
  gap: 2px;
  padding: 0 12px 10px;
  overflow-x: auto;
  flex-shrink: 0;
}
.kd-filmstrip-tabs::-webkit-scrollbar { display: none; }

.kd-filmstrip-tab {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.kd-filmstrip-tab svg { width: 13px; height: 13px; flex-shrink: 0; }
.kd-filmstrip-tab:hover { background: #f0f0ef; color: var(--text); }
.kd-filmstrip-tab.is-active {
  background: var(--text, #2b2b2b);
  color: #fff;
  border-color: var(--text, #2b2b2b);
}

/* Class tab — accent colour to distinguish it */
.kd-filmstrip-tab--class { border-color: #6c7db7; color: #6c7db7; }
.kd-filmstrip-tab--class:hover { background: #edf0f9; color: #6c7db7; }
.kd-filmstrip-tab--class.is-active { background: #6c7db7; color: #fff; border-color: #6c7db7; }

/* Class photo zones — soft blue tint on placeholder */
.kd-zone[data-img-source="class_photo"] .kd-zone-placeholder {
  background: #edf0f9;
  border-color: #6c7db7;
  color: #6c7db7;
}

.kd-zone--keepsake-empty .kd-zone-placeholder {
  background: #fff4f4;
  border-color: #e8a0a0;
  color: #c05050;
}
.kd-zone--keepsake-empty .kd-zone-placeholder svg { stroke: #d07070; }

.kd-filmstrip-loading,
.kd-filmstrip-empty {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  padding: 0 4px;
}

.kd-film-card {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: grab;
  position: relative;
  background: var(--border);
  transition: border-color 0.15s, opacity 0.15s;
}
.kd-film-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.kd-film-card:hover { border-color: var(--gold); }
.kd-film-card.is-selected { border-color: var(--gold); }
.kd-film-card.is-dragging { opacity: 0.5; cursor: grabbing; }

/* ── Toast ── */
.kd-toast {
  position: fixed;
  bottom: 140px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: #333;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 20px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 1000;
  white-space: nowrap;
}
.kd-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Keepsake button on favorites page */
.kd-launch-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.kd-launch-btn:hover { border-color: var(--gold); background: #fdf7eb; color: var(--text); }
.kd-launch-btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.kd-launch-bar {
  text-align: center;
  padding: 20px 0 8px;
}

/* ── Package chip rail (mobile carousel nav) ── */
#kd-pkg-dots { display: none; }
#kd-pkg-nav  { display: none; }

/* ── Mobile package carousel: one large snap card per stack ── */
.kd-canvas--package.kd-canvas--carousel {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0 16px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 8px 0;
  height: 100% !important;
}
.kd-canvas--carousel::-webkit-scrollbar { display: none; }
/* Edge spacers let the first/last card snap to centre */
.kd-canvas--carousel::before,
.kd-canvas--carousel::after {
  content: '';
  flex: 0 0 12vw;
  align-self: stretch;
}
.kd-canvas--carousel .kd-zone-group {
  scroll-snap-align: center;
  scroll-snap-stop: always;
  flex: none;
  align-items: center;
}
/* Member slides (an unstacked group) get a subtle grouped look */
.kd-zone-group--member .kd-zone--pkg-ind {
  opacity: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.kd-zone-restack-btn {
  width: auto;
  gap: 4px;
  padding: 2px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.kd-zone-restack-btn svg { width: 11px; height: 11px; }

/* ── Responsive: narrow viewports ── */
@media (max-width: 700px) {
  .kd-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
  .kd-sidebar { display: none; }
  .kd-controls {
    border-left: none;
    border-bottom: 1px solid var(--border);
    order: -1;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .kd-controls::-webkit-scrollbar { display: none; }
  .kd-panel-section { border-bottom: none; border-right: none; flex-shrink: 0; padding: 8px 10px; }
  .kd-panel-section .kd-panel-label { display: none; }
  /* qty + price + Add to Cart on one compact line, pinned right */
  .kd-order-row { margin-left: auto; gap: 10px; }
  .kd-order-row + .kd-panel-section { padding-left: 0; }
  .kd-add-btn { padding: 9px 16px; white-space: nowrap; width: auto; }
  .kd-custom-fields-section { min-width: 180px; }
  .kd-template-strip { flex-direction: row; }
  /* A sectioned product (mug, cups) wraps: the section builder gets the full
     first row, spacing and the order line share the second */
  .kd-controls.kd-controls--sections { flex-wrap: wrap; overflow-x: visible; }
  .kd-controls--sections #kd-layouts-section { flex: 1 1 100%; padding-bottom: 2px; }
  .kd-controls--sections .kd-layout-pills { flex-direction: row; align-items: center; gap: 8px; }
  .kd-controls--sections .kd-sec-add { margin-bottom: 0; flex-shrink: 0; }
  .kd-controls--sections .kd-sec-btn { flex: none; width: 44px; height: 36px; padding: 0; }
  .kd-controls--sections .kd-sec-grid { flex: 1; min-width: 0; }
  .kd-controls--sections .kd-sec-chip { height: 36px; }
  .kd-controls--sections .kd-sec-del { font-size: 16px; padding: 2px 4px; }
  .kd-controls--sections .kd-sec-link, .kd-controls--sections .kd-sec-unlink { width: 24px; height: 24px; }
  .kd-controls--sections .kd-sec-linkgap { width: 24px; }
  .kd-controls--sections .kd-sec-link svg, .kd-controls--sections .kd-sec-unlink svg { width: 13px; height: 13px; }
  .kd-controls--sections #kd-spacing-section { flex: 1 1 120px; min-width: 0; }
  .kd-controls--sections .kd-order-row + .kd-panel-section { flex: 1 1 100%; padding: 0 10px 10px; }
  /* Editing: the quantity row is hidden, so the save button's section keeps its own padding */
  .kd-editing .kd-order-row + .kd-panel-section { flex: 1 1 100%; padding: 10px; }
  .kd-editing .kd-add-btn { width: 100%; }
  .kd-controls--sections .kd-add-btn { width: 100%; }
  .kd-tpl-thumb { flex-direction: column; width: auto; }

  /* Product bar: tighter, instructions become a single wrapping line */
  .kd-product-bar { padding: 8px 12px 2px; flex-wrap: wrap; gap: 4px 10px; }
  .kd-instructions { margin-left: 0; font-size: 11px; }

  /* Chip rail */
  #kd-pkg-dots {
    display: flex;
    gap: 6px;
    padding: 6px 12px 8px;
    overflow-x: auto;
    flex-shrink: 0;
    scrollbar-width: none;
  }
  #kd-pkg-dots::-webkit-scrollbar { display: none; }
  .kd-pkg-dot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--white, #fff);
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
  }
  .kd-pkg-dot.is-active {
    border-color: var(--text, #2b2b2b);
    color: var(--text, #2b2b2b);
    background: var(--bg, #fafafa);
  }
  .kd-pkg-dot-state {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--border);
    flex-shrink: 0;
  }
  .kd-pkg-dot.is-filled .kd-pkg-dot-state {
    background: var(--gold, #d5a63a);
    border-color: var(--gold, #d5a63a);
  }

  /* Carousel canvas area: no wrap padding so cards can use full width */
  .gallery-view-canvas .kd-canvas-wrap { padding: 4px 0; overflow: hidden; }

  /* ‹ n/m › arrows — under the cards, above the filmstrip */
  #kd-pkg-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 4px 0 2px;
    flex-shrink: 0;
  }
  .kd-pkg-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 30px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--white, #fff);
    color: var(--text);
    cursor: pointer;
    padding: 0;
    transition: border-color 0.15s, opacity 0.15s;
  }
  .kd-pkg-nav-btn:disabled { opacity: 0.35; cursor: default; }
  .kd-pkg-nav-btn svg { width: 14px; height: 14px; display: block; }
  .kd-pkg-nav-pos {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    min-width: 44px;
    text-align: center;
    letter-spacing: 0.03em;
  }

  /* Zoom bar: comfortable touch targets */
  .kd-zoom-btn { width: 34px; height: 34px; }
  .kd-zoom-slider { width: 180px; height: 6px; }

  /* Bigger unstack/restack pills for touch */
  .kd-zone-group-expand-btn { width: 44px; height: 26px; margin-top: 6px; }
  .kd-zone-restack-btn { width: auto; height: 26px; }
}

/* ── Free-form zone builder ──────────────────────────────────────────────────── */

.kd-canvas-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 16px;
}

/* Direction toggle */
.kd-add-direction {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}
.kd-dir-btn {
  flex: 1;
  padding: 5px 6px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.kd-dir-btn:hover { border-color: #ccc; color: var(--text); }
.kd-dir-btn.is-active {
  border-color: var(--gold);
  background: #fdf7eb;
  color: var(--text);
}

/* Ratio picker grid */
.kd-ratio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}
.kd-ratio-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.kd-ratio-btn:hover {
  border-color: var(--gold);
  background: #fdf7eb;
  color: var(--text);
}
.kd-ratio-btn--fill {
  color: var(--text);
  background: #f8f5ef;
  border-style: dashed;
}
.kd-ratio-btn--fill:hover { background: #fdf7eb; }

/* Distribute / text link button */
.kd-panel-link {
  display: inline-block;
  font-size: 11px;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.kd-panel-link:hover { color: var(--text); }

/* Fill zone */
.kd-zone--fill { background: #eef2f7; }
.kd-zone-placeholder--fill { background: rgba(80, 120, 200, 0.04); }
.kd-zone-placeholder--fill span { color: #5a82c4; font-size: 9px; }
.kd-zone-placeholder--fill small { display: block; font-size: 9px; color: var(--muted); margin-top: 2px; }
.kd-zone-placeholder--fill svg { stroke: #8aaad8; }

/* Zone drag handle */
.kd-zone-handle {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 16px;
  padding: 0;
  border: none;
  border-radius: 3px;
  background: rgba(0,0,0,0.35);
  color: #fff;
  cursor: grab;
  opacity: 0;
  transition: opacity 0.15s;
}
.kd-zone:hover .kd-zone-handle { opacity: 1; }
.kd-zone-handle svg { width: 12px; height: 12px; pointer-events: none; }
.kd-zone-handle:active { cursor: grabbing; }

/* Zone remove button */
.kd-zone-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 3px;
  background: rgba(0,0,0,0.35);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.kd-zone:hover .kd-zone-remove-btn { opacity: 1; }
.kd-zone-remove-btn svg { width: 10px; height: 10px; pointer-events: none; }

/* Reorder drop target indicator */
.kd-zone--reorder-target { box-shadow: inset 4px 0 0 var(--gold) !important; }

/* Dragging zone */
.kd-zone--dragging { opacity: 0.4; }

/* ── Family gallery: Buy Looks tab ───────────────────────────────────────── */
.family-tab-bar {
  display: flex; gap: 0; border-bottom: 1px solid var(--gallery-border, #e6e6e6);
  background: #fff; position: sticky; top: 0; z-index: 30;
}
.family-tab-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 12px 22px; font-size: 13px; font-weight: 700; letter-spacing: .01em;
  border: none; background: none; cursor: pointer; font-family: inherit;
  color: #888; border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.family-tab-btn svg { width: 16px; height: 16px; }
.family-tab-btn:hover { color: var(--text, #2b2b2b); }
.family-tab-btn.is-active { color: var(--text, #2b2b2b); border-bottom-color: var(--text, #2b2b2b); }

/* Looks panel */
.looks-panel { width: 100%; }
.looks-inner  { max-width: 800px; margin: 0 auto; padding: 28px 20px 180px; }

/* Per-person subtotal label in group headers */
.looks-group-subtotal {
  margin-left: auto; font-size: 13px; font-weight: 700; color: #d5a63a;
}

/* "per person" note beside pricing strip title */
.looks-mode-strip-note {
  margin-left: 8px; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; color: #d5a63a;
}

/* Tier price strip */
.looks-price-strip {
  background: #f9f9f7; border: 1px solid #e6e6e6; border-radius: 10px;
  padding: 14px 18px; margin-bottom: 24px;
}
.looks-price-strip-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: #aaa; margin-bottom: 10px; }
.looks-price-strip-tiers { display: flex; gap: 0; flex-wrap: nowrap; overflow-x: auto; }
.looks-price-tier {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  flex: 1; min-width: 0; padding: 8px 6px;
  border-right: 1px solid #e6e6e6; text-align: center;
}
.looks-price-tier:last-child { border-right: none; }
.lpt-count { font-size: 11px; color: #888; }
.lpt-price  { font-size: 14px; font-weight: 800; color: var(--text, #2b2b2b); }
/* Extra-selection steps: tighter than the looks strip — title sits close over the prices */
.sel-price-strip { padding: 10px 14px; }
.sel-price-strip .looks-price-strip-label { margin-bottom: 2px; text-align: center; }
.sel-price-strip .looks-price-tier { padding: 4px 6px; gap: 1px; }

/* Look groups */
.looks-group { margin-bottom: 28px; }
.looks-group-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 800; letter-spacing: -.01em;
  padding-bottom: 10px; margin-bottom: 12px;
  border-bottom: 2px solid #e6e6e6;
}
.looks-group-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* Look card */
.look-card {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border: 1.5px solid #e6e6e6; border-radius: 10px;
  padding: 12px 14px; margin-bottom: 10px; cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
  position: relative;
}
.look-card:not(.owned):hover { border-color: #d5a63a; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.look-card.selected { border-color: #d5a63a; background: #fffbf0; }
.look-card.owned    { border-color: #e6e6e6; background: #fafafa; cursor: default; opacity: .85; }

.look-card-thumb {
  width: 60px; height: 60px; border-radius: 8px; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(145deg, #e3ddd5 0%, #cec7bc 100%);
}
.look-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.look-card-nothumb   { width: 100%; height: 100%; }

.look-card-info { flex: 1; min-width: 0; }
.look-card-label {
  font-size: 14px; font-weight: 700; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 7px;
}
.look-card-count { font-size: 12px; color: #888; margin-top: 2px; }

.look-owned-badge {
  display: inline-block; background: #d5a63a; color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  padding: 2px 7px; border-radius: 10px; text-transform: uppercase;
}
.look-pending-badge {
  display: inline-block; margin-top: 5px; font-size: 10px; font-weight: 700;
  letter-spacing: .04em; color: #8a6200; background: #fff3cd;
  padding: 2px 8px; border-radius: 10px; text-transform: uppercase;
}
.look-dl-btn {
  display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 700;
  color: #2563a8; text-decoration: none; border-bottom: 1px solid #2563a8;
  transition: color .12s, border-color .12s;
}
.look-dl-btn:hover { color: #d5a63a; border-color: #d5a63a; }

.look-card-check {
  width: 24px; height: 24px; border: 2px solid #d0d0d0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: border-color .15s, background .15s;
}
.look-card-check svg { width: 14px; height: 14px; opacity: 0; transition: opacity .15s; }
.look-card.selected .look-card-check { background: #d5a63a; border-color: #d5a63a; }
.look-card.selected .look-card-check svg { opacity: 1; stroke: #fff; }

/* Sticky bar */
.looks-sticky-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #2b2b2b; color: #fff; z-index: 50;
  box-shadow: 0 -4px 20px rgba(0,0,0,.18);
  transition: transform .2s;
}
.looks-sticky-inner { max-width: 800px; margin: 0 auto; padding: 14px 20px; position: relative; }
.looks-sticky-close {
  position: absolute; top: 10px; right: 16px;
  background: none; border: none; padding: 6px; cursor: pointer;
  color: rgba(255,255,255,.5); line-height: 0;
  border-radius: 50%; transition: color .15s, background .15s;
}
.looks-sticky-close:hover { color: #fff; background: rgba(255,255,255,.1); }
.looks-sticky-hint { font-size: 13px; color: #aaa; text-align: center; padding: 6px 0; }
.looks-sticky-total { font-size: 15px; font-weight: 800; }
.looks-sticky-save  { font-size: 12px; color: #d5a63a; margin-top: 2px; }

.looks-select-btn, .looks-pay-btn {
  display: block; width: 100%; margin-top: 12px;
  padding: 12px 20px; background: #d5a63a; color: #fff;
  border: none; border-radius: 8px; font-size: 14px; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: background .15s;
}
.looks-select-btn:hover, .looks-pay-btn:hover { background: #b88c2f; }
.looks-pay-btn:disabled { background: #888; cursor: not-allowed; }

/* Pay form fields inside sticky bar */
.looks-pay-fields { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.looks-pay-row { display: flex; gap: 8px; }

/* Coupon row */
.looks-coupon-row { display: flex; gap: 8px; margin-top: 10px; margin-bottom: 2px; }
.looks-coupon-btn {
  padding: 0 16px; height: 38px; border: 1.5px solid #dde0e6; border-radius: 7px;
  background: transparent; font-size: 12px; font-weight: 700; color: #888;
  cursor: pointer; font-family: inherit; white-space: nowrap; flex-shrink: 0;
  transition: border-color .15s, color .15s;
}
.looks-coupon-btn:hover { border-color: #d5a63a; color: #b88c2f; }
.looks-pay-row-2 { flex-wrap: wrap; }
.looks-pay-row-3 { flex-wrap: wrap; }
.looks-input {
  flex: 1; min-width: 120px; padding: 9px 12px;
  background: #3a3a3a; border: 1px solid #555; border-radius: 6px;
  color: #fff; font-size: 13px; font-family: inherit;
  transition: border-color .15s;
}
.looks-input::placeholder { color: #888; }
.looks-input:focus { outline: none; border-color: #d5a63a; }
.looks-input-wide { min-width: 200px; flex: 2; }

.looks-pay-error {
  background: rgba(192,57,43,.15); border: 1px solid rgba(192,57,43,.35);
  border-radius: 6px; padding: 8px 12px; font-size: 12px; color: #ff8878;
  margin-top: 6px; line-height: 1.5;
}

.looks-success-msg {
  display: flex; align-items: flex-start; gap: 12px; padding: 8px 0;
}
.looks-success-msg svg { width: 24px; height: 24px; flex-shrink: 0; margin-top: 2px; }
.looks-success-msg strong { display: block; font-size: 14px; }
.looks-success-msg em { font-size: 12px; color: #bbb; font-style: normal; }

@media (max-width: 480px) {
  .looks-price-strip-tiers { gap: 0; }
  .looks-pay-row-2,
  .looks-pay-row-3 { flex-direction: column; }
  .looks-input { min-width: 0; }
}



/* ——— Screenshot protection ——— */
#screenshot-block-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #000;
  pointer-events: none;
}
#screenshot-block-overlay.is-active {
  display: flex;
  align-items: center;
  justify-content: center;
}
#screenshot-block-overlay .sp-msg {
  color: #fff;
  font-size: 14px;
  letter-spacing: .04em;
  opacity: .7;
}
.gallery-screenshot-protect img {
  -webkit-user-drag: none;
  -webkit-touch-callout: none; /* blocks iOS long-press save sheet */
  user-select: none;
}
