/* Ported by scripts/revamp_2026_11/port_card.py from the PM's prototype of 2026-11-09 — edit the PM source or the script, then re-run;
   docs/tasks/2026-11-10-pm-revamp-home-invite-studio/. */
/* ══ Invite Card gallery — compact discovery (2026-11-09, docs/tasks/2026-11-09-card-gallery-ux/) ══════════════════════════════════
   Loads AFTER the page's #main-dcard style block. Brand tokens only (brand.css --sm-*); no new brand colours.
   The idea: the invitations are the hero, shown the way a stationer shows printed cards — each one whole (never cropped) and standing
   on a blush mat, so 9:16, 2:3 and 5:7 artwork still line up in clean rows. Everything above the grid is one compact discovery bar.
   Gallery-only rules hang off body.cd-in-gallery (set by renderSteps on step 2) so Personalise / Preview / Share are untouched.
   ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════ */

/* ── page header: the Invite Video gallery's look — ◆ eyebrow, a large title, the subtitle and the progress on one line ── */
body.cd-in-gallery #main-dcard .content {
  max-width: calc(var(--sm-maxw) + 2 * var(--sm-gutter));
  padding: 18px var(--sm-gutter) 56px !important;      /* beats the template's inline padding-top */
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 32px; align-items: end;
}
body.cd-in-gallery #main-dcard .content > * { grid-column: 1 / -1; min-width: 0; }
body.cd-in-gallery #main-dcard .ph { grid-column: 1; text-align: left; margin: 0; padding: 0; }
body.cd-in-gallery #main-dcard .ph-eyebrow {
  display: flex; justify-content: flex-start; align-items: center; gap: 12px; margin: 0 0 10px;
  font: 500 13px/1.2 var(--sm-sans); letter-spacing: .24em; text-transform: uppercase; color: var(--sm-rose-text);
}
body.cd-in-gallery #main-dcard .ph-eyebrow::before {           /* ◆ in champagne */
  content: ""; display: block; flex: none; width: 7px; height: 7px; margin: 0 2px; transform: rotate(45deg);
  background: var(--sm-champagne); opacity: 1;
}
body.cd-in-gallery #main-dcard .ph-eyebrow::after {            /* a short champagne hairline, fading out */
  content: ""; display: block; flex: 0 0 52px; height: 1px; background: linear-gradient(90deg, var(--sm-champagne), transparent); opacity: .9;
}
body.cd-in-gallery #main-dcard .ph-title { font-size: clamp(34px, 3.1vw, 46px); line-height: 1.06; letter-spacing: -.005em; margin: 0 0 8px; }
body.cd-in-gallery #main-dcard .ph-sub { margin: 0; max-width: none; font-size: 17px; line-height: 1.5; color: var(--sm-text); }

/* progress: numbered (it is a real sequence), the current step in wine, the rest quiet; champagne hairlines between */
body.cd-in-gallery #main-dcard .content > #cdSteps { grid-column: 2; justify-content: flex-end; flex-wrap: nowrap; gap: 2px; margin: 0 0 1px; }
body.cd-in-gallery #cdSteps .cd-step { gap: 8px; padding: 4px 2px; font-size: 15px; color: var(--sm-muted); white-space: nowrap; }
body.cd-in-gallery #cdSteps .cd-step.active { color: var(--sm-wine); font-weight: 500; }
body.cd-in-gallery #cdSteps .cd-step:disabled { opacity: 1; }
body.cd-in-gallery #cdSteps .step-num { width: 24px; height: 24px; border-width: 1.2px; font-size: 12.5px; }
body.cd-in-gallery #cdSteps .cd-step:not(.active) .step-num { border-color: var(--sm-muted); color: var(--sm-muted); }
body.cd-in-gallery #cdSteps .step-line { width: 32px; margin: 0 8px; background: var(--sm-champagne); opacity: .5; }
body.cd-in-gallery #cdBody { margin-top: 30px; }
/* the template's own Back to studio / My invitations row */
body.cd-in-gallery #main-dcard .content > div[style*="text-align:center"] { margin-top: 28px !important; }

