/* Сайт «Рады вам»: главная, конструктор, страницы с текстами. Приглашение оформляет invite.css. */
@font-face { font-family: 'ZV Golos'; src: url('fonts/golos-ru.woff2?v=1de294cd') format('woff2'); font-weight: 400 700; font-display: swap; unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0400-045F, U+0490-0491, U+2010-2027, U+2030-203A, U+2116, U+20B8, U+20BD, U+2122, U+2212; }
@font-face { font-family: 'ZV Golos'; src: url('fonts/golos-ext.woff2?v=fdfc4dcc') format('woff2'); font-weight: 400 700; font-display: swap; unicode-range: U+0100-0130, U+0132-0151, U+0154-017F, U+018F, U+0259, U+0460-048F, U+0492-04FF, U+0500-052F; }
@font-face { font-family: 'ZV Cormorant'; src: url('fonts/cormorant-ru.woff2?v=ad1b1f12') format('woff2'); font-weight: 300 700; font-style: normal; font-display: swap; unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0400-045F, U+0490-0491, U+2010-2027, U+2030-203A, U+2116, U+20B8, U+20BD, U+2122, U+2212; }
@font-face { font-family: 'ZV Cormorant'; src: url('fonts/cormorant-ext.woff2?v=53d5ec75') format('woff2'); font-weight: 300 700; font-style: normal; font-display: swap; unicode-range: U+0100-0130, U+0132-0151, U+0154-017F, U+018F, U+0259, U+0460-048F, U+0492-04FF, U+0500-052F; }
@font-face { font-family: 'ZV Cormorant'; src: url('fonts/cormorant-italic-ru.woff2?v=3d151743') format('woff2'); font-weight: 300 700; font-style: italic; font-display: swap; unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0400-045F, U+0490-0491, U+2010-2027, U+2030-203A, U+2116, U+20B8, U+20BD, U+2122, U+2212; }
@font-face { font-family: 'ZV Cormorant'; src: url('fonts/cormorant-italic-ext.woff2?v=c6101463') format('woff2'); font-weight: 300 700; font-style: italic; font-display: swap; unicode-range: U+0100-0130, U+0132-0151, U+0154-017F, U+018F, U+0259, U+0460-048F, U+0492-04FF, U+0500-052F; }

