/* ==========================================================================
   МОМЕМО — дизайн-система портала (momemo.ru)
   Собственный CSS, без внешних библиотек. Шрифт Manrope (локальные woff2).
   Основа — «Тихий сад»: хвоя, крем и приглушённое золото.
   Мемориальная страница и семейный блок — «Нить памяти»: индиго и янтарь.
   ========================================================================== */

/* --- Шрифты -------------------------------------------------------------- */
@font-face {
  font-family: 'Manrope';
  src: url('/assets/fonts/manrope-cyrillic-ext.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Manrope';
  src: url('/assets/fonts/manrope-cyrillic.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope';
  src: url('/assets/fonts/manrope-latin.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- Токены -------------------------------------------------------------- */
:root {
  --ink-900: #14211c;
  --ink-700: #2a3a33;
  --ink-500: #5b6b63;

  --forest-900: #0f2b22;
  --forest-800: #12372e;
  --forest-700: #16402f;
  --forest-600: #1d5a42;

  --gold-600: #8a6a2a;
  --gold-500: #c9a24e;
  --gold-400: #d8b56a;
  --gold-300: #e7c766;
  --gold-200: #f0dca0;

  --cream-50: #fbf9f1;
  --cream-100: #f4efe0;
  --cream-200: #e8e0cb;

  --sage-100: #e7efe6;
  --sage-50: #f1f6ef;

  /* «Нить памяти» — мемориальная страница и семейный блок */
  --thread-900: #131a33;
  --thread-800: #1b2340;
  --thread-700: #232c4d;
  --thread-muted: #5b6076;
  --thread-line: #a9b8d8;
  --thread-amber: #dfa45b;
  --thread-amber-soft: rgba(223, 164, 91, 0.18);
  --thread-linen: #f6f1e7;
  --thread-paper: #fffdf8;

  /* Фирменная точка на иконках: золото на светлом, крем на тёмном */
  --icon-dot: #c9a24e;

  --red-50: #fdf2f2;
  --red-200: #fecaca;
  --red-700: #b91c1c;
  --red-800: #991b1b;

  --radius-sm: 0.75rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --radius-xl: 2rem;

  --shadow-sm: 0 1px 2px rgba(15, 43, 34, 0.08);
  --shadow-md: 0 10px 30px -18px rgba(15, 43, 34, 0.35);
  --shadow-soft: 0 30px 80px -60px rgba(18, 55, 46, 0.7);
}

/* --- База ---------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-900);
  background: var(--cream-50);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.link {
  color: var(--forest-700);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link:hover { color: var(--forest-800); }

h1, h2, h3, h4, p, ul, ol, figure, blockquote {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
}

code {
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 0.9em;
  background: rgba(18, 55, 46, 0.06);
  border-radius: 0.375rem;
  padding: 0.1em 0.35em;
}

:focus-visible {
  outline: 3px solid var(--forest-700);
  outline-offset: 2px;
  border-radius: 4px;
}

/* На тёмных поверхностях фокус — золотой: зелёный там не виден */
.section--dark :focus-visible,
.hero :focus-visible,
.footer :focus-visible,
.login-side :focus-visible,
.dash__sidebar :focus-visible,
.card--thread :focus-visible {
  outline-color: var(--gold-300);
}

/* На тёмных поверхностях золотая точка иконки становится кремовой */
.section--dark,
.hero,
.footer,
.login-side,
.dash__sidebar,
.card--thread {
  --icon-dot: var(--cream-50);
}

::selection {
  background: var(--gold-200);
  color: var(--ink-900);
}

/* Переход к содержанию (доступность) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--forest-800);
  color: var(--cream-50);
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
}

/* --- Контейнер и сетки --------------------------------------------------- */
.container {
  width: 100%;
  max-width: 80rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}
@media (min-width: 640px) {
  .container { padding-inline: 2rem; }
}
@media (min-width: 1024px) {
  .container { padding-inline: 2.5rem; }
}

.grid {
  display: grid;
  gap: 1.5rem;
}
/* Сетка не должна раздуваться из-за nowrap-элементов внутри карточек */
.grid > * { min-width: 0; }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
.grid--4 { grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

/* --- Утилиты: флекс и позиционирование ------------------------------------ */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 0%; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.relative { position: relative; }
.inline { display: inline; }
.shrink-0 { flex-shrink: 0; }
.hidden { display: none; }
.min-h-screen { min-height: 100vh; }
.w-full { width: 100%; }
.mx-auto { margin-inline: auto; }
.my-auto { margin-block: auto; }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.text-center { text-align: center; }
.cursor-pointer { cursor: pointer; }

/* --- Утилиты: размеры ----------------------------------------------------- */
.h-px { height: 1px; }
.h-3 { height: 0.75rem; }
.h-3\.5 { height: 0.875rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-7 { height: 1.75rem; }
.h-8 { height: 2rem; }
.h-9 { height: 2.25rem; }
.h-10 { height: 2.5rem; }
.h-11 { height: 2.75rem; }
.h-14 { height: 3.5rem; }
.h-16 { height: 4rem; }
.h-20 { height: 5rem; }
.h-32 { height: 8rem; }
.w-3 { width: 0.75rem; }
.w-3\.5 { width: 0.875rem; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-7 { width: 1.75rem; }
.w-8 { width: 2rem; }
.w-9 { width: 2.25rem; }
.w-10 { width: 2.5rem; }
.w-14 { width: 3.5rem; }
.w-16 { width: 4rem; }
.w-32 { width: 8rem; }

.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-8xl { max-width: 80rem; }
.max-w-form { max-width: 27rem; }

/* --- Утилиты: отступы ----------------------------------------------------- */
.mt-0\.5 { margin-top: 0.125rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-1\.5 { margin-top: 0.375rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-2\.5 { margin-top: 0.625rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-7 { margin-top: 1.75rem; }
.mt-8 { margin-top: 2rem; }
.mt-9 { margin-top: 2.25rem; }
.mt-10 { margin-top: 2.5rem; }
.mt-12 { margin-top: 3rem; }
.mt-14 { margin-top: 3.5rem; }

.p-1\.5 { padding: 0.375rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-4 { padding-inline: 1rem; }
.px-5 { padding-inline: 1.25rem; }
.pr-12 { padding-right: 3rem; }
.py-1\.5 { padding-block: 0.375rem; }
.py-3\.5 { padding-block: 0.875rem; }
.py-6 { padding-block: 1.5rem; }
.py-10 { padding-block: 2.5rem; }
.py-16 { padding-block: 4rem; }
.pt-6 { padding-top: 1.5rem; }
.pt-16 { padding-top: 4rem; }

.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3\.5 > * + * { margin-top: 0.875rem; }
.space-y-5 > * + * { margin-top: 1.25rem; }

/* --- Утилиты: типографика -------------------------------------------------- */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-micro { font-size: 0.65rem; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-extrabold { font-weight: 800; }
.uppercase { text-transform: uppercase; }
.whitespace-nowrap { white-space: nowrap; }

.leading-none { line-height: 1; }
.leading-4 { line-height: 1rem; }
.leading-5 { line-height: 1.25rem; }
.leading-6 { line-height: 1.5rem; }
.leading-7 { line-height: 1.75rem; }

.tracking-tight { letter-spacing: -0.025em; }
.tracking-tighter { letter-spacing: -0.03em; }
.tracking-snug { letter-spacing: -0.02em; }
.tracking-widest { letter-spacing: 0.19em; }
.tracking-wider { letter-spacing: 0.2em; }

/* --- Утилиты: цвета -------------------------------------------------------- */
.bg-white { background: #fff; }
.bg-cream-50 { background: var(--cream-50); }
.bg-sage-50 { background: var(--sage-50); }
.bg-sage-100 { background: var(--sage-100); }
.bg-red-50 { background: var(--red-50); }
.bg-forest-800 { background: var(--forest-800); }

.text-ink-500 { color: var(--ink-500); }
.text-ink-700 { color: var(--ink-700); }
.text-ink-900 { color: var(--ink-900); }
.text-forest-800 { color: var(--forest-800); }
.text-gold-300 { color: var(--gold-300); }
.text-gold-600 { color: var(--gold-600); }
.text-cream-50 { color: var(--cream-50); }
.text-red-700 { color: var(--red-700); }
.text-red-800 { color: var(--red-800); }

.border { border: 1px solid var(--cream-200); }
.border-b { border-bottom: 1px solid var(--cream-200); }
.border-t { border-top: 1px solid var(--cream-200); }
.border-cream-200 { border-color: var(--cream-200); }

.rounded-xl { border-radius: var(--radius-sm); }
.rounded-2xl { border-radius: var(--radius-md); }
.rounded-3xl { border-radius: var(--radius-lg); }
.rounded-full { border-radius: 9999px; }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-soft { box-shadow: var(--shadow-soft); }

.transition-colors { transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease; }
.transition-transform { transition: transform 0.3s ease; }
.duration-300 { transition-duration: 0.3s; }

.group:hover .group-hover\:-rotate-3 { transform: rotate(-3deg); }

.hover\:bg-forest-700:hover { background: var(--forest-700); }
.hover\:bg-forest-900\/5:hover { background: rgba(15, 43, 34, 0.05); }

/* Полупрозрачные цвета (используются в шаблонах) */
.ring-1 { box-shadow: 0 0 0 1px var(--ring-color, rgba(255, 255, 255, 0.15)); }
.ring-white\/15 { --ring-color: rgba(255, 255, 255, 0.15); }

.text-cream-100\/45 { color: rgba(244, 239, 224, 0.45); }
.text-cream-100\/60 { color: rgba(244, 239, 224, 0.6); }
.text-cream-100\/65 { color: rgba(244, 239, 224, 0.65); }
.text-cream-100\/80 { color: rgba(244, 239, 224, 0.8); }
.text-ink-500\/70 { color: rgba(91, 107, 99, 0.7); }
.text-gold-400\/70 { color: rgba(216, 181, 106, 0.7); }

.bg-cream-50\/95 { background: rgba(251, 249, 241, 0.95); }
.bg-gold-400\/15 { background: rgba(216, 181, 106, 0.15); }
.bg-gold-400\/70 { background: rgba(216, 181, 106, 0.7); }
.bg-gold-500\/30 { background: rgba(201, 162, 78, 0.3); }
.bg-gold-200\/25 { background: rgba(240, 220, 160, 0.25); }
.bg-forest-600\/40 { background: rgba(29, 90, 66, 0.4); }

.border-forest-900\/10 { border-color: rgba(15, 43, 34, 0.1); }
.border-forest-900\/15 { border-color: rgba(15, 43, 34, 0.15); }
.border-forest-600\/25 { border-color: rgba(29, 90, 66, 0.25); }
.border-white\/10 { border-color: rgba(255, 255, 255, 0.1); }

/* --- Адаптивные утилиты ---------------------------------------------------- */
@media (min-width: 640px) {
  .sm\:block { display: block; }
  .sm\:flex-row { flex-direction: row; }
  .sm\:justify-center { justify-content: center; }
  .sm\:p-10 { padding: 2.5rem; }
  .sm\:px-8 { padding-inline: 2rem; }
  .sm\:text-4xl { font-size: 2.25rem; }
}
@media (min-width: 1024px) {
  .lg\:hidden { display: none; }
  .lg\:justify-end { justify-content: flex-end; }
  .lg\:px-10 { padding-inline: 2.5rem; }
  .lg\:px-12 { padding-inline: 3rem; }
}
@media (min-width: 1280px) {
  .xl\:px-16 { padding-inline: 4rem; }
}

/* ==========================================================================
   Кнопки
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.75rem;
  padding-inline: 1.25rem;
  border-radius: 9999px;
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--forest-800);
  color: var(--cream-50);
}
.btn--primary:hover { background: var(--forest-700); }

.btn--secondary {
  background: transparent;
  border-color: rgba(15, 43, 34, 0.25);
  color: var(--forest-800);
}
.btn--secondary:hover { background: rgba(15, 43, 34, 0.05); }

.btn--ghost {
  background: transparent;
  color: var(--forest-800);
}
.btn--ghost:hover { background: rgba(15, 43, 34, 0.06); }

.btn--sm { height: 2.25rem; padding-inline: 0.875rem; font-size: 0.8125rem; }
.btn--lg { height: 3.25rem; padding-inline: 1.75rem; font-size: 0.9375rem; }
.btn--block { width: 100%; }

/* На тёмном фоне основное действие — золотое, контурное — кремовое */
.section--dark .btn--primary,
.hero .btn--primary,
.login-side .btn--primary {
  background: var(--gold-400);
  color: var(--forest-900);
}
.section--dark .btn--primary:hover,
.hero .btn--primary:hover,
.login-side .btn--primary:hover {
  background: var(--gold-300);
}
.section--dark .btn--ghost,
.hero .btn--ghost,
.login-side .btn--ghost,
.section--dark .btn--secondary,
.hero .btn--secondary {
  color: var(--cream-50);
  border-color: rgba(244, 239, 224, 0.35);
}
.section--dark .btn--ghost:hover,
.hero .btn--ghost:hover,
.login-side .btn--ghost:hover,
.section--dark .btn--secondary:hover,
.hero .btn--secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(244, 239, 224, 0.55);
}

/* ==========================================================================
   Бейджи и аватары
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  background: rgba(18, 55, 46, 0.08);
  color: var(--ink-700);
  white-space: nowrap;
}
.badge--gold { background: rgba(216, 181, 106, 0.22); color: #8a6a2a; }
.badge--green { background: rgba(29, 90, 66, 0.12); color: var(--forest-700); }
.badge--draft { background: rgba(201, 162, 78, 0.16); color: var(--gold-600); }
.badge--gray { background: rgba(15, 43, 34, 0.06); color: var(--ink-500); }
.badge--red { background: rgba(185, 28, 28, 0.1); color: var(--red-700); }

/* На тёмных поверхностях бейджи читаются как кремовые и золотые */
.section--dark .badge,
.hero .badge,
.login-side .badge {
  background: rgba(255, 255, 255, 0.1);
  color: var(--cream-50);
}
.section--dark .badge--green,
.hero .badge--green,
.login-side .badge--green {
  background: rgba(216, 181, 106, 0.18);
  color: var(--gold-300);
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  background: var(--forest-800);
  color: var(--gold-300);
  font-weight: 800;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

/* ==========================================================================
   Шапка (topbar) и навигация
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 249, 241, 0.95);
  border-bottom: 1px solid rgba(15, 43, 34, 0.08);
  backdrop-filter: blur(8px);
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 4.5rem;
}
.topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
@media (max-width: 420px) {
  /* На узком экране кнопка кабинета остаётся иконкой: подпись читают скринридеры */
  .topbar__actions .btn--primary {
    gap: 0;
    padding-inline: 0.65rem;
    font-size: 0;
  }
}

.nav__list {
  display: none;
  align-items: center;
  gap: 0.25rem;
}
@media (min-width: 1024px) {
  .nav__list { display: flex; }
}
.nav__link {
  display: inline-block;
  padding: 0.5rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-700);
  transition: background-color 0.2s ease, color 0.2s ease;
}
.nav__link:hover { background: rgba(15, 43, 34, 0.06); color: var(--ink-900); }
.nav__link--active,
.nav__link[aria-current="page"] { background: var(--forest-800); color: var(--cream-50); }
.nav__link--active:hover,
.nav__link[aria-current="page"]:hover { background: var(--forest-700); color: var(--cream-50); }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(15, 43, 34, 0.15);
  background: transparent;
  color: var(--ink-900);
}
@media (min-width: 1024px) {
  .nav-toggle { display: none; }
}

.nav-mobile {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--cream-50);
  border-bottom: 1px solid rgba(15, 43, 34, 0.1);
  box-shadow: var(--shadow-md);
  padding: 0.75rem 1.25rem 1.25rem;
}
.nav-mobile__list { display: flex; flex-direction: column; gap: 0.25rem; }
.nav-mobile__link {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-weight: 600;
  color: var(--ink-900);
}
.nav-mobile__link:hover { background: rgba(15, 43, 34, 0.06); }
.nav-mobile__link[aria-current="page"] { background: var(--forest-800); color: var(--cream-50); }

/* --- Хлебные крошки ------------------------------------------------------- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  font-size: 0.8125rem;
  color: var(--ink-500);
}
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.crumbs li { display: inline-flex; align-items: center; gap: 0.5rem; }
.crumbs a { color: var(--forest-600); font-weight: 600; }
.crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }
.crumbs li[aria-current="page"] { color: var(--ink-700); font-weight: 600; }

/* Лист-разделитель «Тихого сада» */
.crumbs:not(.crumbs--thread) li + li::before {
  content: '';
  width: 0.7rem;
  height: 0.7rem;
  flex-shrink: 0;
  background-color: var(--gold-500);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 4.5C11.5 4 6 8.2 6 14a6 6 0 0 0 6 6c5.8 0 10-5.5 8-15.5Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 4.5C11.5 4 6 8.2 6 14a6 6 0 0 0 6 6c5.8 0 10-5.5 8-15.5Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Крошки-«нить»: узлы вместо листьев, янтарный — текущее место */
.crumbs--thread { gap: 0; color: var(--thread-muted); }
.crumbs--thread ol { gap: 0; }
.crumbs--thread li { gap: 0.4rem; }
.crumbs--thread li::before {
  content: '';
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 9999px;
  background: var(--thread-line);
  flex-shrink: 0;
}
.crumbs--thread li::after {
  content: '';
  width: 1.5rem;
  height: 1px;
  margin-inline: 0.5rem;
  background: rgba(27, 35, 64, 0.28);
}
.crumbs--thread li:last-child::after { display: none; }
.crumbs--thread a { color: var(--thread-800); }
.crumbs--thread li[aria-current="page"] { color: var(--thread-800); font-weight: 700; }
.crumbs--thread li[aria-current="page"]::before {
  background: var(--thread-amber);
  box-shadow: 0 0 0 3px rgba(223, 164, 91, 0.24);
}

/* ==========================================================================
   Логотип
   ========================================================================== */
.logo__mark { border-radius: 13px; }
.logo__title { font-size: 1.08rem; letter-spacing: -0.02em; }
.logo__tagline { font-size: 0.56rem; letter-spacing: 0.19em; }

/* ==========================================================================
   Заголовки секций (eyebrow + title)
   ========================================================================== */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--forest-600);
}
.eyebrow--gold { color: var(--gold-400); }
.eyebrow--center { justify-content: center; }
.eyebrow__line {
  display: inline-block;
  width: 1.75rem;
  height: 1px;
  background: rgba(29, 90, 66, 0.4);
}
.eyebrow--gold .eyebrow__line { background: rgba(216, 181, 106, 0.7); }

.section-heading__eyebrow { font-size: 0.7rem; letter-spacing: 0.2em; }
.section-heading__title { line-height: 1.12; letter-spacing: -0.025em; }

/* ==========================================================================
   Секции
   ========================================================================== */
.section { padding-block: 4rem; }
@media (min-width: 1024px) {
  .section { padding-block: 5.5rem; }
}
.section--dark {
  background: var(--forest-900);
  color: var(--cream-50);
}
.section--sand { background: var(--cream-100); }

/* ==========================================================================
   Герой (главная страница)
   ========================================================================== */
.hero {
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(216, 181, 106, 0.16), transparent 60%),
    linear-gradient(160deg, var(--forest-900) 0%, var(--forest-800) 55%, #0d241d 100%);
  color: var(--cream-50);
  overflow: hidden;
}
.hero__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  padding-block: 4rem 4.5rem;
  align-items: center;
}
.hero__inner > * { min-width: 0; }
@media (min-width: 1024px) {
  .hero__inner { grid-template-columns: 1.05fr 0.95fr; padding-block: 6rem; }
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold-400);
}
.hero__eyebrow-line {
  display: inline-block;
  width: 1.75rem;
  height: 1px;
  background: rgba(216, 181, 106, 0.7);
}

.hero__title {
  margin-top: 1.25rem;
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
}
@media (min-width: 640px) {
  .hero__title { font-size: 3rem; }
}
@media (min-width: 1024px) {
  .hero__title { font-size: 3.4rem; }
}
.hero__accent { color: var(--gold-300); }

.hero__lead {
  margin-top: 1.25rem;
  max-width: 34rem;
  font-size: 1rem;
  line-height: 1.75;
  color: rgba(244, 239, 224, 0.75);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}
@media (max-width: 639px) {
  /* На узком экране кнопки не должны раздувать колонку из-за nowrap */
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn {
    width: 100%;
    height: auto;
    min-height: 2.75rem;
    padding-block: 0.7rem;
    white-space: normal;
    line-height: 1.3;
    text-align: center;
  }
}

.hero__points {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-top: 2rem;
  font-size: 0.8125rem;
  color: rgba(244, 239, 224, 0.8);
}
.hero__points li { display: inline-flex; align-items: center; gap: 0.4rem; }
.hero__points svg { color: var(--gold-400); }

.hero__media { position: relative; }
.hero__card {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(6px);
}
.hero__card--main { box-shadow: var(--shadow-md); }
.hero__card-head { display: flex; align-items: center; gap: 0.875rem; }
.hero__card-name { font-weight: 700; font-size: 0.9375rem; }
.hero__card-dates { font-size: 0.75rem; color: rgba(244, 239, 224, 0.6); margin-top: 0.15rem; }
.hero__quote {
  margin-top: 1.25rem;
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--cream-100);
  font-style: italic;
}
.hero__card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
}
.hero__qr {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: rgba(216, 181, 106, 0.18);
  color: var(--gold-300);
}
.hero__card--mini {
  position: absolute;
  right: -0.5rem;
  bottom: -1.25rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
}
@media (max-width: 639px) {
  .hero__card--mini { position: static; margin-top: 1rem; }
}
.hero__mini-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--gold-300);
}
.hero__mini-text { margin-top: 0.25rem; font-size: 0.75rem; color: rgba(244, 239, 224, 0.65); }

/* ==========================================================================
   Карточки
   ========================================================================== */
.card {
  background: #fff;
  border: 1px solid var(--cream-200);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.card--hover { transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.card--hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(216, 181, 106, 0.5);
}
.card--link { display: block; }
.card--sand { background: var(--sage-50); }
.card--wide { grid-column: 1 / -1; }

.card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.875rem;
  background: rgba(18, 55, 46, 0.08);
  color: var(--forest-700);
  margin-bottom: 1rem;
}
.card__title { font-size: 1.125rem; font-weight: 700; letter-spacing: -0.01em; }
.card__text { margin-top: 0.5rem; font-size: 0.875rem; line-height: 1.6; color: var(--ink-500); }
.card__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--ink-500);
}
.card__top { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.card__footer { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 1.25rem; flex-wrap: wrap; }
.card__chip-row { display: flex; align-items: center; gap: 0.5rem; margin-top: 1.25rem; flex-wrap: wrap; }

/* ==========================================================================
   Шаги («Как это работает»)
   ========================================================================== */
.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  counter-reset: steps;
}
@media (min-width: 1024px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
}
.step {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 1.75rem 1.5rem;
}
.step__number {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  color: rgba(216, 181, 106, 0.25);
}
.step__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.875rem;
  background: rgba(216, 181, 106, 0.16);
  color: var(--gold-300);
}
.step__title { margin-top: 1rem; font-size: 1.0625rem; font-weight: 700; }
.step__text { margin-top: 0.5rem; font-size: 0.875rem; line-height: 1.6; color: rgba(244, 239, 224, 0.7); }

