:root {
  color-scheme: dark;
  --bg: #1a0533;
  --bg-card: rgba(20, 0, 40, 0.55);
  --bg-card-hover: rgba(40, 0, 70, 0.72);
  --border: rgba(255, 45, 155, 0.28);
  --text: #fff5fc;
  --text-muted: rgba(255, 220, 245, 0.68);
  --surface: rgba(20, 0, 40, 0.55);
  --surface2: rgba(40, 0, 70, 0.45);
  --primary: #ff2d9b;
  --primary-hover: #e040fb;
  --success: #69f0ae;
  --warning: #ffc940;
  --danger: #ff6b9d;
  --user-bubble: rgba(255, 45, 155, 0.22);
  --admin-bubble: rgba(179, 136, 255, 0.18);
  --pink: #ff2d9b;
  --pink-dim: rgba(255, 45, 155, 0.18);
  --magenta: #e040fb;
  --gold: #ffc940;
  --gold-dim: rgba(255, 201, 64, 0.15);
  --purple: #b388ff;
  --blue: #82b1ff;
  --blue-dim: rgba(130, 177, 255, 0.15);
  --green: #69f0ae;
  --green-dim: rgba(105, 240, 174, 0.12);
  --telegram: #29b6f6;
  --messenger: #0084ff;
  --zalo: #0068ff;
  --phone: #ff6b9d;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 4px 24px rgba(255, 45, 155, 0.15);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --max-w: 480px;
}

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

body.theme-body {
  margin: 0;
  min-height: 100dvh;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background-color: var(--bg);
}

body.theme-body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 120% 80% at 50% -10%, rgba(255, 45, 155, 0.35), transparent 55%),
    radial-gradient(ellipse 80% 50% at 80% 100%, rgba(224, 64, 251, 0.2), transparent 50%),
    url("/assets/bg-sexy.png") center center / cover no-repeat fixed;
}

body.theme-body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 90% 50% at 50% 0%, rgba(255, 45, 155, 0.18), transparent 60%),
    linear-gradient(180deg, rgba(26, 5, 51, 0.35) 0%, rgba(10, 0, 25, 0.72) 55%, rgba(5, 0, 15, 0.88) 100%);
  pointer-events: none;
}

.app {
  width: 100%;
  max-width: var(--max-w);
  min-height: 100dvh;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  padding: calc(16px + var(--safe-top)) 16px calc(20px + var(--safe-bottom));
}

.header { text-align: center; padding: 4px 0 24px; }

.brand-logo {
  display: block;
  width: min(220px, 72vw);
  height: auto;
  margin: 0 auto 16px;
  object-fit: contain;
  filter: drop-shadow(0 4px 24px rgba(255, 45, 155, 0.35));
}

.brand-logo--text {
  width: auto;
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 0.12em;
  background: linear-gradient(135deg, #ff2d9b, #e040fb, #ffc940);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 24px rgba(255, 45, 155, 0.35));
}

.header-title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 12px rgba(255, 45, 155, 0.4);
}

.header-sub { margin: 0 0 14px; font-size: 13px; color: var(--text-muted); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(105, 240, 174, 0.1);
  border: 1px solid rgba(105, 240, 174, 0.3);
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  backdrop-filter: blur(8px);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: theme-pulse 2s ease-in-out infinite;
}

@keyframes theme-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.main { flex: 1; display: flex; flex-direction: column; gap: 24px; }

.section-head { margin-bottom: 12px; }
.section-head h2 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pink);
  text-shadow: 0 0 20px rgba(255, 45, 155, 0.5);
}
.section-head p { margin: 0; font-size: 12px; color: var(--text-muted); line-height: 1.4; }

.grid { display: grid; gap: 10px; }
.grid-2 { grid-template-columns: 1fr 1fr; }

.card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
  -webkit-tap-highlight-color: transparent;
  min-height: 72px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  font: inherit;
  text-align: left;
  width: 100%;
}
button.card { appearance: none; }
.card:active { transform: scale(0.97); }
.card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 45, 155, 0.45);
  box-shadow: 0 4px 24px rgba(255, 45, 155, 0.15);
}