:root {
  --bg: #F6F2EA;
  --surface: #FFFDF9;
  --surface2: #EFE9DE;
  --ink: #1E1A16;
  --muted: #6A6157;
  --line: #E2D9CA;
  --brand: #1D5745;
  --brand-2: #164536;
  --donate-hover: brightness(.94);
  --on-brand: #FFFFFF;
  --gold: #A97C34;
  --danger: #B3412F;
  --ok: #2E7D4F;
  --shadow: 0 1px 2px rgba(40, 30, 15, .06), 0 8px 28px rgba(40, 30, 15, .08);
  --r: 14px;
  --head: 'ZV Cormorant', Georgia, 'Times New Roman', serif;
  --ui: 'ZV Golos', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14120F;
    --surface: #1C1915;
    --surface2: #25211C;
    --ink: #F1EADF;
    --muted: #ABA195;
    --line: #36312A;
    --brand: #5DB394;
    --brand-2: #79C7AA;
    --donate-hover: brightness(1.07);
    --on-brand: #0E1F19;
    --gold: #D8B36B;
    --danger: #F08C78;
    --ok: #7FD1A0;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--ui); -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
a { color: var(--brand); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--head); font-weight: 600; line-height: 1.1; letter-spacing: -0.005em; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(38px, 7.2vw, 64px); }
h2 { font-size: clamp(30px, 5vw, 42px); }
h3 { font-size: 24px; }
p { margin: 0 0 1em; }
.wrap { width: min(1160px, 100% - 32px); margin: 0 auto; }
.narrow { width: min(760px, 100% - 32px); margin: 0 auto; }
.wrap .narrow { width: min(760px, 100%); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Шапка */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.top-row { display: flex; align-items: center; gap: 18px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 600 25px/1 var(--head); letter-spacing: 0.005em; white-space: nowrap; }
.logo svg { width: 34px; height: 34px; flex: none; }
.top-nav { display: flex; gap: 4px; margin-left: auto; }
.top-nav a { color: var(--ink); text-decoration: none; padding: 8px 12px; border-radius: 10px; font-size: 15.5px; }
.top-nav a:hover, .top-nav a[aria-current=page] { background: var(--surface2); }
.top .btn { min-height: 42px; padding: 8px 18px; font-size: 15px; }
/* «Поддержать»: золотая лента с эмблемой-печатью, как печать на конвертах. */
.donate { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 5px 16px 5px 6px; border-radius: 999px; text-decoration: none; white-space: nowrap; font: 600 15px/1 var(--ui); color: #3A2A10; background: linear-gradient(135deg, #F5E3AE, #DDBB6C 55%, #C79D4B); box-shadow: 0 2px 12px rgba(160, 120, 40, .35), inset 0 0 0 1px rgba(255, 255, 255, .5); transition: filter .15s, transform .1s; }
.donate svg { width: 32px; height: 32px; flex: none; }
/* Как у «Создать»: при наведении оттенок (в светлой теме темнее, в тёмной светлее), при нажатии чуть сжимается. */
.donate:hover { filter: var(--donate-hover); }
.donate:active { transform: scale(.98); }
.donate:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.donate-lg { min-height: 54px; padding: 7px 22px 7px 8px; font-size: 16.5px; }
.donate-lg svg { width: 40px; height: 40px; }
.support { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 18px 24px; padding: 28px clamp(20px, 4vw, 40px); border-radius: 24px; background: var(--surface); border: 1px solid var(--line); }
.support::before { content: ''; position: absolute; inset: 8px; border: 1px dashed #D9B566; border-radius: 18px; pointer-events: none; }
.support-seal svg { width: 64px; height: 64px; display: block; }
.support-text { flex: 1 1 260px; min-width: 0; }
.support-text h2 { font-size: clamp(24px, 3.4vw, 32px); margin: 0 0 6px; }
.support-text p { margin: 0; color: var(--muted); }
@media (max-width: 860px) {
  .top-nav { display: none; }
  .top .btn { margin-left: auto; }
  /* На телефоне «Поддержать» золотой кнопкой с подписью; печать внутри не нужна, она похожа на логотип. */
  .top-row { gap: 10px; }
  .top .donate { margin-left: auto; min-height: 40px; padding: 0 14px; font-size: 14.5px; }
  .top .donate svg { display: none; }
  .top .donate + .btn { margin-left: 0; }
  .top .btn { min-height: 40px; padding: 8px 14px; font-size: 14.5px; }
}
/* Телефон боком: экран низкий, шапка не держится сверху, место отдаём содержимому. */
@media (max-height: 500px) and (orientation: landscape) { .top { position: static; } .top-row { min-height: 52px; } }
/* Узкие телефоны: логотип, «Поддержать» и «Создать» в одну строку. */
@media (max-width: 420px) {
  .top-row { gap: 8px; }
  .logo { font-size: 21px; gap: 7px; }
  .logo svg { width: 30px; height: 30px; }
  .top .donate, .top .btn { padding: 0 12px; font-size: 14px; }
}
/* Самые узкие: название уходит, остаётся печать-логотип. */
@media (max-width: 350px) {
  .logo span { display: none; }
}

/* Кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 12px 24px; border-radius: 999px; border: 1px solid transparent; background: var(--brand); color: var(--on-brand); font: 600 16.5px/1.2 var(--ui); text-decoration: none; cursor: pointer; transition: background .15s, transform .1s, box-shadow .15s; white-space: nowrap; }
.btn:hover { background: var(--brand-2); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface2); }
.done-apps { display: flex; gap: 8px; }
.done-note { margin: -2px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.done-apps .btn { flex: 1; }
.btn-sm { min-height: 40px; padding: 8px 16px; font-size: 15px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--brand); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Главная */
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; padding: 56px 0 40px; }
.hero h1 { margin-bottom: 18px; }
.hero h1 em { font-style: italic; color: var(--brand); }
.lead { font-size: 19.5px; color: var(--muted); max-width: 560px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 18px; }
.hero-notes { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; margin: 0; list-style: none; color: var(--muted); font-size: 15px; }
.hero-notes li::before { content: '✓'; color: var(--brand); font-weight: 700; margin-right: 6px; }
.hero-phones { position: relative; height: 640px; }
.hero-phones .phone { position: absolute; }

.hero-phones .phone:nth-child(1) { left: 4%; top: 30px; transform: rotate(-5deg); z-index: 1; }
.hero-phones .phone:nth-child(2) { right: 2%; top: 0; transform: rotate(4deg); z-index: 2; }
@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; gap: 20px; padding-top: 32px; }
  .hero-phones { height: 650px; }
}
/* Телефон: оба экрана целиком. Размер от ширины экрана, высота блока по наклонённому телефону. */
@media (max-width: 520px) {
  .hero-phones { height: calc(min(230px, 54vw) * 2.05 + 60px); margin: 0 -16px; overflow: hidden; }
  .hero-phones .phone { --pw: min(230px, 54vw); }
  .hero-phones .phone:nth-child(1) { left: 24px; top: 40px; }
  .hero-phones .phone:nth-child(2) { right: 20px; top: 12px; }
}