/* ==========================================================================
   Планы ухода
   ========================================================================== */
.pricing { align-items: stretch; }
.plan { display: flex; flex-direction: column; position: relative; }
.plan--featured {
  border-color: rgba(216, 181, 106, 0.7);
  box-shadow: var(--shadow-md);
}
.plan__badge { position: absolute; top: -0.75rem; left: 1.25rem; }
.plan__name { font-size: 1.125rem; font-weight: 800; }
.plan__tagline { margin-top: 0.25rem; font-size: 0.8125rem; color: var(--ink-500); }
.plan__price { margin-top: 1rem; font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; color: var(--forest-800); }
.plan__price small { font-size: 0.8125rem; font-weight: 600; color: var(--ink-500); }
.plan__visits { margin-top: 0.25rem; font-size: 0.8125rem; color: var(--forest-600); font-weight: 600; }
.plan__list {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.875rem;
  color: var(--ink-700);
}
.plan__list li { display: flex; align-items: flex-start; gap: 0.5rem; }
.plan__list svg { color: var(--forest-600); margin-top: 0.2rem; flex-shrink: 0; }
.plan__cta { margin-top: auto; }
.plan__note { margin-top: 0.75rem; font-size: 0.75rem; line-height: 1.4; color: var(--ink-500); text-align: center; }