/* ── the discovery bar ── */
.cdg { display: flex; flex-direction: column; gap: 16px; }
.cdg svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cdg button { font-family: var(--sm-sans); }
.cdg button:focus-visible, .cdg select:focus-visible { outline: 2px solid var(--sm-wine); outline-offset: 2px; }

/* "Choose an occasion" over ONE segmented track (the selected occasion a wine pill), the result count at the row's end */
.cdg-occwrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label ." "bar count"; align-items: center; gap: 12px 24px; }
.cdg-occ-l { grid-area: label; font: 500 16px/1.2 var(--sm-sans); color: var(--sm-ink); }
.cdg-occ-l[hidden] { display: none; }
.cdg-occ { grid-area: bar; display: flex; align-items: center; gap: 8px; min-width: 0; }
.cdg-occ[hidden] { display: none; }
.cdg .cdg-seg {
  flex: 0 1 auto; min-width: 0; display: flex; flex-wrap: nowrap; gap: 4px; margin: 0; padding: 5px; overflow-x: auto; scrollbar-width: none;
  border: 1px solid var(--sm-line); border-radius: var(--sm-r-pill); background: var(--sm-surface); box-shadow: 0 14px 30px -26px rgba(90, 30, 40, .55);
}
.cdg .cdg-seg::-webkit-scrollbar { display: none; }
.cdg .cdg-seg .cd-chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 18px; border: 0; border-radius: var(--sm-r-pill);
  background: transparent; color: var(--sm-ink); font: 500 15.5px/1 var(--sm-sans); box-shadow: none; transition: background-color .2s var(--sm-ease), color .2s var(--sm-ease);
}
.cdg .cdg-seg .cd-chip:hover { background: var(--sm-bg-alt); color: var(--sm-wine); }
.cdg .cdg-seg .cd-chip.on { background: var(--sm-wine); color: #fff; font-weight: 600; box-shadow: var(--sm-shadow-btn); }
.cdg .cdg-seg .cd-chip-n { margin: 0; font-size: 13px; font-weight: 400; color: var(--sm-muted); opacity: 1; }
.cdg .cdg-seg .cd-chip.on .cd-chip-n { color: rgba(255, 255, 255, .8); }
.cdg .cdg-seg .cd-chip:focus-visible { outline: 2px solid var(--sm-wine); outline-offset: -2px; }
.cdg-more { display: none; }
body.cdg-occ-overflow .cdg-more {        /* shown only when the occasions do not fit on the track */
  display: inline-flex; align-items: center; flex: none; height: 50px; padding: 0 16px; border: 1px dashed rgba(125, 46, 62, .4);
  border-radius: var(--sm-r-pill); background: var(--sm-surface); color: var(--sm-wine); font-size: 15px; font-weight: 500; cursor: pointer;
}
.cdg-count { grid-area: count; font-size: 15.5px; color: var(--sm-muted); white-space: nowrap; }

/* an occasion's types: a quieter row of text tabs under the track */
.cdg .cd-type-chips[hidden] { display: none; }
.cdg .cd-type-chips { gap: 4px; margin: -6px 0 0 6px; }
.cdg .cd-type-chips .cd-chip { min-height: 34px; padding: 6px 13px; font-size: 14.5px; border-color: transparent; background: transparent; color: var(--sm-text); }
.cdg .cd-type-chips .cd-chip:hover { color: var(--sm-wine); background: var(--sm-surface); border-color: var(--sm-line); }
.cdg .cd-type-chips .cd-chip-n { opacity: 1; color: var(--sm-muted); }
.cdg .cd-type-chips .cd-chip.on .cd-chip-n { color: var(--sm-wine); }
.cdg .cd-type-chips .cd-chip.on { background: var(--sm-wine-soft); border-color: rgba(125, 46, 62, .28); color: var(--sm-wine); }

/* search + tools: the same paper, hairline and pill as the occasion track */
.cdg-find { display: flex; align-items: center; gap: 10px; }
.cdg-search { position: relative; flex: 1 1 auto; max-width: 640px; min-width: 0; }
.cdg-search input {
  width: 100%; height: 48px; padding: 0 52px 0 48px; border: 1px solid var(--sm-line); border-radius: var(--sm-r-pill);
  background: var(--sm-surface); color: var(--sm-ink); font: 400 16px/1.2 var(--sm-sans); box-shadow: 0 14px 30px -26px rgba(90, 30, 40, .55);
  -webkit-appearance: none; appearance: none; transition: border-color .2s var(--sm-ease), box-shadow .2s var(--sm-ease);
}
.cdg-search input::placeholder { color: var(--sm-muted); opacity: 1; }
.cdg-search input:placeholder-shown { padding-right: 18px; }   /* the clear button only shows once there is text */
.cdg-search input::-webkit-search-cancel-button, .cdg-search input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.cdg-search input:hover { border-color: rgba(125, 46, 62, .3); }
.cdg-search input:focus { outline: none; border-color: var(--sm-wine); box-shadow: 0 0 0 3px rgba(125, 46, 62, .12); }
.cdg-search-i { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); display: grid; color: var(--sm-rose); pointer-events: none; }
.cdg-search-i svg { width: 20px; height: 20px; }
.cdg-qx { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--sm-muted); cursor: pointer; }
.cdg-qx[hidden] { display: none; }
.cdg-qx:hover { background: var(--sm-bg-alt); color: var(--sm-wine); }
.cdg-qx svg { width: 18px; height: 18px; }

