:root {
  --bg: #fffaf8;
  --bg-alt: #fff1f2;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --border: rgba(120, 68, 83, 0.14);
  --shadow: 0 20px 40px rgba(104, 64, 74, 0.12);
  --text: #36252a;
  --muted: #70545d;
  --accent: #d9829f;
  --accent-strong: #bf5f83;
  --accent-soft: #f7d8df;
  --success: #2f8f63;
  --warning: #a66b1f;
  --danger: #b33d4d;
  --dark-outline: #ffd9df;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --font-ui: "Trebuchet MS", "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  --bg: #1a1115;
  --bg-alt: #28171f;
  --surface: rgba(39, 25, 31, 0.9);
  --surface-strong: #23161c;
  --border: rgba(255, 217, 223, 0.18);
  --shadow: 0 18px 38px rgba(0, 0, 0, 0.45);
  --text: #fff2f4;
  --muted: #e8bcc7;
  --accent: #ff9bb8;
  --accent-strong: #ffbfd0;
  --accent-soft: rgba(255, 155, 184, 0.14);
  --success: #6de0a6;
  --warning: #f4c06f;
  --danger: #ff8da2;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-ui);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 224, 230, 0.8), transparent 30%),
    radial-gradient(circle at top right, rgba(255, 204, 215, 0.5), transparent 26%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
  padding: 0 0 110px;
}

a {
  color: var(--accent-strong);
}

button,
input,
select,
textarea {
  font: inherit;
}

.page-shell {
  width: min(1120px, calc(100% - 24px));
  margin: 18px auto 0;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 4000;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  width: min(1120px, calc(100% - 24px));
  margin: 16px auto 0;
  padding: 16px 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
}

.header-left,
.header-right,
.header-badges {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-badges-wrapper {
  display: flex;
  justify-content: center;
}

.header-title {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.badge,
.icon-button,
.button,
.app-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(104, 64, 74, 0.06);
}

.icon-button,
.button {
  cursor: pointer;
}

.icon-button {
  position: relative;
  min-height: 44px;
  padding: 10px 14px;
}

.notification-count {
  position: absolute;
  top: -8px;
  right: -6px;
  min-width: 20px;
  min-height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--danger);
  color: #fff;
  font-size: 12px;
}

.notification-panel {
  position: fixed;
  top: 92px;
  right: max(12px, calc((100vw - 1120px) / 2));
  width: min(380px, calc(100vw - 24px));
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  display: none;
  z-index: 4500;
}

.notification-panel.open {
  display: block;
}

.notification-panel-head,
.button-row,
.toggle-row,
.app-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.notification-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 10px;
}

.notification-item,
.notification-empty,
.card,
.modal-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.notification-item {
  padding: 12px;
  cursor: pointer;
}

.notification-item.unread {
  border-color: var(--accent);
}

.notification-item p {
  margin: 6px 0;
}

.notification-item span,
.muted-copy {
  color: var(--muted);
}

.hero,
.hero-compact,
.guest-story-grid,
.dashboard-grid,
.layout-single {
  display: grid;
  gap: 18px;
}

.hero {
  grid-template-columns: 1.4fr 0.8fr;
  align-items: end;
  padding: 28px;
  margin-bottom: 18px;
  border-radius: calc(var(--radius-lg) + 6px);
  background:
    linear-gradient(135deg, rgba(247, 216, 223, 0.95), rgba(255, 251, 248, 0.98)),
    var(--surface-strong);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hero-compact {
  padding: 24px;
  margin-bottom: 18px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  font-weight: 700;
}

.hero h1,
.hero-compact h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.05;
}

.hero-copy {
  margin: 0;
  color: var(--muted);
  max-width: 62ch;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.hero-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 18px;
}

.hero-side-image {
  width: min(192px, 100%);
  height: auto;
  display: block;
}

.guest-story-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.layout-single {
  max-width: 720px;
  margin: 0 auto;
}

.dashboard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card,
.modal-card {
  padding: 22px;
}

.surface {
  background: var(--surface);
}

.stack-form {
  display: grid;
  gap: 14px;
}

.compact-top {
  margin-top: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-weight: 600;
}

input,
select,
textarea,
.modal-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="dark"] .modal-input {
  background: rgba(20, 14, 18, 0.88);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 18px;
  text-decoration: none;
}

.button-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  border-color: transparent;
}

.button-secondary {
  background: var(--surface-strong);
}

.button-inline {
  min-height: 36px;
  padding: 8px 12px;
}

.inline-notice,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 600;
}

.inline-notice {
  margin-top: 12px;
}

.success {
  background: rgba(47, 143, 99, 0.12);
  color: var(--success);
}

.warning {
  background: rgba(166, 107, 31, 0.14);
  color: var(--warning);
}

.danger {
  background: rgba(179, 61, 77, 0.14);
  color: var(--danger);
}

.muted {
  background: rgba(112, 84, 93, 0.12);
  color: var(--muted);
}

.map-page {
  height: min(72vh, 720px);
}

#map,
#eventMap {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
}