/* Выбор плана в форме заказа */
.plans-choose { display: grid; grid-template-columns: 1fr; gap: 0.75rem; }
@media (min-width: 640px) {
  .plans-choose { grid-template-columns: repeat(2, 1fr); }
}
.plans-choose__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--cream-200);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.plans-choose__item:hover { border-color: rgba(216, 181, 106, 0.6); }
.plans-choose__item input { accent-color: var(--forest-700); }
.plans-choose__item--checked {
  border-color: var(--forest-600);
  background: var(--sage-50);
}
.plans-choose__name { font-weight: 700; font-size: 0.875rem; }
.plans-choose__price { font-size: 0.8125rem; font-weight: 600; color: var(--forest-600); white-space: nowrap; }

/* ==========================================================================
   Карточки партнёров
   ========================================================================== */
.partner-card { display: block; }
.partner-card__top { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.partner-card__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.875rem;
  background: var(--forest-800);
  color: var(--gold-300);
  font-weight: 800;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.partner-card__logo--lg { width: 3.25rem; height: 3.25rem; font-size: 1.5rem; }
.partner-card__logo--xl { width: 4.5rem; height: 4.5rem; font-size: 2rem; border-radius: 1.25rem; }
.partner-card__rating { display: inline-flex; align-items: center; gap: 0.3rem; }

/* ==========================================================================
   Блок «Помощь» (поддержать уход)
   ========================================================================== */
.help {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}
@media (min-width: 1024px) {
  .help { grid-template-columns: 1fr auto; }
}
.help__title { margin-top: 1rem; font-size: 2rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.help__lead { margin-top: 1rem; max-width: 34rem; font-size: 0.9375rem; line-height: 1.75; color: rgba(244, 239, 224, 0.7); }
.help .btn { margin-top: 1.75rem; }

/* ==========================================================================
   QR-виджет
   ========================================================================== */
.qr-widget { background: #fff; }
.qr-widget__canvas {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}
.qr-widget__canvas svg { width: 100%; height: 100%; }

/* ==========================================================================
   Каталог: фильтры и список услуг
   ========================================================================== */
.filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: end;
}
@media (min-width: 640px) {
  .filters { grid-template-columns: 1fr 1fr auto; }
}
.filters__field { display: flex; flex-direction: column; gap: 0.375rem; }
.filters__field--submit { display: flex; gap: 0.5rem; }

.listing { display: flex; flex-direction: column; }
.listing__row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--cream-200);
}
@media (min-width: 640px) {
  .listing__row { flex-direction: row; align-items: flex-start; justify-content: space-between; }
}
.listing__row:last-child { border-bottom: 0; }
.listing__title { margin-top: 0.5rem; font-size: 1.0625rem; font-weight: 700; }
.listing__text { margin-top: 0.35rem; font-size: 0.875rem; line-height: 1.6; color: var(--ink-500); }
.listing__side { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; }
@media (min-width: 640px) {
  .listing__side { align-items: flex-end; text-align: right; }
}
.listing__price { font-size: 1.125rem; font-weight: 800; color: var(--forest-800); }
.listing__unit { font-size: 0.75rem; color: var(--ink-500); }