.cdg-fbtn, .cdg-saved {
  position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 18px;
  border: 1px solid var(--sm-line); border-radius: var(--sm-r-pill); background: var(--sm-surface); color: var(--sm-ink);
  font-size: 15px; font-weight: 500; cursor: pointer; transition: border-color .2s, background-color .2s, color .2s;
}
.cdg-fbtn svg { width: 18px; height: 18px; color: var(--sm-wine); }
.cdg-fbtn:hover, .cdg-fbtn.on { border-color: var(--sm-wine); color: var(--sm-wine); }
.cdg-fbtn-n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--sm-wine); color: #fff; font-size: 12px; font-weight: 600; }
.cdg-fbtn-n[hidden] { display: none; }
.cdg-saved svg { color: var(--sm-wine); }
.cdg-saved:hover { border-color: var(--sm-wine); color: var(--sm-wine); }
.cdg-saved.on { background: var(--sm-wine); border-color: var(--sm-wine); color: #fff; }
.cdg-saved.on svg { color: #fff; fill: currentColor; }
.cdg-saved .cd-chip-n { opacity: .75; font-weight: 400; }

.cdg-sort { position: relative; flex: none; display: inline-flex; align-items: center; height: 48px; padding-left: 18px; border: 1px solid var(--sm-line);
  border-radius: var(--sm-r-pill); background: var(--sm-surface); }
.cdg-sort:hover { border-color: rgba(125, 46, 62, .35); }
.cdg-sort:focus-within { border-color: var(--sm-wine); }
.cdg-sort label { font-size: 14.5px; color: var(--sm-muted); cursor: pointer; }
.cdg-sort select {
  height: 100%; padding: 0 40px 0 6px; border: 0; border-radius: var(--sm-r-pill); background: transparent; color: var(--sm-ink);
  font: 500 15px/1 var(--sm-sans); cursor: pointer; -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237D2E3E' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 18px;
}
.cdg-sort select:focus { outline: none; }

.cdg-helpme { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 40px; margin-left: auto; padding: 0 4px; border: 0; background: none;
  color: var(--sm-wine); font-size: 15px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.cdg-helpme svg { width: 17px; height: 17px; color: var(--sm-champagne); }
.cdg-helpme:hover { text-decoration: underline; text-underline-offset: 3px; }

/* what is applied: removable chips + Clear all */
.cdg-active { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; margin-top: -4px; }
.cdg-active[hidden] { display: none; }
.cdg-achip {
  display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 8px 0 13px; border: 1px solid rgba(125, 46, 62, .2);
  border-radius: var(--sm-r-pill); background: var(--sm-bg-alt); color: var(--sm-wine); font-size: 14px; font-weight: 500; cursor: pointer;
}
.cdg-achip svg { width: 16px; height: 16px; opacity: .8; }
.cdg-achip:hover { border-color: var(--sm-wine); }
.cdg-clear { height: 34px; padding: 0 6px; border: 0; background: none; color: var(--sm-wine); font-size: 14px; font-weight: 500; cursor: pointer;
  text-decoration: underline; text-decoration-color: rgba(125, 46, 62, .35); text-underline-offset: 3px; }
.cdg-clear:hover { text-decoration-color: currentColor; }
.cdg-clear:disabled { color: var(--sm-muted); text-decoration: none; cursor: default; }

/* ── the grid: 5 / 4 / 3 / 2 columns ── */
.cdg .cdg-grid { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 30px 22px; }
@media (max-width: 1279px) { .cdg .cdg-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1023px) { .cdg .cdg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px 16px; } }
@media (max-width: 639px)  { .cdg .cdg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; } }

/* a card: the mat (opens the preview), ♡, badges, the name + occasion · style, Preview + Personalise */
.cdg .cdg-card {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "art" "info" "acts";
  align-content: start; gap: 0; min-width: 0; cursor: default; animation: none; outline: none;
}
.cdg-mat {
  grid-area: art; position: relative; display: block; width: 100%; aspect-ratio: 2 / 3; padding: 0; margin: 0; border: 0;
  border-radius: var(--sm-r-tile); background: var(--sm-bg-alt); cursor: zoom-in; -webkit-tap-highlight-color: transparent;
}
.cdg-mat-in { position: absolute; inset: 4.667% 7%; display: grid; place-items: center; }
.cdg-art {
  display: block; max-width: none; object-fit: cover; border-radius: 3px;
  background: color-mix(in srgb, var(--cd-a, var(--sm-line)) 16%, var(--sm-surface));   /* while it loads: a wash of the design's own colour */
  box-shadow: 0 1px 1px rgba(90, 30, 40, .08), 0 14px 26px -16px rgba(90, 30, 40, .6);
  transition: transform .3s var(--sm-ease), box-shadow .3s var(--sm-ease);
}
.cdg-ph { display: none; }
.cdg-mat-missing { background: radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--cd-a, var(--sm-rose)) 26%, transparent), transparent 70%), var(--sm-bg-alt); }
.cdg-mat-missing .cdg-ph {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; padding: 12px; box-sizing: border-box;
  border: 1px solid var(--sm-line); border-radius: 6px; text-align: center; font: 600 20px/1.2 var(--sm-serif); color: var(--sm-wine);
}
.cdg-mat:focus-visible { outline: 2px solid var(--sm-wine); outline-offset: 3px; }