.card-login {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  min-height: auto;
  padding: 16px;
  cursor: default;
}
.card-login:hover { transform: none; }
.card-login .input { background: rgba(0, 0, 0, 0.25); border-color: var(--border); color: var(--text); }
.card-login .input:focus { border-color: var(--pink); }
.card-login .btn-primary {
  background: linear-gradient(135deg, #ff2d9b, #e040fb);
  border: none;
  width: 100%;
}

.card-chat { flex-direction: row; min-height: 78px; }
.card-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
}
.card-icon svg { width: 20px; height: 20px; }
.card-icon--gold { background: var(--gold-dim); color: var(--gold); border: 1px solid rgba(255, 201, 64, 0.25); }
.card-icon--purple { background: var(--magenta-dim); color: var(--magenta); border: 1px solid rgba(224, 64, 251, 0.25); }
.card-icon--blue { background: var(--blue-dim); color: var(--blue); border: 1px solid rgba(130, 177, 255, 0.25); }
.card-icon--green { background: var(--green-dim); color: var(--green); border: 1px solid rgba(105, 240, 174, 0.25); }
.card-arrow { flex-shrink: 0; color: var(--pink); opacity: 0.6; }
.card-arrow svg { width: 16px; height: 16px; }

.login-panel { max-width: 400px; }

/* Login sheet */
.panel-overlay.active .login-sheet {
  animation: login-sheet-in 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes login-sheet-in {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-sheet {
  position: relative;
  width: 100%;
  max-width: 400px;
  padding: 28px 24px 24px;
  border-radius: 20px;
  background:
    linear-gradient(160deg, rgba(40, 0, 70, 0.92) 0%, rgba(15, 0, 30, 0.96) 100%);
  border: 1px solid rgba(255, 45, 155, 0.35);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    0 0 40px rgba(255, 45, 155, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
}

.login-sheet::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 21px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 45, 155, 0.55), rgba(224, 64, 251, 0.2), rgba(255, 201, 64, 0.25));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.login-sheet-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.login-sheet-close:hover {
  background: rgba(255, 45, 155, 0.15);
  border-color: rgba(255, 45, 155, 0.35);
  color: var(--text);
}

.login-sheet-header {
  text-align: center;
  margin-bottom: 22px;
  padding-top: 4px;
}

.login-sheet-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
}
.login-sheet-icon svg { width: 26px; height: 26px; }

.login-sheet-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pink);
  margin-bottom: 6px;
  text-shadow: 0 0 16px rgba(255, 45, 155, 0.45);
}

.login-sheet-header h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.login-sheet-desc {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

.login-sheet-form { display: flex; flex-direction: column; gap: 18px; }

.login-field { display: flex; flex-direction: column; gap: 8px; }

.login-field-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 220, 245, 0.75);
}

.login-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 45, 155, 0.28);
  background: rgba(0, 0, 0, 0.28);
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.login-input-wrap:focus-within {
  border-color: rgba(255, 45, 155, 0.65);
  background: rgba(0, 0, 0, 0.38);
  box-shadow: 0 0 0 3px rgba(255, 45, 155, 0.15), 0 0 24px rgba(255, 45, 155, 0.12);
}

.login-input-icon {
  display: flex;
  color: var(--pink);
  opacity: 0.85;
  flex-shrink: 0;
}
.login-input-icon svg { width: 18px; height: 18px; }

.login-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  padding: 14px 0;
  outline: none;
  min-width: 0;
}
.login-input::placeholder { color: rgba(255, 220, 245, 0.38); }

.login-field-hint {
  font-size: 11px;
  color: rgba(255, 220, 245, 0.45);
  line-height: 1.4;
  padding-left: 2px;
}

.login-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 20px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, #ff2d9b 0%, #e040fb 50%, #b388ff 100%);
  box-shadow: 0 8px 28px rgba(255, 45, 155, 0.35);
  transition: transform 0.12s, box-shadow 0.18s, filter 0.18s;
}
.login-submit svg { width: 18px; height: 18px; }
.login-submit:hover {
  filter: brightness(1.06);
  box-shadow: 0 10px 32px rgba(255, 45, 155, 0.45);
}
.login-submit:active { transform: scale(0.98); }

.chat-channel-tag {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--pink-dim);
  color: var(--pink);
  border: 1px solid rgba(255, 45, 155, 0.3);
}
.chat-header .info span#onlineStatus { display: block; }
.card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.card-title { font-size: 13px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; }
.card-desc { font-size: 11px; color: var(--text-muted); line-height: 1.3; }

