/* Catalog — Bigstep-clean dark + rose (matches homepage) */
:root {
  --catalog-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sf-bg: #0a0b10;
  --sf-card: #18161f;
  --sf-elev: #1e1a26;
  --sf-ink: #f7f0f4;
  --sf-muted: #9a8a96;
  --sf-line: rgba(255, 182, 210, 0.12);
  --sf-rose: #e11d74;
  --sf-rose-bright: var(--rose-bright, #e56b95);
}

.starry {
  background:
    radial-gradient(ellipse 60% 40% at 80% 10%, rgba(225, 29, 116, 0.14), transparent 55%),
    radial-gradient(ellipse 50% 35% at 10% 70%, rgba(225, 29, 116, 0.08), transparent 50%),
    linear-gradient(180deg, #0c0b12 0%, #0a0b10 100%) !important;
}

.page { padding: 22px 24px 44px; }
.shell { max-width: 1440px; }

/* Header / menu chrome lives in /assets/site-header.css (shared across pages). */
.brand {
  margin-bottom: 26px;
  gap: 20px;
  animation: catalog-header-in 0.7s var(--catalog-ease) both;
}
@keyframes catalog-header-in {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.brand h1 { flex: 0 0 auto; margin: 0; font-size: 28px; color: #fff; }
.catalog-home { flex: 0 0 auto; }
.brand h1 .lemy-logo--custom { width: auto; max-width: 148px; max-height: 48px; }
.brand .lemy-wordmark-text { color: #fff; font-size: 24px; }
.brand .lemy-wordmark-text > span { color: var(--sf-rose-bright); }
.brand .brand-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.catalog-menu-toggle { display: none; }

.card {
  padding: 28px;
  border-radius: 28px;
  background: var(--sf-card);
  border: 1px solid var(--sf-line);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  color: var(--sf-ink);
  animation: catalog-card-in 0.75s var(--catalog-ease) 0.06s both;
}
@keyframes catalog-card-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.studio,
body.app-view-buy .studio { display: block; }
.studio-main { width: 100%; min-width: 0; }
.studio > .studio-preview { display: none !important; }
.studio-main .section-head {
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 182, 210, 0.08);
}
.catalog-heading { min-width: 0; flex: 1; }
.catalog-eyebrow { display: none; }
.catalog-title {
  margin: 0;
  color: #fff;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(30px, 3.2vw, 42px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.catalog-description { display: none; }
.catalog-centered > .seo-catalog-links {
  justify-content: center;
  text-align: center;
}
.catalog-centered > .seo-catalog-links a {
  text-decoration: none;
  transition: color 0.2s ease;
}
.catalog-centered > .seo-catalog-links a:hover,
.catalog-centered > .seo-catalog-links a:focus-visible { color: #ffb6d2; }
.catalog-centered > .seo-catalog-links a:focus-visible {
  outline: 2px solid #ffb6d2;
  outline-offset: 5px;
  border-radius: 3px;
}
.studio-main .catalog-centered > .section-head {
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  text-align: center;
}
.catalog-centered .catalog-heading { flex: 0 1 auto; }
.catalog-centered .catalog-title {
  padding-block: 10px 8px;
  font-size: clamp(34px, 4.4vw, 56px);
  line-height: 1.22;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.catalog-title-accent { color: #f6b4d0; }
.catalog-centered > .filter-bar {
  justify-content: center;
  flex-wrap: wrap;
  overflow-x: visible;
}
.studio-main .section-head .badge {
  flex-shrink: 0;
  align-self: center;
  padding: 8px 14px;
  border: 1px solid rgba(225, 29, 116, 0.28);
  background: linear-gradient(180deg, rgba(225, 29, 116, 0.22), rgba(225, 29, 116, 0.12));
  color: #ffc0d8;
  font-family: "Manrope", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.filter-bar {
  gap: 8px;
  margin-bottom: 24px;
  padding-bottom: 2px;
}
.filter-chip {
  min-height: 38px;
  padding: 8px 16px;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  color: #b9a8b4;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.filter-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(225, 29, 116, 0.4);
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}
.filter-chip.active {
  border-color: rgba(225, 29, 116, 0.5);
  color: #fff;
  background: linear-gradient(180deg, rgba(225, 29, 116, 0.38), rgba(225, 29, 116, 0.22));
  box-shadow: 0 6px 16px rgba(225, 29, 116, 0.18);
}

.template-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 16px; }
.template-grid { scroll-margin-top: 110px; }
.catalog-pagination { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; margin-top: 24px; text-align: center; }
.catalog-pagination[hidden] { display: none; }
.catalog-pagination-buttons { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.catalog-pagination button { min-width: 42px; min-height: 42px; padding: 8px 12px; border: 1px solid var(--sf-line); border-radius: 10px; background: var(--sf-elev); color: var(--sf-ink); font: 600 13px/1.4 "Manrope", sans-serif; cursor: pointer; }
.catalog-pagination button:hover { border-color: var(--sf-rose-bright); }
.catalog-pagination button[aria-current="page"] { background: var(--sf-rose); color: #fff; border-color: var(--sf-rose); }
.catalog-pagination button:disabled { opacity: .4; cursor: default; }
.catalog-pagination button:focus-visible { outline: 2px solid var(--sf-rose-bright); outline-offset: 3px; }
.catalog-pagination-buttons > span { color: var(--sf-muted); }
.template-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--sf-line);
  border-radius: 20px;
  background: var(--sf-elev);
  text-align: left;
  box-shadow: none;
  cursor: default;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.3s var(--catalog-ease);
}
.template-card:hover {
  transform: translateY(-6px);
  border-color: rgba(225, 29, 116, 0.4);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
}
.template-card.selected {
  border-color: rgba(225, 29, 116, 0.5);
  background: #221c2a;
  box-shadow: 0 0 0 1px rgba(225, 29, 116, 0.2);
}
.template-card .check,
.template-card.selected .check { display: none; }

.template-card .thumb.card-preview-button {
  appearance: none;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background-color: #121018;
  background-position: center;
  background-size: cover;
  text-align: center;
  cursor: pointer;
  isolation: isolate;
  overflow: hidden;
  font: inherit;
  transition: transform 0.45s var(--catalog-ease);
}
.template-card:hover .thumb-photo,
.template-card.selected .thumb-photo { background-size: cover; }
.template-card:hover .thumb.card-preview-button { transform: scale(1.03); }

.template-card .template-meta { display: flex; flex: 1; flex-direction: column; padding: 14px; }
.template-card .template-meta h3 {
  min-height: 3.1em; margin: 0 0 9px;
  color: #f0e6ec; font-size: 14px; font-weight: 700; line-height: 1.5;
  text-align: left; overflow-wrap: anywhere;
}
.template-card .template-meta-row { justify-content: flex-end; min-height: 25px; margin-top: auto; margin-bottom: 10px; }
.template-card .template-meta .price {
  justify-content: flex-end; flex-wrap: wrap; gap: 3px 6px;
  color: #ff8fb0; font-size: 16px; font-weight: 700; line-height: 1.4; text-align: right;
}
.template-card .template-meta .price-old { flex-basis: 100%; color: #7a6c78; font-size: 11px; font-weight: 500; }
.template-card .template-meta .price-sale { color: #ff8fb0; white-space: nowrap; }
.template-card .template-meta .sale-badge {
  border: 1px solid rgba(120, 200, 120, 0.35); border-radius: 5px;
  color: #8fd99a; background: rgba(80, 160, 90, 0.15); font-size: 9px; font-weight: 600; padding: 2px 5px;
}

.card-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.card-actions .card-buy-btn,
.card-actions .card-demo-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 38px;
  margin: 0;
  padding: 9px 8px;
  border: 1px solid rgba(225, 29, 116, 0.35);
  border-radius: 999px;
  font: 700 12px/1.25 "Manrope", sans-serif;
  letter-spacing: 0;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.25s ease, transform 0.25s var(--catalog-ease), border-color 0.2s ease;
}
.card-actions svg { flex: 0 0 16px; width: 16px; height: 16px; }
.card-actions .card-buy-btn {
  border-color: transparent;
  background: var(--sf-rose);
  color: #fff;
  box-shadow: 0 8px 20px rgba(225, 29, 116, 0.3);
}
.card-actions .card-buy-btn:hover {
  background: color-mix(in srgb, var(--sf-rose) 88%, #fff);
  box-shadow: 0 10px 24px rgba(225, 29, 116, 0.4);
  transform: translateY(-2px);
}
.card-actions .card-demo-btn {
  background: transparent;
  color: #ffb0d0;
  box-shadow: none;
}
.card-actions .card-demo-btn:hover {
  border-color: rgba(225, 29, 116, 0.5);
  background: rgba(225, 29, 116, 0.12);
  transform: translateY(-2px);
}
.card-actions button:active { transform: translateY(0) scale(0.98); }

.catalog-nav-link:focus-visible,
.brand a:focus-visible,
.catalog-menu-toggle:focus-visible,
.card-preview-button:focus-visible,
.card-buy-btn:focus-visible,
.card-demo-btn:focus-visible,
.catalog-inline-preview:focus-visible,
.catalog-preview-modal button:focus-visible { outline: 2px solid var(--sf-rose-bright); outline-offset: 3px; }
.card-preview-button:focus-visible { outline-offset: -4px; }

/* Buy form — dark */
body.app-view-buy main.card {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
body.app-view-buy .buy-form-panel {
  width: 100%; max-width: 880px; max-height: none; margin: 0 auto; padding: 22px;
  overflow: visible;
  border: 1px solid var(--sf-line);
  border-radius: 22px;
  background: var(--sf-elev);
  box-shadow: none;
  color: var(--sf-ink);
}
body.app-view-buy .buy-form-head { grid-template-columns: 44px minmax(0, 1fr) auto; }
body.app-view-buy .buy-form-head h2,
.buy-form-head h2 { color: #fff !important; }
.buy-form-sub { color: var(--sf-muted) !important; }
.btn-buy-back {
  color: #ffb0d0 !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: var(--sf-line) !important;
}
.catalog-inline-preview {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  grid-column: 3; grid-row: 1 / 3; min-height: 40px; padding: 9px 14px;
  border: 1px solid rgba(225, 29, 116, 0.35); border-radius: 999px;
  background: rgba(225, 29, 116, 0.12); color: #ffb0d0;
  font: 650 12px/1.4 "Manrope", sans-serif; cursor: pointer;
}
.catalog-inline-preview:hover { background: rgba(225, 29, 116, 0.22); }

.card .section { border-bottom-color: var(--sf-line); }
.card .field label,
.card label { color: #e8d6de !important; }
.card .hint,
.card .buy-form-sub,
.card .status { color: var(--sf-muted) !important; }
.card input,
.card textarea,
.card select {
  background: #121018 !important;
  border-color: var(--sf-line) !important;
  color: #fff !important;
}
.card input::placeholder,
.card textarea::placeholder { color: #6f6370 !important; }
.card input:focus,
.card textarea:focus,
.card select:focus {
  border-color: rgba(225, 29, 116, 0.5) !important;
  outline-color: var(--sf-rose-bright);
}

/* Preview modal — dark chrome, keep device light */
.catalog-preview-modal {
  width: min(1200px, calc(100vw - 40px));
  height: min(920px, calc(100dvh - 36px));
  max-width: none; max-height: none; margin: auto; padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  background: var(--sf-card);
  color: var(--sf-ink);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
.catalog-preview-modal:not([open]) { display: none; }
.catalog-preview-modal::backdrop { background: rgba(6, 5, 10, 0.72); backdrop-filter: blur(6px); }
.catalog-preview-surface { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: 100%; height: 100%; }
.catalog-preview-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 18px; border-bottom: 1px solid var(--sf-line); background: var(--sf-card);
}
.catalog-preview-head h2 {
  flex: 1; min-width: 0; margin: 0; color: #fff;
  font: 600 15px/1.45 "Manrope", sans-serif; letter-spacing: -0.02em; overflow-wrap: anywhere;
}
.catalog-preview-close {
  appearance: none; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 12px; border: 1px solid rgba(244, 165, 198, 0.18); border-radius: 12px;
  background: linear-gradient(135deg, rgba(244, 165, 198, 0.08), rgba(244, 165, 198, 0.03)); color: #ead4df;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  font: 600 12px/1.35 "Manrope", sans-serif; cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.catalog-preview-close svg { flex-shrink: 0; opacity: 0.8; }
.catalog-preview-close:hover { background: rgba(225, 29, 116, 0.14); border-color: rgba(244, 165, 198, 0.38); color: #fff0f6; }
.catalog-preview-close:active { background: rgba(225, 29, 116, 0.22); }
.catalog-preview-close:focus-visible { outline: 2px solid #f3a5c5; outline-offset: 3px; }

.catalog-preview-modal .studio-preview,
body.app-view-products .catalog-preview-modal .studio-preview,
body.app-view-preview .catalog-preview-modal .studio-preview,
body.app-view-buy .catalog-preview-modal .studio-preview {
  display: block; position: static; order: initial; align-self: stretch;
  width: 100%; max-width: none; min-width: 0; min-height: 0; padding: 0;
}
.catalog-preview-modal .preview-panel,
body.app-view-buy .catalog-preview-modal .preview-panel {
  display: grid; grid-template-rows: auto minmax(0, 1fr);
  width: 100%; height: 100%; padding: 0; border: 0; border-radius: 0;
  background: #121018; box-shadow: none;
}
.catalog-preview-modal .preview-toolbar,
body.app-view-buy .catalog-preview-modal .preview-toolbar {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; margin: 0;
  padding: 7px 18px; border-bottom: 1px solid var(--sf-line); background: #16131c;
}
.catalog-preview-modal .preview-toolbar .preview-title { color: var(--sf-muted); font-size: 11px; font-weight: 500; letter-spacing: 0; }
.catalog-preview-modal .preview-modes { background: rgba(255, 255, 255, 0.06); padding: 3px; }
.catalog-preview-modal .preview-mode-btn { min-height: 30px; color: #b9a8b4; font-size: 11px; padding: 6px 12px; }
.catalog-preview-modal .preview-mode-btn.active {
  background: rgba(225, 29, 116, 0.25); color: #fff; box-shadow: none;
}
.catalog-preview-modal .preview-tools { gap: 3px; padding: 0; background: none; }
.catalog-preview-modal .preview-tool-btn {
  width: 33px; min-width: 33px; height: 33px; color: #b9a8b4; background: rgba(255, 255, 255, 0.06);
}
.catalog-preview-modal .preview-tool-btn:hover { color: #ffb0d0; background: rgba(225, 29, 116, 0.18); }
.catalog-preview-modal .preview-tool-btn:disabled { opacity: 0.4; cursor: default; }
.catalog-preview-modal .preview-tools .preview-playback-btn {
  width: 33px; min-width: 33px; height: 33px; color: #ffb0d0; background: rgba(225, 29, 116, 0.18);
}
.catalog-preview-modal .preview-stage,
body.app-view-buy .catalog-preview-modal .preview-stage,
body.app-view-preview .catalog-preview-modal .preview-stage {
  position: relative; display: flex; align-items: stretch; justify-content: center;
  width: 100%; height: 100%; min-height: 0; padding: 0; border-radius: 0;
  background: #0e0c14; overflow: hidden;
}
.catalog-preview-modal .preview-device,
body.app-view-buy .catalog-preview-modal .preview-device,
body.app-view-preview .catalog-preview-modal .preview-device {
  width: min(100%, 380px); max-width: 380px; height: 100%; min-height: 0;
  border: 0; border-radius: 0; box-shadow: 0 0 32px rgba(0, 0, 0, 0.4); background: #fff;
  transition: width 0.2s ease, max-width 0.2s ease;
}
.catalog-preview-modal .preview-device.is-desktop,
body.app-view-buy .catalog-preview-modal .preview-device.is-desktop,
body.app-view-preview .catalog-preview-modal .preview-device.is-desktop {
  width: 100%; max-width: 100%; height: 100%; border-radius: 0; box-shadow: none;
}
.catalog-preview-modal .preview-device iframe { background: #0e0c14; }
.catalog-preview-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  min-height: 64px; padding: 12px 24px;
  border-top: 1px solid var(--sf-line); background: var(--sf-card);
}
.catalog-preview-footer p { color: var(--sf-muted); font-size: 12px; line-height: 1.6; }
.catalog-preview-footer .preview-buy-btn,
body.app-view-buy .catalog-preview-footer .preview-buy-btn {
  position: static; display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; gap: 6px; min-height: 40px; padding: 10px 17px; border: 0; border-radius: 999px;
  background: var(--sf-rose); color: #fff; font-size: 12px; font-weight: 700;
  box-shadow: 0 8px 20px rgba(225, 29, 116, 0.3); transform: none; animation: none;
}
.catalog-preview-footer .preview-buy-btn:hover { background: color-mix(in srgb, var(--sf-rose) 88%, #fff); }
.catalog-preview-footer .preview-buy-btn:active { transform: scale(0.98); }
.catalog-preview-modal .preview-panel.is-preview-fullscreen {
  position: static !important; inset: auto !important; width: 100% !important; height: 100% !important;
  padding: 0 !important; border-radius: 0; background: #121018;
}
body.catalog-preview-fullscreen .catalog-preview-modal { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
body.catalog-preview-fullscreen .catalog-preview-modal .studio-preview { min-height: 0; height: 100%; }
.catalog-preview-modal .is-preview-fullscreen .preview-device { width: min(100%, 420px); max-width: 420px; height: 100%; }
.catalog-preview-modal .is-preview-fullscreen .preview-device.is-desktop { width: 100%; max-width: 100%; height: 100%; }
.catalog-preview-modal .is-preview-fullscreen .preview-nav-btn {
  width: 42px; height: 42px; border-color: rgba(255, 255, 255, 0.15);
  background: rgba(18, 16, 24, 0.9); color: #ffb0d0; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.catalog-preview-modal .is-preview-fullscreen .preview-nav-btn:hover {
  background: rgba(225, 29, 116, 0.25); border-color: rgba(225, 29, 116, 0.45);
}
.preview-fs-backdrop { display: none !important; }
body.catalog-preview-open { overflow: hidden; }
body.catalog-preview-open .app-tabbar { visibility: hidden; }
.foot-note { margin-top: 22px; color: #6f6370; font-size: 12px; }

/* App tabbar / misc dark */
.app-tabbar {
  background: rgba(18, 16, 24, 0.92) !important;
  border-color: var(--sf-line) !important;
}

@media (max-width: 1120px) {
  .brand { gap: 12px; padding-left: 18px; }
  .catalog-nav-link { padding-inline: 11px; font-size: 12px; }
  .brand .btn-support { display: none; }
  .template-grid { gap: 16px 14px; }
}
@media (max-width: 959px) {
  .page { padding: 16px 16px 28px; }
  .template-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shell { max-width: 100%; }
  .brand { margin-bottom: 18px; }
  .card { padding: 22px; border-radius: 22px; }
  .filter-bar { flex-wrap: nowrap; gap: 7px; padding-bottom: 2px; margin-bottom: 18px; }
  .filter-chip { min-height: 36px; padding: 8px 12px; font-size: 11px; }
  .catalog-preview-modal { width: calc(100vw - 24px); height: calc(100dvh - 24px); border-radius: 18px; }
  .catalog-preview-modal .preview-mode-btn span { display: inline; }
  .catalog-preview-modal .preview-mode-btn { padding: 6px 10px; }
}
@media (max-width: 760px) {
  .brand .catalog-home { margin-right: auto; }
  .brand h1 .lemy-logo,
  .brand h1 .brand-logo-img { width: 132px; max-width: 132px; max-height: 44px; }
  .brand .brand-actions { gap: 0; }
  .catalog-menu-toggle svg { width: 18px; height: 18px; }
  .template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
  .studio-main .section-head { gap: 12px; margin-bottom: 14px; padding-bottom: 14px; }
  .catalog-title { font-size: 28px; }
  .studio-main .section-head .badge { padding: 7px 12px; font-size: 11px; }
  .filter-chip { min-height: 36px; padding: 7px 13px; font-size: 12px; }
  .template-card .template-meta { padding: 12px; }
  .template-card .template-meta h3 { font-size: 13px; }
  .template-card .template-meta .price { font-size: 15px; }
  .card-actions { gap: 6px; }
  .card-actions .card-buy-btn,
  .card-actions .card-demo-btn { gap: 5px; padding-inline: 6px; font-size: 11px; }
  .catalog-preview-head { padding: 8px 12px; }
  .catalog-preview-head h2 { font-size: 12px; }
  .catalog-preview-close { padding: 8px 10px; }
  .catalog-preview-modal .preview-toolbar .preview-title { display: none; }
  .catalog-preview-modal .preview-toolbar,
  body.app-view-buy .catalog-preview-modal .preview-toolbar { grid-template-columns: 1fr auto; gap: 6px; padding: 7px 10px; }
  .catalog-preview-modal .preview-modes { justify-self: start; }
  .catalog-preview-modal .preview-mode-btn { min-height: 32px; gap: 4px; padding: 6px 10px; font-size: 10px; }
  .catalog-preview-footer { min-height: 60px; gap: 10px; padding: 10px 14px; }
  .catalog-preview-footer p { max-width: 55%; font-size: 11px; }
  body.app-view-buy .buy-form-panel { padding: 14px; }
  body.app-view-buy .buy-form-head { grid-template-columns: 40px minmax(0, 1fr); }
  .catalog-inline-preview {
    grid-column: 2; grid-row: 3; justify-self: start; margin-top: 7px;
    min-height: 38px; padding: 8px 12px; font-size: 11px;
  }
}
@media (max-width: 480px) {
  .page { padding: 12px 10px 24px; }
  .brand { margin-bottom: 14px; padding-left: 14px; }
  .brand h1 .lemy-logo,
  .brand h1 .brand-logo-img { width: 120px; max-width: 120px; max-height: 40px; }
  .brand .btn-account { padding-inline: 10px; font-size: 11px; }
  .card { padding: 18px 12px 14px; border-radius: 20px; }
  .catalog-title { max-width: none; font-size: 26px; }
  .studio-main .section-head .badge { padding: 6px 11px; }
  .template-grid { gap: 12px 10px; }
  .template-card { border-radius: 14px; }
  .template-card .thumb.card-preview-button { aspect-ratio: 4 / 3; }
  .template-card .template-meta { padding: 10px 8px; }
  .template-card .template-meta h3 { min-height: 4.5em; margin-bottom: 7px; font-size: 12px; }
  .template-card .template-meta .price { font-size: 14px; }
  .card-actions .card-buy-btn,
  .card-actions .card-demo-btn { min-height: 36px; font-size: 10px; }
  .catalog-preview-modal { width: calc(100vw - 12px); height: calc(100dvh - 12px); border-radius: 16px; }
  .catalog-preview-modal .preview-device,
  body.app-view-buy .catalog-preview-modal .preview-device,
  body.app-view-preview .catalog-preview-modal .preview-device { width: 100%; max-width: 100%; }
}
@media (max-width: 374px) {
  .template-grid { grid-template-columns: minmax(0, 1fr); }
  .template-card .template-meta { padding: 12px; }
  .template-card .template-meta h3 { min-height: 0; font-size: 14px; }
  .card-actions .card-buy-btn,
  .card-actions .card-demo-btn { min-height: 38px; font-size: 12px; }
}
@media (hover: none) {
  .template-card:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .brand, .card, .template-card, .catalog-nav-link,
  .catalog-preview-modal *, .catalog-inline-preview, .card-actions button,
  .filter-chip, .template-card .thumb.card-preview-button {
    animation: none !important; transition: none !important;
  }
}

/* Buy / checkout panels — force dark to match homepage */
body.app-view-buy .card,
body.app-view-buy .buy-form-panel,
body.app-view-buy .section {
  color: var(--sf-ink);
}
body.app-view-buy .btn,
body.app-view-buy .btn-check,
body.app-view-buy button.btn {
  border-radius: 999px;
}
body.app-view-buy .qr-style-toggle,
body.app-view-buy .qr-style-panel,
body.app-view-buy .music-panel,
body.app-view-buy .music-help-panel,
body.app-view-buy .photo-list,
body.app-view-buy .checkout-panel,
body.app-view-buy .share-password-group,
body.app-view-buy .customization-errors,
body.app-view-buy .draft-status,
body.app-view-buy .music-result,
body.app-view-buy .checkout-quick-account,
body.app-view-buy .tip-btn,
body.app-view-buy .music-help-btn,
body.app-view-buy .music-toggle {
  background: #1e1a26 !important;
  border-color: var(--sf-line) !important;
  color: var(--sf-ink) !important;
}
body.app-view-buy .qr-style-toggle:hover,
body.app-view-buy .qr-style-toggle.is-on,
body.app-view-buy .music-help-btn:hover,
body.app-view-buy .music-help-btn[aria-expanded="true"],
body.app-view-buy .tip-btn.selected,
body.app-view-buy .tip-btn:hover,
body.app-view-buy .music-result[aria-selected="true"],
body.app-view-buy .music-toggle.active,
body.app-view-buy .music-toggle:hover {
  background: rgba(225, 29, 116, 0.14) !important;
  border-color: rgba(225, 29, 116, 0.4) !important;
}
body.app-view-buy .music-toggle .left strong { color: #fff !important; }
body.app-view-buy .music-toggle .left span,
body.app-view-buy .music-price { color: var(--sf-muted) !important; }
body.app-view-buy .music-toggle .music-price { color: #ffb0d0 !important; }

/* Music picker: search first, alternative sources, then playback guidance. */
#musicSection {
  --music-muted: #bfb1c0;
  --music-line: rgba(255, 182, 210, 0.2);
}
#musicSection .music-toggle { padding: 16px; gap: 16px; }
#musicSection .music-toggle .left { min-width: 0; gap: 6px; }
#musicSection .music-toggle .left span { color: var(--music-muted) !important; line-height: 1.6; }
#musicSection .music-price { flex-shrink: 0; }
#musicBox { margin-top: 16px; }
#musicBox.show { display: grid; gap: 12px; }
#musicBox .music-search-block {
  padding: 18px;
  border: 1px solid var(--music-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}
#musicBox .music-label {
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--sf-ink) !important;
  font-size: 14px;
  line-height: 1.5;
}
#musicBox .music-label > svg { flex-shrink: 0; color: #ffb0d0; }
#musicBox .music-label-source {
  margin-left: auto;
  color: var(--music-muted);
  font-size: 12px;
  font-weight: 500;
}
#musicBox input:not([type="range"]) { min-height: 46px; font-size: 14px; }
#musicBox input::placeholder { color: #aa9aaa !important; }
#musicBox input:focus-visible,
#musicSection .music-toggle:focus-visible,
#musicBox button:focus-visible,
#musicBox summary:focus-visible {
  outline: 2px solid #ff96c5;
  outline-offset: 3px;
}
#musicBox .music-hint,
#musicBox .music-note,
#musicBox .music-search-status {
  margin: 8px 0 0;
  color: var(--music-muted);
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
#musicBox .customization-field-error,
#musicBox .music-search-status.is-error {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 145, 158, 0.3);
  border-radius: 10px;
  background: rgba(255, 105, 130, 0.08);
  color: #ffc2cc !important;
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
#musicBox input[aria-invalid="true"] { border-color: #ff919e !important; }
#musicBox .music-alternatives-label {
  margin: 6px 0 0;
  color: var(--music-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}
#musicBox .music-alt {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 1px solid var(--music-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}
#musicBox .music-alt > summary {
  min-height: 72px;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 11px;
  color: var(--sf-ink);
}
#musicBox .music-alt > summary > svg { flex: 0 0 20px; width: 20px; height: 20px; color: #ffb0d0; }
#musicBox .music-alt > summary::after {
  content: "";
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-right: 2px solid var(--music-muted);
  border-bottom: 2px solid var(--music-muted);
  transform: rotate(45deg) translateY(-2px);
}
#musicBox .music-alt[open] > summary::after { transform: rotate(225deg) translate(-2px, -2px); }
#musicBox .music-alt > summary:hover,
#musicBox .music-alt[open] > summary { background: rgba(225, 29, 116, 0.08); color: #fff; }
#musicBox .music-alt-copy { display: grid; min-width: 0; gap: 4px; }
#musicBox .music-alt-copy strong { font-size: 14px; line-height: 1.5; }
#musicBox .music-alt-copy > span { color: var(--music-muted); font-size: 12px; line-height: 1.5; }
#musicBox .music-alt-body { margin: 0 16px; padding: 16px 0; border-top: 1px solid var(--music-line); }
#musicBox .music-alt-body .music-label { font-size: 13px; }
#musicBox .music-sc-btn { min-height: 44px; margin-top: 12px; }
#musicBox .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid #e96aa1;
  border-radius: 999px;
  background: #b51c61;
  color: #fff;
  font: 700 13px/1.5 "Manrope", sans-serif;
  cursor: pointer;
}
#musicBox .btn:hover:not(:disabled) { background: #cf216f; }
#musicBox .btn:disabled { opacity: 0.5; cursor: default; }
#musicBox .music-upload-row { gap: 12px; margin-bottom: 18px; }
#musicBox #musicUploadStatus { color: var(--music-muted) !important; line-height: 1.6; }
#musicBox .music-help-btn { width: 44px; height: 44px; }
#musicBox .music-help-panel { color: var(--music-muted) !important; line-height: 1.65; }
#musicBox .music-help-panel a { color: #ffb0d0; }
#musicBox .music-notes {
  margin-top: 4px;
  padding: 14px 16px;
  border-left: 3px solid rgba(255, 150, 197, 0.55);
  border-radius: 0 10px 10px 0;
  background: rgba(255, 255, 255, 0.025);
}
#musicBox .music-notes > strong { color: #e8d6de; font-size: 13px; line-height: 1.5; }
#musicBox .music-notes .music-note { margin-top: 5px; }

/* Keep search results and the selected track in the same dark palette. */
#musicBox .music-results { border-color: var(--music-line); background: #231d2b; box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35); }
body.app-view-buy #musicBox .music-result { color: var(--sf-ink) !important; }
#musicBox .music-result:hover { background: rgba(225, 29, 116, 0.14) !important; }
#musicBox .music-result-info > span,
#musicBox .music-selected-info > span:not(.music-badge),
#musicBox .music-start-hint,
#musicBox .music-now { color: var(--music-muted); }
#musicBox .music-selected { min-width: 0; margin: 0; padding: 16px; border-color: rgba(255, 150, 197, 0.4); background: rgba(225, 29, 116, 0.08); }
#musicBox .music-badge,
#musicBox .music-start-time { color: #ffb0d0; }
#musicBox .music-start { border-color: var(--music-line); }
#musicBox .music-round-btn,
#musicBox .music-chip { border-color: var(--music-line); background: #282130; color: var(--sf-ink); }
#musicBox .music-round-btn { width: 44px; height: 44px; }
#musicBox .music-remove { width: 36px; height: 36px; color: var(--music-muted); }
#musicBox .music-round-btn.is-playing,
#musicBox .music-chip.is-accent { border-color: #ff96c5; color: #ffc0dc; }
#musicBox .music-round-btn.is-playing { background: #9f1750; color: #fff; }
#musicBox .music-range { background: linear-gradient(to right, #f58abb var(--fill), #514153 var(--fill)) !important; }
#musicBox .music-chip.is-link { border: 0; background: transparent; color: var(--music-muted); }
@media (max-width: 480px) {
  #musicSection .music-toggle { padding: 14px; gap: 10px; }
  #musicBox .music-search-block { padding: 14px; }
  #musicBox input:not([type="range"]) { font-size: 16px; }
  #musicBox .music-label-source { flex-basis: 100%; margin-left: 23px; }
  #musicBox .music-alt > summary { padding: 14px 12px; gap: 10px; }
  #musicBox .music-alt-body { margin: 0 12px; }
  #musicBox .music-sc-btn { width: 100%; }
  #musicBox .music-selected-head { flex-wrap: wrap; gap: 8px; }
  #musicBox .music-selected-info { flex-basis: calc(100% - 60px); }
  #musicBox .music-selected-head .music-remove { margin-left: auto; }
  #musicBox .music-start-label { align-items: baseline; }
  #musicBox .music-now { margin-left: 0; }
}

#musicCustomFieldsHost [data-extra-field="soundMode"] {
  display: grid;
  grid-template-columns: minmax(190px, 0.85fr) minmax(0, 1.65fr);
  align-items: center;
  gap: 10px 20px;
  padding: 18px;
  border: 1px solid rgba(255, 150, 197, 0.2);
  border-radius: 16px;
  background: linear-gradient(120deg, rgba(225, 29, 116, 0.08), rgba(255, 255, 255, 0.015));
  transition: border-color 0.2s, box-shadow 0.2s;
}
#musicCustomFieldsHost [data-extra-field="soundMode"]:focus-within {
  border-color: rgba(255, 150, 197, 0.45);
  box-shadow: 0 0 0 3px rgba(225, 29, 116, 0.06);
}
#musicCustomFieldsHost [data-extra-field="soundMode"] > label {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  cursor: pointer;
}
#musicCustomFieldsHost [data-extra-field="soundMode"] > label::before {
  content: "";
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 150, 197, 0.2);
  border-radius: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23ffb0d0' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18V5l12-2v13M9 9l12-2'/%3E%3Cellipse cx='6' cy='18' rx='3' ry='3'/%3E%3Cellipse cx='18' cy='16' rx='3' ry='3'/%3E%3C/svg%3E") center / 20px no-repeat, rgba(225, 29, 116, 0.12);
}
#musicCustomFieldsHost [data-extra-field="soundMode"] > select {
  appearance: none;
  -webkit-appearance: none;
  color-scheme: dark;
  min-width: 0;
  min-height: 50px;
  padding: 13px 44px 13px 16px;
  border: 1px solid rgba(255, 150, 197, 0.26) !important;
  border-radius: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23ffb0d0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") right 15px center / 18px no-repeat, #19121e !important;
  color: #fff1f7 !important;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
}
#musicCustomFieldsHost [data-extra-field="soundMode"] > select:hover {
  border-color: rgba(255, 150, 197, 0.55) !important;
}
#musicCustomFieldsHost [data-extra-field="soundMode"] > select:focus-visible {
  border-color: #ff96c5 !important;
  outline: 2px solid #ff96c5;
  outline-offset: 3px;
  box-shadow: none;
}
#musicCustomFieldsHost [data-extra-field="soundMode"] > select > option {
  background: #19121e;
  color: #fff1f7;
}
#musicCustomFieldsHost [data-extra-field="soundMode"] > .hint {
  grid-column: 2;
  margin: 0;
  color: #bfb1c0 !important;
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  #musicCustomFieldsHost [data-extra-field="soundMode"] {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
  }
  #musicCustomFieldsHost [data-extra-field="soundMode"] > select {
    padding-left: 12px;
    font-size: 16px;
  }
  #musicCustomFieldsHost [data-extra-field="soundMode"] > .hint { grid-column: 1; }
}
@media (max-width: 360px) {
  #musicCustomFieldsHost [data-extra-field="soundMode"] > select {
    padding-right: 34px;
    background-position: right 10px center !important;
    font-size: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #musicCustomFieldsHost [data-extra-field="soundMode"] { transition: none; }
}
body.app-view-buy .qr-style-toggle-text strong,
body.app-view-buy .qr-style-title,
body.app-view-buy .music-help-panel strong,
body.app-view-buy .buy-custom-head > strong,
body.app-view-buy h2,
body.app-view-buy h3 {
  color: #fff !important;
}
body.app-view-buy .qr-style-toggle-text span,
body.app-view-buy .hint,
body.app-view-buy .music-result,
body.app-view-buy .music-help-note,
body.app-view-buy .music-help-panel,
body.app-view-buy .checkout-quick-account-fields > label,
body.app-view-buy .pay-notice,
body.app-view-buy .summary {
  color: var(--sf-muted) !important;
}
body.app-view-buy .checkout-quick-account-fields > input,
body.app-view-buy .checkout-quick-account-fields .password-field > input,
body.app-view-buy .share-password-group .share-password-field > input,
body.app-view-buy .share-password-group .password-field > input {
  background: #121018 !important;
  border-color: var(--sf-line) !important;
  color: #fff !important;
}
.share-access-group { padding: 16px; }
.share-access-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.share-access-options legend {
  margin-bottom: 14px;
  padding: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}
.share-access-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 13px;
  border: 1px solid #66505f;
  border-radius: 10px;
  background: #18141e;
  cursor: pointer;
}
.share-access-option:has(input:checked) {
  border-color: #f36aa6;
  background: #382031;
}
.share-access-option:focus-within { outline: 2px solid #ffb0d0; outline-offset: 3px; }
.share-access-option input {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: #e11d74;
}
.share-access-option strong { display: block; color: #fff; font-size: 14px; line-height: 1.5; }
.share-access-option small { display: block; margin-top: 4px; color: #d6c5d1; font-size: 12px; line-height: 1.5; }
.share-access-group .share-password-field { margin-top: 16px; padding: 16px 0 0; border-color: #66505f; }
.share-access-group .share-password-field[hidden],
.share-access-group .share-access-note[hidden] { display: none !important; }
body.app-view-buy .share-access-group .share-access-note {
  margin: 12px 0 0;
  padding: 12px;
  border: 1px solid #584451;
  border-radius: 10px;
  background: #2b2330;
  color: #f2e7ee !important;
  font-size: 13px;
  line-height: 1.65;
}
body.app-view-buy .share-access-group .password-field-toggle { color: #dccbd7; }
@media (max-width: 480px) {
  .share-access-group { padding: 14px; }
  .share-access-options { grid-template-columns: 1fr; }
}

/* Buy form chrome — no leftover light pink chips */
body.app-view-buy .btn-buy-back {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid var(--sf-line) !important;
  border-radius: 12px !important;
  color: #ffb0d0 !important;
}
body.app-view-buy .btn-buy-back:hover {
  background: rgba(225, 29, 116, 0.16) !important;
  border-color: rgba(225, 29, 116, 0.4) !important;
}
body.app-view-buy .buy-form-head h2 {
  color: #fff !important;
  font-family: "Manrope", sans-serif !important;
}
body.app-view-buy .buy-form-sub {
  color: var(--sf-muted) !important;
}
body.app-view-buy .customization-tool-btn {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid var(--sf-line) !important;
  color: #ffb0d0 !important;
  box-shadow: none !important;
  border-radius: 999px !important;
}
body.app-view-buy .customization-tool-btn:not(:disabled):hover {
  background: rgba(225, 29, 116, 0.16) !important;
  border-color: rgba(225, 29, 116, 0.4) !important;
  color: #ffd0e4 !important;
}
body.app-view-buy .customization-tool-btn--reset {
  color: var(--sf-muted) !important;
}
body.app-view-buy .customization-tool-btn--reset:not(:disabled):hover {
  color: #e8d6de !important;
  background: rgba(255, 255, 255, 0.06) !important;
}
body.app-view-buy .draft-status {
  background: rgba(52, 211, 153, 0.1) !important;
  border-color: rgba(52, 211, 153, 0.28) !important;
  color: #86efac !important;
}
body.app-view-buy .photo-item button {
  background: rgba(225, 29, 116, 0.12) !important;
  border-color: rgba(225, 29, 116, 0.35) !important;
  color: #ffb0d0 !important;
}
body.app-view-buy .checkout-quick-account {
  background: #1e1a26 !important;
  border-color: var(--sf-line) !important;
  box-shadow: none !important;
}
.checkout-contact-row > .checkout-voucher-field:only-child {
  grid-column: 1 / -1;
}
.checkout-extras .checkout-extra-label {
  display: block;
  margin: 0 0 10px;
  font-size: 0.92rem;
  line-height: 1.5;
  font-weight: 700;
}
@media (min-width: 960px) {
  .checkout-extras {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 18px;
  }
  .checkout-extras > .section {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
  }
  .checkout-extras .input-row > input { min-width: 0; }
}
body.app-view-buy .checkout-quick-account > summary {
  color: #fff !important;
}
body.app-view-buy .checkout-quick-account-badge {
  background: rgba(225, 29, 116, 0.2) !important;
  color: #ffb0d0 !important;
  border-color: rgba(225, 29, 116, 0.35) !important;
}

/* Optional checkout choices appear only in the confirmation dialog. */
dialog.modal-checkout-confirm {
  width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; border: 0; color: var(--sf-ink);
}
dialog.modal-checkout-confirm:not([open]) { display: none; }
dialog.modal-checkout-confirm::backdrop { background: transparent; }
.modal-checkout-confirm .checkout-confirm-modal {
  display: flex; flex-direction: column; width: min(600px, 100%);
  max-height: calc(100dvh - 36px); padding: 0; overflow: hidden; border-radius: 20px;
}
.checkout-confirm-head { flex-shrink: 0; padding: 22px 24px 18px; border-bottom: 1px solid var(--sf-line); }
.checkout-confirm-head h2 { margin: 0; font-size: 21px; line-height: 1.35; }
.checkout-confirm-head h2:focus { outline: none; }
.checkout-confirm-head p { margin: 7px 0 0; font-size: 13px; line-height: 1.5; }
.checkout-confirm-content { min-height: 0; padding: 20px 24px; overflow-y: auto; overscroll-behavior: contain; }
.checkout-confirm-modal .checkout-extras { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.checkout-confirm-modal .checkout-extras > .section { min-width: 0; margin: 0; padding: 0; border: 0; }
.checkout-confirm-modal .checkout-extra-label { font-size: 13px; }
.checkout-extra-label > span { color: var(--sf-muted); font-size: 11px; font-weight: 400; }
.modal-checkout-confirm .checkout-confirm-modal .tip-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.modal-checkout-confirm .checkout-confirm-modal .tip-btn { min-width: 0; min-height: 40px; padding: 9px 4px; font-size: 12px; white-space: nowrap; }
.checkout-confirm-modal .checkout-contact-row { display: block; }
.checkout-confirm-modal .input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.checkout-confirm-modal .input-row > input { width: 100%; min-width: 0; }
.modal-checkout-confirm .checkout-confirm-modal input { background: #121018; border-color: var(--sf-line); color: var(--sf-ink); box-shadow: none; }
.modal-checkout-confirm .checkout-confirm-modal input::placeholder { color: var(--sf-muted); }
.modal-checkout-confirm .checkout-confirm-modal input:focus { border-color: #dc6698; outline: 2px solid rgba(225, 29, 116, 0.14); outline-offset: 1px; }
.checkout-confirm-modal .btn-check { min-height: 42px; padding: 10px 14px; font-size: 12px; }
.checkout-confirm-modal .status { margin-top: 6px; font-size: 12px; }
.checkout-tip-input-label { display: block; margin: 0 0 6px; color: var(--sf-muted); font-size: 12px; }
.checkout-confirm-summary { margin-top: 20px; padding: 16px; border: 1px solid var(--sf-line); border-radius: 14px; background: rgba(255, 255, 255, 0.025); }
.modal-backdrop .checkout-confirm-product { margin: 0 0 14px; color: #ead4df !important; font-size: 13px; font-weight: 600; line-height: 1.55; overflow-wrap: anywhere; }
.checkout-confirm-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-top: 8px; color: var(--sf-muted); font-size: 13px; }
.checkout-confirm-row[hidden] { display: none; }
.checkout-confirm-row strong { color: var(--sf-ink); font-weight: 500; white-space: nowrap; }
.checkout-confirm-total { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--sf-line); color: #f7c5da; font-weight: 600; }
.checkout-confirm-total output { color: #ffb0d0; font-size: 21px; font-weight: 700; white-space: nowrap; }
.checkout-confirm-modal .checkout-confirm-body { margin: 18px 0 0; padding: 12px 14px; }
.checkout-confirm-modal .checkout-confirm-body p,
.checkout-confirm-modal .checkout-confirm-body ul { font-size: 12px; line-height: 1.6; }
.checkout-confirm-modal .lemy-checkout-policy { margin-bottom: 0; font-size: 11px; }
.checkout-confirm-modal .checkout-consent {
  display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 10px;
  width: 100%; text-align: left; font-weight: 500; cursor: pointer;
}
.modal-checkout-confirm .checkout-confirm-modal #checkoutConsent {
  appearance: auto; width: 18px; height: 18px; min-width: 18px; min-height: 18px;
  margin: 2px 0 0; padding: 0; accent-color: #e11d74; color-scheme: dark; cursor: pointer;
}
.checkout-consent > span { min-width: 0; text-align: left; overflow-wrap: anywhere; }
.checkout-confirm-modal .checkout-confirm-actions { flex-shrink: 0; margin: 0; padding: 16px 24px; border-top: 1px solid var(--sf-line); }
.checkout-confirm-modal .checkout-confirm-actions .btn { font-size: 13px; }
.checkout-confirm-modal #btnConfirmCheckout:disabled { opacity: 0.4; filter: saturate(0.5); cursor: not-allowed; box-shadow: none; }
body.checkout-confirm-open { overflow: hidden; }
body.checkout-confirm-open .app-tabbar { visibility: hidden; }
@media (max-width: 480px) {
  dialog.modal-checkout-confirm { padding: 12px; }
  .modal-checkout-confirm .checkout-confirm-modal { max-height: calc(100dvh - 24px); border-radius: 18px; }
  .checkout-confirm-head { padding: 18px 16px 14px; }
  .checkout-confirm-head h2 { font-size: 19px; }
  .checkout-confirm-content { padding: 16px; }
  .checkout-confirm-modal .checkout-confirm-actions { padding: 12px 16px; }
  .modal-checkout-confirm .checkout-confirm-modal .tip-grid { gap: 6px; }
  .checkout-confirm-modal input { font-size: 16px; }
  .checkout-confirm-modal .btn-check { padding-inline: 10px; }
}

/* Sticky checkout bar + CTAs */
body.app-view-buy .checkout-bar,
body.app-view-buy .checkout-bar-inline {
  background: linear-gradient(180deg, transparent, #1a1720 22%) !important;
  border-top-color: var(--sf-line) !important;
}
body.app-view-buy .checkout-actions .btn-apply {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(225, 29, 116, 0.4) !important;
  color: #ffb0d0 !important;
  border-radius: 999px !important;
  box-shadow: none !important;
}
body.app-view-buy .checkout-actions .btn-apply:hover {
  background: rgba(225, 29, 116, 0.16) !important;
  border-color: rgba(225, 29, 116, 0.55) !important;
}
body.app-view-buy .checkout-actions .btn-pay,
body.app-view-buy .btn-pay {
  background: linear-gradient(135deg, #e11d74, #be185d) !important;
  color: #fff !important;
  border-radius: 999px !important;
  box-shadow: 0 10px 28px rgba(190, 24, 93, 0.35) !important;
}
body.app-view-buy .checkout-actions .btn-pay:hover,
body.app-view-buy .btn-pay:hover {
  background: linear-gradient(135deg, #be185d, #9d174d) !important;
}

/* Checkout / payment / guide modals — same dark rose chrome */
.modal-backdrop .modal,
.modal-backdrop .order-modal,
.modal-backdrop .checkout-confirm-modal,
.modal-backdrop .guide-modal {
  background: var(--sf-card) !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--sf-ink);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}
.modal-backdrop .modal h2,
.modal-backdrop .order-modal h2,
.modal-backdrop .checkout-confirm-modal h2 {
  color: #fff !important;
  font-family: "Manrope", sans-serif !important;
}
.modal-backdrop .modal p,
.modal-backdrop .guide-lead {
  color: var(--sf-muted) !important;
}
.modal-backdrop .guide-block {
  background: #1e1a26 !important;
  border-color: var(--sf-line) !important;
  color: var(--sf-ink);
}
.modal-backdrop .guide-block h3 {
  color: var(--sf-rose-bright) !important;
}
.modal-backdrop .order-lines {
  background: #1e1a26 !important;
  border: 1px solid var(--sf-line);
  color: var(--sf-ink);
}
.modal-backdrop .order-lines .total {
  border-top-color: rgba(225, 29, 116, 0.28) !important;
  color: #ffb0d0 !important;
}
.modal-backdrop .pay-box {
  background: linear-gradient(180deg, rgba(225, 29, 116, 0.12), #1e1a26) !important;
  border-color: rgba(225, 29, 116, 0.35) !important;
}
.modal-backdrop .pay-box .pay-title {
  color: #ffb0d0 !important;
}
.modal-backdrop .pay-qr {
  background: #fff !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}
.modal-backdrop .pay-meta {
  color: var(--sf-ink) !important;
}
.modal-backdrop .pay-meta strong {
  color: #ffb0d0 !important;
}
.modal-backdrop .pay-notice,
.modal-backdrop .checkout-confirm-body {
  background: rgba(225, 29, 116, 0.1) !important;
  border-color: rgba(225, 29, 116, 0.32) !important;
}
.modal-backdrop .pay-notice,
.modal-backdrop .checkout-confirm-body p,
.modal-backdrop .checkout-confirm-body ul {
  color: #e8d6de !important;
}
.modal-backdrop .pay-notice a {
  color: #ffb0d0 !important;
}
.modal-backdrop .order-step {
  color: #ffb0d0 !important;
}
.modal-backdrop .btn-ghost {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #e8d6de !important;
  border: 1px solid var(--sf-line);
  border-radius: 999px !important;
}
.modal-backdrop .btn-primary,
.modal-backdrop .btn-pay,
.modal-backdrop .btn-qr-remake {
  border-radius: 999px !important;
}
.modal-backdrop .pay-copy-row input {
  background: #121018 !important;
  border-color: var(--sf-line) !important;
  color: #fff !important;
}

/* Contextual phone navigation and editing actions. */
.app-tabbar {
  background: rgba(28, 23, 33, 0.96) !important;
  border: 1px solid rgba(255, 176, 208, 0.18) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
}
.app-tab { color: #d2c2ce !important; }
.app-tab.is-active {
  color: #ffc4df !important;
  background: rgba(225, 29, 116, 0.2) !important;
}
.app-tab:active {
  background: rgba(225, 29, 116, 0.14) !important;
}
.app-tabbar-catalog[hidden], .app-tabbar-buy[hidden] { display: none !important; }
body.guide-open .app-tabbar,
body.mobile-keyboard-open .app-tabbar,
body:has(#orderModal.open) .app-tabbar { visibility: hidden; }

@media (max-width: 959px) {
  html { scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  body { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
  #appTabbar {
    display: block;
    box-sizing: border-box;
    left: 50%;
    right: auto;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    width: calc(100% - 24px);
    max-width: 560px;
    height: auto;
    padding: 6px;
    border-radius: 22px;
  }
  .app-tabbar-catalog, .app-tabbar-buy {
    display: grid;
    align-items: stretch;
    gap: 4px;
    min-width: 0;
  }
  .app-tabbar-catalog { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .app-tabbar-buy { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.85fr); }
  #appTabbar .app-tab {
    min-width: 0;
    min-height: 54px;
    padding: 5px 2px;
    gap: 5px;
    border-radius: 16px;
  }
  #appTabbar .app-tab-icon { width: 21px; height: 21px; stroke-width: 1.7; }
  #appTabbar .app-tab-label { font-size: 11px; font-weight: 600; line-height: 1.3; letter-spacing: 0; }
  .mobile-pay {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 18px;
    align-content: center;
    align-items: center;
    column-gap: 4px;
    row-gap: 2px;
    min-width: 0;
    min-height: 54px;
    margin: 0;
    padding: 7px 12px;
    border: 1px solid rgba(255, 176, 208, 0.2);
    border-radius: 16px;
    background: linear-gradient(135deg, #e11d74, #be185d);
    box-shadow: 0 3px 12px rgba(190, 24, 93, 0.2);
    color: #fff;
    font: 600 11px/1.3 "Manrope", sans-serif;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-pay strong { grid-column: 1; font-size: 15px; font-weight: 800; white-space: nowrap; }
  .mobile-pay svg { grid-column: 2; grid-row: 1 / 3; width: 18px; height: 18px; }
  .mobile-pay:active:not(:disabled) { filter: brightness(1.12); }
  .mobile-pay:disabled { opacity: 0.5; cursor: wait; }
  #appTabbar :is(a, button):focus-visible { outline: 2px solid #ffd0e4; outline-offset: -3px; }
  body.app-view-buy .checkout-bar-inline {
    position: static;
    margin: 0;
    padding: 0;
    border: 0;
    background: none !important;
  }
  body.app-view-buy .checkout-bar-inline .checkout-actions,
  body.app-view-buy .checkout-bar-inline .summary:empty { display: none; }
}

/* Numbered editing steps, with shared checkout actions below. */
.buy-progress[hidden],
.buy-step-nav[hidden],
.buy-tabs[hidden],
.buy-tab-panel[hidden] { display: none !important; }
.buy-progress { margin-bottom: 22px; }
.buy-progress-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.buy-progress-heading p { margin: 0; color: #ffb0d0; font: 700 13px/1.5 "Manrope", sans-serif; }
.buy-progress-heading > span { color: var(--sf-muted); font-size: 11px; }
.buy-tabs {
  --buy-progress: 0%;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
}
.buy-tabs::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 26px;
  left: 12.5%;
  right: 12.5%;
  height: 3px;
  background: linear-gradient(to right, #e11d74 0 var(--buy-progress), #44323f var(--buy-progress) 100%);
  border-radius: 99px;
}
.buy-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  min-height: 103px;
  padding: 8px 6px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #cbbbc7;
  font: 700 13px/1.5 "Manrope", sans-serif;
  cursor: pointer;
}
.buy-step-number {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: 2px solid #66505f;
  border-radius: 50%;
  background: var(--sf-elev);
  color: #cbbbc7;
  font-size: 14px;
  box-shadow: 0 0 0 6px var(--sf-elev);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.buy-step-status { color: var(--sf-muted); font-size: 10px; font-weight: 500; line-height: 1.4; }
.buy-tab:hover:not(:disabled) .buy-step-label { color: #ffd0e4; }
.buy-tab.is-visited .buy-step-number { border-color: #e11d74; color: #ffb0d0; }
.buy-tab[aria-selected="true"] {
  color: #fff;
}
.buy-tab[aria-selected="true"] .buy-step-number {
  background: #e11d74;
  border-color: #e11d74;
  color: #fff;
}
.buy-tab[aria-selected="true"] .buy-step-status { color: #ffb0d0; }
.buy-tab:disabled { opacity: 0.45; cursor: default; }
.buy-tab:focus-visible,
.buy-tab-panel:focus-visible,
.buy-step-nav button:focus-visible {
  outline: 2px solid #ffb0d0;
  outline-offset: 3px;
}
.buy-step-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 22px; }
.buy-step-nav button {
  min-height: 42px;
  padding: 10px 17px;
  border: 1px solid var(--sf-line);
  border-radius: 999px;
  background: transparent;
  color: #e8d6de;
  font: 700 12px/1.5 "Manrope", sans-serif;
  cursor: pointer;
}
.buy-step-nav .buy-step-next { background: #e11d74; border-color: #e11d74; color: #fff; }
.buy-step-nav .buy-step-next:hover { background: #be185d; }
.buy-step-nav button:disabled { opacity: 0.35; cursor: default; }
@media (min-width: 960px) {
  body.app-view-buy .buy-tab-panel { min-height: 240px; padding-top: 0; }
  body.app-view-buy #buyPasswordSection > .share-password-group { margin: 0; }
  #customFieldsHost,
  #customFieldsHost .custom-fields-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 16px 18px;
  }
  #customFieldsHost > *,
  #customFieldsHost .custom-fields-grid > * {
    grid-column: 1 / -1;
    min-width: 0;
  }
  #customFieldsHost > .custom-field-compact,
  #customFieldsHost .custom-fields-grid > .custom-field-compact {
    grid-column: span 1;
  }
  #customFieldsHost > .field,
  #customFieldsHost .custom-fields-grid > .field { margin-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .buy-step-number { transition: none; }
}

/* Buying guide — shared dark surfaces, rose accents and editorial headings. */
.modal-guide {
  width: min(880px, calc(100% - 48px));
  max-width: none;
  max-height: min(90vh, 860px);
  max-height: min(90dvh, 860px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 182, 210, 0.18);
  border-radius: 28px;
  background: var(--sf-card);
  color: var(--sf-ink);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.6);
}
.modal-guide::backdrop { background: rgba(7, 6, 12, 0.76); backdrop-filter: blur(9px); }
.modal-guide[open] { display: flex; }
.modal-guide .guide-modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  max-height: inherit;
}
body.guide-open { overflow: hidden; }
.guide-header {
  position: relative;
  flex: none;
  padding: 30px 34px 25px;
  border-bottom: 1px solid var(--sf-line);
  background: radial-gradient(ellipse at 90% 0, rgba(225, 29, 116, 0.14), transparent 65%);
}
.guide-eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 13px; color: #ed9fbd; font-size: 11px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; }
.guide-header h2 { margin: 0; color: var(--sf-ink); font: 600 clamp(32px, 4vw, 44px)/1.1 "Cormorant Garamond", Georgia, serif; letter-spacing: -0.025em; }
.guide-modal .guide-lead { margin: 10px 0 0 !important; color: #bcaab7; font-size: 13px; line-height: 1.7; }
.guide-close { position: absolute; top: 20px; right: 20px; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--sf-line); border-radius: 50%; background: rgba(255, 255, 255, 0.03); color: #d4bdcb; cursor: pointer; }
.guide-close:hover { background: rgba(225, 29, 116, 0.14); color: #fff; }
.guide-content { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #67505f transparent; padding: 22px 34px 26px; }
.guide-device-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.guide-device-label { color: #bcaab7; font-size: 12px; }
.guide-device-tabs { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--sf-line); border-radius: 999px; background: #121018; }
.guide-device-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 16px; border: 1px solid transparent; border-radius: 999px; background: transparent; color: #bcaab7; font: 650 12px/1.4 "Manrope", sans-serif; cursor: pointer; }
.guide-device-tabs button[aria-selected="true"] { border-color: rgba(225, 29, 116, 0.35); background: rgba(225, 29, 116, 0.2); color: #ffc2da; }
.guide-device-tabs button:hover { color: #fff; }
.guide-step-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.guide-step-list > li { display: flex; align-items: flex-start; gap: 13px; min-width: 0; padding: 20px 18px; border: 1px solid var(--sf-line); border-radius: 18px; background: var(--sf-elev); }
.guide-step-number { display: grid; flex: 0 0 33px; place-items: center; height: 33px; border: 1px solid rgba(225, 29, 116, 0.28); border-radius: 50%; background: rgba(225, 29, 116, 0.1); color: #f29cbc; font-size: 11px; font-weight: 800; }
.guide-step-list h3 { margin: 4px 0 9px; color: #f7f0f4; font: 750 14px/1.5 "Manrope", sans-serif; }
.guide-step-list p { margin: 0; color: #bcaeb9; font-size: 13px; line-height: 1.8; }
.guide-modal strong { color: #e9d9e3; font-weight: 650; }
.guide-modal .guide-device-tip { margin: 16px 0 0; color: #b6a4b2; font-size: 12px; line-height: 1.8; }
.guide-device-tip kbd { padding: 1px 5px; border: 1px solid var(--sf-line); border-radius: 4px; font: inherit; }
.guide-payment-note { display: flex; align-items: flex-start; gap: 12px; margin-top: 20px; padding: 16px 18px; border: 1px solid rgba(225, 29, 116, 0.2); border-radius: 14px; background: rgba(225, 29, 116, 0.06); }
.guide-payment-note > svg { flex: none; margin-top: 2px; color: #e99bb9; }
.guide-payment-note h3 { margin: 0 0 5px; color: #f1bad0; font-size: 12px; font-weight: 700; }
.guide-payment-note p { margin: 0; color: #bcaeb9; font-size: 12px; line-height: 1.8; }
.guide-footer { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 34px; border-top: 1px solid var(--sf-line); background: #15121b; }
.guide-support { display: flex; align-items: center; gap: 10px; color: #b6a4b2; text-decoration: none; font-size: 10px; line-height: 1.7; }
.guide-support > svg { flex: none; color: #e99bb9; }
.guide-support strong { display: block; color: #f0c1d5; font-size: 12px; }
.guide-support:hover strong { color: #fff; }
.guide-done { display: inline-flex; align-items: center; justify-content: center; flex: none; gap: 22px; min-height: 44px; padding: 11px 22px; border: 1px solid #e11d74; border-radius: 999px; background: #e11d74; color: #fff; font: 750 12px/1.5 "Manrope", sans-serif; cursor: pointer; }
.guide-done:hover { border-color: #be185d; background: #be185d; }
.modal-guide button:focus-visible,
.modal-guide a:focus-visible,
.modal-guide [role="tabpanel"]:focus-visible { outline: 2px solid #ffb0d0; outline-offset: 3px; }
.modal-guide [hidden] { display: none !important; }
@media (max-width: 639px) {
  .modal-guide { width: calc(100% - 24px); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); border-radius: 22px; }
  .guide-header { padding: 25px 20px 20px; }
  .guide-eyebrow { padding-right: 30px; font-size: 9px; letter-spacing: 0.08em; }
  .guide-close { top: 12px; right: 12px; width: 36px; height: 36px; }
  .guide-header h2 { font-size: clamp(29px, 8vw, 36px); }
  .guide-modal .guide-lead { font-size: 12px; }
  .guide-content { padding: 18px 18px 22px; }
  .guide-device-row { flex-direction: column; align-items: flex-start; gap: 9px; margin-bottom: 16px; }
  .guide-device-tabs { width: 100%; }
  .guide-device-tabs button { flex: 1; padding-inline: 10px; }
  .guide-step-list { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .guide-step-list > li { padding: 16px 14px; gap: 12px; border-radius: 15px; }
  .guide-step-list h3 { font-size: 13px; }
  .guide-payment-note { padding: 14px; gap: 10px; }
  .guide-footer { padding: 14px 18px; gap: 12px; }
  .guide-support { gap: 7px; }
  .guide-support > svg { display: none; }
  .guide-support strong { font-size: 10px; }
  .guide-done { gap: 12px; padding-inline: 15px; }
}
@media (max-height: 550px) {
  .guide-header { padding-block: 14px; }
  .guide-eyebrow { margin-bottom: 7px; }
  .guide-header h2 { font-size: 30px; }
  .guide-modal .guide-lead { margin-top: 6px !important; }
  .guide-footer { padding-block: 10px; }
}

/* Preview-only label; the published card is rendered inside a separate document. */
.catalog-preview-modal .preview-watermark {
  position: absolute;
  z-index: 3;
  top: 50%;
  right: 12px;
  bottom: auto;
  left: auto;
  height: max-content;
  max-height: calc(100% - 24px);
  max-width: calc(100% - 24px);
  padding: 10px 5px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #5d5d63;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font: 500 10px/1.4 "Manrope", sans-serif;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  text-align: left;
  transform: translateY(-50%);
  opacity: 0.4;
  pointer-events: none;
  user-select: none;
}
@media (max-width: 480px) {
  .catalog-preview-modal .preview-watermark { font-size: 9px; }
}

/* Keep payment controls reachable while its QR and bank details scroll. */
dialog#orderModal {
  width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; border: 0; color: var(--sf-ink);
}
dialog#orderModal:not([open]) { display: none; }
dialog#orderModal::backdrop { background: transparent; }
body.order-modal-open { overflow: hidden; }
#orderModal .order-modal { overscroll-behavior: contain; }
.order-modal-head {
  position: sticky; top: -22px; z-index: 2;
  display: flex; align-items: center; gap: 12px;
  margin: -22px -18px 16px; padding: 14px 18px;
  background: #201b29; border-bottom: 1px solid var(--sf-line);
}
#orderModal .order-modal-head h2 {
  flex: 1; min-width: 0; margin: 0; text-align: left;
  font-size: clamp(18px, 3vw, 24px); line-height: 1.3;
}
.order-modal-close {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  flex-shrink: 0; min-height: 44px; padding: 0 13px;
  border: 1px solid #c8749b; border-radius: 999px;
  background: #382233; color: #ffd3e6; cursor: pointer;
  font: 600 13px/1.2 "Manrope", sans-serif;
}
.order-modal-close:hover { background: #503047; }
.order-modal-close:focus-visible { outline: 2px solid #ffb0d0; outline-offset: 3px; }
#orderModal .pay-copy-row { display: flex; align-items: center; gap: 8px; }
#orderModal .pay-copy-row input { flex: 1 1 0; min-width: 0; width: 0; }
#orderModal .pay-copy-row .btn-check { flex: 0 0 auto; width: auto; min-height: 44px; }

/* Catalog, customization and preview dialogs keep native scrolling with no tracks.
   This stylesheet is also used by the account page, so scope to catalog views. */
html:has(> body:is(.app-view-products,.app-view-buy,.app-view-preview)),
body:is(.app-view-products,.app-view-buy,.app-view-preview),
body:is(.app-view-products,.app-view-buy,.app-view-preview) * {
  scrollbar-width: none !important;
  scrollbar-gutter: auto !important;
  -ms-overflow-style: none !important;
}
html:has(> body:is(.app-view-products,.app-view-buy,.app-view-preview))::-webkit-scrollbar,
body:is(.app-view-products,.app-view-buy,.app-view-preview)::-webkit-scrollbar,
body:is(.app-view-products,.app-view-buy,.app-view-preview) *::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Heart Tree: keep the background palette together on narrow screens. */
#customFieldsHost [data-extra-field][hidden] { display: none !important; }
#customFieldsHost [data-extra-field="effectColor"] {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}
#customFieldsHost [data-extra-field="effectColor"] .color-field-row {
  flex-wrap: nowrap;
  min-width: 0;
}
#customFieldsHost [data-extra-field="effectColor"] .color-swatch-row {
  flex: 0 1 auto;
}
#customFieldsHost [data-extra-field="effectColor"] .color-swatch-btn {
  flex: 0 0 28px;
}
#customFieldsHost [data-extra-field="effectColor"] .hint { margin-top: 0; }

/* Phone filters stay one compact row so the catalog stays in view. */
@media (max-width:760px) {
  .catalog-centered > .filter-bar {
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 6px;
    margin-bottom: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }
  body.app-view-products .filter-chip {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 5px 11px;
    font-size: 12px;
    white-space: nowrap;
    scroll-snap-align: start;
  }
  body.app-view-products .catalog-pagination button { min-width:44px; min-height:44px; }
  body.app-view-products .card-actions :is(.card-buy-btn,.card-demo-btn) { min-height:44px; padding:10px 8px; font-size:13px; line-height:1.4; white-space:normal; }
}
@media (max-width:480px) {
  body.app-view-products .card-actions { grid-template-columns:minmax(0,1fr); gap:8px; }
  body.app-view-products .template-card .template-meta h3 { font-size:14px; line-height:1.5; }
}