/* ==========================================================================
   Страница партнёра
   ========================================================================== */
.partner-hero__top { display: flex; align-items: flex-start; gap: 1.25rem; flex-wrap: wrap; }
.partner-hero__meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.875rem; }
.partner-hero__contact { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 0.35rem; }

.breadcrumbs { font-size: 0.8125rem; color: var(--ink-500); }
.breadcrumbs a { color: var(--forest-600); font-weight: 600; }
.breadcrumbs a:hover { text-decoration: underline; }

/* ==========================================================================
   Мемориальная страница (профиль могилы)
   ========================================================================== */
.memorial { background: var(--cream-50); padding-block: 3.5rem 5rem; }
.memorial__head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  align-items: center;
}
@media (min-width: 768px) {
  .memorial__head { grid-template-columns: auto 1fr; }
}
.memorial__photo {
  width: 9rem;
  height: 9rem;
  border-radius: 9999px;
  overflow: hidden;
  border: 3px solid var(--gold-400);
  background: var(--cream-100);
  display: flex;
  align-items: center;
  justify-content: center;
}
.memorial__photo img { width: 100%; height: 100%; object-fit: cover; }
.memorial__monogram {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--forest-800);
}
.memorial__name { margin-top: 0.875rem; font-size: 2.25rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
@media (min-width: 768px) {
  .memorial__name { font-size: 2.75rem; }
}
.memorial__dates { margin-top: 0.5rem; font-size: 1.0625rem; color: var(--ink-500); }
.memorial__epitaph {
  margin-top: 1rem;
  font-size: 1.0625rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--forest-700);
  border-left: 3px solid var(--gold-400);
  padding-left: 1rem;
}

.memorial__cols { align-items: start; }
.memorial__main { display: flex; flex-direction: column; gap: 2.5rem; }
.memorial__heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.memorial__heading svg { flex-shrink: 0; }
.memorial__bio { margin-top: 0.75rem; font-size: 0.9375rem; line-height: 1.8; color: var(--ink-700); white-space: pre-line; }
.memorial__side { display: flex; flex-direction: column; gap: 1.25rem; }
.memorial__donation-total { margin-top: 0.5rem; font-size: 1.75rem; font-weight: 800; color: var(--forest-800); }

/* Хронология */
.timeline { position: relative; display: flex; flex-direction: column; }
.timeline__item { position: relative; padding-left: 1.75rem; padding-bottom: 1.75rem; }
.timeline__item::before {
  content: '';
  position: absolute;
  left: 0.3125rem;
  top: 0.375rem;
  bottom: 0;
  width: 2px;
  background: var(--cream-200);
}
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item:last-child::before { display: none; }
.timeline__dot {
  position: absolute;
  left: 0;
  top: 0.375rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 9999px;
  background: var(--gold-500);
  border: 2px solid var(--cream-50);
}
.timeline__date { display: block; font-size: 0.75rem; font-weight: 700; color: var(--forest-600); text-transform: uppercase; letter-spacing: 0.06em; }
.timeline__title { margin-top: 0.25rem; font-size: 1rem; font-weight: 700; }
.timeline__text { margin-top: 0.3rem; font-size: 0.875rem; line-height: 1.6; color: var(--ink-500); }
.timeline--compact .timeline__item { padding-bottom: 1.25rem; }

/* Галерея */
.media-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
@media (min-width: 768px) {
  .media-grid { grid-template-columns: repeat(3, 1fr); }
}
.media-grid__item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--cream-100);
  border: 1px solid var(--cream-200);
}
.media-grid__item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.media-grid__item figcaption { padding: 0.5rem 0.75rem; font-size: 0.75rem; color: var(--ink-500); }

/* ==========================================================================
   «Нить памяти» — мемориальная страница и семейный блок
   Тёплый лён, индиго и янтарь. Янтарь — только декор и крупные акценты:
   мелкий текст на льне остаётся индиго или дымчатым (AA).
   ========================================================================== */
