/* ============================================================
   «Лесное рыцарство» — дизайн-токены и базовая вёрстка
   ============================================================ */

:root {
  --c-surface: #ede3d3;
  --c-text: #3a2c1b;
  --c-muted: #6b5d4a;
  --c-forest: #5b6e4f;
  --c-gold: #c49a3c;
  --c-berry: #9b7ea6;
  --c-deep: #cfd9c4;
  --c-warn: #c26a5a;
  --c-surface-strong: #e2d5c4;
  --c-ring: rgba(196, 154, 60, 0.45);
  --space: 8px;
  --radius: 8px;
  --font-body: "Nunito Sans", system-ui, sans-serif;
  --font-display: "Playfair Display", Georgia, serif;
  --shadow-soft: 0 12px 32px rgba(58, 44, 27, 0.12);
  --shadow-lift: 0 18px 40px rgba(58, 44, 27, 0.16);
  /* Фоновое изображение — одинаково на всех страницах */
  --site-bg-image: url("./assets/invite-bg.jpg");
  --c-bg: #f7f7f2;
  --page-pad-x: clamp(0.75rem, 4vw, 1.25rem);
  --page-pad-y: clamp(1rem, 3vh, 2.5rem);
  --content-inset: clamp(0.85rem, 3.5vw, 1.75rem);
  --card-max: min(640px, calc(100vw - 2 * var(--content-inset)));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  position: relative;
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  font-family: var(--font-body);
  font-size: clamp(16px, 2.8vw, 18px);
  line-height: 1.5;
  color: var(--c-text);
  overflow-x: hidden;
  background-color: var(--c-bg);
}

/* Фоновое фото — фиксированное, одинаковое масштабирование на всех экранах */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--c-bg);
  background-image: var(--site-bg-image);
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}

/* Контент поверх фона */
main,
header,
footer,
.back-to-invite,
.link-feather,
.rsvp-bar {
  position: relative;
  z-index: 1;
}

.rsvp-bar {
  z-index: 100;
}

.back-to-invite,
.link-feather {
  z-index: 50;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--c-text);
}

h1 {
  font-size: clamp(2.1rem, 5vw, 3rem);
}

h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.125rem);
}

h3 {
  font-size: clamp(1.15rem, 2vw, 1.35rem);
}

a {
  color: var(--c-forest);
  font-weight: 700;
}

a:hover {
  color: var(--c-gold);
}

:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 3px;
}

/* ---------- кнопки ---------- */

.cta,
button.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 48px;
  padding: 0.75rem 1.35rem;
  border: 0;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  color: var(--c-text);
  background: linear-gradient(180deg, #d4a84a 0%, var(--c-gold) 45%, #a67c28 100%);
  box-shadow:
    0 0 0 1px rgba(30, 42, 58, 0.12),
    0 4px 0 rgba(58, 44, 27, 0.15),
    0 8px 24px rgba(196, 154, 60, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.cta:hover {
  filter: brightness(1.05);
  box-shadow:
    0 0 0 1px rgba(196, 154, 60, 0.6),
    0 0 20px rgba(196, 154, 60, 0.45),
    0 6px 28px rgba(58, 44, 27, 0.2);
  transform: translateY(-2px);
}

.cta:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(58, 44, 27, 0.2);
}

.cta--wood {
  background: linear-gradient(180deg, #6a4f3a 0%, #4a3829 48%, #3a2c1f 100%);
  color: #fbf7f0;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 0 2px var(--c-gold),
    0 8px 24px rgba(30, 42, 58, 0.25);
}

.cta--wood:hover {
  filter: brightness(1.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 0 0 2px var(--c-gold),
    0 0 24px rgba(196, 154, 60, 0.5);
}

.cta:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  filter: grayscale(0.3);
}

/* ---------- навигация «перо» ---------- */

.back-to-invite,
.link-feather {
  position: fixed;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--c-text);
  background: rgba(251, 247, 240, 0.92);
  border: 1px solid var(--c-surface-strong);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.back-to-invite {
  top: calc(var(--space) * 2);
  left: calc(var(--space) * 2);
}

.link-feather {
  top: calc(var(--space) * 2);
  right: calc(var(--space) * 2);
}

.back-to-invite:hover,
.link-feather:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.link-feather__icon {
  font-size: 1.15rem;
  line-height: 1;
}

/* ---------- hero (details) ---------- */

.hero {
  position: relative;
  z-index: 1;
  padding: max(3.5rem, calc(2.5rem + env(safe-area-inset-top, 0))) var(--page-pad-x) 2.5rem;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(91, 110, 79, 0.18), transparent 60%),
    linear-gradient(180deg, rgba(30, 42, 58, 0.06), transparent);
  pointer-events: none;
}

.sparkles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.sparkles::before,
.sparkles::after {
  content: "";
  position: absolute;
  inset: -20%;
  background-repeat: repeat;
  background-size: 180px 140px;
  opacity: 0.55;
  animation: sparkle-drift 9s ease-in-out infinite;
}

.sparkles::before {
  background-image:
    radial-gradient(circle, rgba(196, 154, 60, 0.85) 0 1.5px, transparent 2px),
    radial-gradient(circle, rgba(255, 252, 246, 0.9) 0 1px, transparent 1.5px);
  animation-duration: 8s;
}

.sparkles::after {
  background-image: radial-gradient(circle, rgba(196, 154, 60, 0.55) 0 1px, transparent 1.5px);
  background-position: 40px 30px;
  animation-duration: 11s;
  animation-delay: -3s;
  opacity: 0.4;
}

@keyframes sparkle-drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
    opacity: 0.4;
  }
  50% {
    transform: translate3d(0, -10px, 0);
    opacity: 0.75;
  }
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: min(880px, var(--card-max));
  margin: 0 auto;
}

/* details.html — одна колонка для hero, аккордеонов и координатора */
body.details-page {
  --details-plate-max: min(640px, calc(100vw - 2 * var(--page-pad-x)));
}

body.details-page .hero-content,
body.details-page .detail-scroll,
body.details-page .detail-coordinator {
  width: 100%;
  max-width: var(--details-plate-max);
  margin-left: auto;
  margin-right: auto;
}

body.details-page main {
  max-width: 100%;
}

.hero-content.detail-info-card {
  padding: clamp(1.1rem, 3vw, 1.35rem) clamp(1.25rem, 3.5vw, 1.75rem);
}

.hero-content .detail-info-card__title {
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  background: linear-gradient(135deg, var(--c-text) 0%, var(--c-forest) 55%, var(--c-gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-content .detail-info-card__accent {
  max-width: min(640px, 100%);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 0;
  line-height: 1.55;
}

.hero-subtitle__item {
  display: inline-block;
  margin-top: 0.15rem;
}

.hero-content .cta {
  margin-top: 0.15rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-style: normal;
}

.hero-cta-row {
  width: 100%;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta-row--auth {
  margin-top: 0;
}

.hero-cta-tiles {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.hero-cta-tiles .hero-cta-tile {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  min-height: 3.25rem;
  padding: 0.7rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.3;
  font-size: clamp(0.88rem, 2.5vw, 1rem);
  text-wrap: balance;
}

#hero-cta-row[hidden],
#hero-cta-auth[hidden] {
  display: none !important;
}

.hero-cta-row--guest .cta {
  flex: 1 1 160px;
  max-width: 200px;
}

.hero-divider {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 1rem 0;
  color: rgba(58, 44, 27, 0.35);
}

.hero-divider__line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(58, 44, 27, 0.22) 20%, rgba(58, 44, 27, 0.22) 80%, transparent);
}

.hero-divider__gem {
  flex-shrink: 0;
  font-size: 0.7rem;
  line-height: 1;
  color: var(--c-gold);
  text-shadow: 0 0 10px rgba(196, 154, 60, 0.45);
}

/* Подпись — как «Координатор в день свадьбы» */
.invite-kicker,
.kicker,
.site-kicker,
.detail-info-card__kicker {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.55;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-muted);
}

.invite-kicker {
  margin-bottom: 0.5rem;
}

/* index.html — подписи одного кегля */
.invite > .invite-kicker,
.invite > .invite-eyebrow,
.invite > .invite-foot {
  font-size: clamp(1.05rem, 3.5vw, 1.2rem);
  line-height: 1.55;
  letter-spacing: 0.14em;
  font-weight: 400;
}

.invite > .invite-kicker {
  margin-bottom: 0.65rem;
}

.kicker {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  color: var(--c-forest);
  background: rgba(91, 110, 79, 0.12);
  border: 1px solid rgba(91, 110, 79, 0.25);
}

/* Заголовки — как hero на details («Самое уютное торжество 2026») */
.hero-content h1,
.rsvp-title,
.auth-title,
.guests-title,
.detail-accordion__label,
.detail-info-card__title,
.profile-view__id h2,
.rsvp-success h2 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--c-text);
  font-size: clamp(1.25rem, 3vw, 1.5rem);
}

.rsvp-title,
.auth-title,
.guests-title {
  margin: 0.35rem 0 0.5rem;
}

body.rsvp-page .rsvp-title {
  margin-bottom: 1.5rem;
}

.site-enter {
  animation: fadeIn 0.65s ease both;
}

.site-enter--d1 {
  animation-delay: 0.08s;
}

.site-enter--d2 {
  animation-delay: 0.16s;
}

.site-enter--d3 {
  animation-delay: 0.24s;
}

@media (prefers-reduced-motion: reduce) {
  .site-enter,
  .site-enter--d1,
  .site-enter--d2,
  .site-enter--d3,
  .detail-scroll,
  .detail-coordinator {
    animation: none;
  }

  .sparkles::before,
  .sparkles::after {
    animation: none;
  }

  .detail-accordion::details-content,
  .detail-accordion__chevron,
  .detail-accordion__summary {
    transition: none;
  }
}

.subtitle,
.rsvp-subtitle,
.auth-subtitle,
.guests-subtitle,
.lead {
  font-family: var(--font-display);
  font-weight: 400;
}

.subtitle {
  max-width: min(640px, 100%);
  margin: 0 auto 1.5rem;
  color: var(--c-muted);
  font-size: clamp(0.95rem, 3.8vw, 1.05rem);
}

main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: min(920px, calc(100vw - 2 * var(--page-pad-x)));
  margin: 0 auto;
  padding: 0 var(--page-pad-x) max(2.5rem, env(safe-area-inset-bottom, 0));
}

/* ---------- детальная страница: одна плашка, разделы внутри ---------- */

.detail-scroll {
  margin-top: calc(var(--space) * 3);
  padding: clamp(1.25rem, 3.5vw, calc(var(--space) * 2.5));
  border-radius: calc(var(--radius) * 2);
  border: 1px solid rgba(58, 44, 27, 0.1);
  background: linear-gradient(165deg, rgba(237, 227, 211, 0.92), rgba(251, 247, 240, 0.85));
  box-shadow: var(--shadow-soft);
  animation: fadeIn 0.65s ease both;
}

.detail-accordion__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: padding-bottom 0.35s ease;
}

.detail-accordion__summary::-webkit-details-marker {
  display: none;
}

.detail-accordion__summary::marker {
  content: "";
}

.detail-accordion__label {
  margin: 0;
}

.detail-accordion__chevron {
  flex-shrink: 0;
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.15rem;
  border-right: 2px solid var(--c-forest);
  border-bottom: 2px solid var(--c-forest);
  transform: rotate(45deg);
  transition: transform 0.35s ease, margin-top 0.35s ease;
}

.detail-accordion[open] > .detail-accordion__summary .detail-accordion__chevron {
  transform: rotate(-135deg);
  margin-top: 0.35rem;
}

.detail-accordion[open] > .detail-accordion__summary {
  padding-bottom: 0.5rem;
}

/* Плавное раскрытие (Chrome 131+, Safari 18.2+, Firefox 131+) */
@supports (interpolate-size: allow-keywords) {
  .detail-accordion {
    interpolate-size: allow-keywords;
  }

  .detail-accordion::details-content {
    height: 0;
    overflow: hidden;
    opacity: 0;
    content-visibility: hidden;
    transition:
      height 0.4s ease,
      opacity 0.3s ease 0.05s,
      content-visibility 0.4s allow-discrete;
  }

  .detail-accordion[open]::details-content {
    height: auto;
    opacity: 1;
    content-visibility: visible;
  }

  @starting-style {
    .detail-accordion[open]::details-content {
      height: 0;
      opacity: 0;
    }
  }
}