.seo-content pre {
  white-space: pre-wrap;
  background: rgba(255, 255, 255, 0.6);
  padding: 16px;
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.app-nav {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  padding: 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 250, 248, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  z-index: 4200;
}

[data-theme="dark"] .cookie-box,
[data-theme="dark"] .app-nav {
  background: rgba(26, 17, 21, 0.92);
}

.cookie-banner {
  position: fixed;
  right: 24px;
  bottom: calc(24px + env(safe-area-inset-bottom));
  width: min(380px, calc(100vw - 32px));
  z-index: 4100;
  align-items: flex-end;
  justify-content: flex-end;
  pointer-events: none;
}

.cookie-box {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 250, 248, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  pointer-events: auto;
}

.cookie-copy h2 {
  margin: 0 0 6px;
  font-size: 1rem;
  line-height: 1.25;
}

.cookie-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.cookie-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
}

.cookie-actions .button {
  min-width: 104px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent-strong);
  outline-offset: 3px;
}

.app-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  min-height: 62px;
  padding: 10px 14px;
  text-decoration: none;
}

.app-btn span {
  font-size: 12px;
}

.badge-popup {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(23, 16, 19, 0.5);
  z-index: 5000;
}

.badge-popup.hidden {
  display: none;
}

.hidden {
  display: none !important;
}

.form-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.message-unread {
  border-left: 4px solid var(--accent, #c4566f);
}

.password-reset-status {
  margin-top: 0.75rem;
  color: var(--muted, #667085);
  font-size: 0.92rem;
}

.badge-popup-content {
  width: min(360px, calc(100vw - 24px));
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.modal-card {
  max-width: 360px;
  margin: 14vh auto 0;
}

.contact-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  padding: 24px 14px;
  overflow-y: auto;
  background: rgba(17, 12, 15, 0.62);
}

.contact-modal-card {
  width: min(760px, calc(100vw - 28px));
  margin: min(8vh, 68px) auto;
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.contact-modal-header h3 {
  margin: 0 0 8px;
}

.contact-receiver-info {
  margin: 0 0 10px;
  color: var(--muted);
}

.contact-privacy-note {
  margin: 0 0 10px;
  line-height: 1.45;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
}

.contact-recommendation {
  margin: 0 0 12px;
  color: var(--muted);
}

.contact-limit-note {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-weight: 600;
}

.contact-label {
  display: inline-block;
  margin-bottom: 8px;
  font-weight: 700;
}

.contact-letter-input {
  min-height: 280px;
  max-height: 520px;
  resize: vertical;
  line-height: 1.6;
}

.contact-meta-row {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.contact-warning {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(179, 61, 77, 0.12);
  color: var(--danger);
}

.modal-result {
  margin-top: 12px;
  white-space: pre-wrap;
}

.popup-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.block,
.box {
  text-align: center;
  margin-top: 16px;
}

.gender-marker,
.event-marker-wrapper {
  background: transparent;
  border: none;
}

.gender-marker .symbol {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid currentColor;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  line-height: 1;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}

[data-theme="dark"] .gender-marker .symbol {
  background: #181014;
}

.gender-marker .emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.gender-marker .svg-fallback {
  display: none !important;
}

.symbol.male { color: #3b82f6; }
.symbol.female { color: #ec4899; }
.symbol.trans { color: #8b5cf6; }
.symbol.other { color: #64748b; }

.gender-marker .age,
.ping-badge,
.attend-badge {
  position: absolute;
  right: -7px;
  bottom: -7px;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  padding: 3px 6px;
  font-size: 10px;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
  border: 2px solid rgba(255, 255, 255, 0.92);
}

.ping-badge {
  top: -6px;
  bottom: auto;
  background: #f5c44f;
  color: #111;
}

.marker-cluster-custom {
  background: transparent;
}

.cluster-icon,
.event-symbol {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 50%;
  color: #fff;
}

.cluster-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.cluster-ping {
  position: absolute;
  top: -5px;
  right: -5px;
}

.event-symbol {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.85);
}

@media (hover: hover) {
  .badge:hover,
  .button:hover,
  .icon-button:hover,
  .app-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(191, 95, 131, 0.32);
  }
}

@media (max-width: 900px) {
  .hero,
  .guest-story-grid,
  .dashboard-grid,
  .app-header {
    grid-template-columns: 1fr;
  }

  .header-badges-wrapper,
  .hero-actions {
    justify-content: flex-start;
  }

  .hero-side {
    align-items: flex-start;
  }

  .notification-panel {
    top: 138px;
    right: 12px;
  }
}

@media (max-width: 640px) {
  body {
    padding-bottom: 126px;
  }

  .page-shell,
  .app-header {
    width: calc(100% - 16px);
  }

  .app-header,
  .hero,
  .hero-compact,
  .card,
  .modal-card {
    padding: 16px;
  }

  .header-badges {
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .app-nav {
    width: calc(100% - 16px);
    justify-content: space-between;
  }

  .cookie-banner {
    right: 12px;
    left: 12px;
    bottom: calc(118px + env(safe-area-inset-bottom));
    width: auto;
  }

  .cookie-box {
    max-height: 38vh;
    overflow-y: auto;
    padding: 14px;
    border-radius: var(--radius-sm);
  }

  .cookie-actions {
    flex-wrap: wrap;
    justify-content: stretch;
  }

  .cookie-actions .button {
    flex: 1 1 132px;
    min-width: 0;
  }

  .app-btn {
    flex: 1;
    min-width: 0;
  }

  .contact-modal-card {
    padding: 16px;
  }

  .contact-letter-input {
    min-height: 240px;
  }
}