/* Один телефон на страницах торжеств: без поворота и обрезки */
.hero-phones.single { height: auto; display: flex; justify-content: center; padding: 10px 0 24px; overflow: visible; margin: 0; }
.hero-phones.single .phone.phone { position: relative; left: auto; right: auto; top: auto; transform: none; }

/* Телефон с приглашением внутри */
.phone { --pw: 290px; width: var(--pw); height: calc(var(--pw) * 2.05); border-radius: calc(var(--pw) * .14); background: #111; padding: calc(var(--pw) * .035); box-shadow: 0 30px 60px rgba(30, 20, 5, .22), 0 0 0 1px rgba(0,0,0,.4); }
.phone-screen { width: 100%; height: 100%; border-radius: calc(var(--pw) * .11); overflow: hidden; background: #fff; position: relative; }
.phone-screen > img, .design-thumb > img, .dz-thumb > img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.phone-scale { display: block; width: 390px; transform-origin: 0 0; transform: scale(var(--s, .6915)); pointer-events: none; }

.section { padding: 56px 0; }
.section-head { max-width: 680px; margin-bottom: 28px; }
.section-head p { color: var(--muted); font-size: 18px; }

.designs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.design-card { position: relative; display: block; min-width: 0; text-decoration: none; color: var(--ink); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; transition: transform .15s, box-shadow .15s; }
.design-card:hover { transform: translateY(-3px); }
.design-thumb { aspect-ratio: 440 / 600; overflow: hidden; position: relative; }
@media (min-width: 1000px) { .designs { grid-template-columns: repeat(4, 1fr); } }
/* На телефоне дизайны в две колонки: в одну 12 карточек растягивали главную на 7000 px. */
@media (max-width: 599px) {
  .designs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .design-card .dc-name { flex-wrap: wrap; gap: 0 6px; padding: 8px 10px; font-size: 15px; }
  .design-card .dc-name span { font-size: 12.5px; }
}
.design-thumb .phone-scale { --s: .56; }
.design-card .dc-name { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; font-weight: 600; }
.design-card .dc-name span { color: var(--muted); font-weight: 400; font-size: 14px; }
.designs-more { margin-top: 18px; }
.designs-more > summary { list-style: none; display: flex; width: max-content; margin: 0 auto; cursor: pointer; }
.designs-more > summary::-webkit-details-marker { display: none; }
.designs-more[open] > summary { display: none; }
.designs-more > .designs { margin-top: 0; }
p.designs-more { display: flex; justify-content: center; margin-bottom: 0; }
.tpl-head { padding-bottom: 0; }
.tpl-head .lead { color: var(--muted); font-size: 18px; margin: 0 0 18px; }
.tpl-group { padding-top: 36px; padding-bottom: 0; scroll-margin-top: 80px; }
.tpl-group h2 { margin-bottom: 18px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: s; padding: 0; margin: 0; list-style: none; }
.steps li { background: var(--surface); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); }
.steps li::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: var(--on-brand); font: 600 22px/1 var(--head); margin-bottom: 12px; }
.steps h3 { font-size: 22px; margin-bottom: 6px; }
.steps p { color: var(--muted); margin: 0; font-size: 16px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; padding: 0; margin: 0; list-style: none; }
.features li { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: start; background: var(--surface); border-radius: var(--r); padding: 16px; border: 1px solid var(--line); }
.features svg { width: 44px; height: 44px; padding: 10px; border-radius: 12px; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }
.features b { display: block; margin-bottom: 2px; }
.features span { color: var(--muted); font-size: 15px; line-height: 1.45; }