body.theme-thread {
  background: var(--thread-linen);
  color: var(--thread-800);
}
.theme-thread .skip-link { background: var(--thread-800); color: var(--thread-linen); }
.theme-thread :focus-visible { outline-color: var(--thread-800); }
.theme-thread .card--thread :focus-visible,
.theme-thread .footer :focus-visible { outline-color: var(--gold-300); }

.theme-thread .topbar {
  background: rgba(246, 241, 231, 0.95);
  border-bottom-color: rgba(27, 35, 64, 0.12);
}
.theme-thread .nav__link { color: var(--thread-muted); }
.theme-thread .nav__link:hover { background: rgba(27, 35, 64, 0.06); color: var(--thread-800); }
.theme-thread .nav__link--active,
.theme-thread .nav__link[aria-current="page"] {
  background: var(--thread-800);
  color: var(--thread-linen);
}
.theme-thread .nav__link--active:hover,
.theme-thread .nav__link[aria-current="page"]:hover { background: var(--thread-700); color: var(--thread-linen); }
.theme-thread .nav-mobile { background: var(--thread-linen); border-bottom-color: rgba(27, 35, 64, 0.12); }
.theme-thread .nav-mobile__link { color: var(--thread-800); }
.theme-thread .nav-mobile__link:hover { background: rgba(27, 35, 64, 0.06); }
.theme-thread .nav-mobile__link[aria-current="page"] { background: var(--thread-800); color: var(--thread-linen); }
.theme-thread .nav-toggle { border-color: rgba(27, 35, 64, 0.2); color: var(--thread-800); }
.theme-thread .footer { background: var(--thread-900); }

.memorial--thread {
  position: relative;
  background:
    radial-gradient(900px 480px at 88% -12%, rgba(223, 164, 91, 0.14), transparent 62%),
    linear-gradient(180deg, var(--thread-linen), #f2ece0 100%);
  color: var(--thread-800);
}
.memorial--thread::before {
  content: '';
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(27, 35, 64, 0.16), transparent);
}

.memorial--thread .memorial__head { position: relative; }
@media (min-width: 768px) {
  /* Нить от фотографии к имени: два узла и линия между ними */
  .memorial--thread .memorial__head::before {
    content: '';
    position: absolute;
    left: 9rem;
    top: 50%;
    width: 1.75rem;
    height: 2px;
    background: linear-gradient(90deg, var(--thread-amber), rgba(223, 164, 91, 0.3));
    transform: translateY(-1px);
  }
  .memorial--thread .memorial__head::after {
    content: '';
    position: absolute;
    left: calc(9rem + 1.75rem - 0.25rem);
    top: calc(50% - 0.25rem);
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: var(--thread-amber);
  }
}
.memorial--thread .memorial__photo {
  border-color: var(--thread-amber);
  background: #efe7d8;
  box-shadow: 0 0 0 6px rgba(223, 164, 91, 0.14);
}
.memorial--thread .memorial__monogram { color: var(--thread-800); }
.memorial--thread .memorial__name { color: var(--thread-800); letter-spacing: -0.025em; }
.memorial--thread .memorial__dates { color: var(--thread-muted); }
.memorial--thread .memorial__epitaph {
  color: var(--thread-800);
  border-left-color: var(--thread-amber);
}
.memorial--thread .eyebrow,
.memorial--thread .eyebrow--gold { color: var(--thread-muted); }
.memorial--thread .eyebrow__line,
.memorial--thread .eyebrow--gold .eyebrow__line { background: var(--thread-amber); }

.memorial--thread .memorial__heading,
.memorial--thread .card__title { color: var(--thread-800); }
.memorial--thread .memorial__heading svg { color: var(--thread-800); --icon-dot: var(--thread-amber); }
.memorial--thread .memorial__bio { color: #3a3f57; }
.memorial--thread .memorial__donation-total { color: var(--thread-800); }

.memorial--thread .timeline__item::before { background: rgba(27, 35, 64, 0.22); }
.memorial--thread .timeline__dot {
  background: var(--thread-amber);
  border-color: var(--thread-linen);
  box-shadow: 0 0 0 2px rgba(223, 164, 91, 0.28);
}
.memorial--thread .timeline__date { color: var(--thread-muted); }
.memorial--thread .timeline__text { color: var(--thread-muted); }

.memorial--thread .media-grid__item {
  background: #efe7d8;
  border-color: rgba(27, 35, 64, 0.14);
}
.memorial--thread .media-grid__item figcaption { color: var(--thread-muted); }

.memorial--thread .notice--info {
  background: var(--thread-paper);
  border-color: rgba(27, 35, 64, 0.16);
  color: var(--thread-800);
}
.memorial--thread .notice--info svg { color: var(--thread-800); --icon-dot: var(--thread-amber); }

.memorial--thread .card {
  background: var(--thread-paper);
  border-color: rgba(27, 35, 64, 0.14);
  box-shadow: 0 18px 40px -34px rgba(27, 35, 64, 0.55);
  color: var(--thread-800);
}
.memorial--thread .card--sand { background: #f1eadc; }
.memorial--thread .card__text,
.memorial--thread .form__hint { color: var(--thread-muted); }
.memorial--thread .form__label { color: var(--thread-800); }
.memorial--thread .form__input,
.memorial--thread .form__textarea,
.memorial--thread .form__select {
  background: var(--thread-paper);
  border-color: rgba(27, 35, 64, 0.2);
  color: var(--thread-800);
}
.memorial--thread .form__input:focus,
.memorial--thread .form__textarea:focus,
.memorial--thread .form__select:focus {
  border-color: var(--thread-800);
  box-shadow: 0 0 0 3px rgba(27, 35, 64, 0.14);
}
.memorial--thread .checkbox { color: var(--thread-muted); }
.memorial--thread .checkbox input { accent-color: var(--thread-800); }
.memorial--thread .btn--primary { background: var(--thread-amber); color: var(--thread-900); }
.memorial--thread .btn--primary:hover { background: #e8b06a; }
.memorial--thread .badge { background: rgba(27, 35, 64, 0.07); color: var(--thread-800); }
.memorial--thread .badge--green { background: rgba(29, 90, 66, 0.12); color: #1d5a42; }
.memorial--thread .badge .icon,
.memorial--thread .badge svg { --icon-dot: var(--thread-amber); }

/* Семейный блок: тёмный индиго, янтарная нить слева */
.card--thread {
  position: relative;
  background:
    radial-gradient(420px 220px at 92% 0%, rgba(223, 164, 91, 0.18), transparent 65%),
    linear-gradient(160deg, var(--thread-900), var(--thread-800) 70%, var(--thread-700));
  border-color: rgba(246, 241, 231, 0.18);
  border-left: 3px solid var(--thread-amber);
  color: var(--thread-linen);
  box-shadow: 0 24px 50px -38px rgba(19, 26, 51, 0.9);
}
.card--thread .card__title,
.card--thread strong { color: var(--thread-linen); }
.card--thread p,
.card--thread .card__text { color: rgba(246, 241, 231, 0.78); }
.card--thread .card__meta,
.card--thread .form__hint { color: var(--thread-line); }
.card--thread a { color: var(--thread-amber); text-decoration: underline; text-underline-offset: 2px; }
.card--thread svg { color: var(--thread-amber); }

/* Семейный блок внутри мемориальной страницы: возвращаем тёмный фон,
   который иначе перекрывает общее правило .memorial--thread .card */
.memorial--thread .card--thread {
  background:
    radial-gradient(420px 220px at 92% 0%, rgba(223, 164, 91, 0.18), transparent 65%),
    linear-gradient(160deg, var(--thread-900), var(--thread-800) 70%, var(--thread-700));
  border-color: rgba(246, 241, 231, 0.18);
  border-left: 3px solid var(--thread-amber);
  color: var(--thread-linen);
}
.memorial--thread .card--thread p { color: rgba(246, 241, 231, 0.78); }

/* ==========================================================================
   Уведомления
   ========================================================================== */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 0.875rem;
  line-height: 1.55;
}
.notice svg { flex-shrink: 0; margin-top: 0.15rem; }
.notice--info { background: var(--sage-50); border-color: rgba(29, 90, 66, 0.2); color: var(--ink-700); }
.notice--success { background: var(--sage-100); border-color: rgba(29, 90, 66, 0.25); color: var(--forest-800); }

/* ==========================================================================
   Формы
   ========================================================================== */
.form { display: flex; flex-direction: column; gap: 1.25rem; }
.form__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 640px) {
  .form__row { grid-template-columns: repeat(2, 1fr); }
}
.form__field { display: flex; flex-direction: column; gap: 0.5rem; }
.form__label { font-size: 0.8125rem; font-weight: 700; color: var(--ink-700); }
.form fieldset { min-width: 0; margin-inline: 0; padding: 0; border: 0; }
.form legend { padding: 0; }

/* Радиокнопки в карточках выбора: аккуратный круг вместо системного */
.plans-choose__item input[type="radio"],
.billing-option input[type="radio"] {
  flex: 0 0 auto;
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  border: 1.5px solid rgba(15, 43, 34, 0.35);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.plans-choose__item input[type="radio"]:checked,
.billing-option input[type="radio"]:checked {
  border-color: var(--forest-700);
  background: var(--forest-700);
  box-shadow: inset 0 0 0 3px #fff;
}
.plans-choose__item input[type="radio"]:focus-visible,
.billing-option input[type="radio"]:focus-visible {
  outline: 2px solid var(--forest-700);
  outline-offset: 2px;
}
.form__input,
.form__textarea,
.form__select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--cream-200);
  border-radius: var(--radius-sm);
  background: #fff;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--ink-900);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form__input:focus,
.form__textarea:focus,
.form__select:focus {
  outline: none;
  border-color: var(--forest-600);
  box-shadow: 0 0 0 3px rgba(29, 90, 66, 0.15);
}
.form__textarea { resize: vertical; min-height: 6rem; }
.form__select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-500) 50%), linear-gradient(135deg, var(--ink-500) 50%, transparent 50%); background-position: calc(100% - 1.25rem) 55%, calc(100% - 1rem) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2.5rem; }
.form__select--sm { width: auto; padding-block: 0.375rem; font-size: 0.8125rem; }
.form__hint { font-size: 0.75rem; line-height: 1.5; color: var(--ink-500); }