.detail-accordion__panel {
  padding: 0 0 1.1rem;
}

.detail-accordion.is-animating .detail-accordion__panel {
  overflow: hidden;
}

.detail-accordion__panel > :first-child {
  margin-top: 0;
}

/* Карточки информации (аккордеоны и блок координатора) */
.detail-prose {
  display: grid;
  gap: 0.75rem;
}

.detail-prose a {
  font-weight: 700;
  color: var(--c-forest);
}

.detail-prose a:hover {
  color: var(--c-gold);
}

.detail-info-card__map-btn {
  display: inline-block;
  margin: 0.5rem 0 0;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-display);
  font-size: clamp(0.88rem, 2.4vw, 1.05rem);
  font-weight: 600;
  line-height: 1.5;
  color: var(--c-forest);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.detail-info-card__map-btn:hover {
  color: var(--c-gold);
}

.detail-info-card {
  padding: clamp(1rem, 3vw, 1.25rem) clamp(1rem, 3.5vw, 1.5rem);
  border-radius: calc(var(--radius) * 2);
  border: 1px solid rgba(91, 110, 79, 0.22);
  background: linear-gradient(165deg, rgba(91, 110, 79, 0.1), rgba(251, 247, 240, 0.96));
  box-shadow: var(--shadow-soft);
  text-align: center;
  font-family: var(--font-display);
}

.detail-info-card > :first-child {
  margin-top: 0;
}

.detail-info-card__kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-muted);
}

.detail-info-card__title {
  margin: 0.5rem 0 0;
}

.detail-info-card__body {
  margin: 0.45rem 0 0;
  font-size: clamp(1.02rem, 2.5vw, 1.12rem);
  font-weight: 700;
  line-height: 1.5;
  color: var(--c-text);
}

.detail-info-card__body:first-child {
  margin-top: 0;
}

.detail-info-card__accent {
  margin: 0.5rem 0 0;
  font-size: clamp(0.95rem, 2.4vw, 1.05rem);
  font-weight: 600;
  line-height: 1.5;
  color: var(--c-forest);
}

.detail-info-card__accent:first-child {
  margin-top: 0;
}

.detail-info-card__link {
  display: inline-block;
  margin-top: 0.65rem;
  font-size: clamp(1.2rem, 3.2vw, 1.45rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--c-forest);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.detail-info-card__link:hover {
  color: var(--c-gold);
}

.detail-coordinator {
  margin-top: calc(var(--space) * 2);
  animation: fadeIn 0.65s ease 0.12s both;
}

.detail-coordinator__contacts {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.15rem;
}

.detail-coordinator__phone {
  margin-top: 0;
}

.detail-coordinator__telegram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(0.95rem, 2.4vw, 1.05rem);
  line-height: 1.35;
  color: var(--c-forest);
  cursor: pointer;
  text-decoration: none;
}

.detail-coordinator__telegram-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-muted);
}

.detail-coordinator__telegram-handle {
  font-size: clamp(1rem, 2.6vw, 1.1rem);
  font-weight: 700;
  color: var(--c-forest);
}

.detail-coordinator__telegram:hover .detail-coordinator__telegram-handle {
  color: var(--c-gold);
}

.forest-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 1.35rem 0;
  font-size: 0.85rem;
  color: var(--c-muted);
  letter-spacing: 0.15em;
}

.forest-divider::before,
.forest-divider::after {
  content: "";
  flex: 1;
  max-width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-forest), transparent);
  opacity: 0.45;
}

/* ---------- вкладки дней ---------- */

.day-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.day-tab {
  flex: 1;
  min-width: 140px;
  padding: 0.65rem 1rem;
  border: 1px solid rgba(58, 44, 27, 0.15);
  border-radius: var(--radius);
  background: rgba(251, 247, 240, 0.7);
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--c-text);
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.day-tab:hover {
  border-color: var(--c-gold);
  box-shadow: 0 0 0 3px var(--c-ring);
}

.day-tab[aria-selected="true"] {
  background: rgba(91, 110, 79, 0.18);
  border-color: var(--c-forest);
  color: var(--c-text);
}

.day-panel {
  display: none;
  animation: fadeIn 0.35s ease;
}

.day-panel.is-active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.schedule-table {
  width: 100%;
  margin: 0.75rem 0 0;
  border-collapse: collapse;
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(251, 247, 240, 0.75);
  border: 1px solid rgba(58, 44, 27, 0.08);
}

.schedule-table caption {
  padding: 0;
}

.schedule-table thead th {
  padding: 0.55rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  color: var(--c-muted);
  background: rgba(91, 110, 79, 0.08);
  border-bottom: 1px solid rgba(58, 44, 27, 0.1);
}

.schedule-table tbody tr {
  border-bottom: 1px solid rgba(58, 44, 27, 0.08);
}

.schedule-table tbody tr:last-child {
  border-bottom: 0;
}

.schedule-table td {
  padding: 0.75rem 0.85rem;
  vertical-align: top;
  line-height: 1.45;
}

.schedule-table__time {
  width: 8.75rem;
  min-width: 8.75rem;
  white-space: nowrap;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--c-forest);
}

.schedule-table__time time {
  font-weight: inherit;
  color: inherit;
}

/* ---------- приглашение (index) ---------- */

body.invite-page {
  min-height: 100dvh;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Бабочки — 9 штук непрерывно по кругу, равномерно по экрану */
.invite-butterflies {
  --butterfly-cycle: 27s;
  --butterfly-stagger: calc(var(--butterfly-cycle) / 9);

  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.butterfly {
  position: fixed;
  left: 0;
  width: clamp(40px, 10vw, 68px);
  opacity: 0;
  will-change: transform, opacity;
  animation: butterfly-pass var(--butterfly-cycle) linear infinite;
}

.butterfly img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 1;
  animation: butterfly-flap 3.6s ease-in-out infinite;
  transform-origin: center center;
  filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.9))
    drop-shadow(0 2px 8px rgba(0, 0, 0, 0.14));
}

.butterfly--1 {
  top: 10%;
  animation-delay: calc(var(--butterfly-stagger) * -0);
}

.butterfly--2 {
  top: 18%;
  width: clamp(36px, 9vw, 58px);
  animation-delay: calc(var(--butterfly-stagger) * -1);
}

.butterfly--3 {
  top: 28%;
  width: clamp(44px, 11vw, 72px);
  animation-delay: calc(var(--butterfly-stagger) * -2);
}

.butterfly--4 {
  top: 38%;
  animation-delay: calc(var(--butterfly-stagger) * -3);
}

.butterfly--5 {
  top: 48%;
  width: clamp(38px, 9.5vw, 62px);
  animation-delay: calc(var(--butterfly-stagger) * -4);
}

.butterfly--6 {
  top: 58%;
  animation-delay: calc(var(--butterfly-stagger) * -5);
}

.butterfly--7 {
  top: 68%;
  width: clamp(42px, 10.5vw, 64px);
  animation-delay: calc(var(--butterfly-stagger) * -6);
}

.butterfly--8 {
  top: 78%;
  width: clamp(34px, 8.5vw, 54px);
  animation-delay: calc(var(--butterfly-stagger) * -7);
}

.butterfly--9 {
  top: 86%;
  animation-delay: calc(var(--butterfly-stagger) * -8);
}

.butterfly--reverse {
  animation-name: butterfly-pass-reverse;
}

@keyframes butterfly-pass {
  0% {
    transform: translateX(-28vw) translateY(0);
    opacity: 0;
  }
  3% {
    transform: translateX(-20vw) translateY(0);
    opacity: 1;
  }
  25% {
    transform: translateX(22vw) translateY(-12px);
    opacity: 1;
  }
  50% {
    transform: translateX(52vw) translateY(6px);
    opacity: 1;
  }
  75% {
    transform: translateX(82vw) translateY(-8px);
    opacity: 1;
  }
  92% {
    transform: translateX(108vw) translateY(2px);
    opacity: 1;
  }
  96% {
    transform: translateX(115vw) translateY(0);
    opacity: 0;
  }
  96.01%,
  100% {
    transform: translateX(-28vw) translateY(0);
    opacity: 0;
  }
}

@keyframes butterfly-pass-reverse {
  0% {
    transform: translateX(115vw) translateY(0);
    opacity: 0;
  }
  3% {
    transform: translateX(105vw) translateY(0);
    opacity: 1;
  }
  25% {
    transform: translateX(72vw) translateY(10px);
    opacity: 1;
  }
  50% {
    transform: translateX(42vw) translateY(-6px);
    opacity: 1;
  }
  75% {
    transform: translateX(12vw) translateY(8px);
    opacity: 1;
  }
  92% {
    transform: translateX(-18vw) translateY(-4px);
    opacity: 1;
  }
  96% {
    transform: translateX(-28vw) translateY(0);
    opacity: 0;
  }
  96.01%,
  100% {
    transform: translateX(115vw) translateY(0);
    opacity: 0;
  }
}

@keyframes butterfly-flap {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.92, 1.04);
  }
}

.butterfly--reverse img {
  animation-name: butterfly-flap-reverse;
}

@keyframes butterfly-flap-reverse {
  0%,
  100% {
    transform: scaleX(-1) scale(1);
  }
  50% {
    transform: scaleX(-1) scale(0.92, 1.04);
  }
}

@media (prefers-reduced-motion: reduce) {
  .invite-butterflies {
    display: none;
  }
}

.invite {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--card-max);
  min-height: 100dvh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  padding: max(var(--page-pad-y), env(safe-area-inset-top, 0)) var(--page-pad-x)
    max(var(--page-pad-y), env(safe-area-inset-bottom, 0));
  text-align: center;
  font-family: var(--font-display);
}

.invite-kicker,
.invite-eyebrow,
.invite-message,
.invite-date,
.invite-date-row,
.invite-date-meta,
.invite-foot,
.invite .cta {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: normal;
}

.invite-eyebrow {
  margin: 0 0 0.5rem;
  font-size: clamp(0.62rem, 2.6vw, 0.72rem);
  line-height: 1.55;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--c-muted);
}

.invite > .invite-eyebrow {
  margin: 0 0 0.65rem;
  letter-spacing: 0.14em;
}

.invite-names {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05em;
  margin: 0.5rem 0 1.1rem;
  line-height: 1.05;
}