.card-social {
  flex-direction: column;
  justify-content: center;
  text-align: center;
  gap: 8px;
  min-height: 86px;
  padding: 14px 10px;
}
.card-social .card-title { font-size: 12px; font-weight: 700; }
.card-call {
  grid-column: span 2;
  flex-direction: row;
  justify-content: flex-start;
  text-align: left;
  min-height: 70px;
  padding: 14px 16px;
  background: linear-gradient(90deg, rgba(255, 45, 155, 0.12), var(--bg-card));
  border-color: rgba(255, 45, 155, 0.35);
}
.card-call .card-body { align-items: flex-start; }
.card-call .card-desc { font-size: 11px; font-weight: 600; color: var(--phone); white-space: normal; }

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
}
.social-icon svg { width: 24px; height: 24px; }
.social-icon--telegram { background: rgba(41, 182, 246, 0.15); color: var(--telegram); }
.social-icon--messenger { background: rgba(0, 132, 255, 0.15); color: var(--messenger); }
.social-icon--zalo { background: rgba(0, 104, 255, 0.15); color: var(--zalo); }
.social-icon--sms { background: var(--pink-dim); color: var(--phone); border-radius: var(--radius-sm); }
.social-icon--phone { background: var(--pink-dim); color: var(--phone); border-radius: var(--radius-sm); }
.card-call .social-icon { border-radius: var(--radius-sm); }
.card.no-link { opacity: 0.65; cursor: not-allowed; }
.card.no-link:hover { transform: none; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25); }

.contact-empty-theme {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  padding: 12px;
}

.footer {
  margin-top: 28px;
  text-align: center;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.footer p { margin: 0; font-size: 12px; color: var(--text-muted); }
.footer-note { margin-top: 4px !important; font-size: 11px !important; opacity: 0.7; }

.toast {
  position: fixed;
  bottom: calc(24px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  max-width: calc(var(--max-w) - 32px);
  width: calc(100% - 32px);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(30, 0, 50, 0.92);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 200;
  backdrop-filter: blur(12px);
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

.panel-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 150;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.panel-overlay.active { display: flex; }
.panel {
  background: rgba(20, 0, 40, 0.95);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  padding: 24px;
  backdrop-filter: blur(12px);
}

/* Chat screen */
.chat-page {
  display: none;
  flex-direction: column;
  height: 100dvh;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}
.chat-page.active { display: flex; }

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(12px + var(--safe-top)) 16px 12px;
  background: rgba(20, 0, 40, 0.75);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.chat-header .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff2d9b, #e040fb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
}
.chat-header .info { flex: 1; min-width: 0; }
.chat-header .info h2 { font-size: 15px; margin: 0; }
.chat-header .info span { font-size: 12px; color: var(--green); }
.chat-header .btn-back {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
}

.chat-messages { background: transparent; }
.msg-row.user .msg-bubble { border: 1px solid rgba(255, 45, 155, 0.25); }
.msg-row.admin .msg-bubble { border: 1px solid rgba(179, 136, 255, 0.25); }
.msg-status.read { color: var(--pink); }

.chat-input-bar {
  background: rgba(20, 0, 40, 0.85);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(12px);
  padding-bottom: calc(12px + var(--safe-bottom));
}
.chat-input-bar textarea {
  background: rgba(0, 0, 0, 0.25);
  border-color: var(--border);
}
.chat-input-bar textarea:focus { border-color: var(--pink); }
.chat-input-bar .btn-primary {
  background: linear-gradient(135deg, #ff2d9b, #e040fb);
}

.chat-contact-section {
  background: rgba(20, 0, 40, 0.6);
  border-top: 1px solid var(--border);
}
.chat-contact-section .theme-contact-grid {
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 6px;
}
.chat-contact-section .card-social { min-height: 72px; padding: 10px 6px; }
.chat-contact-section .social-icon { width: 34px; height: 34px; }
.chat-contact-section .social-icon svg { width: 18px; height: 18px; }

.welcome-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.welcome-card .welcome-label { color: var(--pink); }

.inactivity-banner {
  display: none;
  padding: 12px 16px;
  background: rgba(255, 201, 64, 0.12);
  border-top: 1px solid rgba(255, 201, 64, 0.35);
  color: var(--warning);
  font-size: 13px;
  text-align: center;
  flex-shrink: 0;
}
.inactivity-banner.active { display: block; }

.busy-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.busy-overlay.active { display: flex; }
.busy-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

@media (min-width: 400px) {
  .card-title { font-size: 14px; }
  .card-social .card-title { font-size: 13px; }
}