.form-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.875rem;
  line-height: 1.5;
}
.form-alert--error { background: var(--red-50); border-color: var(--red-200); color: var(--red-800); }
.form-alert svg { flex-shrink: 0; margin-top: 0.15rem; }

.checkbox {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.625rem;
  font-size: 0.875rem;
  color: var(--ink-700);
  cursor: pointer;
}
.checkbox input { margin-top: 0.2rem; accent-color: var(--forest-700); }

.password-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 0.625rem;
  background: transparent;
  color: var(--ink-500);
}
.password-toggle:hover { background: rgba(15, 43, 34, 0.06); color: var(--ink-900); }

/* ==========================================================================
   Страница входа
   ========================================================================== */
.login-layout { grid-template-columns: 1fr; }
@media (min-width: 1024px) {
  .login-layout { grid-template-columns: 1.02fr 0.98fr; }
}
.login-side {
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  background:
    radial-gradient(900px 500px at 90% -10%, rgba(216, 181, 106, 0.18), transparent 60%),
    linear-gradient(160deg, var(--forest-900) 0%, var(--forest-800) 60%, #0d241d 100%);
  color: var(--cream-50);
}
@media (min-width: 1024px) {
  .login-side { padding: 3rem 3.5rem; }
}
.login-title { line-height: 1.08; letter-spacing: -0.03em; }
@media (min-width: 1280px) {
  .login-title { font-size: 2.85rem; }
}
.login-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 1rem;
  background: rgba(18, 55, 46, 0.1);
  color: var(--forest-700);
}

/* ==========================================================================
   Личный кабинет (dash)
   ========================================================================== */
.dash {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
}
@media (min-width: 1024px) {
  .dash { grid-template-columns: 17rem 1fr; }
}
.dash__sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem 1.25rem;
  background: var(--forest-900);
  color: var(--cream-50);
}
@media (min-width: 1024px) {
  .dash__sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 2rem 1.5rem; }
}
.dash__role { margin-top: auto; }
.dash__main { padding: 2rem 1.25rem 4rem; min-width: 0; }
.dash__sidebar { min-width: 0; }
@media (min-width: 640px) {
  .dash__main { padding: 2.5rem 2rem 4rem; }
}
@media (min-width: 1024px) {
  .dash__main { padding: 2.75rem 3rem 5rem; }
}
.dash__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.page-title { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; }
.page-subtitle { margin-top: 0.25rem; font-size: 0.875rem; color: var(--ink-500); }

/* Навигация кабинета */
.dash-nav { display: flex; flex-direction: column; gap: 1rem; }
.dash-nav__list { display: flex; flex-direction: column; gap: 0.25rem; }
.dash-nav__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.625rem 0.875rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(244, 239, 224, 0.75);
  background: transparent;
  border: 0;
  text-align: left;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.dash-nav__link:hover { background: rgba(255, 255, 255, 0.07); color: var(--cream-50); }
.dash-nav__link--active { background: rgba(216, 181, 106, 0.16); color: var(--gold-300); }
.dash-nav__link--logout { color: rgba(244, 239, 224, 0.55); }
.dash-nav__link--logout:hover { background: rgba(185, 28, 28, 0.15); color: #fca5a5; }
.dash-nav__icon { display: inline-flex; flex-shrink: 0; }
.dash-nav__logout { border-top: 1px solid rgba(255, 255, 255, 0.1); padding-top: 1rem; }

/* Навигация администратора */
.admin-nav { margin-top: 1.5rem; overflow-x: auto; }
.admin-nav__list { display: flex; gap: 0.5rem; padding-bottom: 0.25rem; }
.admin-nav__link {
  display: inline-block;
  padding: 0.5rem 0.875rem;
  border-radius: 9999px;
  background: rgba(18, 55, 46, 0.07);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-700);
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.admin-nav__link:hover { background: var(--forest-800); color: var(--cream-50); }

/* Статистика */
.stat {
  background: #fff;
  border: 1px solid var(--cream-200);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}
.stat__value { display: block; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; color: var(--forest-800); }
.stat__label { display: block; margin-top: 0.25rem; font-size: 0.75rem; color: var(--ink-500); }
.stat--gold { background: rgba(216, 181, 106, 0.1); border-color: rgba(216, 181, 106, 0.4); }
.stat--warn { background: var(--red-50); border-color: var(--red-200); }

/* Таблицы */
.table__wrap { position: relative; overflow-x: auto; background: #fff; border: 1px solid var(--cream-200); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; min-width: 40rem; }
.table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-500);
  background: var(--sage-50);
  border-bottom: 1px solid var(--cream-200);
}
.table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--cream-200); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: rgba(18, 55, 46, 0.02); }

/* Кликабельные строки: переход по data-row-href, ссылка остаётся в первой ячейке */
.table tbody tr[data-row-href] { cursor: pointer; }
.table tbody tr[data-row-href]:hover td { background: var(--sage-50); }
.table tbody tr[data-row-href]:focus-within { outline: 2px solid var(--forest-700); outline-offset: -2px; }
.table__row-link { font-weight: 600; color: var(--forest-800); }
.table__row-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.table__cell-note { display: block; margin-top: 0.15rem; font-size: 0.75rem; font-weight: 400; color: var(--ink-500); }
.table__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.table__action-hint { font-size: 0.75rem; color: var(--ink-500); }

/* Кликабельная плитка статистики */
a.stat { display: block; transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease; }
a.stat:hover { border-color: rgba(15, 43, 34, 0.25); box-shadow: var(--shadow-md, 0 10px 30px rgba(15, 43, 34, 0.08)); transform: translateY(-1px); }
a.stat:focus-visible { outline: 3px solid var(--forest-700); outline-offset: 2px; }
a.stat .stat__label::after { content: " →"; color: var(--forest-600); }