.invite-name {
  display: block;
  font-family: inherit;
  font-weight: 400;
  font-size: clamp(2.4rem, 7vw, 3.4rem);
  background: linear-gradient(135deg, var(--c-text) 0%, var(--c-forest) 55%, var(--c-gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
}

.invite-name--first {
  z-index: 2;
  padding-bottom: 0.1em;
}

.invite-name--second {
  padding-top: 0.09em;
}

.invite-amp {
  display: block;
  font-family: inherit;
  font-weight: 400;
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  margin: 0.05em 0;
  background: linear-gradient(135deg, var(--c-text) 0%, var(--c-forest) 55%, var(--c-gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.invite-message {
  margin: 0 auto 1.5rem;
  max-width: min(460px, 100%);
  color: var(--c-text);
  font-size: clamp(0.95rem, 3.8vw, 1.02rem);
}

.invite-date {
  margin: 0 auto 1.25rem;
  width: 70%;
  max-width: 70%;
  padding: 0.85rem 1.1rem;
  border-radius: calc(var(--radius) * 1.5);
  background: rgba(207, 217, 196, 0.6);
  color: var(--c-text);
  display: block;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 1px 0 rgba(58, 44, 27, 0.04);
}

.invite-date-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.45rem;
  font-size: clamp(1.65rem, 4.5vw, 2.25rem);
  letter-spacing: 0.06em;
}

.invite-date-heart {
  font-size: 0.45em;
  line-height: 1;
  color: var(--c-gold);
  opacity: 0.9;
  transform: translateY(-0.08em);
}

.invite-date-meta {
  margin: 0.45rem 0 0;
  font-size: clamp(0.76rem, 3.1vw, 0.88rem);
  line-height: 1.45;
  opacity: 0.88;
  text-wrap: balance;
}

/* ---------- таймер (три состояния) ---------- */

.timer-block {
  margin: 0 auto 1.5rem;
  max-width: 460px;
}

.timer-phase {
  display: none;
  border-radius: calc(var(--radius) * 1.5);
  padding: 1rem 1.1rem;
  background: var(--c-deep);
  color: var(--c-text);
  text-align: center;
}

.timer-phase.is-active {
  display: block;
}

.timer-phase h3 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  color: var(--c-text);
}

.timer-phase p {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.85;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.countdown-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.55rem 0.35rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(58, 44, 27, 0.08);
}

.countdown-cell strong {
  font-family: inherit;
  font-size: clamp(1.25rem, 3.5vw, 1.65rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--c-text);
}

.countdown-cell span {
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-muted);
  opacity: 0.85;
}

.invite-cta {
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  display: flex;
}

.invite-foot {
  margin: 1.35rem 0 0;
  font-size: clamp(0.62rem, 2.6vw, 0.72rem);
  line-height: 1.55;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--c-muted);
}

.invite > .invite-foot {
  margin: 1.5rem 0 0;
  letter-spacing: 0.14em;
}

/* ---------- RSVP / auth страницы ---------- */

body.auth-page {
  min-height: 100dvh;
  min-height: 100vh;
}

body.rsvp-page {
  min-height: 100dvh;
  min-height: 100vh;
  padding-bottom: max(var(--page-pad-y), env(safe-area-inset-bottom, 0));
  font-family: var(--font-display);
}

body.rsvp-page .rsvp-page-main {
  padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0));
}

@media (max-width: 540px) {
  body.rsvp-page .rsvp-page-main {
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0));
  }
}

body.auth-page,
body.profile-page {
  font-family: var(--font-display);
}

body.rsvp-page .cta,
body.rsvp-page button.cta,
body.auth-page .cta,
body.auth-page button.cta,
body.profile-page .cta,
body.profile-page button.cta {
  font-family: var(--font-display);
}

.rsvp-page-main {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100dvh;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: max(3.5rem, calc(2.5rem + env(safe-area-inset-top, 0))) var(--page-pad-x) 2rem;
}

.rsvp-card {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: var(--card-max);
  padding: clamp(1.35rem, 4vw, 2rem) var(--content-inset) 1.75rem;
  border-radius: calc(var(--radius) * 2);
  border: 1px solid rgba(58, 44, 27, 0.1);
  background: linear-gradient(165deg, rgba(237, 227, 211, 0.96), rgba(251, 247, 240, 0.92));
  box-shadow: var(--shadow-lift);
}


.rsvp-subtitle {
  margin: 0 0 1.5rem;
  color: var(--c-muted);
  font-size: 1rem;
}

.rsvp-form--full {
  display: grid;
  gap: 1.1rem;
}