.types { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0; list-style: none; }
.types a { display: inline-block; padding: 10px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.types a:hover { border-color: var(--brand); }

.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; padding: 14px 32px 14px 0; font-weight: 600; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 4px; top: 10px; font-size: 24px; color: var(--muted); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); }

.cta-band { background: var(--brand); color: var(--on-brand); border-radius: 24px; padding: 40px clamp(20px, 5vw, 56px); display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.cta-band h2 { margin: 0; color: inherit; }
.cta-band .btn { background: var(--on-brand); color: var(--brand); }

/* Статьи и страницы торжеств */
.page { padding: 32px 0 56px; }
.prose { font-size: 18px; }
.prose h2 { margin-top: 1.4em; }
.prose h3 { margin-top: 1.2em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin: .3em 0; }
.prose .texts, .prose .types { padding-left: 0; }
.prose .texts li, .prose .types li { margin: 0; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 18px 0 0; font-size: 14px; color: var(--muted); }
.crumbs li + li::before { content: '›'; margin-right: 6px; }
.crumbs a { color: var(--muted); }
/* Над узкой колонкой (документы, тексты) крошки начинаются от её левого края, а не от края шапки. */
.crumbs:has(+ .narrow) { width: min(760px, 100%); margin-inline: auto; }
.texts { display: grid; gap: 12px; padding: 0; margin: 18px 0 28px; list-style: none; }
.texts li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.texts p { margin: 0 0 10px; font-family: var(--head); font-size: 21px; line-height: 1.35; }
.texts .t-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: 14px; color: var(--muted); }
.texts .t-meta a, .texts .t-meta button { font-size: 14px; }
.lang-tag { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--surface2); }
.type-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; margin: 22px 0; }
.type-cta p { margin: 0; flex: 1 1 260px; }

/* Пример приглашения */
.demo-bar { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); font-size: 15px; }
.demo-bar .btn { min-height: 40px; padding: 8px 18px; font-size: 15px; }