/* Шаги оформления заказа и документов */
.flow { display: grid; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
@media (min-width: 900px) {
  .flow { grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
}
.flow__item {
  position: relative;
  padding: 0.75rem 0.9rem 0.75rem 2.6rem;
  border: 1px solid var(--cream-200);
  border-radius: var(--radius-sm, 0.75rem);
  background: #fff;
}
.flow__num {
  position: absolute;
  left: 0.9rem;
  top: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: var(--cream-100);
  color: var(--ink-500);
  font-size: 0.6875rem;
  font-weight: 800;
}
.flow__title { display: block; font-size: 0.8125rem; font-weight: 700; color: var(--ink-700); }
.flow__text { display: block; margin-top: 0.15rem; font-size: 0.75rem; line-height: 1.45; color: var(--ink-500); }
.flow__item--done { border-color: rgba(29, 90, 66, 0.28); background: var(--sage-50); }
.flow__item--done .flow__num { background: var(--forest-700); color: var(--cream-50); }
.flow__item--done .flow__title { color: var(--forest-800); }
.flow__item--current { border-color: var(--forest-600); box-shadow: inset 0 0 0 1px var(--forest-600); }
.flow__item--current .flow__num { background: var(--gold-500); color: var(--ink-900); }

/* Список определений */
.dl { display: flex; flex-direction: column; }
.dl > div { display: grid; grid-template-columns: 10rem 1fr; gap: 0.75rem; padding: 0.625rem 0; border-bottom: 1px solid var(--cream-200); font-size: 0.875rem; }
.dl > div:last-child { border-bottom: 0; }
.dl dt { color: var(--ink-500); }
.dl dd { font-weight: 600; color: var(--ink-900); }

/* ==========================================================================
   Подвал
   ========================================================================== */
.footer {
  background: var(--forest-900);
  color: var(--cream-50);
  padding-block: 3.5rem 2rem;
}
.footer__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}
@media (min-width: 768px) {
  .footer__inner { grid-template-columns: 1.4fr 1fr 1fr; }
}
.footer__moto { margin-top: 1.25rem; max-width: 22rem; font-size: 0.875rem; line-height: 1.65; color: rgba(244, 239, 224, 0.6); }
.footer__nav { display: flex; flex-direction: column; gap: 0.875rem; }
.footer__heading {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold-400);
}
.footer__nav ul { display: flex; flex-direction: column; gap: 0.5rem; }
.footer__nav a { font-size: 0.875rem; color: rgba(244, 239, 224, 0.75); }
.footer__nav a:hover { color: var(--gold-300); }
.footer__bottom {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  color: rgba(244, 239, 224, 0.45);
}
@media (min-width: 768px) {
  .footer__bottom { flex-direction: row; justify-content: space-between; }
}
.footer__legal { max-width: 40rem; }

/* ==========================================================================
   Доступность: уменьшенное движение
   ========================================================================== */
/* ==========================================================================
   Доступность: скрытый текст для скринридеров
   ========================================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Тарифная сетка: карточки и сравнительная матрица
   ========================================================================== */
.plan__year {
  margin-top: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-700);
}
.plan__year-note { color: var(--ink-500); font-weight: 500; }
.plan__save {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: var(--sage-100);
  color: var(--forest-700);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.tariff { margin-top: 3.5rem; }
.tariff__title { font-size: 1.375rem; font-weight: 800; color: var(--ink-900); }
.tariff__hint { margin-top: 0.5rem; max-width: 46rem; font-size: 0.875rem; line-height: 1.65; color: var(--ink-500); }
.tariff__scroll {
  position: relative;
  margin-top: 1.5rem;
  max-width: 100%;
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--cream-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}
.tariff__scroll:focus-visible { outline: 3px solid var(--forest-700); outline-offset: 2px; }
.tariff-grid {
  width: 100%;
  min-width: 43rem;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.tariff-grid caption { text-align: left; }
.tariff-grid thead th {
  padding: 0.9rem 1rem;
  text-align: left;
  vertical-align: bottom;
  background: var(--cream-50);
  border-bottom: 1px solid var(--cream-200);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--ink-700);
}
.tariff-grid thead th:first-child { min-width: 16rem; }
.tariff-grid thead th:not(:first-child) { text-align: center; }
.tariff-grid__plan { display: block; font-size: 0.9375rem; font-weight: 800; color: var(--ink-900); }
.tariff-grid__price { display: block; margin-top: 0.15rem; font-size: 0.75rem; font-weight: 600; color: var(--forest-600); }
.tariff-grid tbody th,
.tariff-grid tbody td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--cream-200);
  vertical-align: middle;
}
.tariff-grid tbody th[scope="row"] {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  font-weight: 600;
  color: var(--ink-700);
  text-align: left;
  box-shadow: 1px 0 0 var(--cream-200);
}
.tariff-grid tbody td { text-align: center; }
.tariff-grid tbody tr:last-child th,
.tariff-grid tbody tr:last-child td { border-bottom: 0; }
.tariff-grid__group th {
  position: static;
  padding: 0.55rem 1rem;
  background: var(--sage-50);
  color: var(--forest-800);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: none;
}
.tariff-grid__value { font-weight: 700; color: var(--ink-900); white-space: nowrap; }
.tariff-grid__yes {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--sage-100);
  color: var(--forest-700);
}
.tariff-grid__no { display: inline-block; color: #9aa79f; }
.tariff__note { margin-top: 1rem; font-size: 0.8125rem; line-height: 1.65; color: var(--ink-500); }

/* Списки планов на телефоне (вместо широкой таблицы) */
.tariff-mobile { display: none; }

@media (max-width: 767px) {
  .tariff__scroll { display: none; }
  .tariff-mobile { display: grid; gap: 0.75rem; margin-top: 1.25rem; }
  .tariff-m {
    background: #fff;
    border: 1px solid var(--cream-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }
  .tariff-m--featured { border-color: rgba(201, 162, 78, 0.55); }
  .tariff-m__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    cursor: pointer;
    list-style: none;
  }
  .tariff-m__summary::-webkit-details-marker { display: none; }
  .tariff-m__summary::after {
    content: "";
    flex: 0 0 auto;
    width: 0.5rem;
    height: 0.5rem;
    margin-left: 0.25rem;
    border-right: 2px solid var(--forest-700);
    border-bottom: 2px solid var(--forest-700);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
  }
  .tariff-m[open] .tariff-m__summary::after { transform: rotate(-135deg); }
  .tariff-m__summary:focus-visible { outline: 3px solid var(--forest-700); outline-offset: -3px; }
  .tariff-m__name { font-size: 1rem; font-weight: 800; color: var(--ink-900); }
  .tariff-m--featured .tariff-m__name { color: var(--forest-800); }
  .tariff-m__price { margin-left: auto; font-size: 1rem; font-weight: 800; color: var(--forest-800); white-space: nowrap; }
  .tariff-m__unit { font-size: 0.75rem; font-weight: 600; color: var(--ink-500); }
  .tariff-m__body { padding: 0 1rem 1rem; border-top: 1px solid var(--cream-200); }
  .tariff-m__year { margin-top: 0.7rem; font-size: 0.8125rem; font-weight: 600; color: var(--forest-600); }
  .tariff-m__group {
    margin-top: 0.9rem;
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-500);
  }
  .tariff-m__list { display: grid; gap: 0.4rem; margin-top: 0.45rem; }
  .tariff-m__list li { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.875rem; line-height: 1.5; color: var(--ink-700); }
  .tariff-m__list svg { flex: 0 0 auto; margin-top: 0.15rem; color: var(--forest-700); }
  .tariff-m__none { color: var(--ink-500); font-style: italic; }
  .tariff-m__cta { margin-top: 1rem; }
  .tariff-m__hint { font-size: 0.75rem; line-height: 1.6; color: var(--ink-500); }
}

/* ==========================================================================
   Период оплаты в заказе
   ========================================================================== */
