:root {
  color-scheme: light;
  --paper: #f6f1e7;
  --sheet: #fcf9f2;
  --ink: #2c2824;
  --muted: #6a6257;
  --line: #dcd2c1;
  --band: #eadfcc;
  --accent: #6d2f2b;
  --error: #a3261d;
  --display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --text: Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 68px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.7 var(--text);
}
a { color: inherit; text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.brand {
  color: var(--accent);
  font: italic 400 22px var(--display);
  text-decoration: none;
}
/* Верхня панель закріплена під час прокручування. */
.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 52px;
  padding: 2px 12px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.site-head .brand { grid-column: 2; }
.head-tools { display: flex; grid-column: 1; }
.icon-btn { display: flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--ink); }
.icon-btn svg { width: 24px; height: 24px; }

/* Меню й пошук на весь екран */
.overlay-open { overflow: hidden; }
.overlay { position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 2px 12px 32px; overflow-y: auto; border: 0; background: var(--paper); color: var(--ink); }
.overlay:focus { outline: none; }
.overlay-top { display: flex; align-items: center; min-height: 52px; }
.menu-links { max-width: 640px; margin: 8px auto 0; padding: 0 12px; }
.menu-links a { display: block; padding: 13px 0; border-bottom: 1px solid var(--line); font: 500 26px/1.25 var(--display); text-decoration: none; }
.search-top { gap: 6px; max-width: 664px; margin: 0 auto; padding-top: 6px; }
.search-form { flex: 1; min-width: 0; }
.search-form input { width: 100%; padding: 10px 14px; border: 1px solid #c9bca6; border-radius: 4px; background: var(--sheet); color: var(--ink); font: 17px var(--text); -webkit-appearance: none; appearance: none; }
.search-form input:focus { outline: none; border-color: var(--accent); }
.search-results { max-width: 640px; margin: 18px auto 0; padding: 0 12px; }
.search-results h2 { margin: 0 0 6px; font-size: 25px; }
.search-results section { padding: 0; margin-bottom: 26px; }
.result { display: block; padding: 11px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.result-name { display: block; font: 600 21px/1.25 var(--display); }
.result-about { display: block; margin-top: 2px; color: var(--muted); font-size: 15px; line-height: 1.45; }
.no-results { color: var(--muted); font-size: 16px; }

.wrap { max-width: 640px; margin: 0 auto; padding: 0 24px; }
section { padding: 64px 0; }
#gift { padding-top: 0; }
#how { background: var(--band); }

/* Рівні тексту: сторінка → розділ (бордовий) → підрозділ → основний текст → деталі (дрібні, сірі). */
h1, h2, h3 { font-family: var(--display); }
h1 { margin: 0 0 8px; font-size: clamp(34px, 6.5vw, 54px); font-weight: 500; line-height: 1.08; }
h2 { margin: 0 0 28px; color: var(--accent); font-size: clamp(32px, 5vw, 40px); font-weight: 600; line-height: 1.15; }
h3 { margin: 0 0 6px; font-size: 26px; font-weight: 600; line-height: 1.2; }
p { margin: 0 0 18px; }
.muted { color: var(--muted); }
.quiet-link { color: var(--accent); }

/* Перший екран */
.hero {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 24px 48px;
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: 56px;
  align-items: start;
}
.envelope { display: block; width: 100%; max-width: 360px; height: auto; margin: 12px auto 0; }
.pick { margin: 0; padding: 12px 0 10px; border: 0; border-top: 1px solid var(--line); min-width: 0; }
.pick legend { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; float: left; width: 100%; padding: 0; margin-bottom: 4px; color: var(--accent); font: 600 23px/1.2 var(--display); }
.pick legend + * { clear: both; }
.legend-link { color: var(--muted); font: 400 14px var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 0 6px; }
.chips .choice, .chips .choice:has(input:checked) { position: relative; min-height: 44px; margin: 0; padding: 0; background: none; box-shadow: none; }
.chips input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.chip { display: flex; align-items: center; min-height: 38px; padding: 0 13px; border: 1px solid #c9bca6; border-radius: 19px; background: var(--sheet); font-size: 15px; white-space: nowrap; }
.chips input:checked + .chip { border-color: var(--accent); background: var(--accent); color: #fff; }
.chips input:focus-visible + .chip { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Картки тарифів */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.plan { position: relative; display: block; cursor: pointer; }
.plan input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.plan-body { display: flex; flex-direction: column; align-items: center; height: 100%; padding: 14px 4px 10px; border: 1px solid #c9bca6; border-radius: 6px; background: var(--sheet); line-height: 1.25; text-align: center; }
.plan input:checked + .plan-body { padding: 13px 3px 9px; border: 2px solid var(--accent); background: #efe5d8; }
.plan input:focus-visible + .plan-body { outline: 2px solid var(--accent); outline-offset: 2px; }
.plan-name { font-size: 15px; }
.plan .price { margin: 2px 0 4px; font: 600 28px/1.1 var(--display); font-variant-numeric: lining-nums; white-space: nowrap; }
.plan small { color: var(--muted); font-size: 13px; line-height: 1.25; }
.plan .per { white-space: nowrap; }
.per-short { display: none; }
.plan input:checked + .plan-body small { color: var(--ink); }
.save { margin-top: 6px; padding: 1px 7px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 12px; line-height: 1.4; }
.badge { position: absolute; top: -10px; left: 50%; padding: 0 8px; border-radius: 9px; background: var(--ink); color: #fff; font-size: 11px; line-height: 1.6; transform: translateX(-50%); white-space: nowrap; }
.plans-note { margin-top: 8px; text-align: center; font-size: 14px; }

.gift-box { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; margin: 4px 0 0; padding: 6px 12px; border: 1px dashed #8d7f6b; border-radius: 6px; font-size: 16px; cursor: pointer; }
.gift-box input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.desc { margin: 24px 0 12px; font-size: 17px; line-height: 1.55; }
.desc strong { font-weight: 700; }
.trust { margin: 0; padding: 0; list-style: none; font-size: 16px; }
.trust li { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
.trust svg { flex: none; width: 22px; height: 22px; color: var(--accent); }

/* Як це працює */
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 44px 1fr; margin-bottom: 26px; }
.steps li::before {
  content: counter(step);
  color: var(--accent);
  font: italic 400 28px/1.2 var(--display);
}
.steps strong { display: block; font-weight: 600; font-family: var(--display); font-size: 24px; line-height: 1.25; }

/* Види листів */
.kind { margin-bottom: 44px; }
.kind:last-child { margin-bottom: 0; }
.kind p { margin-bottom: 10px; font-size: 17px; line-height: 1.6; }
.excerpt {
  margin: 12px 0;
  padding: 18px 22px;
  background: var(--sheet);
  border: 1px solid var(--line);
  font: italic 400 21px/1.5 var(--display);
}
.kind p.excerpt { font: italic 400 21px/1.5 var(--display); }

/* Питання */
details { border-bottom: 1px solid var(--line); }
details:first-of-type { border-top: 1px solid var(--line); }
summary { padding: 14px 0; font: 600 22px/1.3 var(--display); cursor: pointer; }
details p { color: var(--muted); font-size: 16px; line-height: 1.6; }

.site-foot { padding: 36px 24px 40px; background: var(--accent); color: #fbf3ea; font-size: 15px; line-height: 1.5; }
.site-foot > * { max-width: 592px; margin-left: auto; margin-right: auto; }
.foot-brand { margin-bottom: 4px; font: italic 400 26px var(--display); }
.foot-tagline { margin-bottom: 18px; opacity: .9; }
.foot-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.site-foot nav a { display: block; padding: 6px 0; }
.site-foot a:hover { color: #fff; }
.foot-contacts { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(251, 243, 234, .3); font-size: 13px; opacity: .9; }
a[href^="tel:"], a[href^="mailto:"] { white-space: nowrap; }

/* Юридичні сторінки */
.legal { max-width: 720px; margin: 0 auto; padding: 32px 24px 64px; }
.legal h1 { margin-bottom: 4px; font-size: clamp(32px, 6vw, 44px); }
.legal-sub { margin: 0 0 8px; color: var(--accent); font: italic 400 21px/1.3 var(--display); }
.legal-meta { margin-bottom: 28px; color: var(--muted); font-size: 15px; }
.legal h2 { margin: 32px 0 10px; font-size: 25px; line-height: 1.25; }
.legal p { font-size: 16px; line-height: 1.65; overflow-wrap: anywhere; }
.legal a { color: var(--accent); }
.consent { margin: 4px 0 16px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.consent a { color: var(--accent); }

/* Замовлення */
.order { max-width: 600px; margin: 0 auto; padding: 24px 24px 80px; }
.order h1 { font-size: clamp(38px, 7vw, 52px); margin-bottom: 24px; }
.part { margin: 0; padding: 32px 0; border: 0; border-top: 1px solid var(--line); min-width: 0; }
.part legend { float: left; width: 100%; padding: 0; margin-bottom: 14px; color: var(--accent); font: 600 28px/1.2 var(--display); }
.part legend + * { clear: both; }
.small-note { margin: 10px 0 0; color: var(--muted); font-size: 15px; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; margin-bottom: 4px; font-size: 16px; }
.field .opt { display: inline; color: var(--muted); }
input[type="text"], input[type="email"], input[type="tel"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #c9bca6;
  border-radius: 4px;
  background: var(--sheet);
  color: var(--ink);
  font: inherit;
  font-size: 17px;
}
.choice { display: flex; gap: 12px; align-items: center; margin: 0 -10px; padding: 4px 10px; border-radius: 4px; font-size: 17px; line-height: 1.35; cursor: pointer; }
.choice:has(input:checked) { background: var(--sheet); box-shadow: inset 0 0 0 1px var(--line); }
.choice input { flex: none; accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.choice .price { margin-left: auto; padding-left: 16px; font-size: 18px; white-space: nowrap; }
.choice small { display: block; color: var(--muted); font-size: 14px; }
.part .choice { padding: 8px 10px; }
.field .choice { margin: 0; padding: 8px 0; }
.field .choice:has(input:checked) { background: none; box-shadow: none; }
.field-error { margin: 4px 0 0; color: var(--error); font-size: 15px; }
.field.invalid > span:first-child, .field.invalid .choice { color: var(--error); }
.field.invalid input[type="text"], .field.invalid input[type="email"] {
  border: 2px solid var(--error);
  padding: 9px 11px;
  background: #fbeeea;
}
.field.invalid input[type="checkbox"] { outline: 2px solid var(--error); outline-offset: 2px; }
.form-error { margin: 12px 0 0; color: var(--error); font-size: 16px; }
.paybar { margin-top: 12px; }
.total { margin: 0 0 16px; line-height: 1.3; }
.total strong { display: block; font-weight: 400; font-size: 18px; }
.total small { display: block; color: var(--muted); font-size: 14px; }
.phone-only { display: none; }
button {
  padding: 12px 32px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  cursor: pointer;
}
.notice { margin-top: 24px; padding: 24px; background: var(--sheet); border: 1px solid var(--line); }

@media (max-width: 720px) {
  section { padding: 48px 0; }
  body { font-size: 17px; line-height: 1.6; }
  .hero { grid-template-columns: 1fr; gap: 2px; padding: 8px 24px 40px; }
  .envelope { width: auto; height: 78px; margin: 0 auto; }
  .hero h1 { margin-bottom: 8px; font-size: 28px; text-align: center; }
  .choice, .part .choice { min-height: 44px; padding: 3px 10px; }
  .chips .choice, .chips .choice:has(input:checked) { padding: 0; }
  .field .choice { padding: 3px 0; }
  summary { padding: 12px 0; }
  .quiet-link { display: inline-block; padding: 10px 0; }
  .site-foot { padding-bottom: 110px; }

  /* Сума й кнопка завжди внизу екрана. */
  .paybar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    margin: 0;
    padding: 10px 16px;
    background: var(--sheet);
    border-top: 1px solid var(--line);
  }
  .keyboard-open .paybar { display: none; }
  .phone-only { display: block; }
  .total { flex: 1 1 0; min-width: 0; margin: 0; }
  .total strong { font-size: 17px; }
  .total small { font-size: 13px; }
  .paybar button { flex: 0 0 auto; min-height: 46px; padding: 10px 24px; }
  .save { white-space: normal; }
  .form-error { order: -1; flex: 0 0 100%; margin: 0; font-size: 14px; line-height: 1.35; }
  .order { padding-bottom: 110px; }
}
/* На вузьких телефонах картки тарифів завузькі для «6 листів по 510 ₴». */
@media (max-width: 430px) {
  .per-long { display: none; }
  .per-short { display: inline; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