/* Живой пример на главной */
.live-demo { display: grid; grid-template-columns: auto 1fr; gap: 48px; align-items: center; }
.live-phone { --pw: 290px; }
.live-phone iframe, .live-facade { display: block; width: 390px; height: 830px; border: 0; transform: scale(var(--s, .6915)); transform-origin: 0 0; background: #fff; }
/* До нажатия картинка конверта: живой пример со своими шрифтами грузится, только когда его открывают. */
.live-facade { padding: 0; cursor: pointer; }
/* Пока пример грузится, картинка конверта лежит поверх него. */
.live-facade.is-loading { position: absolute; top: 0; left: 0; z-index: 1; cursor: progress; }
.live-facade img { display: block; width: 100%; height: 100%; }
.live-points { list-style: none; padding: 0; margin: 0 0 14px; font-size: 18px; }
.live-points li { padding: 6px 0 6px 28px; position: relative; }
.live-points li::before { content: ''; position: absolute; left: 4px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.embed .demo-bar { display: none; }
@media (max-width: 760px) {
  .live-demo { grid-template-columns: 1fr; justify-items: center; text-align: left; }
  .live-demo > div:last-child { width: 100%; }
}

/* Подвал */
.foot { border-top: 1px solid var(--line); padding: 36px 0 48px; margin-top: 40px; color: var(--muted); font-size: 15px; }
.foot-grid { display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.foot a { color: var(--muted); }
.foot p { margin: 0; }
@media (max-width: 360px) { .foot p { font-size: 14px; } }
.foot .foot-note { order: 9; flex-basis: 100%; max-width: none; font-size: 13px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; z-index: 200; font-size: 15px; max-width: calc(100% - 32px); box-shadow: var(--shadow); }
.notfound { padding: 80px 0; text-align: center; }

/* ---------- Конструктор ---------- */
.cz { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 40px; align-items: start; padding: 24px 0 120px; }
.cz-main { min-width: 0; }
.cz-head h1 { font-size: clamp(32px, 5vw, 46px); margin-bottom: 6px; }
.cz-head p { color: var(--muted); margin-bottom: 6px; }
.cz-tools { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 18px; }
.cz-tools [hidden] { display: none; }
.cz-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px clamp(16px, 3vw, 24px) 22px; margin: 0; min-width: 0; }
.step > legend, .step-h { float: left; width: 100%; padding: 0; margin: 0 0 14px; font: 600 23px/1.2 var(--head); display: flex; align-items: center; gap: 10px; }
/* Поля-сетки рядом с плавающим заголовком сжимались в ноль: всё после заголовка начинается под ним. */
.step > legend ~ *, .step-h ~ * { clear: both; }
.step-h .n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: var(--on-brand); font: 600 15px/1 var(--ui); flex: none; }
.step > legend + * { clear: both; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; margin-bottom: 12px; min-width: 0; }
.field > span, .field > label { font-size: 14.5px; color: var(--muted); }
.field .hint { font-size: 13.5px; color: var(--muted); }
.field input:not([type=checkbox]):not([type=radio]), .field textarea, .field select { width: 100%; font: 16.5px/1.4 var(--ui); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; min-height: 48px; }
.field textarea { min-height: 110px; resize: vertical; }
/* Дата и время: системный вид на iPhone не сжимается по колонке и выше остальных полей.
   Без него поле ровно по колонке и той же высоты, что соседние. */
.field input[type=date], .field input[type=time], .row input[type=time] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; line-height: normal; }
.field input[type=date], .field input[type=time] { height: 48px; }
.row input[type=time] { height: 46px; }
input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value { text-align: left; margin: 0; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.field [aria-invalid=true] { border-color: var(--danger) !important; }
.err-msg { display: block; color: var(--danger); font-size: 14px; margin: -6px 0 10px; }
.rows .err-msg { margin: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0 10px; cursor: pointer; font-size: 16px; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; min-height: 42px; padding: 8px 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); font-size: 15.5px; transition: background .15s, border-color .15s; }
.chip input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.chip input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.dz { display: grid; grid-auto-flow: column; grid-auto-columns: 118px; gap: 10px; overflow-x: auto; padding: 2px 2px 10px; scroll-snap-type: x proximity; }
.dz > label { scroll-snap-align: start; }
/* Группы дизайнов над лентой. */
.dz-groups { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 10px; padding-bottom: 2px; scrollbar-width: none; }
.dz-groups::-webkit-scrollbar { display: none; }
.chip-b { flex: none; min-height: 36px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink); font: 14.5px/1.2 var(--ui); cursor: pointer; }
.chip-b[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.dz > label[hidden] { display: none; }
.dz label { position: relative; cursor: pointer; min-width: 0; }
.dz input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.dz-thumb, .dz-name { display: block; }
.dz-card { display: block; border-radius: 12px; overflow: hidden; border: 2px solid transparent; box-shadow: 0 0 0 1px var(--line); transition: border-color .15s, transform .15s; }
.dz input:checked + .dz-card { border-color: var(--brand); }
.dz input:focus-visible + .dz-card { outline: 2px solid var(--brand); outline-offset: 2px; }
.dz-thumb { position: relative; height: 150px; overflow: hidden; pointer-events: none; }
.dz-thumb .phone-scale { --s: .31; }
.dz-name { display: block; padding: 6px 8px; font-size: 14px; background: var(--surface); text-align: center; }
.rows { display: grid; gap: 8px; margin-bottom: 8px; }
.row { display: grid; grid-template-columns: 96px 1fr 44px; gap: 8px; align-items: center; }
.row-c { grid-template-columns: 1fr 1fr 44px; }
.row .row-a { grid-column: 2 / 3; min-height: 40px; font-size: 15px; padding: 8px 12px; }
.rows [data-row=prog] + [data-row=prog] { margin-top: 6px; }
@media (max-width: 520px) { .row .row-a { grid-column: 1 / 3; } .row-c { grid-template-columns: 1fr 44px; } .row-c input:nth-child(2) { grid-column: 1; } .row-c .x { grid-row: 1 / span 2; grid-column: 2; } }
.row input[type=time] { padding-inline: 10px 8px; min-width: 0; }
@media (pointer: fine) { .row:not(.row-c) { grid-template-columns: 132px 1fr 44px; } }
@media (pointer: coarse) { .row input[type=time]::-webkit-calendar-picker-indicator { display: none; } }
.row input { width: 100%; font: 16px/1.4 var(--ui); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-height: 46px; }
.x { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 22px; cursor: pointer; }
.x:hover { color: var(--danger); border-color: var(--danger); }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.quick:empty { display: none; }
.quick button { min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1px dashed var(--line); background: transparent; color: var(--ink); font: 14.5px/1.2 var(--ui); cursor: pointer; }
.quick button:hover { border-color: var(--brand); color: var(--brand); }
.more summary { cursor: pointer; font-weight: 600; color: var(--brand); padding: 4px 0; list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: '+ '; }
.more[open] summary::before { content: '− '; }
.more[open] summary { margin-bottom: 12px; }
.pub { position: sticky; bottom: 12px; z-index: 5; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow); display: grid; gap: 10px; }
.cz-form > .agree { margin: 0; padding: 4px 6px; font-size: 15px; color: var(--muted); }
.cz-form > .agree[hidden] { display: none; }
.cz-form > .agree:has([aria-invalid=true]) span { color: var(--danger); }
.pub .errs { margin: 0; padding: 0; list-style: none; color: var(--danger); font-size: 15px; }
.pub .errs a { color: var(--danger); }
.pub .errs:empty { display: none; }
.pub-row { display: flex; gap: 10px; }
.pub-row .btn { flex: 1; min-width: 0; padding: 12px 14px; white-space: normal; }
.pub-preview { display: none; }
/* Узкие телефоны: «Предпросмотр» и «Сохранить изменения» помещаются в панель. */
@media (max-width: 360px) { .pub { padding: 12px; } .pub-row .btn { padding: 10px 12px; font-size: 14px; } .pub-row .pub-preview { flex: 0 1 auto !important; } }
.cz-side { position: sticky; top: 84px; }
/* Поле не прячется под шапкой и нижней панелью при прокрутке к нему */
.cz-form input, .cz-form textarea, .cz-form select { scroll-margin: 90px 0 140px; }
/* Пока человек печатает на телефоне, панель не липнет: её не перекрывает клавиатура */
@media (max-width: 980px) {
  .typing .pub { position: static; box-shadow: none; }
}
/* Дизайны на телефоне лентой */
@media (max-width: 600px) {
  .dz { display: flex; overflow-x: auto; gap: 10px; margin: 0 -16px; padding: 4px 16px 10px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .dz::-webkit-scrollbar { display: none; }
  .dz > label { flex: 0 0 116px; scroll-snap-align: start; }
}
.cz-phone { --pw: 380px; height: calc(100vh - 110px); max-height: 800px; width: 100%; border-radius: 44px; background: #111; padding: 12px; box-shadow: 0 30px 60px rgba(30, 20, 5, .2); }
.cz-screen { height: 100%; border-radius: 34px; overflow: auto; background: #fff; overscroll-behavior: contain; scrollbar-width: thin; }
.cz-note { text-align: center; color: var(--muted); font-size: 14px; margin: 10px 0 0; }
@media (max-width: 980px) {
  .cz { grid-template-columns: minmax(0, 1fr); }
  .cz-side { display: none; }
  .pub-preview { display: inline-flex; flex: 0 0 auto !important; }
}
.sheet { position: fixed; inset: 0; z-index: 60; background: rgba(10, 8, 5, .55); display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-in { position: relative; width: min(100%, 560px); max-height: 94vh; background: var(--surface); border-radius: 22px 22px 0 0; overflow: auto; overscroll-behavior: contain; }
.sheet-in.full { height: 94vh; padding: 0; }
.sheet-close { position: sticky; top: 8px; float: right; margin: 8px 8px 0 0; z-index: 3; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .55); color: #fff; font-size: 24px; cursor: pointer; }
.sheet-body { padding: 22px 20px 28px; }
/* Предпросмотр: крестик лежит поверх приглашения и виден до конца прокрутки, приглашение во всю ширину. */
.sheet-in.full > .sheet-close { float: none; display: block; margin: 8px 8px -52px auto; }
@media (max-width: 699px) {
  /* На телефоне предпросмотр во весь экран. */
  .sheet-in.full { width: 100%; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; }
}
@media (min-width: 700px) {
  .sheet { align-items: center; }
  .sheet-in { border-radius: 22px; }
}
.texts-pick { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.texts-pick button { width: 100%; text-align: left; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font: 17px/1.45 var(--head); color: var(--ink); cursor: pointer; }
.texts-pick button:hover { border-color: var(--brand); }
.texts-pick small { display: block; font: 13px/1.4 var(--ui); color: var(--muted); margin-top: 4px; }

.done h2 { margin-bottom: 8px; }
.linkbox { display: flex; gap: 8px; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 6px 6px 6px 14px; margin: 10px 0 14px; }
.linkbox input { flex: 1; min-width: 0; border: 0; background: transparent; font: 600 16px/1.4 var(--ui); color: var(--ink); }
.done-actions { display: grid; gap: 10px; }
.keep { background: color-mix(in srgb, var(--gold) 14%, transparent); border-radius: 12px; padding: 12px 14px; font-size: 15px; margin-top: 14px; }
.keep b { display: block; margin-bottom: 4px; }
.tip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 16px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 12px; font-size: 15px; color: var(--muted); }
.tip p { margin: 0; }

/* Открытка для печати */
.print-opts { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 14px 0; }
.print-opts .check { margin: 0 0 0 6px; }
.print-actions { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 22px; }
.psheet { display: flex; justify-content: center; gap: 0; background: #fff; margin: 0 auto 40px; box-shadow: var(--shadow); }
.psheet .muted { padding: 40px; }
.psheet-a4 { width: min(100%, 297mm); }
.psheet-a5 { width: min(100%, 148mm); }
.psheet .card { display: block; width: 50%; height: auto; min-width: 0; }
.psheet-a5 .card { width: 100%; }
.psheet-a4 .card + .card { border-left: 1px dashed #bbb; }
@media print {
  .top, .foot, .skip, .print-ui, .crumbs, .toast { display: none !important; }
  body, main.wrap { background: #fff; margin: 0; padding: 0; width: auto; }
  .print-page { padding: 0; }
  .psheet { box-shadow: none; margin: 0; }
  .psheet-a4 { width: 297mm; height: 210mm; }
  .psheet-a5 { width: 148mm; height: 210mm; }
  .psheet .card { height: 210mm; width: 148.5mm; }
  .psheet-a5 .card { width: 148mm; }
}

/* Мои приглашения */
.my-list { display: grid; gap: 14px; padding: 0; margin: 0; list-style: none; }
.my-item { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; overflow-wrap: anywhere; }
.my-item h3 { margin: 0 0 4px; font-size: 26px; }
.my-meta { color: var(--muted); font-size: 15px; margin: 0 0 12px; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--surface2); color: var(--ink); font-size: 13px; white-space: nowrap; }
.badge-now { background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--brand); font-weight: 600; }
.badge-past { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.my-item:has(.badge-past) h3 { color: var(--muted); }
.my-big { margin: 6px 0 10px; font-size: 17px; color: var(--muted); }
.my-big b { font: 600 44px/1 var(--head); color: var(--brand); margin-right: 4px; vertical-align: -4px; }
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.menu-list { position: absolute; z-index: 5; top: calc(100% + 6px); right: 0; min-width: 240px; display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; }
.menu-list a, .menu-list button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px; border: 0; background: none; color: var(--ink); text-decoration: none; font: 15.5px/1.3 var(--ui); cursor: pointer; }
.menu-list a:hover, .menu-list button:hover { background: var(--surface2); }
.menu-list hr { border: 0; height: 1px; background: var(--line); margin: 4px 6px; }
.menu-list .menu-danger { color: var(--danger); }
/* На телефоне меню снизу во всю ширину: так оно не уходит за край экрана. */
@media (max-width: 600px) { .menu[open]::before { content: ''; position: fixed; inset: 0; z-index: 59; background: rgba(20, 16, 10, .35); } .menu-list { position: fixed; top: auto; left: 12px; right: 12px; bottom: 12px; min-width: 0; z-index: 60; padding: 8px; box-shadow: 0 -8px 40px rgba(20, 16, 10, .25); } .menu-list a, .menu-list button { padding: 13px 14px; font-size: 16.5px; } }
.notify { margin: 14px 0 0; font-size: 14.5px; color: var(--muted); }
.notify label { display: block; margin-bottom: 6px; }
.notify-row { display: flex; gap: 8px; flex-wrap: wrap; }
.notify-wait { margin: 8px 0 0; color: var(--ink); }
.notify-row input { flex: 1 1 200px; min-height: 40px; font: 16px/1.4 var(--ui); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.guests-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.guests-q { flex: 1 1 180px; min-height: 40px; font: 16px/1.4 var(--ui); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.my-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; }
.my-stats li { background: var(--bg); border-radius: 10px; padding: 6px 12px; font-size: 15px; }
.my-stats b { font-size: 18px; }
.my-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.guests { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 15px; }
.guests th, .guests td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.guests th { color: var(--muted); font-weight: 500; font-size: 13.5px; }
.guests .g-com { overflow-wrap: anywhere; }
/* Ответ и число гостей не рвутся посреди слова («Придё/т»): карточка переносит слова где угодно, а таблица из-за этого сжимала эти колонки. */
.guests th, .guests .g-att, .guests .g-cnt { white-space: nowrap; overflow-wrap: normal; }
/* На телефоне строка таблицы становится карточкой: имя и ответ сверху, комментарий под ними. */
@media (max-width: 600px) {
  .guests, .guests tbody { display: block; }
  .guests thead { display: none; }
  .guests tr { display: grid; grid-template-columns: minmax(0, 1fr) auto 44px; grid-template-areas: "name att del" "name cnt del" "com com del"; column-gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .guests td { padding: 0; border: 0; min-width: 0; }
  .guests .g-name { grid-area: name; overflow-wrap: anywhere; }
  .guests .g-att { grid-area: att; text-align: right; }
  .guests .g-cnt { grid-area: cnt; text-align: right; color: var(--muted); font-size: 14px; }
  .guests .g-cnt:not(:empty)::after { content: ' чел.'; }
  .guests .g-com { grid-area: com; margin-top: 4px; }
  .guests .g-com:empty { display: none; }
  .guests .g-del { grid-area: del; }
}
.att-yes { color: var(--ok); font-weight: 600; }
.att-no { color: var(--danger); font-weight: 600; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: 18px; padding: 28px; text-align: center; color: var(--muted); }