.rsvp-field {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.rsvp-field.rsvp-attendance,
.rsvp-field.rsvp-inline {
  border: 0;
}

.rsvp-label {
  font-weight: 800;
  font-size: 0.92rem;
}

.rsvp-label em {
  font-style: normal;
  color: var(--c-warn);
}

.rsvp-hint {
  margin: 0;
  font-size: 0.88rem;
  color: var(--c-muted);
}

.rsvp-form--full input[type="text"],
.rsvp-form--full input[type="email"],
.rsvp-form--full input[type="tel"],
.rsvp-form--full input[type="password"],
.rsvp-form--full textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid rgba(58, 44, 27, 0.15);
  background: rgba(251, 247, 240, 0.95);
  font: inherit;
  color: var(--c-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rsvp-form--full textarea {
  min-height: 100px;
  resize: vertical;
}

.rsvp-form--full input:focus,
.rsvp-form--full textarea:focus {
  border-color: var(--c-gold);
  box-shadow: 0 0 0 3px var(--c-ring);
  outline: none;
}

.field-row {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 540px) {
  .field-row {
    grid-template-columns: 1fr 1fr;
  }
}

.rsvp-field legend.rsvp-label {
  padding: 0;
  margin: 0 0 0.15rem;
}

.check-grid {
  display: grid;
  gap: 0.55rem;
  width: 100%;
}

.check-tile {
  position: relative;
  display: block;
  cursor: pointer;
}

.check-tile input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.check-tile span {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 52px;
  padding: 0.75rem 1rem;
  border-radius: calc(var(--radius) * 1.5);
  border: 1px solid rgba(196, 154, 60, 0.38);
  background: rgba(248, 244, 236, 0.92);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(0.95rem, 2.4vw, 1.05rem);
  line-height: 1.35;
  color: var(--c-text);
  box-shadow:
    0 2px 10px rgba(58, 44, 27, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.18s ease;
}

.check-tile span::before {
  content: "";
  flex-shrink: 0;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 4px;
  border: 2px solid rgba(91, 110, 79, 0.45);
  background: rgba(251, 247, 240, 0.95);
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.check-tile:has(input[type="radio"]) span::before {
  border-radius: 50%;
}

.check-tile:hover span {
  border-color: rgba(196, 154, 60, 0.62);
  background: rgba(252, 250, 245, 0.98);
  transform: translateY(-1px);
}

.check-tile input:focus-visible + span {
  outline: none;
  border-color: var(--c-gold);
  box-shadow:
    0 2px 10px rgba(58, 44, 27, 0.08),
    0 0 0 3px var(--c-ring);
}

.check-tile input:checked + span {
  border-color: var(--c-forest);
  background: rgba(91, 110, 79, 0.1);
  box-shadow:
    0 2px 14px rgba(58, 44, 27, 0.1),
    0 0 0 2px rgba(196, 154, 60, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.check-tile input:checked + span::before {
  border-color: var(--c-forest);
  background: var(--c-forest);
  box-shadow: inset 0 0 0 3px #fbf7f0;
}

.check-tile:has(input[type="radio"]:checked) span::before {
  box-shadow: inset 0 0 0 4px #fbf7f0;
}

/* Чипы выбора дней (регистрация / профиль) */
.check-grid--chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.check-tile--chip {
  flex: 1 1 calc(50% - 0.25rem);
  min-width: 8.75rem;
}

.check-tile--chip span {
  justify-content: center;
  gap: 0.25rem;
  min-height: 44px;
  padding: 0.6rem 1rem;
  font-size: clamp(0.88rem, 2.2vw, 1rem);
  white-space: nowrap;
}

.check-tile--chip span::before {
  display: none;
}

.check-tile--chip:hover span {
  transform: translateY(-1px);
}

.check-tile--chip input:checked + span {
  border-color: var(--c-gold);
  background: linear-gradient(
    180deg,
    rgba(196, 154, 60, 0.22) 0%,
    rgba(91, 110, 79, 0.12) 100%
  );
  box-shadow:
    0 2px 12px rgba(58, 44, 27, 0.1),
    0 0 0 2px rgba(196, 154, 60, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

/* Станции отдыха — план на праздник */
.plan-stations {
  display: grid;
  gap: 1rem;
}

body.rsvp-page .plan-stations,
body.profile-page .plan-stations {
  margin-top: 1.25rem;
}

.plan-stations__title {
  margin: 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 3.2vw, 1.35rem);
  font-weight: 400;
  color: var(--c-text);
}

.plan-stations__grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 560px) {
  .plan-stations__grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: stretch;
  }
}

.plan-station {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 11.5rem;
  border-radius: calc(var(--radius) * 2);
  border: 2px dashed rgba(107, 93, 74, 0.35);
  background: rgba(248, 244, 236, 0.72);
  box-shadow: 0 2px 10px rgba(58, 44, 27, 0.05);
  cursor: pointer;
  transition:
    border-color 0.25s ease,
    border-style 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease,
    opacity 0.25s ease;
}

.plan-station.is-selected {
  border: 2px solid var(--c-forest);
  background: linear-gradient(
    165deg,
    rgba(237, 227, 211, 0.98) 0%,
    rgba(225, 236, 218, 0.55) 100%
  );
  box-shadow:
    0 4px 20px rgba(58, 44, 27, 0.12),
    0 0 0 3px rgba(196, 154, 60, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.plan-station__mark {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid rgba(107, 93, 74, 0.45);
  background: rgba(251, 247, 240, 0.95);
  pointer-events: none;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

.plan-station__mark-icon::before {
  content: "";
  display: block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: transparent;
}

.plan-station.is-selected .plan-station__mark {
  border-color: var(--c-forest);
  background: var(--c-forest);
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(91, 110, 79, 0.35);
}

.plan-station.is-selected .plan-station__mark-icon::before {
  content: "✓";
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  color: #fbf7f0;
}

.plan-station__head {
  display: block;
  width: 100%;
  margin: 0;
  padding: 1.15rem 1rem 0.85rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.plan-station__ribbon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 3vw, 1.15rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: none;
  color: var(--c-text);
  line-height: 1.35;
}

.plan-station__ribbon-line {
  flex: 1;
  max-width: 2.75rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196, 154, 60, 0.55), transparent);
}

.plan-station.is-selected .plan-station__ribbon {
  color: var(--c-forest);
}

.plan-station__body {
  display: grid;
  gap: 0.85rem;
  padding: 0 1.1rem 1.25rem;
}

.plan-station__date {
  margin: 0;
  cursor: pointer;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 2.5vw, 1.05rem);
  line-height: 1.4;
  color: var(--c-text);
  transition: color 0.2s ease;
}

.plan-station.is-selected .plan-station__date {
  color: var(--c-forest);
  font-weight: 700;
}

.plan-station__hint {
  margin: 0;
  text-align: center;
  font-family: var(--font-body);
  font-size: clamp(0.82rem, 2.4vw, 0.92rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.4;
}

.plan-station__hint--idle {
  color: var(--c-muted);
}

.plan-station.is-selected .plan-station__hint--idle {
  display: none;
}

.plan-station__date em {
  display: block;
  margin-top: 0.15rem;
  font-style: italic;
  font-size: 0.88em;
  color: var(--c-muted);
}

.plan-station__lodging {
  margin: 0;
  padding: 0;
  border: 0;
  display: none;
  gap: 0.65rem;
}

.plan-station__lodging:not([hidden]) {
  display: grid;
  animation: plan-lodging-in 0.4s ease;
}

.plan-station__lodging[hidden] {
  display: none !important;
}

@keyframes plan-lodging-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.plan-station__lodging legend.plan-station__lodging-q {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: clamp(0.88rem, 2.5vw, 0.98rem);
  font-weight: 700;
  line-height: 1.4;
  color: var(--c-muted);
  text-align: center;
}

.plan-station__choices {
  display: grid;
  gap: 0.55rem;
}

.plan-station__choices--yesno {
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.plan-choice {
  position: relative;
  display: block;
  cursor: pointer;
}

.plan-choice input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.plan-choice span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1rem;
  border-radius: calc(var(--radius) * 1.5);
  border: 1px solid rgba(58, 44, 27, 0.15);
  background: rgba(251, 247, 240, 0.95);
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 2.6vw, 1.08rem);
  font-weight: 400;
  line-height: 1.35;
  text-align: center;
  color: var(--c-text);
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.plan-choice input:checked + span {
  border-color: var(--c-forest);
  background: rgba(91, 110, 79, 0.12);
  box-shadow: 0 0 0 2px var(--c-ring);
}

.plan-choice input:checked + span::before {
  content: "✓ ";
  color: var(--c-forest);
}

.plan-save-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin-top: 0.25rem;
  padding: 0.7rem 1.25rem;
  border: 1px solid rgba(91, 110, 79, 0.4);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.6vw, 1.08rem);
  font-weight: 400;
  color: #fbf7f0;
  background: linear-gradient(180deg, #5f7354 0%, #4a5c42 52%, #3f5038 100%);
  box-shadow:
    0 2px 14px rgba(58, 44, 27, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: filter 0.18s ease, transform 0.18s ease;
}

.plan-save-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.plan-stations.is-confirmed .plan-save-btn {
  border-color: rgba(196, 154, 60, 0.55);
  background: linear-gradient(180deg, #ebe3d0 0%, #d9cdb5 52%, #cfc0a4 100%);
  color: #6b5d4a;
  box-shadow: 0 2px 12px rgba(58, 44, 27, 0.1);
}

.rsvp-after-plan {
  display: grid;
  gap: 1.1rem;
  opacity: 0;
  margin-top: 0;
  transition: opacity 0.45s ease, margin-top 0.45s ease;
}

.rsvp-after-plan.is-visible {
  opacity: 1;
  margin-top: 0.5rem;
}

.rsvp-after-plan[hidden] {
  display: none !important;
}

.wedding-help-offer {
  display: grid;
  gap: 1rem;
  padding: 1.1rem 1rem;
  border-radius: calc(var(--radius) * 2);
  border: 1px solid rgba(196, 154, 60, 0.38);
  background: rgba(248, 244, 236, 0.92);
  text-align: center;
  box-shadow: 0 2px 12px rgba(58, 44, 27, 0.06);
}

.wedding-help-offer__text {
  display: grid;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-size: clamp(0.92rem, 2.5vw, 1.02rem);
  line-height: 1.45;
  color: var(--c-text);
}

.wedding-help-offer__lead {
  margin: 0;
  font-size: clamp(1rem, 2.8vw, 1.12rem);
  font-weight: 700;
  color: var(--c-text);
}

.wedding-help-offer__text p {
  margin: 0;
  color: var(--c-muted);
}

.wants-help-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 0.75rem 1.25rem;
  border: 2px dashed rgba(107, 93, 74, 0.35);
  border-radius: calc(var(--radius) * 2);
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.6vw, 1.1rem);
  font-weight: 400;
  color: var(--c-text);
  background: rgba(251, 247, 240, 0.95);
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.18s ease;
}

.wants-help-btn:hover {
  border-color: rgba(196, 154, 60, 0.55);
  transform: translateY(-1px);
}

.wants-help-btn.is-active {
  border: 2px solid var(--c-forest);
  color: var(--c-forest);
  background: linear-gradient(
    165deg,
    rgba(237, 227, 211, 0.98) 0%,
    rgba(225, 236, 218, 0.55) 100%
  );
  box-shadow:
    0 2px 14px rgba(58, 44, 27, 0.1),
    0 0 0 3px rgba(196, 154, 60, 0.3);
}

.rsvp-after-plan:not([hidden]).is-visible {
  display: grid;
}

/* Плавное появление блока размещения (профиль) */
.lodging-reveal {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  margin: 0;
  transition:
    grid-template-rows 0.55s ease,
    opacity 0.5s ease,
    margin 0.5s ease;
}

.lodging-reveal.is-visible {
  grid-template-rows: 1fr;
  opacity: 1;
  margin: 0.35rem 0 0.15rem;
}

.lodging-reveal__inner {
  min-height: 0;
  overflow: hidden;
  display: grid;
  gap: 0.85rem;
}

.lodging-reveal__wave {
  height: 14px;
  margin: 0.15rem 0 0;
  opacity: 0.55;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 14' preserveAspectRatio='none'%3E%3Cpath fill='none' stroke='%23c49a3c' stroke-width='1.2' stroke-opacity='0.55' d='M0 7 Q30 2 60 7 T120 7 T180 7 T240 7'/%3E%3C/svg%3E")
    center / 100% 100% no-repeat;
}

.lodging-reveal__info {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.5rem 0.15rem 0;
}

.lodging-reveal__icon {
  flex-shrink: 0;
  font-size: 1.45rem;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(58, 44, 27, 0.12));
}

.lodging-reveal__hint {
  margin: 0.15rem 0 0;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--c-muted);
}

.rsvp-field--lodging {
  padding-top: 0.15rem;
}

@media (prefers-reduced-motion: reduce) {
  .lodging-reveal {
    transition: opacity 0.2s ease;
  }

  .lodging-reveal.is-visible {
    grid-template-rows: 1fr;
  }
}

@media (min-width: 400px) {
  .check-tile--chip {
    flex: 1 1 auto;
  }

  .check-tile--chip span {
    width: 100%;
  }
}

.team-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.team-btn {
  position: relative;
  cursor: pointer;
}

.team-btn input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.team-btn span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 1rem 0.6rem;
  border-radius: var(--radius);
  border: 2px solid rgba(58, 44, 27, 0.1);
  background: rgba(251, 247, 240, 0.9);
  font-weight: 800;
  text-align: center;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.team-btn input:checked + span {
  border-color: var(--c-gold);
  box-shadow: 0 0 0 3px var(--c-ring);
}

.team-btn:hover span {
  transform: translateY(-2px);
}

.team-crest {
  font-size: 2rem;
  line-height: 1;
}

.rsvp-pledge {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px dashed rgba(91, 110, 79, 0.45);
  background: rgba(91, 110, 79, 0.06);
}

.rsvp-pledge input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.2rem;
  accent-color: var(--c-forest);
}

.rsvp-warn-banner {
  display: none;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid rgba(194, 106, 90, 0.45);
  background: rgba(194, 106, 90, 0.1);
  color: var(--c-text);
  font-size: 0.92rem;
}

.rsvp-warn-banner.is-visible {
  display: flex;
}

.rsvp-warn-banner::before {
  content: "⚠️";
  flex-shrink: 0;
}

.rsvp-skip {
  text-align: center;
  margin-top: 0.5rem;
}

.rsvp-skip a {
  font-weight: 800;
}

.register-step {
  display: none;
  gap: inherit;
}

.register-step.is-active {
  display: grid;
}

.register-step[hidden] {
  display: none !important;
}

.register-step__nav {
  display: flex;
  justify-content: center;
  margin-top: 1.25rem;
}

.register-step__nav--final {
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.register-next-btn,
.register-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1rem, 2.6vw, 1.08rem);
  cursor: pointer;
  transition: filter 0.18s ease, transform 0.18s ease;
}

.register-next-btn {
  width: 100%;
  max-width: 360px;
  border: 1px solid rgba(196, 154, 60, 0.42);
  color: #6b5d4a;
  background: linear-gradient(180deg, #ebe3d0 0%, #d9cdb5 52%, #cfc0a4 100%);
  box-shadow:
    0 2px 14px rgba(58, 44, 27, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.register-next-btn:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
}

.register-back-btn {
  border: 1px solid rgba(91, 110, 79, 0.35);
  color: var(--c-forest);
  background: rgba(251, 247, 240, 0.9);
}

.register-back-btn:hover {
  filter: brightness(1.02);
}

.register-step__nav--final .register-submit-btn {
  flex: 1 1 200px;
  max-width: 360px;
}

.rsvp-submit {
  margin-top: 1rem;
  text-align: center;
}

.register-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 360px;
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  border: 1px solid rgba(196, 154, 60, 0.42);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1rem, 2.6vw, 1.08rem);
  letter-spacing: 0.02em;
  color: #6b5d4a;
  background: linear-gradient(180deg, #ebe3d0 0%, #d9cdb5 52%, #cfc0a4 100%);
  box-shadow:
    0 2px 14px rgba(58, 44, 27, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: filter 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.register-submit-btn:hover:not(:disabled) {
  filter: brightness(1.03);
  transform: translateY(-1px);
  box-shadow:
    0 4px 18px rgba(58, 44, 27, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.register-submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.rsvp-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem calc(0.65rem + env(safe-area-inset-bottom, 0));
  background: linear-gradient(180deg, rgba(251, 247, 240, 0.92), rgba(237, 227, 211, 0.98));
  border-top: 1px solid rgba(58, 44, 27, 0.12);
  box-shadow: 0 -8px 32px rgba(58, 44, 27, 0.12);
}

.rsvp-bar--inline {
  position: static;
  z-index: auto;
  box-shadow: none;
  border-top: 0;
  padding: 0;
  background: transparent;
}

.rsvp-bar .cta {
  flex: 1;
  max-width: 420px;
}

.rsvp-status {
  margin: 0;
  min-height: 1.25rem;
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--c-forest);
}

.register-submit-hint {
  margin: 0.5rem 0 0;
  text-align: center;
  font-size: 0.92rem;
  color: var(--c-warn);
}

.rsvp-status--error {
  color: var(--c-warn);
}

.rsvp-success {
  text-align: center;
  padding: 1rem 0;
}

.rsvp-success[hidden] {
  display: none;
}

.rsvp-success-crest {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.rsvp-success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  margin-top: 1rem;
}

.rsvp-link {
  display: inline-block;
  padding: 0.55rem 0.9rem;
  font-weight: 800;
  color: var(--c-forest);
  text-decoration: none;
  border-radius: var(--radius);
}

.rsvp-link:hover {
  background: rgba(91, 110, 79, 0.1);
}

.rsvp-when-here[hidden] {
  display: none !important;
}

/* ---------- misc details ---------- */

.lead {
  font-size: 1.05rem;
  color: var(--c-muted);
}

.pill {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(91, 110, 79, 0.12);
  color: var(--c-forest);
}

@media (max-width: 540px) {
  .countdown {
    grid-template-columns: repeat(2, 1fr);
  }

  .team-pick {
    grid-template-columns: 1fr;
  }

  .back-to-invite,
  .link-feather {
    font-size: 0.78rem;
    padding: 0.45rem 0.65rem;
  }

  .link-feather span:last-child {
    display: none;
  }
}

/* ============================================================
   Личный кабинет, аутентификация, гости, чат
   ============================================================ */

.invite-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 1.25rem;
}

.invite .invite-cta-row .invite-cta-secondary {
  flex: 1 1 13rem;
  min-width: 13rem;
  max-width: 14rem;
  justify-content: center;
  text-align: center;
}

@keyframes invite-cta-shimmer {
  0% {
    transform: translateX(-130%) skewX(-20deg);
  }
  55% {
    transform: translateX(130%) skewX(-20deg);
  }
  100% {
    transform: translateX(130%) skewX(-20deg);
  }
}

@keyframes invite-cta-glow {
  0%,
  100% {
    border-color: rgba(196, 154, 60, 0.35);
    box-shadow:
      0 2px 12px rgba(58, 44, 27, 0.08),
      0 0 12px rgba(196, 154, 60, 0.12);
  }
  50% {
    border-color: rgba(196, 154, 60, 0.65);
    box-shadow:
      0 4px 18px rgba(58, 44, 27, 0.12),
      0 0 22px rgba(196, 154, 60, 0.28);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cta--ghost,
  .invite-cta-secondary,
  button.cta.cta--ghost,
  button.cta.invite-cta-secondary,
  a.cta.cta--ghost,
  a.cta.invite-cta-secondary {
    animation: none;
  }

  .cta--ghost::before,
  .invite-cta-secondary::before,
  button.cta.cta--ghost::before,
  button.cta.invite-cta-secondary::before,
  a.cta.cta--ghost::before,
  a.cta.invite-cta-secondary::before {
    animation: none;
    display: none;
  }
}

.cta--ghost,
.invite-cta-secondary,
button.cta.cta--ghost,
button.cta.invite-cta-secondary,
a.cta.cta--ghost,
a.cta.invite-cta-secondary {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  font-weight: 400;
  background: rgba(248, 244, 236, 0.88);
  color: var(--c-text);
  border: 1px solid rgba(196, 154, 60, 0.48);
  box-shadow:
    0 2px 14px rgba(58, 44, 27, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.35) inset;
  animation: invite-cta-glow 9.6s ease-in-out infinite;
}

.cta--ghost::before,
.invite-cta-secondary::before,
button.cta.cta--ghost::before,
button.cta.invite-cta-secondary::before,
a.cta.cta--ghost::before,
a.cta.invite-cta-secondary::before {
  content: "";
  position: absolute;
  inset: -50% -80%;
  z-index: 0;
  background: linear-gradient(
    105deg,
    transparent 38%,
    rgba(255, 255, 255, 0.65) 48%,
    rgba(196, 154, 60, 0.45) 52%,
    transparent 62%
  );
  transform: translateX(-130%) skewX(-20deg);
  animation: invite-cta-shimmer 7.8s ease-in-out infinite;
  pointer-events: none;
}

.cta--ghost:hover,
.invite-cta-secondary:hover,
button.cta.cta--ghost:hover,
button.cta.invite-cta-secondary:hover,
a.cta.cta--ghost:hover,
a.cta.invite-cta-secondary:hover {
  filter: brightness(1.03);
  background: rgba(252, 250, 245, 0.94);
  transform: translateY(-1px);
  color: var(--c-text);
  box-shadow:
    0 2px 14px rgba(58, 44, 27, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.35) inset;
}

.cta--ghost:active,
.invite-cta-secondary:active,
button.cta.cta--ghost:active,
button.cta.invite-cta-secondary:active,
a.cta.cta--ghost:active,
a.cta.invite-cta-secondary:active {
  transform: translateY(0);
  filter: brightness(0.98);
  background: rgba(248, 244, 236, 0.88);
  box-shadow:
    0 2px 14px rgba(58, 44, 27, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.35) inset;
}

/* ---------- общий topbar для авторизованных страниц ---------- */
.guest-topbar {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  padding: 0.6rem 1rem;
  background: linear-gradient(180deg, rgba(251, 247, 240, 0.92), rgba(237, 227, 211, 0.78));
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid rgba(58, 44, 27, 0.08);
}

.guest-topbar__nav {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.guest-topbar__menu-slot {
  position: relative;
  flex: 0 0 auto;
  z-index: 25;
}

.topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--c-surface-strong);
  border-radius: 999px;
  background: rgba(251, 247, 240, 0.92);
  color: var(--c-text);
  font-weight: 700;
  font-size: 0.9rem;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease, color 120ms ease;
}

.topbar-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.topbar-link.is-active {
  background: rgba(91, 110, 79, 0.18);
  color: var(--c-text);
  border-color: rgba(91, 110, 79, 0.45);
}

/* Меню шестерёнки: профиль и выход */
.topbar-menu {
  position: relative;
  flex: 0 0 auto;
}

.topbar-gear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--c-surface-strong);
  border-radius: 999px;
  background: rgba(251, 247, 240, 0.92);
  color: var(--c-text);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.topbar-gear:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.topbar-gear[aria-expanded="true"] {
  background: rgba(91, 110, 79, 0.18);
  border-color: rgba(91, 110, 79, 0.45);
}

.topbar-menu__popup {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 11rem;
  padding: 0.35rem;
  background: #fffcf6;
  border: 1px solid rgba(58, 44, 27, 0.14);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(58, 44, 27, 0.16);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topbar-menu__popup[hidden] {
  display: none !important;
}

.topbar-menu__item {
  display: block;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--c-text);
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 120ms ease;
}

.topbar-menu__item:hover {
  background: rgba(91, 110, 79, 0.1);
}

.topbar-menu__item.is-active {
  background: rgba(91, 110, 79, 0.14);
}

.topbar-menu__item--danger {
  color: var(--c-warn);
}

.topbar-menu__item--danger:hover {
  background: rgba(194, 106, 90, 0.1);
}

.topbar-link--logout {
  color: var(--c-warn);
  border-color: rgba(194, 106, 90, 0.45);
}

.topbar-link--logout:hover {
  background: rgba(194, 106, 90, 0.08);
}

@media (max-width: 540px) {
  .guest-topbar {
    padding: 0.5rem 0.65rem;
  }

  .guest-topbar__nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    scrollbar-width: none;
  }

  .guest-topbar__nav::-webkit-scrollbar {
    display: none;
  }

  .topbar-link {
    padding: 0.45rem 0.75rem;
    font-size: 0.82rem;
    flex-shrink: 0;
  }
}

/* ---------- авторизация (login.html) ---------- */
.auth-page-main {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: min(420px, var(--card-max));
  margin: max(2.5rem, calc(1.5rem + env(safe-area-inset-top, 0))) auto 0;
  padding: 0 var(--page-pad-x) max(3rem, env(safe-area-inset-bottom, 0));
}

.auth-card {
  position: relative;
  overflow: hidden;
  width: 100%;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.96), rgba(237, 227, 211, 0.92));
  border-radius: 20px;
  padding: clamp(1.25rem, 4vw, 1.75rem) var(--content-inset);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(58, 44, 27, 0.08);
}


