:root {
  --bg: #F7F1F2; --card: #FFFFFF; --fg: #2B1A1E; --muted: #7A6469; --line: #E6D8DB;
  --accent: #7B1F35; --accent-soft: #F3E1E6; --on-accent: #FFF6F8; --ok: #2F6B4A; --danger: #A3243B;
  --display: "Marck Script", "Segoe Script", cursive;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --heart: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 93'><path d='M50 92C18 70 0 52 0 29C0 12 14 0 29 0C39 0 46 5 50 12C54 5 61 0 71 0C86 0 100 12 100 29C100 52 82 70 50 92Z'/></svg>");
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 15px; line-height: 1.55;
  padding-block: 16px 48px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
a { color: var(--accent); }
h1 { font-size: 22px; line-height: 1.25; margin: 0; text-wrap: balance; }
h2 { font-size: 18px; margin: 0; }
p { margin: 0; }
[hidden] { display: none !important; }

.wrap { max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.wrap.wide { max-width: 880px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { font-family: var(--display); font-size: 30px; color: var(--accent); text-decoration: none; line-height: 1; }
.back { font-size: 14px; }
.sub { color: var(--muted); }
.hint { font-size: 12.5px; color: var(--muted); }
.center { text-align: center; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 16px; }

/* поля форми */
label, .field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.flabel { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.opt, .count { font-weight: 400; }
input[type=text], textarea {
  font: inherit; font-size: 16px; color: var(--fg); background: var(--bg);
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; width: 100%;
}
textarea { min-height: 88px; resize: vertical; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.file { position: relative; flex-direction: row; align-items: center; justify-content: center; border: 1px dashed var(--line);
  border-radius: 12px; padding: 12px; color: var(--accent); font-weight: 700; font-size: 14px; cursor: pointer; background: var(--bg); }
.file.small { border: none; background: none; padding: 4px; font-weight: 500; font-size: 13px; }
.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.err { font-size: 13.5px; color: var(--danger); }

.btn { font: inherit; font-weight: 700; font-size: 15px; border-radius: 14px; padding: 13px 16px; cursor: pointer;
  border: 1px solid var(--accent); text-align: center; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn:disabled { opacity: .55; cursor: wait; }
.link-btn { font: inherit; font-size: 13px; color: var(--accent); background: none; border: none; padding: 2px 0; cursor: pointer; text-decoration: underline; align-self: flex-start; }
.link-btn.inline { display: inline; font-size: inherit; padding: 0; align-self: auto; }
.field > label { font-size: 13px; font-weight: 500; color: var(--muted); }
.field > label.flabel { flex-direction: row; justify-content: space-between; align-items: baseline; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 140px; }

.voice { display: flex; align-items: center; gap: 12px; }
.voice .btn { flex: 1; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); display: inline-block; }
.recording .dot { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--danger); min-width: 44px; }
audio { width: 100%; height: 40px; }

.melodies { display: flex; flex-direction: column; gap: 6px; transition: opacity .2s; }
.melodies.dim { opacity: .55; }
.mel { display: flex; align-items: center; gap: 10px; font: inherit; font-size: 14px; font-weight: 500; color: var(--fg); text-align: left;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; cursor: pointer; }
.mel[aria-checked=true] { border-color: var(--accent); background: var(--accent-soft); }
.mel .pl { width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--card); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; color: var(--accent); font-size: 11px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font: inherit; font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 6px; padding: 7px 12px 7px 8px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--fg); cursor: pointer; }
.chip i { width: 16px; height: 16px; border-radius: 50%; display: block; }
.chip[aria-checked=true] { border-color: var(--accent); background: var(--accent-soft); }
.cats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.cats::-webkit-scrollbar { display: none; }
.cats .chip { padding: 8px 14px; white-space: nowrap; text-decoration: none; flex: none; }
.cats .chip[aria-current=true] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.total { display: flex; justify-content: space-between; font-weight: 700; font-variant-numeric: tabular-nums; border-top: 1px solid var(--line); padding-top: 14px; }
.linkbox { font-family: ui-monospace, Menlo, monospace; font-size: 15px; background: var(--accent-soft); border-radius: 12px; padding: 13px; word-break: break-all; user-select: all; color: var(--fg); }
.ok { color: var(--ok); font-weight: 700; }

/* серце */
.heart { position: relative; width: 100%; max-width: 320px; aspect-ratio: 100 / 93; margin: 0 auto;
  -webkit-mask: var(--heart) center / 100% 100% no-repeat; mask: var(--heart) center / 100% 100% no-repeat;
  background: var(--paper, #F6E3E8); }
.heart.small { max-width: 240px; }
.inside { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 13% 21% 27%; text-align: center; gap: 4px; overflow: hidden; }
.inside img { width: 30%; aspect-ratio: 1; border-radius: 50%; object-fit: cover; border: 2px solid #fff; flex: none; }
.inside .nm { font-family: var(--display); font-size: clamp(24px, 8.5vw, 36px); line-height: 1.1; color: var(--ink, #7B1F35); overflow-wrap: anywhere; }
.inside .tx { font-size: 13px; line-height: 1.35; color: var(--ink-text, #3A1E25); overflow-wrap: anywhere; }
.heart.small .inside .nm { font-size: 26px; }
.heart.small .inside .tx { font-size: 11px; }
.heart canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: pointer; }

/* вітрина */
.hero { display: flex; flex-direction: column; gap: 10px; padding-block: 12px 4px; max-width: 560px; }
.hero h1 { font-size: clamp(26px, 6vw, 36px); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; text-decoration: none; color: var(--fg);
  display: flex; flex-direction: column; }
.tile-art { aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; }
.tile-art .heart { width: 58%; background: var(--foil); }
.tile-body { display: flex; flex-direction: column; align-items: flex-start; padding: 12px 14px 4px; gap: 2px; }
.tile-name { font-weight: 700; }
.tile-price { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile > .btn { margin: 8px 14px 14px; }
.tile:hover { border-color: var(--accent); }
.custom { gap: 10px; align-items: flex-start; }
.perks { display: flex; flex-direction: column; gap: 10px; }
.perks div { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); }
.perks b { font-size: 14px; }
.perks span { font-size: 13.5px; color: var(--muted); }
.foot { display: flex; gap: 16px; flex-wrap: wrap; }
.foot a { color: var(--muted); }
.how { display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }
.how ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.foot { color: var(--muted); font-size: 13px; padding-top: 12px; }

/* сторінка отримувача */
.cardpage { min-height: 80vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.hello { font-family: var(--display); font-size: clamp(30px, 9vw, 42px); color: var(--ink); line-height: 1.15; }
.made { font-size: 12px; color: var(--muted); opacity: .7; margin-top: 28px; text-decoration: none; animation: fadein 1.2s ease; }
.made:hover { opacity: 1; text-decoration: underline; }
@keyframes fadein { from { opacity: 0; } to { opacity: .7; } }

@media (prefers-reduced-motion: reduce) { .recording .dot { animation: none; } }

/* листівка з каталогу на весь екран */
body.tpl { padding: 0 !important; overflow: hidden; background: #1c1416 !important; }
body.tpl .wrap { display: none; }
#tplFrame { position: fixed; inset: 0; width: 100%; height: 100%; border: 0; background: #1c1416; }
.tile-art.photo { aspect-ratio: 3 / 4; background: #e9dfe1; overflow: hidden; }
.tile-art.photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; }
.tile-name { font-size: 14px; line-height: 1.3; }
.tile-art { position: relative; display: block; }
.tile-play { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); background: rgba(28,20,22,.72); color: #fff;
  font-size: 12px; font-weight: 700; border-radius: 999px; padding: 5px 11px; white-space: nowrap; pointer-events: none; }
.tile-btns { display: flex; gap: 6px; margin: 8px 12px 12px; }
.tile-btns .btn { flex: 1; padding: 10px 6px; font-size: 13.5px; border-radius: 12px; }

/* відео «як працює» */
.tile { position: relative; }
.tile-vid { position: absolute; top: 8px; right: 8px; z-index: 2; font: inherit; font-size: 12px; font-weight: 700; color: #fff;
  background: rgba(123,31,53,.9); border: 0; border-radius: 999px; padding: 6px 11px; cursor: pointer; }
.tile-vid:hover { background: var(--accent); }
.vid-ov { position: fixed; inset: 0; z-index: 100; background: rgba(20,12,14,.92); display: flex; align-items: center; justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px)); }
.vid-box { width: 100%; max-width: 900px; max-height: 100%; display: flex; justify-content: center; }
.vid-box video { max-width: 100%; max-height: calc(100vh - 90px); max-height: calc(100dvh - 90px); border-radius: 12px; background: #000; }
.vid-box.yt { aspect-ratio: 16 / 9; max-height: calc(100dvh - 90px); }
.vid-box.yt iframe { width: 100%; height: 100%; border: 0; border-radius: 12px; }
.vid-x { position: absolute; top: max(12px, env(safe-area-inset-top, 0px)); right: 12px; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 20px; cursor: pointer; }

/* ===== вітрина: оновлений дизайн ===== */
:root { --serif: "Cormorant Garamond", Georgia, serif; --gold: #D9B26A; --gold-deep: #B8893A; --wine: #4A1020; }
body.shop { padding: 0; }
body.shop h1, body.shop h2 { font-family: var(--serif); font-weight: 700; letter-spacing: -.01em; }
body.shop h2 { font-size: 26px; line-height: 1.15; }
.nav { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  background: rgba(247,241,242,.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav .brand { font-size: 32px; }
.nav-links { display: flex; gap: 18px; font-size: 14px; font-weight: 500; }
.nav-links a { color: var(--fg); text-decoration: none; }
.nav-links a:hover { color: var(--accent); }
@media (max-width: 560px) { .nav-links a:not(:nth-child(2)) { display: none; } }

.hero2 { position: relative; overflow: hidden; color: #FFF6EC; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); align-items: center; gap: 24px;
  padding: 48px max(24px, calc((100% - 880px) / 2)) 56px;
  background: radial-gradient(120% 90% at 85% 10%, #8E2A43 0%, transparent 55%), radial-gradient(90% 80% at 0% 100%, #2a0a14 0%, transparent 60%), var(--wine); }
.hero2::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(1.5px 1.5px at 12% 20%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 30% 70%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 55% 15%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 70% 85%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 90% 40%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 42% 42%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 6% 88%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 82% 8%, #fff 50%, transparent 51%); }
.hero-text { position: relative; display: flex; flex-direction: column; gap: 16px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.hero2 h1 { font-size: clamp(36px, 6.4vw, 56px); line-height: 1.02; color: #FFF6EC; }
.hero2 p { color: rgba(255,246,236,.82); font-size: 16px; max-width: 480px; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.btn.gold { background: linear-gradient(180deg, #E8C680, var(--gold-deep)); border-color: var(--gold-deep); color: #2B1408; }
.btn.line { background: transparent; color: #FFF6EC; border-color: rgba(255,246,236,.45); }
.btn.line:hover { border-color: #FFF6EC; }
.perks2 { list-style: none; margin: 4px 0 0; padding: 0; display: flex; gap: 22px; flex-wrap: wrap; }
.perks2 li { display: flex; flex-direction: column; font-size: 12.5px; color: rgba(255,246,236,.7); }
.perks2 b { font-family: var(--serif); font-size: 26px; line-height: 1.1; color: var(--gold); }
.hero-art { position: relative; height: 340px; }
.fan { position: absolute; width: 46%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 14px; box-shadow: 0 18px 40px rgba(0,0,0,.45); border: 2px solid rgba(255,246,236,.25); }
.fan.f1 { left: 2%; top: 14%; transform: rotate(-9deg); }
.fan.f3 { right: 2%; top: 14%; transform: rotate(9deg); }
.fan.f2 { left: 27%; top: 0; z-index: 2; width: 48%; }
@media (max-width: 700px) {
  .hero2 { grid-template-columns: 1fr; padding: 32px 20px 36px; gap: 8px; }
  .hero-art { height: 220px; order: -1; max-width: 340px; width: 100%; margin: 0 auto; }
}

.shop-main { padding: 28px 16px 48px; gap: 18px; }
.sec-head { display: flex; flex-direction: column; gap: 4px; scroll-margin-top: 70px; }
.sec-head h2 { font-size: clamp(28px, 5vw, 36px); }
.shop .cats { margin: 0 -16px; padding: 2px 16px; }
@media (min-width: 700px) { .shop .cats { flex-wrap: wrap; margin: 0; padding: 0; } }
.shop .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.shop .tile { border-radius: 16px; transition: transform .2s, box-shadow .2s; }
.shop .tile:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(74,16,32,.12); }
.shop .tile-body { gap: 2px; padding: 10px 12px 0; flex: 1; }
.shop .tile-name { font-size: 13.5px; font-weight: 600; }
.shop .tile-price { font-weight: 700; color: var(--accent); font-size: 13.5px; }

.how2 { display: flex; flex-direction: column; gap: 14px; padding-top: 20px; scroll-margin-top: 70px; }
.how2 ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; counter-reset: s; }
.how2 li { counter-increment: s; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.how2 li::before { content: counter(s); font-family: var(--serif); font-size: 34px; font-weight: 700; line-height: 1; color: var(--gold-deep); margin-bottom: 4px; }
.how2 li span { color: var(--muted); font-size: 14px; }
.duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; padding-top: 8px; }
.duo .card { gap: 10px; }
.duo h2 { font-size: 24px; }
