:root {
  color: #24302a;
  background: #f6efe3;
  font-family: Nunito, system-ui, sans-serif;
  color-scheme: light;
  --elka-ink: #24302a;
  --elka-muted: #4c5850;
  --elka-green: #2e4b3c;
  --elka-red: #7e2a44;
  --elka-paper: #fffbf3;
  --elka-border: #ddceb4;
}

.elka-site, .elka-party-dialog { box-sizing: border-box; }
.elka-site *, .elka-party-dialog * { box-sizing: border-box; }
body.elka-app { margin: 0; min-width: 0; }
body.elka-app--alternate { height: auto !important; overflow: auto !important; }
body.elka-app--alternate #dc-root { display: none; }
.elka-site { min-height: 100vh; }
.elka-site__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  padding: 12px max(16px, calc((100% - 1080px) / 2));
  border-bottom: 1px solid var(--elka-border);
  background: var(--elka-paper);
}
.elka-site__brand, .elka-site__nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.elka-site__brand { font-family: Unbounded, system-ui, sans-serif; font-size: 13px; font-weight: 700; }
.elka-site__nav { gap: 12px; }
.elka-site__nav a, .elka-site__brand { color: var(--elka-green); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.elka-site__nav a:hover { text-decoration: underline; }
.elka-mobile-gifts { display: inline-flex; align-items: center; min-height: 44px; color: var(--elka-green); font-size: 14px; white-space: nowrap; }
.elka-site__brand svg { display: block; width: 106px; height: auto; }
.elka-site__main { width: min(100% - 32px, 740px); margin: 0 auto; padding: clamp(26px, 6vw, 66px) 0 54px; }
.elka-site h1, .elka-site h2, .elka-party-dialog h2 { font-family: Unbounded, system-ui, sans-serif; line-height: 1.22; color: var(--elka-green); overflow-wrap: anywhere; }
.elka-site h1 { font-size: clamp(25px, 5vw, 39px); margin: 0 0 12px; text-wrap: balance; }
.elka-site h2, .elka-party-dialog h2 { font-size: 19px; margin: 0; }
.elka-site p, .elka-party-dialog p { line-height: 1.5; margin: 0; overflow-wrap: anywhere; }
.elka-site .elka-site__intro { margin-bottom: 18px; color: var(--elka-muted); }
.elka-panel, .elka-party-dialog {
  display: grid;
  gap: 15px;
  padding: clamp(16px, 4vw, 26px);
  background: var(--elka-paper);
  border: 1px solid var(--elka-border);
  border-radius: 22px;
}
.elka-party-dialog:not([open]) { display: none; }
.elka-party-dialog { width: min(calc(100% - 32px), 460px); max-height: calc(100% - 32px); color: var(--elka-ink); }
.elka-party-dialog::backdrop { background: #15291ccc; }
.elka-stack { display: grid; gap: 14px; }
.elka-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.elka-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 9px 15px;
  border: 2px solid var(--elka-red);
  border-radius: 13px;
  background: var(--elka-red);
  color: white;
  text-align: center;
  text-decoration: none;
  font: 650 13px/1.35 Unbounded, system-ui, sans-serif;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.elka-button--quiet { background: transparent; border-color: var(--elka-border); color: var(--elka-green); }
.elka-button:disabled { opacity: .68; cursor: wait; }
.elka-site :focus-visible, .elka-party-dialog :focus-visible { outline: 2px solid var(--elka-red); outline-offset: 3px; }
.elka-field { display: grid; gap: 6px; color: var(--elka-green); font-weight: 750; }
.elka-field :is(input, select, textarea) {
  min-width: 0;
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--elka-border);
  border-radius: 11px;
  background: white;
  color: var(--elka-ink);
  font: 600 16px/1.45 Nunito, system-ui, sans-serif;
}
.elka-field textarea { resize: vertical; }
.elka-detail { border: 1px solid var(--elka-border); border-radius: 12px; }
.elka-detail summary { padding: 12px; min-height: 44px; cursor: pointer; color: var(--elka-green); font-weight: 800; }
.elka-detail summary:hover { background: #f6efe3; border-radius: 12px; }
.elka-detail > .elka-stack { padding: 0 12px 12px; }
.elka-status { font-size: 15px; color: var(--elka-green); }
.elka-status:empty { display: none; }
.elka-status[role="alert"] { color: var(--elka-red); }
.elka-content { white-space: pre-wrap; }
.elka-window-note { position: relative; z-index: 1; padding: 8px 16px; text-align: center; color: #fffaf0; background: var(--elka-green); font: 600 13px/1.45 Nunito, system-ui, sans-serif; margin: 0; }
.elka-recipient [data-elka-locked="true"] { filter: grayscale(.7); opacity: .64; }
.elka-recipient [data-elka-locked="false"] { filter: none; opacity: 1; }
#dc-root .paper:has(.relc[role="radio"]) a.cta[href="/editor/"] { overflow-wrap: anywhere; line-height: 1.3; padding-block: 8px; }

[data-elka-page="home"] #dc-root :is(#top, #how, #what, #prices) { scroll-margin-top: 16px; }
[data-elka-page="create"] #dc-root input[aria-invalid="true"] { outline: 2px solid var(--elka-red); outline-offset: 2px; }
[data-elka-page="create"] #dc-root .elka-setup-error { margin: 0; }
[data-elka-page="create"] #dc-root h1 { text-wrap: balance; }

[data-elka-page="create"][data-elka-layout="mobile"] #dc-root > .paper {
  width: min(100%, 440px) !important;
  height: auto !important;
  min-height: 100dvh;
  overflow: visible !important;
  margin-inline: auto;
  zoom: 1;
}
.elka-setup-fields { display: flex; flex: 1 1 auto; flex-direction: column; gap: 14px; padding: 8px 20px 16px; }
.elka-setup-fields .relc { min-width: 0; padding-block: 10px 8px; overflow-wrap: anywhere; }
.elka-setup-fields .fmt { min-height: 60px; padding-block: 8px; }
[data-elka-page="create"][data-elka-layout="mobile"] #dc-root > .paper > .bar {
  position: static;
  padding: 12px 20px max(12px, env(safe-area-inset-bottom));
}
[data-elka-page="create"][data-elka-layout="mobile"] #dc-root > .paper > header > span { font-size: 14px !important; text-align: right; }

.elka-button:not(:disabled) { touch-action: manipulation; }
.elka-button:not(.elka-button--quiet):not(:disabled):hover { background: #692239; border-color: #692239; }
.elka-button--quiet:not(:disabled):hover { background: #f6efe3; }
.elka-party-dialog, #dc-root :is(.sheet, .modal)[role="dialog"] { overscroll-behavior: contain; }
.elka-demo-frame > iframe { display: block; width: 375px; height: 852px; border: 0; }
.elka-flip-caption { color: #f0c766; font-weight: 800; text-align: center; }
.elka-flip-sample { width: 177px; height: 260px; overflow: hidden; border-radius: 17px; background: #f6efe3; }
.elka-flip-sample > iframe { width: 375px; height: 552px; border: 0; transform: scale(.472); transform-origin: top left; }
[data-elka-page="home"] #dc-root .flip .face[aria-hidden="true"] { visibility: hidden; pointer-events: none; }
[data-elka-page="home"] #dc-root .flip .ghost {
  min-height: 48px;
  border-radius: 999px;
  transition: background-color .16s, box-shadow .16s, transform .16s;
}
[data-elka-page="home"] #dc-root .flip .ghost:is(:hover, :focus-visible) { background-color: #ffffff24; box-shadow: 0 5px 13px #24302a35; transform: translateY(-2px); }
[data-elka-page="home"] #dc-root .flip .face[aria-hidden] { transition: visibility 0s .28s; }
[data-elka-page="home"] #dc-root .elka-final-cta { background: #fffbf3 !important; color: #24302a !important; }
#prices .elka-format-card { padding-block-start: 30px !important; }

:is([data-elka-page="review"], [data-elka-page="share"], [data-elka-page="gifts"]) .elka-site__main {
  width: min(100% - clamp(32px, 11vw, 160px), 1280px);
  padding-top: clamp(24px, 4vw, 48px);
}
:is([data-elka-page="review"], [data-elka-page="share"], [data-elka-page="gifts"]) .elka-site__header {
  padding: 10px clamp(16px, 3vw, 40px);
  min-height: 68px;
  background: #f6efe3;
}
.elka-site :is(.elka-review-title h1, .elka-share-content h1, .elka-gift-list) { margin: 0; }
.elka-checkout { display: grid; grid-template-columns: minmax(0, 640px) minmax(0, 420px); align-items: start; justify-content: center; gap: clamp(20px, 3vw, 40px); }
.elka-review-summary, .elka-review-title { display: grid; gap: 18px; min-width: 0; }
.elka-review-header { display: grid; grid-template-columns: minmax(95px, 210px) minmax(0, 1fr); align-items: center; gap: clamp(12px, 2vw, 22px); }
.elka-review-title .elka-button { justify-self: start; color: var(--elka-green); font: 800 15px Nunito, system-ui, sans-serif; }
.elka-review-rows, .elka-order { background: var(--elka-paper); border: 0; border-radius: 20px; box-shadow: 0 8px 20px #24302a12; }
.elka-review-rows { padding: 4px clamp(12px, 2vw, 22px); }
.elka-review-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 56px; }
.elka-review-row:not(:last-child) { border-bottom: 1px solid #efe6d6; }
.elka-review-row > svg { max-width: 24px; max-height: 24px; }
.elka-review-row > span { overflow-wrap: anywhere; }
.elka-site .elka-text-action { padding: 5px 0 5px 6px; border: 0; background: transparent; font: 800 16px Nunito, system-ui, sans-serif; text-decoration: underline; }
.elka-review-previews { display: flex; flex-wrap: wrap; gap: 8px; }
.elka-review-previews[hidden] { display: none; }
.elka-review-note { padding: 12px 16px; background: #fff6de; border-radius: 16px; }
.elka-review-note--warn { background: #fbe7e4; color: #6b2238; }
.elka-review-detail { color: var(--elka-muted); font-weight: 600; }
.elka-order { align-content: start; gap: 16px; }
.elka-order-price { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.elka-order-format, .elka-order p { color: var(--elka-muted); }
.elka-order p { text-align: center; }
.elka-site .elka-price { font: 750 clamp(26px, 4vw, 40px) Unbounded, sans-serif; }

.elka-design-tree { position: relative; display: grid; place-items: center; min-width: 0; isolation: isolate; }
.elka-design-tree::before { position: absolute; inset: 3% -14% 0; z-index: -1; background: radial-gradient(circle, #f0c76652 0, transparent 64%); content: ''; pointer-events: none; }
.elka-design-tree > svg { display: block; width: 100%; height: auto; }
.elka-design-star { position: absolute; left: 50%; top: 7.5%; width: 13%; aspect-ratio: 1; background: #edbb58; transform: translate(-50%, -50%); clip-path: polygon(50% 0, 64% 33%, 100% 36%, 73% 60%, 82% 99%, 50% 78%, 18% 99%, 27% 60%, 0 36%, 36% 33%); }
.elka-design-bauble { position: absolute; left: var(--x); top: var(--y); width: 14%; aspect-ratio: 1; border: 1px solid #a69c85; border-radius: 50%; transform: translate(-50%, -50%); background: #ece5d5; }
.elka-design-bauble--lit { border-color: #fff3cc; background: radial-gradient(circle at 31% 27%, #fffc 5%, transparent 20%), var(--ornament); box-shadow: 0 0 9px #f4ca6a; }
.elka-design-bauble--draft { border: 1px dashed #ad9164; background: var(--ornament); opacity: .68; }
.elka-design-bauble--small { width: 9%; }
.elka-design-envelope { display: block; position: relative; width: min(90%, 220px); aspect-ratio: 1.5; margin-block: 25%; border: 1px solid #d2b478; border-radius: 10px; background: #f4dca9; }
.elka-design-envelope::before { position: absolute; inset: 0; background: #e4be76; clip-path: polygon(0 0, 100% 0, 50% 68%); content: ''; }
.elka-share-layout { display: grid; grid-template-columns: minmax(180px, 360px) minmax(0, 560px); align-items: center; justify-content: center; gap: clamp(24px, 6vw, 80px); }
.elka-share-content, .elka-share-art, .elka-gift-card__body { display: grid; gap: 16px; min-width: 0; }
.elka-share-art > p { color: var(--elka-green); font: 700 28px Caveat, cursive; text-align: center; }
.elka-share-bubble { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; background: #e3eef4; border-radius: 20px 20px 20px 6px; padding: 14px 16px; }
.elka-share-bubble .elka-field input { background: #f7fbfd; border-color: #b7cbd6; }
.elka-share-bubble .elka-status { grid-column: 1 / -1; }
.elka-share-channels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.elka-share-more { color: var(--elka-muted); }
.elka-share-more a { color: var(--elka-green); font-weight: 800; }

.elka-gift-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.elka-gift-card {
  grid-template-columns: minmax(105px, 170px) minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 8px 18px;
  padding: clamp(14px, 2vw, 22px);
  border: 0;
  box-shadow: 0 8px 20px #24302a12;
}
.elka-gift-card .elka-design-tree { grid-row: 1 / 3; }
.elka-gift-card__body { gap: 6px; }
.elka-gift-card__actions { grid-column: 2; gap: 8px; }
.elka-gift-card__actions .elka-button { font: 800 15px Nunito, system-ui, sans-serif; }
.elka-gift-badge { justify-self: start; padding: 3px 10px; border-radius: 99px; background: #eef3ec; font-size: 15px; font-weight: 800; color: var(--elka-green); }
.elka-gift-card--draft .elka-gift-badge { background: #fff6de; color: #955019; }
.elka-gift-format { color: var(--elka-muted); font-weight: 750; }
.elka-gift-new { min-height: 72px; color: var(--elka-green); background: transparent; border: 2px dashed #9c8f75; border-radius: 22px; }
.elka-gift-new:not(:disabled):hover { color: var(--elka-green); background: #fff8e9; border-color: #9c8f75; }
.elka-telegram { display: grid; gap: 12px; padding: clamp(14px, 2vw, 22px); background: #e3eef4; border-radius: 20px; }
.elka-telegram h2 { font-size: 17px; }
.elka-telegram--linked { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding-block: 10px; }
.elka-telegram--linked .elka-status { grid-column: 1 / -1; }
.elka-share-content .elka-telegram { margin-top: 4px; }
.elka-opened-slot { padding: 11px; color: var(--elka-muted); border-bottom: 1px solid var(--elka-border); }
.elka-answers[hidden] { display: none; }
.elka-quiz-label { display: flex; align-items: center; gap: 8px; min-height: 36px; }

.elka-scene-dialog { --scene-aspect: .462; width: min(calc(100% - 20px), 420px, calc(20px + (100dvh - 92px) * var(--scene-aspect))); gap: 8px; padding: 10px; overflow: hidden; }
.elka-scene-dialog[data-kind="coupon"] { --scene-aspect: .586; }
.elka-scene-dialog > button { justify-self: end; min-height: 42px; }
.elka-scene-dialog > h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.elka-scene-iframe { display: block; width: 100%; aspect-ratio: var(--scene-aspect); border: 0; border-radius: 12px; background: #f6efe3; }
[data-elka-page="scene"], [data-elka-page="scene"] body { margin: 0; overflow: hidden; }
[data-elka-page="scene"] #dc-root { min-height: 100dvh; display: grid; justify-items: center; }
[data-elka-page="scene"] #dc-root > [data-scene-board] { height: var(--scene-height, 812px) !important; zoom: var(--scene-scale, 1); margin: 0; }
[data-scene-demo][data-scene-kind="question"] [data-scene-board] > :is(span, .rise) { margin-top: 6px !important; }
[data-scene-board="coupon"] .ticket.pop [data-scene-coupon-surface] { visibility: hidden; pointer-events: none; }
[data-scene-long-coupon] [data-scene-board] { gap: 8px !important; padding: 14px !important; }
[data-scene-long-coupon] [data-scene-board] > p { display: none; }
[data-scene-long-coupon] .ticket { flex: none; gap: 6px !important; padding: 12px 18px !important; }
[data-scene-long-coupon] .ticket > div:has([data-scene-coupon-surface]) { width: 100% !important; height: 56px !important; }
[data-scene-long-coupon] .ticket > div:last-child { display: none !important; }
[data-scene-long-coupon] [data-scene-coupon-actions] { flex: 1 1 auto; min-height: 0; gap: 7px !important; }
[data-scene-long-coupon] [data-scene-coupon-actions] > span {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  font-size: 15px !important;
  line-height: 1.32;
}
[data-scene-coupon-actions] > :is(button, a) { flex-shrink: 0; }
[data-elka-page="scene"] #dc-root:not([data-scene-ready]),
[data-elka-page="recipient"] #dc-root:not([data-elka-personal-ready]),
[data-elka-page="recipient-first"] #dc-root:has(h1) { visibility: hidden; }
[data-elka-page="scene"] [hidden] { display: none !important; }
[data-scene-wipe] { touch-action: none; cursor: grab; }
[data-scene-wipe]:active { cursor: grabbing; }
[data-scene-text] { overflow-wrap: anywhere; }
[data-scene-text="attachment"] a { color: inherit; text-underline-offset: .18em; }
.elka-gift-attachment:not(:empty) { display: block; margin-top: 6px; font: 800 15px Nunito, system-ui, sans-serif; }
.elka-personal-loading { position: fixed; inset: 0; display: grid; place-items: center; margin: 0; color: var(--elka-green); font-weight: 750; }
.elka-recipient-home { display: inline-flex; align-items: center; color: inherit; text-underline-offset: .2em; }
.elka-star-author { display: block; font-weight: 800; }
.elka-star-author > span { color: var(--elka-muted); font-weight: 500; }
.elka-star-author input { display: block; width: 100%; box-sizing: border-box; }
.elka-star-previous { min-height: 36px; padding: 2px 9px; white-space: nowrap; }
.elka-star-review { background: var(--elka-red); width: 100%; min-height: 48px; }
[data-elka-page="editor"] .elka-panel > [hidden] { display: none; }

/* Редактор на телефоне: экран во всю высоту (панель с кнопкой — у нижнего края, как в макете V6-K2),
   «Мои подарки» — круглая кнопка «‹» как в макете, иначе «Сохранить» уезжает за край. */
[data-elka-page="editor"][data-elka-layout="mobile"] #dc-root > .paper {
  width: min(100%, 440px) !important;
  height: 100dvh !important;
  min-height: 600px;
  margin-inline: auto;
}
[data-elka-page="editor"] #dc-root header .elka-mobile-gifts {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  border-radius: 50%;
  font-size: 0;
  color: transparent;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2324302A' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 6l-6 6 6 6'/%3E%3C/svg%3E") center / 22px no-repeat;
  box-shadow: none;
}
@media (max-height: 800px) {
  [data-elka-page="editor"][data-elka-layout="mobile"] #dc-root > .paper > div:nth-child(3) > div:nth-child(2) { zoom: .9; }
}
@media (max-height: 760px) {
  [data-elka-page="editor"][data-elka-layout="mobile"] #dc-root > .paper > div:nth-child(3) > div:nth-child(2) { zoom: .8; }
}
@media (max-height: 720px) {
  [data-elka-page="editor"][data-elka-layout="mobile"] #dc-root > .paper > div:nth-child(4) > span { display: none; }
}
/* Шторки редактора на телефоне: не выше экрана, содержимое прокручивается, кнопка действия
   прилипает к низу. Без этого «Проверить подарок» в шторке звезды уезжала за экран. */
[data-elka-page="editor"][data-elka-layout="mobile"] #dc-root .sheet[role="dialog"] {
  max-height: min(640px, calc(100dvh - 24px)) !important;
  overflow-y: auto;
  overscroll-behavior: contain;
}
[data-elka-page="editor"][data-elka-layout="mobile"] #dc-root .sheet[role="dialog"] > * { flex-shrink: 0; }
[data-elka-page="editor"][data-elka-layout="mobile"] #dc-root .sheet[role="dialog"] > .safe:last-child {
  position: sticky;
  bottom: 0;
  z-index: 1;
  background: #FFFBF3;
  box-shadow: 0 -10px 14px -10px rgba(36, 48, 42, .18);
}
[data-elka-page="editor"] #dc-root .elka-star-previous {
  align-self: flex-start;
  min-height: 32px;
  margin: 4px 0 2px;
  padding: 0 12px;
  font-size: 14px;
}

/* Выключатель звука на ёлке получателя */
.elka-sound-toggle {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  z-index: 30;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: rgba(255, 251, 243, .92) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2324302A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9v6h4l5 4V5L8 9z'/%3E%3Cpath d='M16.5 8.5a5 5 0 0 1 0 7M19 6a8.5 8.5 0 0 1 0 12'/%3E%3C/svg%3E") center / 22px no-repeat;
  box-shadow: 0 4px 12px rgba(36, 48, 42, .18);
}
.elka-sound-toggle[data-muted="true"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2324302A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9v6h4l5 4V5L8 9z'/%3E%3Cpath d='M17 9l5 6M22 9l-5 6'/%3E%3C/svg%3E");
}
.elka-sound-toggle:focus-visible { outline: 2px solid var(--elka-red); outline-offset: 3px; }
.elka-sound-toggle--inline { position: static; box-shadow: 0 4px 10px rgba(36, 48, 42, .06); background-color: #fffbf3; }
.elka-plaque-column { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
/* Ёлка получателя на телефоне — во всю высоту экрана (кнопка у нижнего края). */
@media (max-width: 600px) {
  [data-elka-page="recipient"] #dc-root > .paper { width: min(100%, 440px) !important; height: 100dvh !important; min-height: 560px; margin-inline: auto; }
}
.elka-plaque-column > [hidden] { display: none; }
@media (max-width: 600px) {
  [data-elka-page="recipient-onegift"] #dc-root > .paper,
  [data-elka-page="recipient-onegift"] #dc-root > div:first-child { width: min(100%, 440px) !important; height: 100dvh !important; min-height: 560px; margin-inline: auto; }
}
.elka-replies { list-style: none; margin: 0 0 18px; padding: 4px 18px; background: var(--elka-paper); border-radius: 20px; box-shadow: 0 8px 20px #24302a12; }
.elka-replies__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 10px 0; }
.elka-replies__row:not(:last-child) { border-bottom: 1px solid #efe6d6; }
.elka-replies__row--pale { opacity: .55; }
.elka-replies__text { display: grid; gap: 2px; min-width: 0; }
.elka-replies__title { font-weight: 800; color: var(--elka-green); }
.elka-replies__quote { color: var(--elka-muted); overflow-wrap: anywhere; }
.elka-replies__value { flex-shrink: 0; color: var(--elka-muted); font-weight: 700; text-align: right; max-width: 45%; }
.elka-replies__value--on { padding: 4px 12px; border-radius: 999px; background: #7e2a44; color: #fff; }
.elka-limit { display: block; min-height: 0; margin-top: 4px; font: 700 15px/1.3 Nunito, system-ui, sans-serif; color: #4c5850; text-align: right; }
.elka-limit:empty { display: none; }
.elka-limit--error { color: #b3261e; }
.elka-limit--warn { color: #b7791f; }
#dc-root textarea[aria-invalid], #dc-root input[aria-invalid] { border-color: #b3261e !important; outline-color: #b3261e; }
#dc-root button:disabled { opacity: .5; cursor: not-allowed; }
.elka-tree-hint { margin: 8px 0 0; text-align: center; color: #4c5850; font: 700 15px/1.35 Nunito, system-ui, sans-serif; }
.elka-late-banner { position: relative; z-index: 5; margin: 10px 20px 0; padding: 12px 16px; border-radius: 18px; background: #fffbf3; box-shadow: 0 6px 16px rgba(36, 48, 42, .1); font: 600 15px/1.35 Nunito, system-ui, sans-serif; color: #24302a; }
.elka-late-banner strong { display: block; font: 700 18px/1.25 Unbounded, system-ui, sans-serif; color: #7e2a44; }
.elka-late-banner p { margin: 4px 0 0; }
.elka-late-banner--compact { padding: 8px 14px; }
.elka-late-banner--compact strong { display: inline; font-size: 15px; }
.elka-waking { position: relative; z-index: 5; margin: 8px 20px 0; font: 600 16px/1.4 Nunito, system-ui, sans-serif; color: #3d4842; }
.elka-waking p { margin: 0 0 10px; }
.elka-countdown { display: flex; gap: 8px; }
.elka-countdown__cell { flex: 1 1 0; display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border-radius: 16px; background: #fffbf3; box-shadow: 0 4px 10px rgba(36, 48, 42, .06); }
.elka-countdown__cell strong { font: 700 26px/1.1 Unbounded, system-ui, sans-serif; color: #2e4b3c; }
.elka-countdown__cell span { font-size: 15px; color: #4c5850; }
.elka-waiting-tag { position: absolute !important; left: 50% !important; top: 100% !important; right: auto !important; bottom: auto !important; translate: -50% 0; white-space: nowrap; pointer-events: none; z-index: 4; }
.elka-toast {
  position: fixed;
  left: 50%;
  bottom: max(96px, calc(env(safe-area-inset-bottom) + 96px));
  z-index: 50;
  max-width: min(340px, calc(100vw - 32px));
  padding: 12px 18px;
  border-radius: 16px;
  background: #24302a;
  color: #fffbf3;
  font: 700 16px/1.35 Nunito, system-ui, sans-serif;
  text-align: center;
  box-shadow: 0 10px 24px rgba(36, 48, 42, .25);
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.elka-toast[data-visible="true"] { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .elka-toast { transition: none; } }
.elka-today-badge {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translate(-50%, 2px);
  padding: 3px 10px;
  border-radius: 999px;
  background: #7e2a44;
  color: #fff;
  font: 800 15px/1.2 Nunito, system-ui, sans-serif;
  white-space: nowrap;
  pointer-events: none;
  z-index: 4;
}

.elka-share-message { margin: 0; color: var(--elka-ink); font-size: 16px; line-height: 1.45; grid-column: 1 / -1; }

@media (max-width: 650px) {
  .elka-checkout, .elka-share-layout, .elka-gift-list { grid-template-columns: minmax(0, 1fr); }
  .elka-review-header { grid-template-columns: minmax(90px, 37%) minmax(0, 1fr); }
  .elka-review-title { display: contents; }
  .elka-review-title .elka-button { grid-column: 1 / -1; justify-self: stretch; }
  .elka-share-art { justify-self: center; width: min(44vw, 210px); gap: 4px; }
  .elka-share-content h1, .elka-share-more { text-align: center; }
  .elka-gift-card { grid-template-columns: minmax(72px, 34%) minmax(0, 1fr); gap: 12px; }
  .elka-gift-card .elka-design-tree { grid-row: 1; }
  .elka-gift-card__actions { grid-column: 1 / -1; }
  /* Как в макете V6-K5: цена и «Оформить» всегда видны внизу экрана. */
  .elka-order {
    position: sticky;
    bottom: 0;
    z-index: 5;
    gap: 10px;
    margin-inline: -16px;
    padding: 12px 16px max(12px, env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 20px #24302a1f;
  }
  .elka-order > p:not(.elka-status) { display: none; }
  .elka-site .elka-order .elka-price { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  [data-elka-page="home"] #dc-root .flip :is(.ghost, .face[aria-hidden]) { transition: none; transform: none; }
}
@media (max-width: 420px) {
  .elka-actions > :is(a, button) { flex: 1 1 auto; }
  .elka-site__nav { column-gap: 10px; font-size: 14px; }
  .elka-review-row { gap: 7px; }
  .elka-share-bubble { grid-template-columns: minmax(0, 1fr); }
  .elka-share-channels { gap: 6px; }
  .elka-share-channels .elka-button { padding-inline: 5px; font: 800 15px Nunito, system-ui, sans-serif; }
}
@media (max-width: 360px) {
  .elka-setup-fields .relc { padding-inline: 4px; }
}

/* ТЗ 5–6: почта, оплата (P1/P2), вход по коду (K0/K0e/L1), «Мои подарки» с почтой */
.elka-email-error { font-size: 15px; font-weight: 650; color: #b3261e; }
.elka-email-error:empty { display: none; }
.elka-field input[aria-invalid="true"], #dc-root input[type="email"][aria-invalid] { border-color: #b3261e; box-shadow: 0 0 0 1px #b3261e; }
.elka-email-hint { justify-self: start; min-height: 36px; padding: 4px 0; border: 0; background: none; color: var(--elka-red); font: 700 15px Nunito, sans-serif; text-decoration: underline; cursor: pointer; }
.elka-email-hint[hidden] { display: none; }
.elka-field-hint { color: var(--elka-muted); font-size: 14px; font-weight: 600; }
.elka-review-email { padding: 14px 16px; background: var(--elka-paper); border: 1px solid var(--elka-border); border-radius: 16px; }
.elka-pay-terms, .elka-pay-test { margin: 0; font-size: 14px; }
.elka-pay-terms a { color: inherit; }
.elka-pay-test { color: #8a6d1d !important; }
.elka-pay-plaque { padding: 12px 14px; border-radius: 14px; font-weight: 700; line-height: 1.4; }
.elka-pay-plaque--error { background: #fbe7e4; color: #8f1f2c; }
.elka-pay-plaque--note { background: #e6f1e8; color: var(--elka-green); }
.elka-pay-overlay { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgb(36 48 42 / .55); }
.elka-pay-card { display: grid; justify-items: center; gap: 12px; width: min(380px, 100%); padding: 28px 22px; text-align: center; background: var(--elka-paper); border-radius: 24px; box-shadow: 0 18px 50px rgb(0 0 0 / .25); }
.elka-pay-card h2 { margin: 0; font: 750 21px/1.25 Unbounded, sans-serif; color: var(--elka-green); }
.elka-pay-card p { margin: 0; color: var(--elka-muted); }
.elka-pay-spinner { width: 44px; height: 44px; border: 4px solid #e8dcc6; border-top-color: var(--elka-red); border-radius: 50%; animation: elka-spin .9s linear infinite; }
.elka-pay-done { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: #eef3ec; color: var(--elka-green); font-size: 28px; font-weight: 900; }
@keyframes elka-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .elka-pay-spinner { animation-duration: 3s; } }
.elka-login { width: min(460px, 100%); margin-inline: auto; }
.elka-login h1 { margin: 0; }
.elka-code { font: 750 26px/1 Unbounded, monospace !important; letter-spacing: .32em; text-align: center; }
.elka-login-again, .elka-login-note { margin: 0; color: var(--elka-muted); font-size: 15px; }
.elka-login-gift { display: grid; justify-items: center; gap: 2px; }
.elka-login-gift .elka-design-tree { width: 120px; }
.elka-login-gift__title { margin: 6px 0 0; font: 750 20px Unbounded, sans-serif; color: var(--elka-green); }
.elka-login-gift__sign { margin: 0; color: var(--elka-muted); }
.elka-account { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 12px; margin-bottom: 14px; }
.elka-account__email { font-weight: 800; color: var(--elka-green); overflow-wrap: anywhere; }
.elka-account__hint { color: var(--elka-muted); }
.elka-gift-status { margin: 0; color: var(--elka-muted); font-size: 15px; }
.elka-gift-reply { margin: 0; padding: 8px 12px; background: #fff6de; border-radius: 12px; font-weight: 700; }
.elka-share-email { margin: 0; color: var(--elka-muted); overflow-wrap: anywhere; }
.elka-share-email-form { margin-top: 8px; }
.elka-share-main { width: 100%; }
/* ТЗ 4.4 M1–M3: фото, голос, сертификат */
.elka-media { min-width: min(340px, 78vw); }
.elka-media-hint { margin: 0; color: var(--elka-muted); font-size: 15px; }
.elka-media-warn { margin: 0; color: #8f1f2c; font-weight: 800; }
.elka-media-progress { width: 100%; height: 10px; accent-color: var(--elka-red); }
.elka-media-percent { margin: 0; font-weight: 800; color: var(--elka-green); }
.elka-media-thumb { display: block; width: 100%; max-height: 260px; object-fit: contain; border-radius: 12px; background: #f6efe3; }
.elka-media-ready audio, .elka-media audio { width: 100%; }
.elka-media-link { margin: 0; overflow-wrap: anywhere; color: var(--elka-muted); }
.elka-media-rec { margin: 0; color: #b3261e; font-weight: 800; }
.elka-media-timer { margin: 0; font: 750 28px Unbounded, monospace; color: var(--elka-green); font-variant-numeric: tabular-nums; }
.elka-media-timer--late { color: #b3261e; }
.elka-media-wave { width: 100%; max-width: 280px; height: 48px; }
.elka-toast-undo { margin-left: 8px; padding: 4px 10px; border: 0; border-radius: 999px; background: #fffbf3; color: var(--elka-red); font: 800 14px Nunito, sans-serif; cursor: pointer; }
.elka-onegift-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
/* упаковки (ТЗ 8.2): демо-подробности бордов спрятаны, даже если у элемента inline display */
[data-scene-board] [hidden] { display: none !important; }
.elka-pack-media { position: relative; z-index: 3; display: grid; gap: 8px; justify-items: center; margin: 8px auto; width: min(300px, 100%); }
.elka-pack-media img { width: 100%; max-height: 240px; object-fit: cover; border-radius: 12px; box-shadow: 0 10px 24px rgba(36,48,42,.18); }
.elka-pack-media audio { width: 100%; }

/* K8 / D6: правка после отправки */
.elka-sent-banner { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 40; transform: translateX(-50%); width: min(620px, calc(100vw - 32px)); padding: 10px 16px; border-radius: 14px; background: #e6f1e8; color: var(--elka-green); box-shadow: 0 8px 24px rgb(36 48 42 / .16); font: 700 14px/1.4 Nunito, sans-serif; text-align: center; }
[data-elka-sent] .elka-sent-banner { pointer-events: none; }
.elka-locked-note { display: grid; gap: 8px; margin: 10px 0; padding: 14px 16px; border: 2px solid #b8ae9a; border-radius: 16px; background: #f3efe6; color: var(--elka-ink); font: 600 15px/1.45 Nunito, sans-serif; }
.elka-locked-note strong { color: var(--elka-green); font-size: 16px; }
.elka-locked-note p { margin: 0; }
.elka-locked-note .elka-button { justify-self: start; pointer-events: auto; opacity: 1; }
[data-elka-locked-panel] :is(textarea, input, select, button:not(.elka-button):not([aria-label*="Закрыть"]):not([aria-label*="Назад"]):not([aria-label*="Следующ"]):not([aria-label*="Предыдущ"])) { pointer-events: none; opacity: .45; }
@media (max-width: 760px) { .elka-sent-banner { bottom: auto; top: max(8px, env(safe-area-inset-top)); font-size: 13px; } }.elka-sent-banner { transition: opacity .4s; }
.elka-sent-banner--hide { opacity: 0; }

/* V4-R-States */
.elka-state { display: grid; justify-items: start; gap: 14px; }
.elka-state__art { width: 96px; height: 96px; }
.elka-slow { position: fixed; inset: 0; z-index: 70; display: grid; place-content: center; justify-items: center; gap: 10px; background: rgb(246 239 227 / .92); color: var(--elka-green); font: 700 17px Nunito, sans-serif; text-align: center; }
.elka-slow strong { font: 750 22px Unbounded, sans-serif; }
.elka-owner-note { position: fixed; left: 50%; top: max(12px, env(safe-area-inset-top)); z-index: 60; transform: translateX(-50%); display: grid; gap: 6px; justify-items: center; width: min(420px, calc(100vw - 32px)); padding: 14px 16px; border: 2px solid #b8d0bd; border-radius: 18px; background: #e6f1e8; color: var(--elka-green); box-shadow: 0 10px 28px rgb(36 48 42 / .18); font: 600 15px/1.4 Nunito, sans-serif; text-align: center; }
.elka-owner-note strong { font-size: 17px; }
/* V4-R-Share: картинка 9:16 */
.elka-share-dialog { width: min(420px, calc(100vw - 24px)); }
.elka-share-preview { display: block; width: min(300px, 70vw); aspect-ratio: 9 / 16; margin: 0 auto; border-radius: 18px; box-shadow: 0 10px 30px rgb(36 48 42 / .25); -webkit-touch-callout: default; }
.elka-share-hint { margin: 0; color: var(--elka-muted); font-size: 14px; text-align: center; }