.auth-subtitle {
  margin: 0 0 1.25rem;
  color: var(--c-muted);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
  font: inherit;
}

.auth-form .cta {
  align-self: flex-start;
  margin-top: 0.5rem;
}


.auth-foot {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  color: var(--c-muted);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0 0.85rem;
  color: var(--c-muted);
  font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(58, 44, 27, 0.12);
}

.auth-google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.72rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(58, 44, 27, 0.18);
  background: #fff;
  color: var(--c-ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(58, 44, 27, 0.08);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.auth-google-btn:hover {
  background: #fafafa;
  box-shadow: 0 2px 6px rgba(58, 44, 27, 0.1);
}

.auth-google-btn:active {
  transform: translateY(1px);
}

.auth-google-btn:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 2px;
}

.auth-google-btn__icon {
  display: inline-flex;
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}

.auth-google-btn__icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- общая дроп-зона аватара ---------- */
.rsvp-field--account,
.rsvp-field--avatar {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.avatar-dropzone {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem;
  border: 1.5px dashed rgba(91, 110, 79, 0.45);
  border-radius: 14px;
  background: rgba(255, 252, 246, 0.6);
  transition: background 120ms ease, border-color 120ms ease;
}

.avatar-dropzone.is-drag {
  border-color: var(--c-gold);
  background: rgba(196, 154, 60, 0.08);
}

.avatar-preview {
  flex: 0 0 auto;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgba(91, 110, 79, 0.18);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--c-forest);
  border: 2px solid rgba(255, 252, 246, 0.85);
  box-shadow: var(--shadow-soft);
}

.avatar-preview.has-image {
  background-color: transparent;
}

.avatar-dropzone__text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.92rem;
  color: var(--c-muted);
}

.avatar-dropzone__btn {
  display: inline;
  cursor: pointer;
}

.avatar-dropzone__btn span {
  text-decoration: underline;
  color: var(--c-forest);
  font-weight: 800;
}

/* ---------- профиль (profile.html) ---------- */
.profile-card {
  padding-bottom: 1.5rem;
}

.profile-view[hidden],
#profile-form[hidden] {
  display: none;
}

.profile-view__head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin: 0.5rem 0 1.25rem;
}

.profile-view__id {
  flex: 1;
  min-width: 0;
}

.profile-view__avatar .chat-avatar--lg {
  flex-shrink: 0;
  width: 88px;
  height: 88px;
  font-size: 1.6rem;
}

.profile-view__id h2 {
  margin: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.profile-view__id p {
  margin: 0.15rem 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.profile-view__list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 1rem;
  margin: 0;
}

.profile-view__list > div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  background: rgba(255, 252, 246, 0.65);
  border: 1px solid rgba(58, 44, 27, 0.06);
}

.profile-view__wishes {
  grid-column: 1 / -1;
}

.profile-view__list dt {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c-muted);
}

.profile-view__list dd {
  margin: 0;
  color: var(--c-text);
}

#view-lodging {
  white-space: pre-line;
}

.profile-view__actions:not([hidden]),
.profile-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1.25rem;
}

.profile-view__actions[hidden] {
  display: none !important;
}

@media (max-width: 640px) {
  .profile-view__list {
    grid-template-columns: 1fr;
  }

  .profile-view__avatar .chat-avatar--lg {
    width: 72px;
    height: 72px;
    font-size: 1.35rem;
  }

  .profile-view__id h2 {
    font-size: clamp(1.05rem, 4.5vw, 1.25rem);
  }

  .profile-view__id p {
    font-size: 0.88rem;
  }
}

/* ---------- список гостей (guests.html) ---------- */
.guests-page {
  padding-bottom: 4rem;
}

.guests-main {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: min(1080px, calc(100vw - 2 * var(--page-pad-x)));
  margin: 0 auto;
  padding: max(1.25rem, env(safe-area-inset-top, 0)) var(--page-pad-x) 4rem;
}

.guests-hero {
  text-align: center;
  margin-bottom: 1.5rem;
}


.guests-subtitle {
  color: var(--c-muted);
  margin: 0 0 1rem;
  white-space: pre-line;
}

.guests-search {
  max-width: 360px;
  margin: 0 auto;
}

.guest-list-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  grid-auto-rows: auto;
  gap: 1rem;
  align-items: stretch;
}

.guest-card {
  display: flex;
  flex-direction: column;
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
  min-height: 0;
  position: relative;
  z-index: 1;
}

.guest-card:has(.guest-card__info.is-open) {
  z-index: 5;
}

@media (hover: hover) {
  .guest-card:has(.guest-card__info:hover) {
    z-index: 5;
  }
}

.guest-card__shell {
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 18rem;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.96), rgba(237, 227, 211, 0.92));
  border-radius: 16px;
  border: 1px solid rgba(58, 44, 27, 0.08);
  box-shadow: var(--shadow-soft);
  overflow: visible;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.guest-card__shell:has(.guest-card__link:hover),
.guest-card__shell:has(.guest-card__link:focus-visible) {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(58, 44, 27, 0.18);
  border-color: rgba(196, 154, 60, 0.45);
}

.guest-card--declined .guest-card__shell {
  opacity: 0.78;
}

.guest-card__link {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 0 1 auto;
  min-height: 0;
  padding: 1rem 2.75rem 1rem 1rem;
  width: 100%;
  overflow-y: auto;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  color: inherit;
  text-decoration: none;
}

.guest-card__link:hover,
.guest-card__link:focus-visible {
  text-decoration: none;
}

.guest-card__link:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: -2px;
}

.guest-card__head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.guest-card__id h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--c-text);
}

.guest-card__team {
  margin: 0.1rem 0 0;
  font-size: 0.85rem;
  color: var(--c-muted);
}

.guest-card__chips {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.guest-card__info {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 4;
}

.guest-card__info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid rgba(58, 44, 27, 0.14);
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.95);
  color: var(--c-muted);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.guest-card__info-btn:hover,
.guest-card__info-btn:focus-visible {
  color: var(--c-forest);
  background: rgba(91, 110, 79, 0.12);
  box-shadow: var(--shadow-lift);
  transform: translateY(-1px);
}

.guest-card__info-btn:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 2px;
}

.guest-card__info-popover {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: min(16rem, calc(100vw - 2.5rem));
  max-width: 18rem;
  padding: 0.55rem;
  background: #fffcf6;
  border: 1px solid rgba(58, 44, 27, 0.14);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(58, 44, 27, 0.16);
  z-index: 30;
}

.guest-card__info.is-open .guest-card__info-popover {
  display: block;
}

@media (hover: hover) {
  .guest-card__info:hover .guest-card__info-popover,
  .guest-card__info:focus-within .guest-card__info-popover {
    display: block;
  }
}

.guest-chip {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(91, 110, 79, 0.1);
  color: var(--c-forest);
  font-size: 0.78rem;
  font-weight: 700;
}

.guest-chip--day {
  background: rgba(196, 154, 60, 0.15);
  color: var(--c-text);
}

.guest-chip--help {
  border-color: rgba(196, 154, 60, 0.45);
  background: rgba(196, 154, 60, 0.15);
  color: var(--c-text);
}

.guest-chip--muted {
  background: rgba(58, 44, 27, 0.08);
  color: var(--c-muted);
}

.guest-card__contacts {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0 1rem 0.65rem;
  font-size: 0.88rem;
  flex-shrink: 0;
}

.guest-card__contact {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.35rem 0.5rem;
  align-items: baseline;
}

.guest-card__contact-label {
  color: var(--c-muted);
  font-weight: 700;
  font-size: 0.78rem;
}

.guest-card__contact-value {
  color: var(--c-forest);
  font-weight: 700;
  text-decoration: none;
  word-break: break-word;
}

.guest-card__contact-value:hover,
.guest-card__contact-value:focus-visible {
  text-decoration: underline;
}

.guest-card__about {
  margin: 0;
  color: var(--c-text);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.guest-card__actions {
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
  margin-top: auto;
  padding: 0 1rem 1rem;
}

.guest-card__write {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(91, 110, 79, 0.45);
  background: rgba(91, 110, 79, 0.1);
  color: var(--c-ink);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 120ms ease, transform 120ms ease;
}

.guest-card__write:hover,
.guest-card__write:focus-visible {
  background: rgba(91, 110, 79, 0.18);
  transform: translateY(-1px);
}

.guest-card__write:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 2px;
}