.cdg .cdg-heart {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 40px; height: 40px; display: grid; place-items: center; padding: 0;
  border: 1px solid var(--sm-line); border-radius: 50%; background: rgba(255, 253, 251, .94); color: var(--sm-wine); box-shadow: none; font-size: 0;
}
.cdg .cdg-heart svg { width: 20px; height: 20px; }
.cdg .cdg-heart.on { background: var(--sm-wine); border-color: var(--sm-wine); color: #fff; }
.cdg .cdg-heart.on svg { fill: currentColor; }
.cdg-badge { grid-area: art; z-index: 2; justify-self: start; padding: 3px 9px; border-radius: var(--sm-r-pill); font: 500 12px/1.4 var(--sm-sans); pointer-events: none; }
.cdg-badge-p { align-self: start; margin: 12px 0 0 12px; background: var(--sm-wine); color: #fff; }
.cdg-badge-f { align-self: end; margin: 0 0 12px 12px; background: rgba(255, 253, 251, .95); color: var(--sm-wine); border: 1px solid var(--sm-line); }

.cdg-info { grid-area: info; display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 12px 2px 0; }
.cdg-name { font: 600 19px/1.2 var(--sm-serif); color: var(--sm-wine); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cdg-sub { font: 400 13.5px/1.4 var(--sm-sans); color: var(--sm-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cdg-acts { grid-area: acts; display: flex; gap: 8px; padding-top: 10px; }
.cdg-act {
  flex: 1 1 0; min-width: 0; height: 40px; padding: 0 8px; border-radius: var(--sm-r-pill); font-size: 14px; font-weight: 500; line-height: 1;
  white-space: nowrap; cursor: pointer; transition: background-color .2s, border-color .2s, color .2s;
}
.cdg-act-pv { border: 1px solid var(--sm-line); background: var(--sm-surface); color: var(--sm-ink); }
.cdg-act-pv:hover { border-color: var(--sm-wine); color: var(--sm-wine); }
.cdg-act-use { border: 1px solid transparent; background: var(--sm-wine-soft); color: var(--sm-wine); }
.cdg-act-use:hover { background: var(--sm-wine); color: #fff; }

/* mouse + trackpad: the actions rise over the mat on hover (or keyboard focus); the card lifts off its mat */
@media (hover: hover) and (pointer: fine) {
  .cdg-acts {
    grid-area: art; align-self: end; z-index: 3; padding: 56px 12px 12px; border-radius: 0 0 var(--sm-r-tile) var(--sm-r-tile);
    background: linear-gradient(180deg, rgba(245, 233, 227, 0), rgba(245, 233, 227, .96) 52%);
    opacity: 0; transform: translateY(6px); pointer-events: none; transition: opacity .2s var(--sm-ease), transform .2s var(--sm-ease);
  }
  .cdg-act-pv { border-color: rgba(125, 46, 62, .3); color: var(--sm-wine); }
  .cdg-act-use { background: var(--sm-wine); color: #fff; box-shadow: var(--sm-shadow-btn); }
  .cdg-act-use:hover { background: var(--sm-wine-hover); }
  .cdg-card:hover .cdg-acts { opacity: 1; transform: none; }
  .cdg-card:hover .cdg-act { pointer-events: auto; }
  .cdg-card:hover .cdg-art { transform: translateY(-4px); box-shadow: 0 2px 3px rgba(90, 30, 40, .08), 0 26px 38px -22px rgba(90, 30, 40, .62); }
}
@media (hover: hover) and (pointer: fine) {
  @supports selector(:has(*)) {
    .cdg-card:has(:focus-visible) .cdg-acts { opacity: 1; transform: none; }
    .cdg-card:has(:focus-visible) .cdg-act { pointer-events: auto; }
  }
  @supports not selector(:has(*)) {
    .cdg-card:focus-within .cdg-acts { opacity: 1; transform: none; }
    .cdg-card:focus-within .cdg-act { pointer-events: auto; }
  }
}

/* ── nothing found: say why, offer what does exist, one way out ── */
.cdg-none { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 56px 16px 40px; text-align: center; }
.cdg-none-t { margin: 0; font: 600 28px/1.15 var(--sm-serif); color: var(--sm-wine); }
.cdg-none-s { margin: 0; font-size: 15.5px; color: var(--sm-text); }
.cdg-try { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }
.cdg-none-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; }

.cdg .cd-back-row { margin-top: 26px; }
.cdg .cd-back-row .cd-link-btn { min-height: 44px; padding: 0 12px; }

/* ── the Filters panel: a side sheet; a bottom sheet on phones ── */
.cdg-fp[hidden] { display: none; }
.cdg-fp { position: fixed; inset: 0; z-index: 2100; font-family: var(--sm-sans); }
.cdg-fp-scrim { position: absolute; inset: 0; background: rgba(58, 42, 47, .42); opacity: 0; transition: opacity .22s var(--sm-ease); }
.cdg-fp-sheet {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%); display: flex; flex-direction: column; box-sizing: border-box;
  background: var(--sm-surface); border-radius: var(--sm-r-card) 0 0 var(--sm-r-card); box-shadow: var(--sm-shadow-pop);
  opacity: 0; transform: translateX(28px); transition: opacity .24s var(--sm-ease), transform .24s var(--sm-ease);
}
.cdg-fp.in .cdg-fp-scrim { opacity: 1; }
.cdg-fp.in .cdg-fp-sheet { opacity: 1; transform: none; }
.cdg-fp svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.cdg-fp-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 18px 14px 24px; border-bottom: 1px solid var(--sm-line); }
.cdg-fp-t { margin: 0; font: 600 28px/1.1 var(--sm-serif); color: var(--sm-wine); }
.cdg-fp-x { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--sm-line); border-radius: 50%; background: var(--sm-surface); color: var(--sm-ink); cursor: pointer; }
.cdg-fp-x:hover { border-color: var(--sm-wine); color: var(--sm-wine); }
.cdg-fp-b { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 4px 24px 20px; }
.cdg-fs { margin: 0; padding: 18px 0 16px; border: 0; min-width: 0; }
.cdg-fs + .cdg-fs { border-top: 1px solid var(--sm-line); }
.cdg-fs legend { float: left; width: 100%; margin: 0 0 12px; padding: 0; font: 600 15px/1.2 var(--sm-sans); color: var(--sm-ink); }
.cdg-fs legend + * { clear: left; }
.cdg-fs-occ { display: none; }
.cdg-fs-occ + .cdg-fs { border-top: 0; }
body.cdg-occ-overflow .cdg-fs-occ { display: block; }
body.cdg-occ-overflow .cdg-fs-occ + .cdg-fs { border-top: 1px solid var(--sm-line); }
.cdg-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.cdg-opt {
  position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; box-sizing: border-box;
  border: 1px solid var(--sm-line); border-radius: var(--sm-r-pill); background: var(--sm-surface); color: var(--sm-ink);
  font: 500 14.5px/1 var(--sm-sans); cursor: pointer; user-select: none; transition: background-color .15s, border-color .15s, color .15s;
}
.cdg-opt input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.cdg-opt:hover { border-color: var(--sm-wine); color: var(--sm-wine); }
.cdg-opt.on { background: var(--sm-wine); border-color: var(--sm-wine); color: #fff; }
.cdg-opt .cd-chip-n { font-size: 13px; font-weight: 400; opacity: .75; }
.cdg-sw { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(58, 42, 47, .18); flex: none; }
.cdg-opt.on .cdg-sw { box-shadow: 0 0 0 1.5px #fff; }
@supports selector(:has(*)) { .cdg-opt:has(input:focus-visible) { outline: 2px solid var(--sm-wine); outline-offset: 2px; } }
@supports not selector(:has(*)) { .cdg-opt:focus-within { outline: 2px solid var(--sm-wine); outline-offset: 2px; } }
.cdg-fp-f {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--sm-line); background: var(--sm-surface); border-radius: 0 0 0 var(--sm-r-card);
}
.cdg-fp-go { flex: 0 1 auto; min-height: 48px; }

/* ── the preview: Save from here too ── */
#cdModal .cd-modal-acts .btn-sm { justify-content: center; }
.cdg-msave svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.cdg-msave.on { background: var(--sm-bg-alt); border-color: rgba(125, 46, 62, .35); }
.cdg-msave.on svg { fill: currentColor; }

/* ── tablet ── */
@media (max-width: 1023px) {
  body.cd-in-gallery #main-dcard .content { grid-template-columns: minmax(0, 1fr); }
  body.cd-in-gallery #main-dcard .content > #cdSteps { grid-column: 1; justify-content: flex-start; margin: 14px 0 0; }
  body.cd-in-gallery #cdBody { margin-top: 24px; }
  .cdg-find { flex-wrap: wrap; }
  .cdg-search { flex: 1 1 100%; max-width: none; }
  .cdg-occwrap { grid-template-areas: "label count" "bar bar"; }
  .cdg .cdg-seg .cd-chip { padding: 0 13px; font-size: 15px; }
  .cdg .cdg-seg .cd-chip-n { font-size: 12.5px; }
}

/* ── phones ── */
@media (max-width: 767px) {
  body.cd-in-gallery #main-dcard .content { padding-top: 16px !important; }
  body.cd-in-gallery #main-dcard .ph-title { font-size: 31px; }
  body.cd-in-gallery #main-dcard .ph-sub { font-size: 15.5px; }
  body.cd-in-gallery #main-dcard .content > #cdSteps { margin-top: 10px; }
  body.cd-in-gallery #cdSteps .cd-step:not(.active) .cd-step-l { display: none; }
  body.cd-in-gallery #cdSteps .step-line { width: 14px; margin: 0 4px; }
  .cdg { gap: 12px; }
  body.cd-in-gallery #main-dcard .ph-eyebrow { font-size: 12px; margin-bottom: 8px; }
  body.cd-in-gallery #cdBody { margin-top: 20px; }
  .cdg-occ-l { font-size: 15px; }
  .cdg-count { font-size: 14.5px; }
  .cdg-occ { gap: 6px; }
  .cdg .cdg-seg { flex: 1 1 auto; padding: 4px; }
  .cdg .cdg-seg .cd-chip { min-height: 38px; padding: 0 14px; font-size: 15px; }
  body.cdg-occ-overflow .cdg-more { height: 46px; padding: 0 14px; }
  .cdg .cd-type-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: -4px calc(-1 * var(--sm-gutter)) 0; padding: 0 var(--sm-gutter) 2px; }

  .cdg-find { display: grid; grid-template-columns: 1fr 1fr auto; grid-template-areas: "q q v" "f s s" "h h h"; gap: 10px; }
  .cdg-search { grid-area: q; }
  .cdg-saved { grid-area: v; padding: 0 14px; }
  .cdg-fbtn { grid-area: f; height: 44px; }
  .cdg-sort { grid-area: s; height: 44px; padding-left: 14px; }
  .cdg-sort select { flex: 1 1 auto; min-width: 0; font-size: 16px; }   /* 16px: iOS does not zoom the page */
  .cdg-helpme { grid-area: h; justify-self: end; height: 36px; margin: -4px 0 -6px; }
  .cdg-active { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--sm-gutter)); padding: 0 var(--sm-gutter); }
  .cdg-active::-webkit-scrollbar { display: none; }
  .cdg-achip, .cdg-clear { flex: none; height: 36px; }

  .cdg-info { padding-top: 10px; }
  .cdg-name { font-size: 17px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .cdg-sub { font-size: 13px; }
  .cdg-acts { gap: 6px; padding-top: 8px; }
  .cdg-act { height: 40px; padding: 0 4px; font-size: 13.5px; }
  .cdg .cdg-heart { top: 8px; right: 8px; width: 38px; height: 38px; }
  .cdg-badge-p { margin: 8px 0 0 8px; } .cdg-badge-f { margin: 0 0 8px 8px; }

  .cdg-fp-sheet {
    top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 88vh; max-height: 88dvh;
    border-radius: var(--sm-r-card) var(--sm-r-card) 0 0; transform: translateY(32px);
  }
  .cdg-fp-h { position: relative; padding: 22px 16px 12px 20px; }
  .cdg-fp-h::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--sm-line); }
  .cdg-fp-t { font-size: 26px; }
  .cdg-fp-b { padding: 0 20px 16px; }
  .cdg-fp-f { padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px)); border-radius: 0; }
  .cdg-fp-go { flex: 1 1 auto; }
  .cdg-opt { min-height: 44px; font-size: 15px; }
}
@media (max-width: 479px) {
  .cdg-saved-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  .cdg-art, .cdg-acts, .cdg-fp-scrim, .cdg-fp-sheet, .cdg-saved, .cdg-act, .cdg-opt { transition: none !important; }
  .cdg-card:hover .cdg-art { transform: none; }
}

