/* MUST CRUSH — one stylesheet for every page. Mobile-first, night-plum theme.
   Display face: Cormorant Garamond (self-hosted, SIL Open Font License, see /fonts). */

@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/cormorant-garamond-latin-600-italic.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/cormorant-garamond-cyrillic-600-italic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/cormorant-garamond-cyrillic-ext-600-italic.woff2) format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/cormorant-garamond-latin-600-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/cormorant-garamond-cyrillic-600-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/cormorant-garamond-cyrillic-ext-600-normal.woff2) format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

:root {
  /* Night plum: late-night texting, warm rather than neon. */
  --bg: #170c16;
  --bg-2: #1c0f1b;
  --surface: #22121f;
  --surface-2: #2c1828;
  --surface-3: #3a1f34;
  --border: rgba(255, 214, 230, 0.09);
  --border-strong: rgba(255, 214, 230, 0.18);
  --text: #f8eef3;
  --muted: #cdb4c2;
  --faint: #9c8193;
  --rose: #e85c8c;
  --blush: #ffa3bf;
  --candle: #f2b66d;
  --grad: linear-gradient(135deg, #c72c62 0%, #b22d78 50%, #9a2f86 100%);
  --grad-soft: linear-gradient(135deg, rgba(232, 92, 140, 0.18), rgba(154, 47, 134, 0.12));
  --ok: #5fd6a4;
  --warn: #f2b66d;
  --danger: #ff7a85;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.75);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-display: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 520px at 85% -12%, rgba(199, 44, 98, 0.24), transparent 62%),
    radial-gradient(700px 480px at -5% 8%, rgba(154, 47, 134, 0.18), transparent 60%);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
}

img, svg { display: block; max-width: 100%; }
a { color: #ffa3bf; text-underline-offset: 3px; }
a:hover { color: #ffc6d6; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.6em; letter-spacing: -0.015em; }
h1, h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: 0; }
h1 { font-size: clamp(2.9rem, 9vw, 4.6rem); font-style: italic; line-height: 1.02; }
h2 { font-size: clamp(1.7rem, 4.4vw, 2.15rem); line-height: 1.12; }
h3 { font-size: 1.1rem; font-weight: 650; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.25em; margin: 0 0 1em; }
li { margin-bottom: 0.4em; }

:focus-visible {
  outline: 3px solid #ffa3bf;
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--surface-2); color: var(--text); padding: 10px 14px; border-radius: 10px;
}
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 18px; }
.container-narrow { max-width: 760px; }

/* ---------- header & footer ---------- */

.site-header { position: relative; z-index: 2; padding: 18px 0; }
.header-inner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-style: italic; font-weight: 600;
  font-size: 1.55rem; letter-spacing: 0.01em; line-height: 1;
  color: var(--text); text-decoration: none; white-space: nowrap;
}
.logo:hover { color: var(--text); }
/* Heart mark: one heart, used only here and in the favicon. */
.logo-mark {
  width: 32px; height: 32px; border-radius: 11px; background: var(--grad);
  box-shadow: 0 6px 20px -6px rgba(199, 44, 98, 0.85);
  position: relative; flex: none;
}
.logo-mark::before {
  content: ""; position: absolute; inset: 7px; background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.6-9.6-9.3C.9 8.3 3 4.5 6.8 4.5c2.2 0 3.7 1.2 5.2 3 1.5-1.8 3-3 5.2-3 3.8 0 5.9 3.8 4.4 7.2C19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.6-9.6-9.3C.9 8.3 3 4.5 6.8 4.5c2.2 0 3.7 1.2 5.2 3 1.5-1.8 3-3 5.2-3 3.8 0 5.9 3.8 4.4 7.2C19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.tagline { margin: 0; color: var(--muted); font-size: 0.9rem; display: none; }
.header-nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.header-nav a { color: var(--muted); text-decoration: none; font-size: 0.92rem; padding: 8px 10px; border-radius: 10px; }
.header-nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }

.lang-toggle {
  font: inherit; font-size: 0.85rem; font-weight: 600; color: var(--text);
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border-strong);
  border-radius: 999px; padding: 6px 12px; cursor: pointer; min-height: 36px;
}
.lang-toggle:hover { background: rgba(255, 255, 255, 0.1); }

@media (min-width: 720px) {
  .tagline { display: block; padding-left: 12px; border-left: 1px solid var(--border-strong); }
}

.site-footer {
  margin-top: auto; padding: 36px 0 44px; border-top: 1px solid var(--border);
  color: var(--faint); font-size: 0.9rem;
}
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 12px; }
.footer-nav a { color: var(--muted); text-decoration: none; }
.footer-nav a:hover { color: var(--text); text-decoration: underline; }
.footer-note { margin: 0; }

/* ---------- buttons ---------- */

.btn {
  --btn-bg: rgba(255, 255, 255, 0.07);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 14px;
  font: inherit; font-weight: 650; font-size: 0.98rem; line-height: 1.2;
  color: var(--text); background: var(--btn-bg); border: 1px solid var(--border-strong);
  text-decoration: none; cursor: pointer; user-select: none;
  transition: transform 0.15s var(--ease), background-color 0.15s, opacity 0.15s, box-shadow 0.2s;
}
.btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.11); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn-primary {
  color: #fff; background: var(--grad); border-color: transparent;
  box-shadow: 0 10px 28px -12px rgba(199, 44, 98, 0.9);
}
.btn-primary:hover { color: #fff; background: var(--grad); box-shadow: 0 14px 34px -12px rgba(199, 44, 98, 1); filter: brightness(1.08); }
.btn-primary[disabled] { box-shadow: none; filter: grayscale(0.4); }
.btn-ghost { background: transparent; }
.btn-danger { color: #ffd2d2; border-color: rgba(255, 122, 122, 0.4); background: rgba(255, 122, 122, 0.08); }
.btn-danger:hover { background: rgba(255, 122, 122, 0.16); color: #fff; }
.btn-lg { min-height: 56px; padding: 14px 26px; font-size: 1.08rem; border-radius: 16px; width: 100%; }
.btn-sm { min-height: 40px; padding: 8px 12px; font-size: 0.9rem; border-radius: 12px; }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.35); border-top-color: #fff;
  animation: spin 0.8s linear infinite; flex: none;
}

/* ---------- cards ---------- */

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015)), var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}

/* ---------- homepage hero ---------- */

.hero { display: grid; gap: 26px; padding-top: 18px; padding-bottom: 36px; align-items: center; }
.hero h1 { color: #fff3f7; max-width: 9em; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 34em; margin-top: 18px; }
.hero-points { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.hero-points li {
  margin: 0; font-size: 0.86rem; color: var(--muted); padding: 6px 12px;
  border-radius: 999px; border: 1px solid var(--border); background: rgba(255, 255, 255, 0.03);
}

@media (min-width: 900px) {
  .hero { grid-template-columns: 1.05fr 1fr; gap: 48px; padding-top: 40px; padding-bottom: 56px; }
}

.match-card { position: relative; overflow: hidden; }
.match-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, rgba(232, 92, 140, 0.55), rgba(154, 47, 134, 0.15) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}

.online-pill {
  display: flex; align-items: center; gap: 9px; margin: -4px 0 16px;
  font-size: 0.9rem; color: var(--muted);
}
.online-pill .dot { background: var(--ok); box-shadow: 0 0 0 0 rgba(95, 214, 164, 0.6); animation: live 2.4s ease-out infinite; }
.online-pill[data-empty="true"] .dot { background: var(--faint); box-shadow: none; animation: none; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(95, 214, 164, 0.55); } 70%, 100% { box-shadow: 0 0 0 7px rgba(95, 214, 164, 0); } }

fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 700; font-size: 1.05rem; margin-bottom: 12px; padding: 0; }