.guest-card__wishes {
  margin: 0;
  padding-left: 0.5rem;
  border-left: 3px solid rgba(196, 154, 60, 0.45);
  color: var(--c-muted);
  font-style: italic;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* ---------- аватары для чата и карточек ---------- */
.chat-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(91, 110, 79, 0.22);
  color: var(--c-text);
  font-weight: 800;
  font-size: 0.85rem;
  overflow: hidden;
  flex: 0 0 auto;
}

.chat-avatar--lg {
  width: 64px;
  height: 64px;
  font-size: 1.2rem;
}

.chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-avatar--tone-a { background: rgba(196, 154, 60, 0.28); }
.chat-avatar--tone-b { background: rgba(91, 110, 79, 0.28); }
.chat-avatar--tone-c { background: rgba(155, 126, 166, 0.28); }
.chat-avatar--tone-d { background: rgba(194, 106, 90, 0.22); }
.chat-avatar--tone-e { background: rgba(207, 217, 196, 0.65); }

/* ---------- чат (chat.html) ---------- */
.chat-page {
  margin: 0;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  min-height: -webkit-fill-available;
  overflow: hidden;
}

.chat-app {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: min(300px, 34vw) minmax(0, 1fr);
  background: linear-gradient(180deg, rgba(251, 247, 240, 0.65), rgba(237, 227, 211, 0.55));
  z-index: 1;
  min-height: 100svh;
  min-height: -webkit-fill-available;
}

.chat-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(91, 110, 79, 0.12);
  border-right: 1px solid rgba(58, 44, 27, 0.1);
}

.chat-sidebar__head,
.chat-header {
  --chat-head-pad-y: 0.65rem;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  min-height: calc(4.5rem + env(safe-area-inset-top, 0));
  padding: calc(var(--chat-head-pad-y) + env(safe-area-inset-top, 0)) 1rem var(--chat-head-pad-y);
  background: linear-gradient(180deg, rgba(91, 110, 79, 0.95), rgba(91, 110, 79, 0.82));
  color: #fbf7f0;
}

.chat-sidebar__head {
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
}

.chat-sidebar__head strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.15;
}

.chat-sidebar__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chat-sidebar__btn {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(251, 247, 240, 0.45);
  background: rgba(251, 247, 240, 0.14);
  color: #fbf7f0;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: background 120ms ease;
}

.chat-sidebar__btn:hover {
  background: rgba(251, 247, 240, 0.26);
}

.chat-group-dialog {
  border: none;
  padding: 0;
  max-width: min(420px, calc(100vw - 2rem));
  width: 100%;
  background: transparent;
}

.chat-group-dialog::backdrop {
  background: rgba(58, 44, 27, 0.45);
}

.chat-group-dialog__panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.1rem 1.1rem;
  border-radius: calc(var(--radius) * 2);
  background: var(--c-bg);
  color: var(--c-text);
  max-height: min(85vh, 640px);
}

.chat-group-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.chat-group-dialog__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
}

.chat-group-dialog__close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--c-muted);
}

.chat-group-dialog__list {
  flex: 1 1 auto;
  min-height: 8rem;
  max-height: min(42vh, 320px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.25rem 0;
}

.chat-group-dialog__guest {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.5rem;
  border-radius: var(--radius);
  cursor: pointer;
}

.chat-group-dialog__guest:hover {
  background: rgba(91, 110, 79, 0.1);
}

.chat-group-dialog__guest input {
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
}

.chat-group-dialog__guest-name {
  flex: 1 1 auto;
  font-weight: 700;
  font-size: 0.92rem;
}

.chat-group-dialog__guest-av .chat-avatar {
  width: 36px;
  height: 36px;
  font-size: 0.85rem;
}

.chat-group-dialog__empty {
  margin: 0.5rem 0;
  font-size: 0.88rem;
  color: var(--c-muted);
  text-align: center;
}

.chat-group-dialog__actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.chat-group-dialog__actions .cta {
  min-width: 7rem;
}

.chat-room--custom .chat-room__icon {
  background: rgba(155, 126, 166, 0.22);
}

.chat-room-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0.35rem 0;
}

.chat-room {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.7rem 1rem;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: var(--c-ink);
  transition: background 120ms ease;
}

.chat-room:hover {
  background: rgba(91, 110, 79, 0.1);
}

.chat-room.is-active {
  background: rgba(91, 110, 79, 0.18);
}

.chat-room-item {
  display: flex;
  align-items: stretch;
  background: transparent;
  transition: background 120ms ease;
}

.chat-room-item:hover {
  background: rgba(91, 110, 79, 0.1);
}

.chat-room-item.is-active {
  background: rgba(91, 110, 79, 0.18);
}

.chat-room-item .chat-room {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
}

.chat-room-item:hover .chat-room,
.chat-room-item.is-active .chat-room {
  background: transparent;
}

.chat-room__invite {
  flex: 0 0 auto;
  align-self: center;
  margin: 0 0.75rem 0 0;
  padding: 0.35rem 0;
  border: none;
  background: transparent;
  color: var(--c-muted);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: right;
  cursor: pointer;
  transition: color 120ms ease;
  max-width: 5.75rem;
  white-space: normal;
}

.chat-room__invite:hover {
  color: var(--c-forest);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.chat-room-item:hover .chat-room__invite,
.chat-room-item.is-active .chat-room__invite {
  color: var(--c-text);
}

.chat-room__icon {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.35rem;
  background: rgba(91, 110, 79, 0.2);
}

.chat-room--helpers .chat-room__icon {
  background: rgba(201, 162, 39, 0.25);
}

.chat-room__icon--avatar {
  padding: 0;
  background: transparent;
  overflow: hidden;
}

.chat-room__icon--avatar .chat-avatar {
  width: 48px;
  height: 48px;
  font-size: 1rem;
}

.chat-room--dm .chat-room__icon:not(.chat-room__icon--avatar) {
  background: rgba(91, 110, 79, 0.22);
}

.chat-room__text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.chat-room__title {
  font-weight: 800;
  font-size: 0.95rem;
}

.chat-room__subtitle {
  font-size: 0.78rem;
  color: var(--c-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-pane {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  min-height: 0;
}

.chat-header__title--back {
  cursor: pointer;
}

@media (max-width: 768px) {
  .chat-app {
    grid-template-columns: 1fr;
  }

  .chat-app--rooms .chat-pane {
    display: none;
  }

  .chat-app--chat .chat-sidebar {
    display: none;
  }
}

.chat-header {
  gap: 0.65rem;
  padding-left: 0.9rem;
  padding-right: 0.9rem;
  box-shadow: 0 4px 14px rgba(58, 44, 27, 0.18);
}

.chat-header__title {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.chat-header__title strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
}

.chat-header__title span {
  font-size: 0.78rem;
  opacity: 0.85;
}

.chat-header__actions {
  display: flex;
  flex: 1;
  min-width: 0;
  gap: 0.25rem;
}

.chat-header__menu-slot {
  position: relative;
  flex: 0 0 auto;
  z-index: 25;
}

.chat-header__actions .topbar-link {
  color: #fbf7f0;
  background: rgba(255, 252, 246, 0.14);
  border-color: rgba(255, 252, 246, 0.3);
}

.chat-header__actions .topbar-link:hover {
  background: rgba(255, 252, 246, 0.22);
  box-shadow: none;
  transform: none;
}

.chat-header__actions .topbar-link.is-active {
  background: rgba(255, 252, 246, 0.32);
  color: #fff;
  border-color: rgba(255, 252, 246, 0.45);
}

.chat-header__actions .topbar-link--logout {
  color: rgba(255, 220, 210, 0.95);
  border-color: rgba(255, 220, 210, 0.45);
}

.chat-header__actions .topbar-link--logout:hover {
  background: rgba(255, 220, 210, 0.18);
}

.chat-header__actions .topbar-gear {
  color: #fbf7f0;
  background: rgba(255, 252, 246, 0.14);
  border-color: rgba(255, 252, 246, 0.3);
}

.chat-header__actions .topbar-gear:hover {
  background: rgba(255, 252, 246, 0.22);
  box-shadow: none;
  transform: none;
}

.chat-header__actions .topbar-gear[aria-expanded="true"] {
  background: rgba(255, 252, 246, 0.32);
  border-color: rgba(255, 252, 246, 0.45);
}

.chat-header__actions .topbar-menu__popup {
  background: rgba(36, 48, 38, 0.98);
  border-color: rgba(255, 252, 246, 0.2);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
}

.chat-header__actions .topbar-menu__item {
  color: #fbf7f0;
}

.chat-header__actions .topbar-menu__item:hover {
  background: rgba(255, 252, 246, 0.12);
}

.chat-header__actions .topbar-menu__item.is-active {
  background: rgba(255, 252, 246, 0.18);
}

.chat-header__actions .topbar-menu__item--danger {
  color: rgba(255, 200, 190, 0.98);
}

.chat-header__actions .topbar-menu__item--danger:hover {
  background: rgba(194, 106, 90, 0.22);
}

.chat-messages {
  overflow-y: auto;
  padding: 1rem 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  scroll-behavior: smooth;
}

.chat-empty {
  margin: auto;
  text-align: center;
  color: var(--c-muted);
  max-width: 280px;
}

.chat-day-divider {
  align-self: center;
  margin: 0.6rem 0 0.2rem;
  padding: 0.2rem 0.7rem;
  background: rgba(58, 44, 27, 0.08);
  color: var(--c-muted);
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 999px;
}

.chat-bubble {
  display: flex;
  gap: 0.45rem;
  align-items: flex-end;
  max-width: 82%;
}

.chat-bubble--mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-bubble--other {
  align-self: flex-start;
}

.chat-bubble--grouped {
  margin-top: -0.25rem;
}

.chat-bubble__avatar {
  flex: 0 0 auto;
}

.chat-bubble__avatar--placeholder {
  width: 36px;
  height: 36px;
  visibility: hidden;
}

.chat-bubble__avatar--link {
  display: inline-flex;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 120ms ease;
}

.chat-bubble__avatar--link:hover,
.chat-bubble__avatar--link:focus-visible {
  transform: scale(1.05);
}

.chat-bubble__avatar--link:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 2px;
}

.chat-bubble__author--link {
  text-decoration: none;
}

.chat-bubble__author--link:hover {
  text-decoration: underline;
  text-decoration-color: rgba(91, 110, 79, 0.5);
  text-underline-offset: 2px;
}

.chat-bubble__body {
  position: relative;
  padding: 0.5rem 0.7rem 1.4rem;
  border-radius: 16px;
  background: rgba(255, 252, 246, 0.95);
  color: var(--c-text);
  box-shadow: 0 6px 16px rgba(58, 44, 27, 0.08);
  word-break: break-word;
  white-space: pre-wrap;
  font-size: 0.96rem;
}

.chat-bubble--mine .chat-bubble__body {
  background: linear-gradient(180deg, #f3e3b8, #e7cf85);
  color: var(--c-text);
}

.chat-bubble__author {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--c-forest);
}

.chat-bubble__author--mine {
  text-align: right;
  color: var(--c-muted);
  font-weight: 700;
  font-size: 0.5em;
  line-height: 1.2;
}

.chat-bubble--standalone-media .chat-bubble__author {
  margin-bottom: 0.3rem;
  padding: 0 0.1rem;
}

.chat-bubble--standalone-media.chat-bubble--mine .chat-bubble__author--mine {
  text-align: right;
}

.chat-bubble__text-row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.2rem 0.45rem;
  max-width: 100%;
}

.chat-bubble__text-row .chat-bubble__text {
  flex: 0 1 auto;
  min-width: 0;
}

.chat-bubble__text-row .chat-bubble__meta {
  position: static;
  flex: 0 0 auto;
  white-space: nowrap;
  margin: 0;
}

.chat-bubble__body:has(.chat-bubble__text-row) {
  padding-bottom: 0.45rem;
}

.chat-bubble__text {
  font-size: 1em;
  line-height: 1.4;
  font-family: inherit, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.chat-bubble__meta {
  font-size: 0.5em;
  line-height: 1.2;
}

.chat-bubble__time {
  white-space: nowrap;
}

.chat-bubble__image {
  display: block;
  padding: 0;
  margin: 0 0 0.3rem;
  border: 0;
  background: none;
  cursor: zoom-in;
  border-radius: 12px;
  overflow: hidden;
}

.chat-bubble__image img {
  display: block;
  max-width: 280px;
  max-height: 320px;
  object-fit: cover;
  border-radius: 12px;
}

.chat-bubble__voice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.35rem;
  max-width: min(280px, 88vw);
  background: transparent;
}

.chat-bubble__voice audio {
  flex: 1 1 auto;
  min-width: 180px;
  max-width: 100%;
  height: 36px;
}

.chat-bubble__voice-dur {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--c-muted);
  font-variant-numeric: tabular-nums;
}