.plans-choose__body { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.plans-choose__meta { font-size: 0.75rem; font-weight: 500; color: var(--ink-500); }
.plans-choose__prices { display: flex; flex-direction: column; align-items: flex-end; gap: 0.1rem; text-align: right; }
.plans-choose__price { font-size: 0.8125rem; font-weight: 700; color: var(--forest-700); white-space: nowrap; }
.plans-choose__price-year { font-size: 0.6875rem; color: var(--ink-500); white-space: nowrap; }

.billing-options { display: grid; grid-template-columns: 1fr; gap: 0.75rem; }
@media (min-width: 640px) {
  .billing-options { grid-template-columns: repeat(2, 1fr); }
}
.billing-option {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--cream-200);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.billing-option:hover { border-color: rgba(216, 181, 106, 0.6); }
.billing-option input { accent-color: var(--forest-700); margin-bottom: 0.25rem; }
.billing-option--checked { border-color: var(--forest-600); background: var(--sage-50); }
.billing-option__title { font-size: 0.875rem; font-weight: 700; color: var(--ink-900); }
.billing-option__text { font-size: 0.75rem; line-height: 1.5; color: var(--ink-500); }

/* ==========================================================================
   Документы: списки, фильтры, таблица кабинета
   ========================================================================== */
.doc-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--cream-200);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 0.8125rem;
  color: var(--ink-700);
}
.doc-summary__item { display: inline-flex; align-items: center; gap: 0.4rem; }
.doc-summary__item svg { color: var(--forest-600); }

.doc-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.doc-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--cream-200);
  border-radius: 999px;
  background: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-700);
}
.doc-filter:hover { border-color: rgba(216, 181, 106, 0.7); color: var(--forest-800); }
.doc-filter--active {
  border-color: var(--forest-700);
  background: var(--forest-800);
  color: var(--cream-50);
}
.doc-filter__count {
  display: inline-flex;
  min-width: 1.35rem;
  justify-content: center;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: rgba(15, 43, 34, 0.07);
  font-size: 0.6875rem;
  font-weight: 700;
}
.doc-filter--active .doc-filter__count { background: rgba(255, 255, 255, 0.18); color: var(--cream-50); }

.doc-list { display: flex; flex-direction: column; gap: 0.5rem; }
.doc-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--cream-200);
  border-radius: var(--radius-sm);
  background: var(--cream-50);
}
.doc-steps__form { margin: 0; }
.doc-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 0.75rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--cream-200);
  border-radius: var(--radius-sm);
  background: #fff;
}
.doc-item__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border-radius: 0.6rem;
  background: var(--sage-50);
  color: var(--forest-700);
}
.doc-item__body { display: flex; flex: 1 1 12rem; flex-direction: column; gap: 0.1rem; min-width: 0; }
.doc-item__title { font-size: 0.875rem; font-weight: 700; color: var(--ink-900); }
.doc-item__title:hover { color: var(--forest-700); text-decoration: underline; }
.doc-item__meta { font-size: 0.75rem; line-height: 1.5; color: var(--ink-500); }
.doc-item__action { flex-shrink: 0; }
@media (max-width: 479px) {
  .doc-item__action { width: 100%; }
}

.doc-table__title { font-weight: 700; color: var(--ink-900); }
.doc-table__title:hover { color: var(--forest-700); text-decoration: underline; }
.doc-table__meta { display: block; margin-top: 0.15rem; font-size: 0.75rem; color: var(--ink-500); }
.doc-table__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }

@media (max-width: 639px) {
  /* На телефоне таблица документов превращается в карточки */
  .table--docs { min-width: 0; width: 100%; }
  .table--docs thead { display: none; }
  .table--docs tbody,
  .table--docs tr,
  .table--docs td { display: block; width: 100%; }
  .table--docs tr { padding: 0.85rem 1rem; border-bottom: 1px solid var(--cream-200); }
  .table--docs tr:last-child { border-bottom: 0; }
  .table--docs tr:hover td { background: transparent; }
  .table--docs td { padding: 0.15rem 0; border: 0; }
  .table--docs td[data-label] {
    display: grid;
    grid-template-columns: 4.5rem 1fr;
    gap: 0.5rem;
    align-items: baseline;
  }
  .table--docs td[data-label]::before {
    content: attr(data-label);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-500);
  }
  .table--docs td[data-label="Действия"] {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.6rem;
  }
  .table--docs td[data-label="Действия"]::before {
    flex: 0 0 4.5rem;
  }
  .table--docs td[data-label] > .badge { justify-self: start; }
}

/* ==========================================================================
   Печатный проект документа
   ========================================================================== */
.doc-top {
  background: var(--cream-50);
  border-bottom: 1px solid var(--cream-200);
}
.doc-top__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}
.doc-top__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.doc-page { padding: 2rem 0 4rem; background: var(--thread-linen); }
.doc-page > .container { max-width: 56rem; }

.doc-sheet {
  padding: 2.5rem;
  background: var(--thread-paper);
  border: 1px solid var(--cream-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  color: var(--ink-900);
  font-size: 0.9375rem;
  line-height: 1.65;
}
@media (max-width: 639px) {
  .doc-top__inner { align-items: flex-start; }
  .doc-page { padding: 1.25rem 0 2.5rem; }
  .doc-sheet { padding: 1.25rem; border-radius: var(--radius-sm); }
}
.doc-sheet__brand {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--forest-600);
}
.doc-sheet__title { margin-top: 0.4rem; font-size: 1.5rem; font-weight: 800; line-height: 1.25; color: var(--thread-800); }
.doc-sheet__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--ink-500);
}
.doc-sheet__parties {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--cream-200);
  border-radius: var(--radius-sm);
  background: var(--cream-50);
}
@media (min-width: 640px) {
  .doc-sheet__parties { grid-template-columns: repeat(2, 1fr); }
}
.doc-sheet__parties h2 { font-size: 0.6875rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--forest-700); }
.doc-sheet__parties p { margin-top: 0.25rem; font-size: 0.875rem; }
.doc-sheet__muted { color: var(--ink-500); font-size: 0.8125rem; }
.doc-sheet__section { margin-top: 1.75rem; }
.doc-sheet__section h2 { font-size: 1.0625rem; font-weight: 800; color: var(--thread-800); }
.doc-sheet__section h3 { margin-top: 1rem; font-size: 0.8125rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; color: var(--forest-700); }
.doc-sheet__section p { margin-top: 0.5rem; }
.doc-sheet__facts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem 1.25rem;
  margin-top: 0.85rem;
}
@media (min-width: 640px) {
  .doc-sheet__facts { grid-template-columns: repeat(2, 1fr); }
}
.doc-sheet__facts dt { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-500); }
.doc-sheet__facts dd { margin-top: 0.1rem; font-size: 0.875rem; font-weight: 600; }
.doc-sheet__list { margin-top: 0.6rem; display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.875rem; }
.doc-sheet__list li { display: flex; align-items: flex-start; gap: 0.45rem; }
.doc-sheet__list svg { margin-top: 0.2rem; flex-shrink: 0; color: var(--forest-600); }
.doc-sheet__list--plain li { display: list-item; margin-left: 1.1rem; list-style: disc; }
.doc-sheet__sign {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--cream-200);
}
@media (min-width: 640px) {
  .doc-sheet__sign { grid-template-columns: repeat(2, 1fr); }
}
.doc-sheet__sign h2 { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--forest-700); }
.doc-sheet__line { margin-top: 1.5rem; font-size: 0.875rem; color: var(--ink-700); }
.doc-sheet__footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--cream-200);
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--ink-500);
}

/* ==========================================================================
   Печать
   ========================================================================== */
@media print {
  @page { margin: 16mm; }

  body { background: #fff; color: #000; }

  .no-print,
  .site-header,
  .site-footer,
  .skip-link,
  .doc-top {
    display: none !important;
  }

  .doc-page { padding: 0; background: #fff; }
  .doc-page > .container { max-width: none; padding: 0; }
  .doc-sheet {
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
    font-size: 10.5pt;
    line-height: 1.5;
  }
  .doc-sheet__section,
  .doc-sheet__parties,
  .doc-sheet__sign { break-inside: avoid; }
  .doc-sheet__section h2 { break-after: avoid; }
  .doc-sheet a { color: inherit; text-decoration: none; }
  .doc-sheet__footer { color: #444; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}