.gender-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gender-option { position: relative; display: block; cursor: pointer; }
.gender-option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.gender-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 128px; padding: 16px; border-radius: 18px;
  background: var(--surface-2); border: 2px solid var(--border-strong);
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
}
.gender-icon {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
  font-size: 1.7rem; font-weight: 700; background: rgba(255, 255, 255, 0.06); color: var(--muted);
  transition: background 0.2s, color 0.2s;
}
.gender-label { font-weight: 700; font-size: 1.05rem; }
.gender-check {
  position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--border-strong); display: grid; place-items: center; transition: 0.2s;
}
.gender-option:hover .gender-card { border-color: rgba(185, 168, 255, 0.5); transform: translateY(-2px); }
.gender-option input:focus-visible + .gender-card { outline: 3px solid #ffa3bf; outline-offset: 3px; }
.gender-option input:checked + .gender-card {
  border-color: transparent; background: var(--grad-soft), var(--surface-2);
  box-shadow: 0 0 0 2px #e85c8c, 0 16px 40px -18px rgba(199, 44, 98, 0.9);
}
.gender-option input:checked + .gender-card .gender-icon { background: var(--grad); color: #fff; }
.gender-option input:checked + .gender-card .gender-check { background: var(--grad); border-color: transparent; }
.gender-option input:checked + .gender-card .gender-check::after {
  content: ""; width: 9px; height: 5px; border: solid #fff; border-width: 0 0 2.5px 2.5px;
  transform: translateY(-1px) rotate(-45deg);
}

.match-pref {
  margin: 16px 0 6px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03); border: 1px dashed var(--border-strong);
  color: var(--muted); font-size: 0.95rem;
}
.match-pref strong { color: var(--text); }
.hint { color: var(--faint); font-size: 0.86rem; margin: 6px 0 14px; }

.age-check {
  display: flex; gap: 12px; align-items: flex-start; margin: 4px 0 18px;
  font-size: 0.93rem; color: var(--muted); cursor: pointer;
}
.age-check input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: #e85c8c; cursor: pointer; }

.form-status { min-height: 1.6em; margin: 12px 0 0; font-size: 0.93rem; color: var(--muted); text-align: center; }
.form-status.is-error { color: var(--danger); }
.form-status.is-ok { color: var(--ok); }

/* searching view */
.search-view { text-align: center; padding: 8px 0 4px; animation: fade-in 0.35s var(--ease); }
.search-view h2 { margin-top: 18px; }
.search-view p { color: var(--muted); }
.search-timer { font-variant-numeric: tabular-nums; color: var(--faint); font-size: 0.9rem; }
.heartbeat { width: 240px; max-width: 100%; height: 84px; margin: 4px auto 0; }
.heartbeat svg { width: 100%; height: 100%; overflow: visible; }
.beat-base { fill: none; stroke: rgba(255, 163, 191, 0.16); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.beat-line {
  fill: none; stroke: #ff5c93; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 90 420; stroke-dashoffset: 510;
  filter: drop-shadow(0 0 6px rgba(255, 92, 147, 0.75));
  animation: beat 1.7s linear infinite;
}
.search-view.is-found .beat-line {
  stroke: var(--candle); stroke-dasharray: none; animation: none;
  filter: drop-shadow(0 0 10px rgba(242, 182, 109, 0.8));
}
.search-view.is-found h2 { color: var(--candle); }

/* notices */
.notice {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  padding: 14px 16px; margin-bottom: 22px; border-radius: var(--radius-sm);
  background: rgba(247, 192, 74, 0.08); border: 1px solid rgba(247, 192, 74, 0.35);
}
.notice p { margin: 0; }
.notice-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- homepage content ---------- */

.section { padding: 28px 0; }
.section-title { text-align: left; margin-bottom: 18px; }
.info-grid { display: grid; gap: 16px; }
@media (min-width: 760px) { .info-grid { grid-template-columns: 1fr 1fr; } }
.info-grid .card h2 { font-size: 1.6rem; }
.info-grid .card p:last-child, .info-grid .card ul:last-child { margin-bottom: 0; }
.safety-list li::marker { color: var(--violet); }
.card-links { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.95rem; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; counter-reset: step; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { margin: 0; counter-increment: step; }
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 12px;
  border-radius: 12px; background: var(--grad); color: #fff; font-weight: 800;
}
.steps h3 { margin-bottom: 6px; }
.steps p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.faq details {
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  margin-bottom: 10px; overflow: hidden;
}
.faq summary {
  cursor: pointer; padding: 15px 44px 15px 16px; font-weight: 650; list-style: none; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  font-size: 1.3rem; color: var(--faint); transition: transform 0.2s;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details > div { padding: 0 16px 14px; color: var(--muted); }
.faq details > div p:last-child { margin-bottom: 0; }

/* ---------- ads (only rendered when configured) ---------- */

.ad-wrap { margin-top: 56px; padding-top: 24px; padding-bottom: 24px; border-top: 1px solid var(--border); }
.ad-wrap[hidden] { display: none; }
.ad-label {
  margin: 0 0 8px; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint);
}
.ad-wrap ins { min-height: 100px; }

/* ---------- content pages ---------- */

.page { padding: 18px 0 40px; }
.page h1 { font-size: clamp(2.6rem, 7vw, 3.6rem); }
.page h2 { margin-top: 1.6em; }
.page p, .page li { color: #d7d5ea; }
.page .updated { color: var(--faint); font-size: 0.9rem; }
.callout {
  padding: 14px 16px; border-radius: var(--radius-sm); margin: 18px 0;
  background: var(--grad-soft); border: 1px solid rgba(232, 92, 140, 0.3);
}
.callout p:last-child { margin: 0; }
.callout-warn { background: rgba(247, 192, 74, 0.08); border-color: rgba(247, 192, 74, 0.35); }
.translation-note { font-size: 0.9rem; }
.contact-email { font-size: 1.15rem; font-weight: 700; word-break: break-all; }

/* ---------- chat page ---------- */

.chat-body { background-attachment: scroll; overflow: hidden; }
.chat-app {
  height: var(--app-height, 100dvh);
  display: flex; flex-direction: column; max-width: 900px; margin: 0 auto; width: 100%;
  position: relative;
}
@supports not (height: 100dvh) { .chat-app { height: var(--app-height, 100vh); } }

.chat-header {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-bottom: 1px solid var(--border); background: rgba(23, 12, 22, 0.85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.chat-header .logo-mark { width: 28px; height: 28px; border-radius: 9px; }
.chat-header .logo-mark::before { inset: 6px; }
.chat-header .logo { font-size: 1.3rem; }
.chat-header .logo .logo-text { display: none; }
.chat-status {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0;
  font-size: 0.88rem; color: var(--muted); padding: 6px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border);
}
.chat-status span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex: none; }
.chat-status[data-state="connecting"] .dot { background: var(--warn); animation: pulse 1.2s infinite; }
.chat-status[data-state="connected"] .dot { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.chat-status[data-state="away"] .dot { background: var(--warn); }
.chat-status[data-state="offline"] .dot,
.chat-status[data-state="error"] .dot { background: var(--danger); }
.chat-actions { margin-left: auto; display: flex; gap: 6px; }
.chat-actions .btn span.label { display: none; }
@media (min-width: 560px) {
  .chat-header { padding: 12px 16px; gap: 12px; }
  .chat-header .logo .logo-text { display: inline; }
  .chat-actions .btn span.label { display: inline; }
}

.net-banner {
  margin: 8px 12px 0; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.9rem;
  background: rgba(255, 122, 122, 0.1); border: 1px solid rgba(255, 122, 122, 0.35); color: #ffd6d6;
}

.messages {
  flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 12px 12px;
  display: flex; flex-direction: column; gap: 6px; scroll-behavior: smooth;
}
@media (min-width: 560px) { .messages { padding: 20px 18px 14px; } }

.msg { display: flex; flex-direction: column; max-width: min(78%, 560px); animation: msg-in 0.22s var(--ease); }
.msg-me { align-self: flex-end; align-items: flex-end; }
.msg-them { align-self: flex-start; align-items: flex-start; }
.msg + .msg-me.msg-first, .msg + .msg-them.msg-first { margin-top: 8px; }
.msg-who { font-size: 0.74rem; color: var(--faint); margin: 0 6px 3px; font-weight: 600; letter-spacing: 0.02em; }
.bubble {
  padding: 9px 14px; border-radius: 18px; white-space: pre-wrap; word-wrap: break-word;
  overflow-wrap: anywhere; font-size: 0.98rem; line-height: 1.45;
}
.msg-me .bubble { background: var(--grad); color: #fff; border-bottom-right-radius: 6px; }
.msg-them .bubble { background: var(--surface-3); border: 1px solid var(--border); border-bottom-left-radius: 6px; }
.msg-meta { font-size: 0.74rem; color: var(--faint); margin: 3px 6px 0; display: flex; gap: 8px; align-items: center; }
.msg.is-pending .bubble { opacity: 0.65; }
.msg.is-failed .bubble { background: rgba(255, 122, 122, 0.18); border: 1px solid rgba(255, 122, 122, 0.45); color: var(--text); }
.msg.is-failed .msg-meta { color: var(--danger); }
.link-btn { font: inherit; color: #ffb3c8; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }

.system-msg {
  align-self: center; text-align: center; max-width: 92%; margin: 8px 0;
  font-size: 0.86rem; color: var(--muted); padding: 8px 14px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border);
}
.system-msg strong { color: var(--text); }

.jump-btn {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 92px; z-index: 3;
  font: inherit; font-size: 0.85rem; font-weight: 600; color: #fff; background: var(--grad);
  border: 0; border-radius: 999px; padding: 8px 14px; cursor: pointer; box-shadow: var(--shadow);
}

.composer {
  display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border); background: rgba(23, 12, 22, 0.9);
  position: relative;
}
.composer textarea {
  flex: 1; min-height: 46px; max-height: 160px; resize: none; padding: 12px 14px;
  font: inherit; font-size: 16px; line-height: 1.4; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 16px;
}
.composer textarea::placeholder { color: var(--faint); }
.composer textarea:focus { outline: none; border-color: #e85c8c; box-shadow: 0 0 0 3px rgba(232, 92, 140, 0.25); }
.composer textarea:disabled { opacity: 0.5; }
.btn-send { width: 46px; min-height: 46px; padding: 0; border-radius: 14px; flex: none; }
.char-count {
  position: absolute; right: 70px; top: -22px; font-size: 0.75rem; color: var(--faint);
  background: var(--bg); padding: 0 6px; border-radius: 6px;
}
.char-count.is-over { color: var(--danger); }

.ended-panel {
  margin: 0 12px 12px; padding: 18px; text-align: center; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border-strong); animation: fade-in 0.3s var(--ease);
}
.ended-panel p { margin-bottom: 14px; color: var(--muted); }
.ended-panel strong { color: var(--text); display: block; font-size: 1.05rem; margin-bottom: 4px; }
.ended-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* report dialog */
dialog {
  width: min(480px, calc(100vw - 24px)); padding: 0; border: 1px solid var(--border-strong);
  border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(15, 6, 14, 0.7); backdrop-filter: blur(3px); }
.dialog-body { padding: 22px; }
.dialog-body h2 { font-size: 1.25rem; }
.dialog-body p { color: var(--muted); font-size: 0.93rem; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 6px; }
.field select, .field textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border-strong); border-radius: 12px; padding: 10px 12px;
}
.field textarea { min-height: 84px; resize: vertical; }
.dialog-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.dialog-error { color: var(--danger) !important; min-height: 1.2em; margin: 0 0 10px; }

/* ---------- animation ---------- */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes beat { to { stroke-dashoffset: 0; } }
@keyframes pulse { 50% { opacity: 0.35; } }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px) scale(0.98); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .beat-line { stroke-dasharray: none; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition: none !important; scroll-behavior: auto !important; }
}

[hidden] { display: none !important; }