.chat-bubble--mine .chat-bubble__voice {
  margin-left: auto;
}

/* ---------- запись медиа (удержание круга) ---------- */
.media-hold-dialog {
  border: 0;
  padding: 0;
  margin: 0;
  max-width: 100%;
  width: 100%;
  height: 100%;
  max-height: none;
  background: transparent;
  overflow: visible;
}

.media-hold-dialog[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  position: fixed;
  inset: 0;
  z-index: 2000;
}

.media-hold-dialog::backdrop {
  background: rgba(31, 27, 22, 0.78);
}

.media-hold-dialog__hint {
  margin: 0;
  padding: 0 1.25rem;
  max-width: 320px;
  text-align: center;
  font-size: 0.88rem;
  line-height: 1.35;
  color: rgba(251, 247, 240, 0.92);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.media-hold-dialog__trigger {
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.media-hold-dialog__trigger:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 6px;
  border-radius: 50%;
}

.media-hold-dialog__ring {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(280px, 72vw);
  height: min(280px, 72vw);
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(196, 154, 60, 0.65);
  background: #1a2018;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  transition: border-color 150ms ease, transform 150ms ease;
}

.media-hold-dialog__ring--video video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.media-hold-dialog__ring--voice {
  background: rgba(91, 110, 79, 0.25);
}

.media-hold-dialog__mic-icon {
  font-size: 3.5rem;
  line-height: 1;
  pointer-events: none;
}

.media-hold-dialog__ring.is-recording {
  border-color: rgba(194, 106, 90, 0.9);
  transform: scale(1.03);
  animation: mediaHoldPulse 1s ease-in-out infinite;
}

@keyframes mediaHoldPulse {
  0%, 100% { box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45); }
  50% { box-shadow: 0 14px 48px rgba(194, 106, 90, 0.35); }
}

.media-hold-dialog__timer {
  position: absolute;
  left: 50%;
  bottom: 10%;
  transform: translateX(-50%);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fbf7f0;
  font-size: 0.82rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  z-index: 2;
}

.chat-bubble__video-note {
  position: relative;
  width: min(220px, 58vw);
  aspect-ratio: 1;
  margin: 0 0 0.35rem;
  border-radius: 50%;
  overflow: hidden;
  background: #2a3228;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(58, 44, 27, 0.22);
}

.chat-bubble__video-note video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-bubble__video-note-dur {
  position: absolute;
  right: 0.45rem;
  bottom: 0.45rem;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fbf7f0;
  font-size: 0.72rem;
  font-weight: 700;
  pointer-events: none;
}

.chat-bubble--mine .chat-bubble__video-note {
  margin-left: auto;
}

/* видео/голос без прямоугольного пузыря (как в Telegram) */
.chat-bubble--standalone-media .chat-bubble__body--standalone-media {
  background: transparent;
  box-shadow: none;
  padding: 0;
  color: inherit;
}

.chat-bubble--standalone-media.chat-bubble--mine .chat-bubble__body--standalone-media {
  background: transparent;
}

.chat-bubble--standalone-media .chat-bubble__video-note {
  margin: 0;
}

.chat-bubble--standalone-media .chat-bubble__voice {
  margin: 0;
}

.chat-bubble--standalone-media .chat-bubble__body--standalone-media:has(.chat-bubble__video-note) {
  display: inline-grid;
  width: min(220px, 58vw);
}

.chat-bubble--standalone-media .chat-bubble__body--standalone-media:has(.chat-bubble__video-note) .chat-bubble__video-note,
.chat-bubble--standalone-media .chat-bubble__body--standalone-media:has(.chat-bubble__video-note) .chat-bubble__meta,
.chat-bubble--standalone-media .chat-bubble__body--standalone-media:has(.chat-bubble__video-note) .chat-bubble__menu {
  grid-area: 1 / 1;
}

.chat-bubble--standalone-media .chat-bubble__body--standalone-media:has(.chat-bubble__video-note) .chat-bubble__meta {
  position: static;
  align-self: end;
  justify-self: start;
  margin: 0 0 0.5rem 0.55rem;
  z-index: 2;
  font-size: 0.5em;
  font-weight: 700;
  color: #fbf7f0;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.65);
  opacity: 1;
  pointer-events: none;
}

.chat-bubble--standalone-media .chat-bubble__body--standalone-media:has(.chat-bubble__video-note) .chat-bubble__meta .chat-bubble__edited {
  color: inherit;
}

.chat-bubble--standalone-media .chat-bubble__body--standalone-media:has(.chat-bubble__video-note) .chat-bubble__menu {
  position: relative;
  align-self: start;
  justify-self: end;
  margin: 0.35rem 0.35rem 0 0;
  z-index: 3;
  opacity: 0;
}

.chat-bubble--standalone-media .chat-bubble__body--standalone-media:has(.chat-bubble__video-note):hover .chat-bubble__menu,
.chat-bubble--standalone-media .chat-bubble__body--standalone-media:has(.chat-bubble__video-note) .chat-bubble__menu:focus-within,
.chat-bubble--standalone-media .chat-bubble__body--standalone-media:has(.chat-bubble__video-note) .chat-bubble__menu-popup.is-open {
  opacity: 1;
}

.chat-bubble--standalone-media .chat-bubble__body--standalone-media:has(.chat-bubble__video-note) .chat-bubble__menu-btn {
  background: rgba(0, 0, 0, 0.45);
  color: #fbf7f0;
}

.chat-bubble--standalone-media .chat-bubble__body--standalone-media:has(.chat-bubble__video-note) .chat-bubble__menu-btn:hover {
  background: rgba(0, 0, 0, 0.62);
}

/* голос: полоса плеера без пузыря; время — под полосой */
.chat-bubble--standalone-media .chat-bubble__body--standalone-media:has(.chat-bubble__voice):not(:has(.chat-bubble__video-note)) {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  max-width: min(280px, 88vw);
}

.chat-bubble--standalone-media.chat-bubble--other .chat-bubble__body--standalone-media:has(.chat-bubble__voice):not(:has(.chat-bubble__video-note)) {
  align-items: flex-start;
}

.chat-bubble--standalone-media .chat-bubble__body--standalone-media:has(.chat-bubble__voice):not(:has(.chat-bubble__video-note)) .chat-bubble__meta {
  position: static;
  display: flex;
  justify-content: flex-end;
  margin-top: 0.2rem;
  padding: 0;
  font-size: 0.5em;
  color: var(--c-muted);
  text-shadow: none;
  opacity: 0.9;
  pointer-events: none;
}

.chat-bubble--standalone-media.chat-bubble--other .chat-bubble__body--standalone-media:has(.chat-bubble__voice):not(:has(.chat-bubble__video-note)) .chat-bubble__meta {
  justify-content: flex-start;
}

.chat-bubble--standalone-media .chat-bubble__body--standalone-media:has(.chat-bubble__voice):not(:has(.chat-bubble__video-note)) .chat-bubble__menu {
  position: absolute;
  top: 0;
  right: 0;
  opacity: 0;
}

.chat-bubble--standalone-media .chat-bubble__body--standalone-media:has(.chat-bubble__voice):not(:has(.chat-bubble__video-note)):hover .chat-bubble__menu,
.chat-bubble--standalone-media .chat-bubble__body--standalone-media:has(.chat-bubble__voice):not(:has(.chat-bubble__video-note)) .chat-bubble__menu:focus-within,
.chat-bubble--standalone-media .chat-bubble__body--standalone-media:has(.chat-bubble__voice):not(:has(.chat-bubble__video-note)) .chat-bubble__menu-popup.is-open {
  opacity: 1;
}

.chat-bubble__body > .chat-bubble__meta {
  position: absolute;
  right: 0.6rem;
  bottom: 0.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  color: var(--c-muted);
  opacity: 0.9;
  white-space: nowrap;
}

.chat-bubble--mine .chat-bubble__meta {
  color: rgba(58, 44, 27, 0.62);
}

.chat-bubble__ticks {
  font-size: 1em;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.14em;
}

.chat-bubble__ticks--sent {
  color: rgba(58, 44, 27, 0.42);
}

.chat-bubble__ticks--read {
  color: #4a8fd4;
}

.chat-bubble--standalone-media .chat-bubble__body--standalone-media:has(.chat-bubble__video-note) .chat-bubble__ticks--sent {
  color: rgba(251, 247, 240, 0.75);
}

.chat-bubble--standalone-media .chat-bubble__body--standalone-media:has(.chat-bubble__video-note) .chat-bubble__ticks--read {
  color: #9ec9f5;
}

.chat-bubble--enter {
  animation: chatBubbleIn 180ms ease-out;
}

@keyframes chatBubbleIn {
  from { transform: translateY(6px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

/* «изменено» — мелкий лейбл рядом со временем */
.chat-bubble__edited {
  font-style: italic;
  margin-right: 0.35rem;
  opacity: 0.85;
}

/* меню «···» на собственных сообщениях */
.chat-bubble__menu {
  position: absolute;
  top: 4px;
  right: 6px;
  opacity: 0;
  transition: opacity 120ms ease;
}

.chat-bubble--mine .chat-bubble__body:hover .chat-bubble__menu,
.chat-bubble__menu:focus-within,
.chat-bubble__menu-popup.is-open {
  opacity: 1;
}

.chat-bubble__menu-btn {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: rgba(58, 44, 27, 0.18);
  color: var(--c-text);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.chat-bubble__menu-btn:hover {
  background: rgba(58, 44, 27, 0.32);
}

.chat-bubble__menu-popup {
  position: absolute;
  top: 28px;
  right: 0;
  min-width: 144px;
  background: #fffcf6;
  border: 1px solid rgba(58, 44, 27, 0.18);
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(58, 44, 27, 0.18);
  display: none;
  flex-direction: column;
  padding: 4px;
  z-index: 10;
}

.chat-bubble__menu-popup.is-open {
  display: flex;
}

.chat-bubble__menu-item {
  display: block;
  width: 100%;
  padding: 0.5rem 0.7rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--c-text);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.chat-bubble__menu-item:hover {
  background: rgba(91, 110, 79, 0.12);
}

.chat-bubble__menu-item--danger {
  color: var(--c-warn);
}

.chat-bubble__menu-item--danger:hover {
  background: rgba(194, 106, 90, 0.12);
}

/* для тач-устройств меню всегда видимо */
@media (hover: none) {
  .chat-bubble__menu {
    opacity: 1;
  }
}

/* inline-редактирование пузыря */
.chat-bubble__editor {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0 0 0.3rem;
}

.chat-bubble__editor textarea {
  width: 100%;
  min-width: 200px;
  min-height: 60px;
  max-height: 220px;
  resize: vertical;
  border: 1px solid rgba(58, 44, 27, 0.25);
  border-radius: 10px;
  background: rgba(255, 252, 246, 0.95);
  color: var(--c-text);
  padding: 0.45rem 0.6rem;
  font: inherit;
  outline: none;
}

.chat-bubble__editor textarea:focus {
  border-color: var(--c-gold);
  box-shadow: 0 0 0 2px var(--c-ring);
}

.chat-bubble__editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
}

.chat-bubble__editor-save,
.chat-bubble__editor-cancel {
  border: 0;
  border-radius: 8px;
  padding: 0.35rem 0.7rem;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.chat-bubble__editor-save {
  background: var(--c-forest);
  color: #fbf7f0;
}

.chat-bubble__editor-save:hover {
  background: #4d6043;
}

.chat-bubble__editor-save:disabled,
.chat-bubble__editor-cancel:disabled {
  opacity: 0.6;
  cursor: progress;
}

.chat-bubble__editor-cancel {
  background: rgba(58, 44, 27, 0.08);
  color: var(--c-text);
}

.chat-bubble__editor-cancel:hover {
  background: rgba(58, 44, 27, 0.14);
}

/* ---------- composer ---------- */
.composer {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem calc(0.55rem + env(safe-area-inset-bottom, 0));
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.88), rgba(237, 227, 211, 0.96));
  border-top: 1px solid rgba(58, 44, 27, 0.08);
  z-index: 4;
}

.composer__emoji {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(196, 154, 60, 0.14);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0;
  transition: background 120ms ease, transform 80ms ease;
}

.composer__emoji:hover {
  background: rgba(196, 154, 60, 0.28);
}

.composer__emoji[aria-expanded="true"] {
  background: rgba(196, 154, 60, 0.35);
}

.composer__attach {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(91, 110, 79, 0.12);
  color: var(--c-forest);
  cursor: pointer;
  font-size: 1.2rem;
}

.composer__attach:hover {
  background: rgba(91, 110, 79, 0.22);
}

.composer__voice {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(91, 110, 79, 0.45);
  background: rgba(91, 110, 79, 0.12);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1.15rem;
  transition: background 120ms ease, transform 80ms ease;
}

.composer__voice:hover {
  background: rgba(91, 110, 79, 0.22);
}

.composer__video {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(196, 154, 60, 0.55);
  background: rgba(255, 252, 246, 0.9);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 120ms ease, transform 80ms ease;
}

.composer__video:hover {
  background: rgba(196, 154, 60, 0.15);
}

.composer__video-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #e8a87c, #c26a5a 55%, #9b4d42);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.composer__field {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
  background: #fff;
  border: 1px solid rgba(58, 44, 27, 0.16);
  border-radius: 18px;
  padding: 0.4rem 0.6rem;
  box-shadow: inset 0 1px 0 rgba(58, 44, 27, 0.04);
}

.composer-emoji-panel {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: calc(100% + 0.35rem);
  z-index: 30;
  padding: 0.5rem;
  border-radius: 14px;
  border: 1px solid rgba(58, 44, 27, 0.1);
  background: rgba(255, 252, 246, 0.98);
  box-shadow: 0 10px 28px rgba(58, 44, 27, 0.18);
  pointer-events: auto;
}

.composer-emoji-panel.is-open {
  display: block;
}

.composer-emoji-panel__grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.2rem;
  max-height: min(220px, 42vh);
  overflow-y: auto;
}

.composer-emoji-panel__btn {
  width: 100%;
  aspect-ratio: 1;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background 100ms ease, transform 80ms ease;
}

.composer-emoji-panel__btn:hover,
.composer-emoji-panel__btn:focus-visible {
  background: rgba(196, 154, 60, 0.2);
  transform: scale(1.08);
}

.composer-emoji-panel__btn:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 1px;
}

@media (max-width: 540px) {
  .composer-emoji-panel__grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.composer__attach-preview {
  position: relative;
  display: flex;
  align-items: flex-start;
  align-self: flex-start;
}

.composer__attach-preview img {
  max-width: 140px;
  max-height: 140px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(58, 44, 27, 0.12);
}

#composer-attach-clear {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 0;
  background: rgba(58, 44, 27, 0.85);
  color: #fff;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
}

#composer-input {
  width: 100%;
  border: 0;
  outline: none;
  resize: none;
  font: inherit;
  font-family: inherit, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  background: transparent;
  color: var(--c-text);
  min-height: 24px;
  max-height: 160px;
}

.composer__send {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: var(--c-forest);
  color: #fbf7f0;
  font-size: 1.05rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 80ms ease, background 120ms ease;
}

.composer__send:hover {
  background: #4d6043;
}

.composer__send:active {
  transform: scale(0.94);
}

.composer__send:disabled {
  background: rgba(91, 110, 79, 0.5);
  cursor: progress;
}

.visually-hidden {
  position: absolute !important;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  width: 1px; height: 1px;
  overflow: hidden;
  white-space: nowrap;
}

.chat-image-dialog {
  border: 0;
  background: rgba(31, 27, 22, 0.95);
  padding: 0;
  border-radius: 12px;
  max-width: 92vw;
  max-height: 92vh;
}

.chat-image-dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
}

.chat-image-dialog img {
  display: block;
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
}

.chat-image-dialog__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}

@media (max-width: 540px) {
  .chat-bubble {
    max-width: 92%;
  }

  .chat-bubble__image img {
    max-width: 220px;
  }
}

/* ---------- адаптив: телефоны (единые отступы и кнопки) ---------- */
@media (max-width: 760px) {
  .invite .sparkles {
    opacity: 0.35;
  }

  body.invite-page::before {
    background-position: center center;
    background-size: cover;
  }

  body.invite-page {
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: max(0.5rem, env(safe-area-inset-top, 0)) var(--page-pad-x)
      max(0.5rem, env(safe-area-inset-bottom, 0));
  }

  .invite {
    min-height: auto;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: min(19rem, calc(100vw - 2 * var(--page-pad-x)));
    margin-inline: auto;
    padding: 0.5rem 0.25rem;
  }

  .invite::before {
    content: none;
    display: none;
  }

  .invite > .invite-kicker {
    margin: 0 0 0.5rem;
    font-size: clamp(0.62rem, 2.4vw, 0.72rem);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--c-forest);
    text-shadow: 0 1px 6px rgba(255, 252, 246, 0.9);
  }

  .invite > .invite-eyebrow {
    margin: 0 0 0.75rem;
    max-width: 14.5rem;
    font-size: clamp(0.72rem, 2.8vw, 0.82rem);
    line-height: 1.55;
    letter-spacing: 0.05em;
    text-transform: none;
    color: var(--c-muted);
    text-shadow: 0 1px 6px rgba(255, 252, 246, 0.9);
  }

  .invite-names {
    margin: 0 0 0.65rem;
  }

  .invite-name--first,
  .invite-name--second {
    font-size: clamp(1.45rem, 6.5vw, 1.85rem);
    filter: drop-shadow(0 1px 3px rgba(255, 252, 246, 0.85));
  }

  .invite-amp {
    font-size: clamp(0.95rem, 4vw, 1.15rem);
    margin: 0.05em 0;
    filter: drop-shadow(0 1px 3px rgba(255, 252, 246, 0.85));
  }

  .invite-message {
    margin: 0 auto 0.75rem;
    max-width: 15.5rem;
    font-size: clamp(0.78rem, 3vw, 0.88rem);
    line-height: 1.55;
    color: var(--c-text);
    text-shadow: 0 1px 6px rgba(255, 252, 246, 0.92);
  }

  .invite-date {
    width: auto;
    max-width: min(100%, 13.5rem);
    margin: 0 auto 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(207, 217, 196, 0.55);
  }

  .invite-date-row {
    font-size: clamp(1.1rem, 4.2vw, 1.35rem);
  }

  .invite-cta-row {
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 13.5rem;
    margin: 0 auto;
    flex: 0 0 auto;
    gap: 0.45rem;
  }

  .invite-cta,
  .invite-cta-secondary {
    width: 100%;
    max-width: none;
    font-size: 0.88rem;
  }

  .invite .invite-cta-row .invite-cta-secondary {
    flex: 0 0 auto;
    min-width: 0;
    max-width: none;
    width: 100%;
    min-height: 44px;
    padding: 0.55rem 0.85rem;
  }

  .invite > .invite-foot {
    margin: 0.75rem 0 0;
    font-size: clamp(0.58rem, 2.2vw, 0.68rem);
    letter-spacing: 0.1em;
    line-height: 1.5;
    color: var(--c-muted);
    text-shadow: 0 1px 6px rgba(255, 252, 246, 0.9);
  }

  .hero-cta-tiles {
    flex-direction: row;
    gap: 0.5rem;
  }

  .hero-cta-tiles .hero-cta-tile {
    min-height: 3rem;
    font-size: clamp(0.8rem, 3vw, 0.92rem);
    padding: 0.6rem 0.5rem;
  }

  .day-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
  }

  .day-tab {
    min-height: 48px;
    padding: 0.55rem 0.45rem;
    font-size: clamp(0.78rem, 3.2vw, 0.9rem);
  }

  .guests-hero {
    padding: 0 var(--page-pad-x);
  }

  .auth-form .cta {
    width: 100%;
    align-self: stretch;
  }

  .avatar-dropzone__drag-hint {
    display: none;
  }
}

@media (max-width: 480px) {
  .hero-cta-tiles {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-cta-tiles .hero-cta-tile {
    width: 100%;
    min-height: 48px;
    font-size: clamp(0.88rem, 3.5vw, 1rem);
    padding: 0.65rem 0.75rem;
  }

  body.invite-page::before {
    background-position: center center;
  }

  .invite {
    max-width: min(17rem, calc(100vw - 2 * var(--page-pad-x)));
  }

  .invite-name--first,
  .invite-name--second {
    font-size: clamp(1.3rem, 5.8vw, 1.55rem);
  }

  .invite-amp {
    font-size: clamp(0.85rem, 3.6vw, 0.95rem);
  }

  .invite-cta-row {
    max-width: 12rem;
  }
}

@media (max-width: 540px) {
  .rsvp-label {
    font-size: 1rem;
  }

  .day-tab {
    font-size: max(0.875rem, 16px);
  }

  .rsvp-bar--inline {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    margin: 0;
    gap: 0.65rem;
    padding: 0.65rem 1rem calc(0.65rem + env(safe-area-inset-bottom, 0));
    background: linear-gradient(180deg, rgba(251, 247, 240, 0.92), rgba(237, 227, 211, 0.98));
    border-top: 1px solid rgba(58, 44, 27, 0.12);
    box-shadow: 0 -8px 32px rgba(58, 44, 27, 0.12);
  }

  .register-step__nav--final.rsvp-bar--inline {
    justify-content: stretch;
  }

  .register-step__nav--final .register-submit-btn {
    flex: 1 1 auto;
    max-width: none;
    min-width: 0;
  }

  .profile-form__actions .cta {
    flex: 1 1 auto;
    min-width: 0;
  }

  .schedule-table thead {
    display: none;
  }

  .schedule-table tbody tr {
    display: block;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid rgba(58, 44, 27, 0.08);
  }

  .schedule-table tbody tr:last-child {
    border-bottom: 0;
  }

  .schedule-table td {
    display: block;
    padding: 0;
    width: auto;
  }

  .schedule-table__time {
    width: auto;
    min-width: 0;
    white-space: normal;
    margin-bottom: 0.25rem;
    font-size: 0.88rem;
  }

  .schedule-table td:not(.schedule-table__time) {
    font-size: 0.95rem;
  }

  .composer {
    gap: 0.35rem;
    padding: 0.45rem 0.5rem calc(0.45rem + env(safe-area-inset-bottom, 0));
  }

  .composer__voice,
  .composer__video,
  .composer__emoji {
    display: none;
  }

  .composer__attach,
  .composer__send {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }

  .composer__field {
    min-width: 0;
    padding: 0.35rem 0.5rem;
  }

  #composer-input {
    min-width: 0;
    font-size: 16px;
  }

  .chat-header {
    gap: 0.45rem;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  .chat-header__title {
    min-width: 0;
    overflow: hidden;
  }

  .chat-header__title strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.95rem;
  }

  .chat-header__title span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .chat-header__actions {
    flex-shrink: 1;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: min(55%, calc(100% - 3.5rem));
  }

  .chat-header__actions::-webkit-scrollbar {
    display: none;
  }

  .chat-header__actions .topbar-link {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
    flex-shrink: 0;
  }
}

@media (max-width: 400px) {
  .check-tile--chip {
    flex: 1 1 100%;
    min-width: 0;
  }

  .check-tile--chip span {
    white-space: normal;
    text-align: center;
  }

  .avatar-dropzone {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}
