/* ── Reset & Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:   #5B21B6;
  --primary-l: #7C3AED;
  --primary-d: #4C1D95;
  --accent:    #F59E0B;
  --accent2:   #10B981;
  --bg:        #F5F3FF;
  --surface:   #FFFFFF;
  --border:    #DDD6FE;
  --text:      #1E1B4B;
  --muted:     #6B7280;
  --danger:    #EF4444;
  --success:   #10B981;
  --radius:    14px;
  --shadow-sm: 0 2px 8px rgba(91,33,182,.08);
  --shadow:    0 8px 32px rgba(91,33,182,.12);
  --shadow-lg: 0 20px 60px rgba(91,33,182,.18);
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.hidden { display: none !important; }

/* ── Scrollbar ────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Navbar ───────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 68px;
  background: var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(91,33,182,.35);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: #fff;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -.5px;
}

.brand-icon { font-size: 1.6rem; }

.nav-left { display: flex; align-items: center; gap: 1rem; }

.nav-apps-menu { position: relative; }
.nav-apps-btn {
  cursor: pointer;
  list-style: none;
  background: rgba(255,255,255,.15);
  color: #fff;
  padding: .35rem .75rem;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
}
.nav-apps-btn::-webkit-details-marker { display: none; }
.nav-apps-menu[open] .nav-apps-btn { background: rgba(255,255,255,.28); }
.nav-apps-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: 0 10px 35px rgba(0,0,0,.25);
  padding: .5rem;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  min-width: 150px;
  z-index: 250;
}
.nav-apps-dropdown a {
  color: var(--text);
  text-decoration: none;
  padding: .5rem .6rem;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 600;
}
.nav-apps-dropdown a:hover { background: var(--bg); }

.nav-actions, .nav-user {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.nav-user { position: relative; }

.nav-user-menu { display: flex; align-items: center; gap: .75rem; }

.nav-hamburger-btn {
  display: none;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  padding: .3rem .5rem;
  line-height: 1;
}

#navUserName {
  color: #EDE9FE;
  font-size: .9rem;
  font-weight: 600;
}

/* ── Buttons ──────────────────────────────────────── */
.btn {
  padding: .55rem 1.4rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

.btn-primary {
  background: #fff;
  color: var(--primary);
}
.btn-primary:hover { background: #EDE9FE; }

.btn-primary-solid {
  background: var(--primary);
  color: #fff;
}
.btn-primary-solid:hover { background: var(--primary-d); }

.btn-outline {
  background: transparent;
  border: 2px solid rgba(255,255,255,.5);
  color: #fff;
}
.btn-outline:hover { background: rgba(255,255,255,.15); border-color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--border); }

.btn-lg { padding: .8rem 2rem; font-size: 1rem; border-radius: 12px; }
.btn-full { width: 100%; margin-top: .75rem; padding: .8rem; justify-content: center; }

/* ── Hero ─────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary-d) 0%, var(--primary-l) 60%, #A78BFA 100%);
  color: #fff;
  padding: 5rem 2rem 6rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-inner { position: relative; max-width: 700px; margin: 0 auto; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  padding: .35rem 1rem;
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(4px);
}

.hero h1 {
  font-size: 3.2rem;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1.25rem;
  letter-spacing: -.5px;
}

.hero h1 span { color: var(--accent); }

.hero p {
  font-size: 1.15rem;
  opacity: .85;
  line-height: 1.7;
  margin-bottom: 2.5rem;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.hero-btn-primary {
  background: var(--accent);
  color: #1E1B4B;
  padding: .85rem 2.25rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 4px 20px rgba(245,158,11,.35);
}
.hero-btn-primary:hover { background: #D97706; transform: translateY(-2px); }

.hero-btn-outline {
  background: rgba(255,255,255,.12);
  color: #fff;
  padding: .85rem 2.25rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid rgba(255,255,255,.4);
  cursor: pointer;
  transition: all .2s;
  backdrop-filter: blur(4px);
}
.hero-btn-outline:hover { background: rgba(255,255,255,.22); }

/* ── Group Cards (landing) ────────────────────────── */
.groups-showcase {
  max-width: 1100px;
  margin: -2rem auto 0;
  padding: 0 1.5rem 3rem;
  position: relative;
  z-index: 2;
}

.groups-showcase h2 {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.group-pill {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
  font-weight: 700;
  font-size: .9rem;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: all .2s;
}

.group-pill:hover { border-color: var(--primary-l); color: var(--primary); transform: translateY(-3px); box-shadow: var(--shadow); }
.group-pill .gi { font-size: 2rem; display: block; margin-bottom: .4rem; }

/* ── App Section ──────────────────────────────────── */
.app-section {
  display: flex;
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
  gap: 1.25rem;
  min-height: calc(100vh - 68px);
}

/* ── Filter Panel ─────────────────────────────────── */
.filter-panel {
  width: 270px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  height: fit-content;
  position: sticky;
  top: 84px;
  box-shadow: var(--shadow-sm);
}

.filter-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.filter-label {
  font-size: .75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: .75rem 0 .3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.filter-label .opt-tag {
  font-size: .65rem;
  background: #EDE9FE;
  color: var(--primary);
  padding: .1rem .4rem;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.filter-panel select,
.filter-panel input {
  width: 100%;
  padding: .55rem .8rem;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: .88rem;
  outline: none;
  background: var(--bg);
  color: var(--text);
  transition: border-color .2s;
}
.filter-panel select:focus,
.filter-panel input:focus { border-color: var(--primary-l); }

.range-row { display: flex; align-items: center; gap: .4rem; }
.range-row input { flex: 1; }
.range-row span { color: var(--muted); font-weight: 600; }

.filter-actions { display: flex; gap: .5rem; margin-top: 1rem; }
.filter-actions .btn { flex: 1; justify-content: center; }

/* ── Members Area ─────────────────────────────────── */
.members-area { flex: 1; min-width: 0; }

.members-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: .5rem;
}

.members-header h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
}

.members-count {
  background: var(--primary);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  padding: .25rem .75rem;
  border-radius: 999px;
}

.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}

.empty-state {
  grid-column: 1/-1;
  text-align: center;
  padding: 4rem 2rem;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
}
.empty-state .es-icon { font-size: 3rem; display: block; margin-bottom: .75rem; }

/* ── Member Card ──────────────────────────────────── */
.member-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  transition: all .2s;
  position: relative;
  overflow: hidden;
}

.member-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-l), var(--accent));
  opacity: 0;
  transition: opacity .2s;
}

.member-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #C4B5FD; }
.member-card:hover::before { opacity: 1; }

.member-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-l));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  font-weight: 800;
  margin-bottom: .35rem;
  position: relative;
}

.online-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: var(--success);
  border: 2px solid #fff;
  border-radius: 50%;
  display: none;
}
.online-indicator.active { display: block; }

.online-badge {
  font-size: .68rem;
  font-weight: 600;
  color: var(--success);
  margin-left: .35rem;
  vertical-align: middle;
}

.last-seen-badge {
  font-size: .68rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: .35rem;
  vertical-align: middle;
}

.member-name {
  font-weight: 700;
  font-size: .95rem;
  color: var(--text);
}

.member-occupation {
  font-size: .8rem;
  color: var(--primary-l);
  font-weight: 600;
}

.member-role {
  font-weight: 400;
  color: #999;
  font-size: .75rem;
}

.member-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .2rem;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .15rem .5rem;
  font-size: .73rem;
  color: var(--muted);
  font-weight: 500;
}

.group-tag {
  display: inline-block;
  background: #EDE9FE;
  color: var(--primary);
  font-size: .72rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 6px;
  margin-top: .25rem;
}

.member-desc {
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.5;
  margin-top: .2rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.member-card-actions {
  display: flex;
  gap: .5rem;
  margin-top: .6rem;
}
.chat-btn {
  flex: 1;
  padding: .5rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
}
.chat-btn:hover { background: var(--primary-d); }
.report-btn {
  padding: .5rem .7rem;
  background: transparent;
  color: #f87171;
  border: 1.5px solid #f87171;
  border-radius: 9px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s;
  white-space: nowrap;
}
.report-btn:hover { background: #f87171; color: #fff; }
.msg-system {
  text-align: center;
  font-size: .78rem;
  color: #f87171;
  background: #450a0a22;
  border-radius: 8px;
  padding: .4rem .75rem;
  margin: .4rem auto;
  max-width: 90%;
}

/* ── Chat Drawer ──────────────────────────────────── */
.chat-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30,27,75,.4);
  /* Above the persistent married/permission banners (z-index 9998-9999) —
     an open chat should never be covered by them. */
  z-index: 10000;
  backdrop-filter: blur(2px);
}

.chat-drawer {
  position: fixed;
  right: 0; top: 0; bottom: 0;
  width: 420px;
  max-width: 96vw;
  background: var(--surface);
  box-shadow: -8px 0 40px rgba(91,33,182,.2);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  animation: slideIn .25s ease;
}

@keyframes slideIn {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, var(--primary-d), var(--primary-l));
  color: #fff;
}

.chat-header-info { display: flex; align-items: center; gap: .75rem; min-width: 0; flex: 1; }

.chat-avatar {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  border: 2px solid rgba(255,255,255,.4);
}

.chat-header-info > div:last-child { min-width: 0; overflow: hidden; }
.chat-with-name { font-weight: 700; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-with-detail { font-size: .75rem; opacity: .75; margin-top: .1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chat-header-actions { flex-shrink: 0; }

.close-btn {
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.close-btn:hover { background: rgba(255,255,255,.3); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  background: #F5F3FF;
}

.chat-day-label {
  text-align: center;
  font-size: .72rem;
  color: var(--muted);
  background: rgba(255,255,255,.7);
  padding: .25rem .75rem;
  border-radius: 999px;
  display: inline-block;
  margin: .25rem auto;
  align-self: center;
}

.msg-bubble {
  max-width: 78%;
  padding: .65rem 1rem;
  border-radius: 16px;
  font-size: .9rem;
  line-height: 1.5;
  word-break: break-word;
  position: relative;
}

.msg-bubble.sent {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(91,33,182,.25);
}

.msg-bubble.received {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.msg-time {
  font-size: .65rem;
  opacity: .7;
}
.msg-bubble.received .msg-meta-row { justify-content:flex-start; }

.chat-input-row {
  display: flex;
  gap: .6rem;
  padding: .9rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.chat-input-row input {
  flex: 1;
  padding: .65rem 1.1rem;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  font-size: .9rem;
  outline: none;
  background: var(--bg);
  transition: border-color .2s;
}
.chat-input-row input:focus { border-color: var(--primary-l); }

.icon-btn {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: all .2s;
  color: var(--muted);
}
.icon-btn:hover { background: var(--border); border-color: var(--primary-l); }

.emoji-picker {
  position: absolute;
  bottom: 75px;
  left: 0; right: 0;
  background: var(--surface);
  border-top: 1.5px solid var(--border);
  padding: .75rem;
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  max-height: 200px;
  overflow-y: auto;
  z-index: 10;
}

.emoji-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  padding: .2rem .25rem;
  border-radius: 6px;
  transition: background .15s;
  line-height: 1;
}
.emoji-btn:hover { background: var(--bg); }

.attachment-preview {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: .5rem .75rem;
  margin: 0 1.25rem .5rem;
  font-size: .82rem;
  color: var(--text);
}

.attachment-preview img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.attachment-preview .att-name {
  flex: 1;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.att-remove {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 1rem;
  padding: .1rem .3rem;
  border-radius: 4px;
}
.att-remove:hover { background: #FEF2F2; }

.msg-image {
  max-width: 200px;
  border-radius: 10px;
  margin-bottom: .25rem;
  display: block;
  cursor: pointer;
}

.msg-file {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255,255,255,.15);
  border-radius: 8px;
  padding: .4rem .6rem;
  margin-bottom: .25rem;
  font-size: .82rem;
  text-decoration: none;
  color: inherit;
}
.msg-bubble.sent .msg-file { background: rgba(255,255,255,.2); }
.msg-bubble.received .msg-file { background: var(--bg); color: var(--text); }

.send-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 42px; height: 42px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: background .2s;
}
.send-btn:hover { background: var(--primary-d); }

/* ── Modals ───────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(30,27,75,.55);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--surface);
  border-radius: 20px;
  padding: 2rem;
  width: 100%;
  max-width: 540px;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: modalIn .25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1)  translateY(0); }
}

.modal-header { margin-bottom: 1.5rem; }
.modal h2 { font-size: 1.5rem; font-weight: 800; color: var(--text); }
.modal-sub { color: var(--muted); font-size: .88rem; margin-top: .25rem; }

.modal-close {
  position: absolute;
  top: 1.1rem; right: 1.1rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  color: var(--muted);
}
.modal-close:hover { background: var(--border); color: var(--text); }

/* ── Form ─────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .9rem;
}

.form-group { display: flex; flex-direction: column; gap: .3rem; }
.form-group.full { grid-column: 1/-1; }

.dob-input-group { display: flex; gap: .5rem; }
.dob-input-col { display: flex; flex-direction: column; gap: .2rem; width: 0; flex: 1; }
.dob-input-col:last-child { flex: 1.4; }
.dob-input-group input { width: 100%; text-align: center; }
.dob-sublabel { font-size: .7rem; color: var(--text-muted,#6b7280); text-align: center; }

.form-group label {
  font-size: .75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  display: flex;
  align-items: center;
  gap: .3rem;
}

.req { color: var(--danger); }
.opt { color: #A78BFA; font-size: .68rem; font-weight: 600; background: #EDE9FE; padding: .05rem .35rem; border-radius: 4px; text-transform: none; letter-spacing: 0; }
.field-note { display: block; font-size: .7rem; color: #7C3AED; margin-top: .25rem; font-style: italic; }

/* ── Married Banner ───────────────────────────────── */
.married-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  background: linear-gradient(135deg, #7c3aed, #db2777);
  color: #fff;
  padding: 1rem 1.5rem;
  box-shadow: 0 4px 24px rgba(124,58,237,.4);
  animation: slideDown .4s ease;
}
@keyframes slideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }
.married-banner.hidden { display: none; }
.married-banner-inner {
  max-width: 900px; margin: 0 auto;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.married-banner-emoji { font-size: 2rem; line-height: 1; }
.married-banner-text { flex: 1; }
.married-banner-text h3 { font-size: 1.1rem; margin-bottom: .2rem; }
.married-banner-text p  { font-size: .82rem; opacity: .9; }
.married-story-btn {
  background: #fff; color: #7c3aed;
  border: none; border-radius: 10px;
  padding: .55rem 1.2rem; font-size: .85rem; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  transition: opacity .2s;
}
.married-story-btn:hover { opacity: .85; }
.married-banner-close {
  background: none; border: none; color: #fff;
  font-size: 1.2rem; cursor: pointer; opacity: .8; padding: .2rem;
}
.married-banner-close:hover { opacity: 1; }

/* ── Permissions Banner (notifications + location) ── */
.permission-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9998;
  background: linear-gradient(135deg, #2563eb, #0891b2);
  color: #fff;
  padding: 1rem 1.5rem;
  box-shadow: 0 4px 24px rgba(37,99,235,.4);
  animation: slideDown .4s ease;
}
.permission-banner.hidden { display: none; }
.permission-banner-inner {
  max-width: 900px; margin: 0 auto;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.permission-banner-emoji { font-size: 2rem; line-height: 1; }
.permission-banner-text { flex: 1; }
.permission-banner-text h3 { font-size: 1.1rem; margin-bottom: .2rem; }
.permission-banner-text p  { font-size: .82rem; opacity: .9; }
.permission-banner-btn {
  background: #fff; color: #2563eb;
  border: none; border-radius: 10px;
  padding: .55rem 1.2rem; font-size: .85rem; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  transition: opacity .2s;
}
.permission-banner-btn:hover { opacity: .85; }
.permission-banner-close {
  background: none; border: none; color: #fff;
  font-size: 1.2rem; cursor: pointer; opacity: .8; padding: .2rem;
}
.permission-banner-close:hover { opacity: 1; }
@media (max-width: 600px) {
  .permission-banner { padding: .8rem 1rem; }
  .permission-banner-inner { align-items: flex-start; }
  .permission-banner-text { min-width: 100%; order: 1; }
  .permission-banner-emoji { order: 0; font-size: 1.5rem; }
  .permission-banner-btn { order: 2; }
  .permission-banner-close { order: 3; margin-left: auto; }
}

/* ── Married Sidebar Note ─────────────────────────── */
.married-sidebar-note {
  background: linear-gradient(135deg, #f5f3ff, #fce7f3);
  border: 1.5px solid #a78bfa;
  border-radius: 12px;
  padding: .85rem 1rem;
  font-size: .8rem;
  color: #4c1d95;
  line-height: 1.6;
  margin-top: .75rem;
  text-align: center;
}

.form-group input,
.form-group select {
  padding: .65rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: .9rem;
  outline: none;
  background: var(--bg);
  color: var(--text);
  width: 100%;
  transition: border-color .2s, box-shadow .2s;
}

.form-group textarea {
  padding: .65rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: .9rem;
  outline: none;
  background: var(--bg);
  color: var(--text);
  width: 100%;
  resize: vertical;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.form-group textarea:focus {
  border-color: var(--primary-l);
  box-shadow: 0 0 0 3px rgba(124,58,237,.1);
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--primary-l);
  box-shadow: 0 0 0 3px rgba(124,58,237,.1);
}

/* ── Aadhaar Upload ───────────────────────────────── */
.aadhaar-upload-box {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: #F5F3FF;
  border: 1.5px dashed #A78BFA;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.char-quiz-box {
  background: #F5F3FF;
  border: 1.5px solid #DDD6FE;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.char-quiz-chat-log {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: .7rem;
  padding-right: .25rem;
}
.char-quiz-bubble {
  font-size: .82rem;
  line-height: 1.4;
  padding: .5rem .75rem;
  border-radius: 10px;
  max-width: 88%;
}
.char-quiz-bubble.assistant {
  background: #fff;
  border: 1px solid #E5E0FA;
  color: #3730A3;
  align-self: flex-start;
}
.char-quiz-bubble.user {
  background: #7C3AED;
  color: #fff;
  align-self: flex-end;
}
.char-quiz-input-row { display: flex; gap: .5rem; align-items: flex-end; }
.char-quiz-input-row textarea {
  flex: 1;
  resize: none;
  font-size: .82rem;
  border: 1px solid #E5E0FA;
  border-radius: 8px;
  padding: .5rem .6rem;
  font-family: inherit;
}
.char-quiz-input-row textarea:focus { outline: none; border-color: #A78BFA; }
.char-quiz-done { font-size: .82rem; color: #15803D; margin-top: .5rem; font-weight: 600; }

.char-quiz-q { margin-bottom: 1rem; }
.char-quiz-q:last-child { margin-bottom: 0; }
.char-quiz-q-text { font-size: .85rem; font-weight: 600; color: #3730A3; margin-bottom: .4rem; }
.char-quiz-options { display: flex; flex-direction: column; gap: .35rem; }
.char-quiz-option {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  font-size: .82rem;
  color: #3F3F46;
  cursor: pointer;
  background: #fff;
  border: 1px solid #E5E0FA;
  border-radius: 8px;
  padding: .45rem .6rem;
}
.char-quiz-option:hover { border-color: #A78BFA; }
.char-quiz-option input { margin-top: .15rem; flex-shrink: 0; }

.aadhaar-icon { font-size: 2rem; line-height: 1; }
.aadhaar-upload-info { flex: 1; }
.aadhaar-preview {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: #EDE9FE;
  border-radius: 8px;
  padding: .35rem .75rem;
  font-size: .8rem;
  color: #5B21B6;
  width: 100%;
  margin-top: .5rem;
}
.aadhaar-preview.hidden { display: none; }
.aadhaar-clear {
  background: none;
  border: none;
  color: #7C3AED;
  cursor: pointer;
  font-size: .9rem;
  margin-left: auto;
  padding: 0;
}

/* ── Profile Image Upload ─────────────────────────── */
.img-upload-box {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--bg);
  border: 1.5px dashed var(--border);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  transition: border-color .2s;
}
.img-upload-box:hover { border-color: var(--primary-l); }

.img-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-l));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
  overflow: hidden;
  border: 3px solid #fff;
  box-shadow: var(--shadow-sm);
}

.img-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.img-upload-info { flex: 1; }

.img-upload-label {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text);
  display: block;
  margin-bottom: .2rem;
  cursor: pointer;
}

.img-upload-hint {
  font-size: .75rem;
  color: var(--muted);
  margin-bottom: .6rem;
}

.btn-choose-img {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: .4rem 1rem;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.btn-choose-img:hover { background: var(--primary-d); }

/* member card photo */
.member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 50%;
}

/* chat avatar photo */
.chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 50%;
}

/* ── Payment Box ──────────────────────────────────── */
.payment-box {
  background: linear-gradient(135deg, #F0FDF4, #ECFDF5);
  border: 2px solid #6EE7B7;
  border-radius: 16px;
  padding: 1.4rem;
  text-align: center;
  margin-bottom: 1.25rem;
}

.payment-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: var(--success);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: .25rem .85rem;
  border-radius: 999px;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: .5rem;
}

.payment-amount {
  font-size: 2.6rem;
  font-weight: 900;
  color: #065F46;
  line-height: 1;
  margin-bottom: .25rem;
}

.payment-note {
  font-size: .78rem;
  color: #6B7280;
  margin-bottom: .9rem;
}

.qr-wrapper {
  display: inline-block;
  margin-bottom: .9rem;
  width: 220px;
  height: 330px;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}

.qr-img {
  width: 220px;
  height: auto;
  display: block;
}

.upi-id-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-size: .85rem;
  background: #fff;
  border: 1px solid #D1FAE5;
  border-radius: 10px;
  padding: .45rem 1rem;
  margin-bottom: .6rem;
}

.upi-id-box strong { color: #065F46; font-weight: 700; }

.copy-btn {
  background: var(--success);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: .2rem .65rem;
  font-size: .74rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s;
}
.copy-btn:hover { background: #059669; }

.payment-instruction {
  font-size: .78rem;
  color: var(--muted);
}

/* ── Error ────────────────────────────────────────── */
.error-msg {
  color: var(--danger);
  font-size: .84rem;
  background: #FEF2F2;
  border: 1.5px solid #FECACA;
  border-radius: 10px;
  padding: .65rem 1rem;
  margin: .5rem 0;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.success-msg {
  color: #065F46;
  font-size: .84rem;
  background: #F0FDF4;
  border: 1.5px solid #6EE7B7;
  border-radius: 10px;
  padding: .65rem 1rem;
  margin: .5rem 0;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.switch-link {
  text-align: center;
  margin-top: 1rem;
  font-size: .85rem;
  color: var(--muted);
}
.switch-link a { color: var(--primary); text-decoration: none; font-weight: 700; }
.switch-link a:hover { text-decoration: underline; }

/* ── Divider ──────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 1.25rem 0; }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 900px) {
  .app-section { flex-direction: column; }
  .filter-panel { width: 100%; position: static; }
}

@media (max-width: 600px) {
  .hero h1 { font-size: 2.1rem; }
  .navbar { padding: 0 1rem; }
  .nav-left { gap: .5rem; }
  .nav-brand { font-size: 1.05rem; gap: .35rem; }
  .brand-icon { font-size: 1.2rem; }
  .nav-apps-btn { padding: .3rem .55rem; font-size: .7rem; }
  .nav-actions { gap: .4rem; }
  .nav-actions .btn { padding: .4rem .7rem; font-size: .78rem; }
  .form-grid { grid-template-columns: 1fr; }
  .modal { padding: 1.5rem 1.25rem; border-radius: 16px; }

  /* Nav buttons collapse into a hamburger dropdown — keeps Sign Out reachable */
  .nav-hamburger-btn { display: inline-flex; }
  .nav-user-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: .5rem;
    background: var(--surface);
    padding: .9rem;
    border-radius: 12px;
    box-shadow: 0 10px 35px rgba(0,0,0,.3);
    z-index: 250;
    min-width: 210px;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
  }
  .nav-user-menu.open { display: flex; }
  .nav-user-menu .btn { width: 100%; justify-content: flex-start; }
  /* .btn-outline is white-on-transparent for the purple navbar — on the light
     dropdown panel that's invisible, so override it here specifically. */
  .nav-user-menu .btn-outline { background: var(--bg); border-color: var(--border); color: var(--text); }
  #navUserName { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Chat drawer — full screen on mobile */
  .chat-drawer {
    width: 100vw;
    max-width: 100vw;
    top: 0; bottom: 0; right: 0; left: 0;
    border-radius: 0;
  }
  .chat-messages {
    padding: .75rem;
  }
  .chat-input-row {
    padding: .6rem .75rem;
    gap: .4rem;
  }
  .chat-input-row input {
    font-size: .85rem;
    padding: .55rem .85rem;
  }
  .icon-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  .chat-header {
    padding: .75rem 1rem;
  }
  .emoji-picker {
    bottom: 65px;
    max-height: 160px;
  }
}

/* ═══════════════════════════════════════════
   ASTROLOGY FEATURES
═══════════════════════════════════════════ */

/* ── Cosmic Splash Screen ── */
.cosmic-splash {
  position: fixed; inset: 0; z-index: 9999;
  background: radial-gradient(ellipse at center, #1a0533 0%, #0a0118 60%, #000 100%);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  animation: cosmicFadeIn .4s ease;
}
.cosmic-splash.hidden { display: none; }
@keyframes cosmicFadeIn { from { opacity:0 } to { opacity:1 } }
@keyframes cosmicFadeOut { from { opacity:1 } to { opacity:0 } }
.cosmic-splash.fade-out { animation: cosmicFadeOut .8s ease forwards; }

.cosmic-stars { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.cosmic-star {
  position: absolute; background: #fff; border-radius: 50%;
  animation: twinkle var(--dur, 2s) ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity:.2; transform:scale(1) } to { opacity:1; transform:scale(1.4) } }

.cosmic-content { text-align: center; z-index: 1; padding: 2rem; }
.cosmic-sign-symbol {
  font-size: 6rem; line-height: 1;
  animation: floatSign 3s ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(200,150,255,.8));
}
@keyframes floatSign {
  0%,100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-18px) scale(1.08); }
}
.cosmic-sign-name {
  font-size: 1rem; letter-spacing: .35em; text-transform: uppercase;
  color: #c89dff; margin: .5rem 0 1.2rem; font-weight: 600;
}
.cosmic-welcome {
  font-size: 1.9rem; font-weight: 800; color: #fff;
  margin: 0 0 .6rem;
  text-shadow: 0 0 30px rgba(200,150,255,.6);
}
.cosmic-message {
  font-size: 1rem; color: #d4b8ff; max-width: 360px;
  margin: 0 auto 2rem; line-height: 1.6; font-style: italic;
}
.cosmic-loader { display: flex; gap: .5rem; justify-content: center; }
.cosmic-loader span {
  width: 8px; height: 8px; border-radius: 50%;
  background: #c89dff;
  animation: cosmicDot 1.2s ease-in-out infinite;
}
.cosmic-loader span:nth-child(2) { animation-delay: .2s; }
.cosmic-loader span:nth-child(3) { animation-delay: .4s; }
@keyframes cosmicDot {
  0%,80%,100% { transform:scale(0); opacity:.3 }
  40%          { transform:scale(1); opacity:1 }
}

/* ── Zodiac Toast ── */
.zodiac-toast {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 8000;
  background: linear-gradient(135deg, #2d0a5a, #1a0533);
  border: 1px solid rgba(200,150,255,.35);
  border-radius: 16px; padding: 1rem 1.3rem;
  display: flex; align-items: center; gap: .9rem;
  box-shadow: 0 8px 32px rgba(100,0,200,.4);
  max-width: 340px; color: #fff;
  animation: toastSlide .5s cubic-bezier(.34,1.56,.64,1);
  transition: opacity .4s;
}
.zodiac-toast.hidden { display: none; }
.zodiac-toast.toast-hide { opacity: 0; }
@keyframes toastSlide {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.zodiac-toast-icon { font-size: 2.2rem; flex-shrink: 0; }
.zodiac-toast-text { display: flex; flex-direction: column; gap: .15rem; }
.zodiac-toast-text strong { font-size: .95rem; color: #e8d5ff; }
.zodiac-toast-text span   { font-size: .82rem; color: #b89dcc; line-height: 1.4; }

/* ── Astrology Sidebar Widget ── */
.astro-widget {
  margin-top: 1.5rem;
  background: linear-gradient(135deg, #1e0840, #2d0a5a);
  border: 1px solid rgba(200,150,255,.25);
  border-radius: 14px; padding: 1rem 1.1rem;
  color: #e8d5ff;
}
.astro-widget-header {
  font-size: .78rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: #c89dff; margin-bottom: .7rem;
}
.astro-widget-sign {
  font-size: 2rem; margin-bottom: .4rem; text-align: center;
}
.astro-widget-tip {
  font-size: .82rem; color: #d4b8ff; line-height: 1.5;
  font-style: italic; margin: 0 0 .6rem; text-align: center;
}
.astro-widget-footer {
  font-size: .72rem; color: #9b7fc0; text-align: center;
}

/* ── Panchangam Widget ── */
.panchangam-widget {
  background: linear-gradient(135deg, #1a0a2e, #0d0520);
  border: 1px solid rgba(255,200,50,.2);
  border-radius: 16px; padding: 1rem 1.1rem;
  margin-top: 1rem; color: #fff;
}
.panchangam-header {
  font-size: .85rem; font-weight: 700; color: #ffd700;
  text-align: center; letter-spacing: .04em; margin-bottom: .7rem;
}
.panchangam-body { display: flex; flex-direction: column; gap: .4rem; }
.panch-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .78rem; border-bottom: 1px solid rgba(255,255,255,.06); padding-bottom: .3rem;
}
.panch-label { color: #aaa; }
.panch-val { color: #fff; font-weight: 600; text-align: right; max-width: 60%; }
.panch-rahu { color: #ff6b6b; }
.panch-good { color: #6bffb8; }
.panch-neutral { color: #ffd700; }
.panch-loading { text-align:center; color:#9b7fc0; font-size:.8rem; padding:.5rem 0; }

.btn-health-assist {
  background: linear-gradient(135deg, #0a7c4a, #0fa86a);
  color: #fff; font-weight: 700; font-size: .85rem;
  border: none; border-radius: 8px; padding: .45rem 1rem;
  cursor: pointer; transition: opacity .2s;
}
.btn-health-assist:hover { opacity: .85; }

.btn-astrologer {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff; font-weight: 700; font-size: .85rem;
  border: none; border-radius: 8px; padding: .45rem 1rem;
  cursor: pointer; transition: opacity .2s;
}
.btn-astrologer:hover { opacity: .85; }

/* ── Astrologer Modal ── */
.astro-chat-messages {
  flex: 1; overflow-y: auto; padding: .8rem 1rem;
  display: flex; flex-direction: column; gap: .7rem;
}
.astro-msg { max-width: 85%; border-radius: 14px; padding: .65rem .9rem; font-size: .85rem; line-height: 1.5; }
.astro-msg.user { align-self: flex-end; background: linear-gradient(135deg,#7b00cc,#4a0080); color:#fff; border-bottom-right-radius:4px; }
.astro-msg.bot  { align-self: flex-start; background: linear-gradient(135deg,#1a0a2e,#2a1040); color:#e8d5ff; border: 1px solid rgba(200,150,255,.2); border-bottom-left-radius:4px; }
.astro-msg.bot .astro-bot-label { font-size:.7rem; color:#ffd700; font-weight:700; margin-bottom:.3rem; }
.astro-msg.typing { color:#9b7fc0; font-style:italic; font-size:.8rem; }
.astro-suggestions {
  display: flex; flex-wrap: wrap; gap: .4rem;
  padding: .5rem 1rem; flex-shrink: 0;
}
.astro-suggestions button {
  font-size: .75rem; padding: .35rem .75rem;
  border-radius: 20px; border: 1px solid rgba(200,150,255,.3);
  background: rgba(123,0,204,.1); color: #c89dff; cursor: pointer;
  transition: background .2s;
}
.astro-suggestions button:hover { background: rgba(123,0,204,.25); }
.astro-input-row {
  display: flex; gap: .5rem; padding: .7rem 1rem;
  border-top: 1px solid rgba(255,255,255,.08); flex-shrink: 0;
}
.astro-input-row input {
  flex: 1; background: rgba(100,60,180,.08); border: 1px solid rgba(120,80,200,.35);
  border-radius: 10px; padding: .55rem .9rem; color: #1a1a2e; font-size: .85rem;
  outline: none; caret-color: #1a1a2e; -webkit-text-fill-color: #1a1a2e;
}
.astro-input-row input::placeholder { color: #666; }

/* ── Zodiac chip on member cards ── */
.zodiac-chip {
  display: inline-flex; align-items: center; gap: .25rem;
  background: linear-gradient(135deg, rgba(100,0,200,.15), rgba(200,100,255,.1));
  border: 1px solid rgba(200,150,255,.3);
  border-radius: 20px; padding: .2rem .6rem;
  font-size: .75rem; color: #c89dff; font-weight: 600;
}

.nakshatra-chip {
  display: inline-flex; align-items: center; gap: .2rem;
  background: linear-gradient(135deg, rgba(255,170,0,.15), rgba(255,220,100,.1));
  border: 1px solid rgba(255,200,50,.35);
  border-radius: 20px; padding: .15rem .55rem;
  font-size: .72rem; color: #e8a800; font-weight: 600;
}
.lagna-chip {
  display: inline-flex; align-items: center; gap: .2rem;
  background: linear-gradient(135deg, rgba(0,180,255,.1), rgba(100,220,255,.08));
  border: 1px solid rgba(0,180,255,.3);
  border-radius: 20px; padding: .15rem .55rem;
  font-size: .72rem; color: #00b4d8; font-weight: 600;
}

/* Guna Milan row */
.guna-milan-row {
  display: flex; align-items: center; gap: .45rem;
  margin: .45rem 0 .3rem; flex-wrap: wrap;
}
.guna-label { font-size: .72rem; color: #aaa; white-space: nowrap; }
.guna-bar-wrap {
  flex: 1; min-width: 60px; height: 7px;
  background: rgba(255,255,255,.08); border-radius: 4px; overflow: hidden;
}
.guna-bar-fill { height: 100%; border-radius: 4px; transition: width .5s ease; }
.guna-score { font-size: .78rem; font-weight: 700; white-space: nowrap; }
.guna-verdict { font-size: .72rem; font-weight: 600; white-space: nowrap; }
.nadi-dosha-badge {
  font-size: .68rem; background: rgba(220,53,69,.15);
  border: 1px solid rgba(220,53,69,.4); border-radius: 12px;
  padding: .1rem .4rem; color: #ff6b7a; white-space: nowrap;
}
.match-vedic-note { font-size: .78rem; color: #9b7fc0; margin: .2rem 0 0; }

/* ── AI Agent Card ── */
.ai-agent-card {
  background: linear-gradient(135deg, #1e0840 0%, #2d0a5a 50%, #1a0533 100%);
  border: 1.5px solid rgba(200,150,255,.4);
  color: #e8d5ff;
  position: relative;
  overflow: hidden;
}
.ai-agent-card::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 70% 20%, rgba(200,100,255,.15), transparent 60%);
  pointer-events: none;
}
.ai-avatar {
  background: linear-gradient(135deg, #4a0080, #7b00cc) !important;
  font-size: 1.8rem !important;
  display: flex; align-items: center; justify-content: center;
  color: #fff !important;
}
.ai-agent-card .member-name { color: #fff; }
.ai-agent-card .member-occupation { color: #c89dff; }
.ai-agent-card .member-desc { color: #b89dcc; }
.ai-tag {
  background: linear-gradient(135deg, #7b00cc, #4a0080) !important;
  color: #fff !important;
}
.ai-chat-btn {
  background: linear-gradient(135deg, #7b00cc, #4a0080) !important;
  box-shadow: 0 4px 20px rgba(123,0,204,.4) !important;
}
.ai-chat-btn:hover {
  background: linear-gradient(135deg, #9b00ff, #6a00bb) !important;
  transform: translateY(-2px);
}
.msg-ai-intro {
  background: linear-gradient(135deg, rgba(100,0,200,.15), rgba(200,100,255,.1));
  border: 1px solid rgba(200,150,255,.2);
  border-radius: 12px; padding: .75rem 1rem;
  color: #d4b8ff; font-size: .9rem; margin-bottom: .5rem;
}

/* ── Find My Match Button ── */
.btn-find-match {
  width: 100%; margin-top: 1rem;
  padding: .75rem; border: none; border-radius: 12px; cursor: pointer;
  background: linear-gradient(135deg, #7b00cc, #4a0080);
  color: #fff; font-size: .9rem; font-weight: 700;
  box-shadow: 0 4px 20px rgba(123,0,204,.4);
  transition: transform .2s, box-shadow .2s;
}
.btn-find-match:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(123,0,204,.5); }

/* ── Match Modal ── */
.match-modal { max-width: 520px; }
.match-loading { text-align:center; padding: 2rem; color:#9b7fc0; }
.match-loading p { margin-top:1rem; font-style:italic; }
.match-error { text-align:center; padding:1.5rem; color:#9b7fc0; font-style:italic; }

.match-card {
  display: flex; gap: 1rem; align-items: flex-start;
  background: linear-gradient(135deg, #f8f4ff, #fff);
  border: 1px solid rgba(123,0,204,.15);
  border-radius: 14px; padding: 1rem 1.1rem; margin-bottom: .9rem;
  position: relative;
}
.match-rank {
  position:absolute; top:.6rem; right:.8rem;
  font-size:.75rem; font-weight:800; color:#7b00cc; opacity:.5;
}
.match-avatar {
  width: 54px; height: 54px; border-radius: 50%; flex-shrink:0;
  background: linear-gradient(135deg, #7b00cc, #4a0080);
  color:#fff; font-size:1.4rem; font-weight:700;
  display:flex; align-items:center; justify-content:center; overflow:hidden;
}
.match-avatar img { width:100%; height:100%; object-fit:cover; object-position:center top; }
.match-info { flex:1; min-width:0; }
.match-name { font-weight:700; font-size:1rem; color:#1a0533; display:flex; align-items:center; gap:.4rem; flex-wrap:wrap; }
.match-occupation { font-size:.82rem; color:#7b00cc; margin:.15rem 0; }
.match-location { font-size:.78rem; color:#888; margin-bottom:.3rem; }
.match-chips { display:flex; flex-wrap:wrap; gap:.3rem; margin:.3rem 0 .4rem; }
.match-score-bar { width:100%; height:6px; background:#ede9fe; border-radius:10px; margin:.3rem 0 .2rem; overflow:hidden; }
.match-score-fill { height:100%; background:linear-gradient(90deg,#7c3aed,#a78bfa); border-radius:10px; transition:width .6s ease; }
.match-score { font-size:.82rem; color:#f59e0b; font-weight:700; margin-bottom:.35rem; }
.match-score span { color:#555; font-weight:600; margin-left:.3rem; }
.match-reason { font-size:.82rem; color:#555; font-style:italic; line-height:1.45; margin:.3rem 0; }
.match-zodiac-note { font-size:.78rem; color:#9b7fc0; margin:.2rem 0 0; }

/* ── Voice AI Assistant ─────────────────────────────── */
.btn-voice-ai {
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  color: #fff;
  border: none;
  padding: .45rem 1rem;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s;
}
.btn-voice-ai:hover { opacity: .88; }

.btn-english-ai {
  background: linear-gradient(135deg, #059669, #34d399);
  color: #fff;
  border: none;
  padding: .45rem 1rem;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s;
}
.btn-english-ai:hover { opacity: .88; }

.btn-talk-now {
  background: linear-gradient(135deg, #ea580c, #fb923c);
  color: #fff;
  border: none;
  padding: .45rem 1rem;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s;
}
.btn-talk-now:hover { opacity: .88; }

.btn-danger {
  background: linear-gradient(135deg, #dc2626, #f87171);
  color: #fff;
  border: none;
  padding: .45rem 1rem;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s;
}
.btn-danger:hover { opacity: .88; }

.voice-ai-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  /* Above the chat drawer (10001) — a call started from within a chat must
     render on top of it, and above the persistent married/permission banners. */
  z-index: 10002;
  background: linear-gradient(135deg, #0f0720 0%, #1a0a3e 100%);
  border-bottom: 2px solid #7c3aed;
  box-shadow: 0 8px 40px rgba(124,58,237,.45);
  padding: 1.5rem 2rem;
  animation: slideDown .3s ease;
}
.voice-ai-overlay.open { display: block; }
@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

.voice-ai-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem;
}
.voice-ai-title { font-size: 1.1rem; font-weight: 700; color: #a78bfa; }
.voice-ai-close {
  background: none; border: none; color: #a78bfa; font-size: 1.4rem; cursor: pointer; line-height: 1;
}

.voice-mode-toggle {
  display: flex; gap: .5rem; margin-bottom: 1rem;
}
.voice-mode-btn {
  flex: 1; padding: .45rem .8rem; border-radius: 20px; cursor: pointer;
  font-size: .82rem; font-weight: 600;
  background: transparent; color: #a78bfa; border: 1px solid #7c3aed;
  transition: background .2s, color .2s;
}
.voice-mode-btn.active {
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  color: #fff;
}

.voice-ai-body {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}

.mic-btn {
  width: 70px; height: 70px; border-radius: 50%; border: none; cursor: pointer; flex-shrink: 0;
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  color: #fff; font-size: 1.8rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 0 rgba(167,139,250,.5);
  transition: transform .15s;
}
.mic-btn:hover { transform: scale(1.06); }
.mic-btn.listening {
  animation: micPulse 1.2s infinite;
  background: linear-gradient(135deg, #dc2626, #f87171);
}
@keyframes micPulse {
  0%   { box-shadow: 0 0 0 0 rgba(248,113,113,.6); }
  70%  { box-shadow: 0 0 0 18px rgba(248,113,113,0); }
  100% { box-shadow: 0 0 0 0 rgba(248,113,113,0); }
}

/* English Practice AI — always-on mic indicator, no click target (hands-free) */
.english-mic-indicator { cursor: default; }
.english-mic-indicator.hearing {
  animation: micPulse 1.2s infinite;
  background: linear-gradient(135deg, #dc2626, #f87171);
}
.english-mic-indicator.thinking {
  animation: micThinking 1s infinite ease-in-out;
  background: linear-gradient(135deg, #d97706, #fbbf24);
}
.english-mic-indicator.speaking {
  animation: micPulse 1.2s infinite;
  background: linear-gradient(135deg, #059669, #34d399);
}
@keyframes micThinking {
  0%, 100% { opacity: 1; }
  50%      { opacity: .5; }
}

/* Random Voice Talk */
.talk-now-body { flex-direction: column; align-items: center; gap: 1rem; }
.talk-now-state { display: flex; flex-direction: column; align-items: center; gap: .8rem; width: 100%; }
.talk-now-state.hidden { display: none; }
.talk-now-spinner {
  width: 48px; height: 48px; border-radius: 50%;
  border: 4px solid rgba(251,146,60,.25); border-top-color: #fb923c;
  animation: talkNowSpin 1s linear infinite;
}
@keyframes talkNowSpin { to { transform: rotate(360deg); } }
.talk-now-partner { font-size: 1rem; font-weight: 600; color: #fdba74; }
.talk-now-controls { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }
#talkNowRemoteAudio, #directCallRemoteAudio { display: none; }

/* Direct Chat Voice/Video Call — video stage */
.direct-call-videos {
  position: relative; width: 100%; max-width: 420px; aspect-ratio: 4/3;
  background: #0a0614; border-radius: 12px; overflow: hidden; margin: 0 auto;
}
.direct-call-videos.hidden { display: none; }
.direct-call-remote-video { width: 100%; height: 100%; object-fit: cover; background: #0a0614; }
.direct-call-local-video {
  position: absolute; bottom: 10px; right: 10px; width: 96px; height: 72px;
  object-fit: cover; border-radius: 8px; border: 2px solid rgba(255,255,255,.5);
  background: #1a1030;
}

/* Direct Chat Voice Call — incoming call popup */
.incoming-call-overlay {
  position: fixed; inset: 0;
  /* Highest of the chat/call stack — an incoming call must interrupt
     everything, including an already-open chat or call overlay. */
  z-index: 10003;
  background: rgba(0,0,0,.75);
  display: flex; align-items: center; justify-content: center;
}
.incoming-call-overlay.hidden { display: none; }
.incoming-call-card {
  background: #1a1030; border: 1px solid rgba(167,139,250,.35); border-radius: 16px;
  padding: 1.6rem 2rem; text-align: center; display: flex; flex-direction: column; gap: .6rem;
  min-width: 260px; animation: incomingCallPulse 1.4s ease-in-out infinite;
}
@keyframes incomingCallPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(167,139,250,.4); } 50% { box-shadow: 0 0 0 14px rgba(167,139,250,0); } }
.incoming-call-name { font-size: 1.1rem; font-weight: 700; color: #e0e0e0; margin: 0; }
.incoming-call-sub { font-size: .82rem; color: #a78bfa; margin: 0 0 .4rem; }

.voice-ai-convo {
  flex: 1; min-width: 260px; max-height: 160px; overflow-y: auto;
  display: flex; flex-direction: column; gap: .6rem;
}
.voice-bubble {
  padding: .55rem .9rem; border-radius: 12px; font-size: .88rem; line-height: 1.45; max-width: 90%;
}
.voice-bubble.user {
  background: #2e1065; color: #e0e0e0; align-self: flex-end; border-bottom-right-radius: 3px;
}
.voice-bubble.ai {
  background: #1e0f3a; color: #c4b5fd; align-self: flex-start; border-bottom-left-radius: 3px;
  border-left: 3px solid #7c3aed;
}
.voice-bubble.status { color: #888; font-style: italic; font-size: .8rem; align-self: center; }

.voice-ai-hint { font-size: .75rem; color: #666; margin-top: .5rem; text-align: center; }

/* ── Calendar ──────────────────────────────────────── */
.btn-my-groups { background: #7c3aed; color: #fff; border: none; font-size: .85rem; padding: .4rem .9rem; border-radius: 8px; cursor: pointer; }
.btn-my-groups:hover { background: #6d28d9; }
.btn-calendar { background: #0ea5e9; color: #fff; border: none; font-size: .85rem; padding: .4rem .9rem; border-radius: 8px; cursor: pointer; }
.btn-calendar:hover { background: #0284c7; }

.calendar-modal { max-width: 480px; width: 100%; }

.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.cal-nav-btn { background: none; border: 2px solid var(--border); border-radius: 8px; width: 34px; height: 34px; font-size: 1.3rem; cursor: pointer; color: var(--primary); display: flex; align-items: center; justify-content: center; }
.cal-nav-btn:hover { background: var(--bg); }
.cal-month-label { font-weight: 700; font-size: 1.1rem; color: var(--primary); }

.cal-weekdays { display: grid; grid-template-columns: repeat(7,1fr); text-align: center; font-size: .75rem; font-weight: 600; color: var(--muted); margin-bottom: .4rem; }

.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; }
.cal-cell {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; font-size: .9rem; cursor: pointer; font-weight: 500;
  border: 2px solid transparent; transition: all .15s;
}
.cal-cell:hover:not(.cal-blank) { border-color: var(--primary); background: var(--bg); }
.cal-blank { cursor: default; }
.cal-today { border-color: var(--primary) !important; font-weight: 800; color: var(--primary); }
.cal-marked { border-color: transparent !important; font-weight: 700; position: relative; }
.cal-count-badge {
  position: absolute; top: -4px; right: -4px; background: #1f2937; color: #fff;
  font-size: .6rem; font-weight: 800; border-radius: 50%; width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}

.cal-legend { margin-top: 1rem; display: flex; flex-direction: column; gap: .5rem; font-size: .82rem; }
.cal-legend-item { display: flex; align-items: center; gap: .5rem; background: var(--bg); border-radius: 8px; padding: .35rem .6rem; }
.cal-legend-item.cal-legend-past { opacity: .5; }
.cal-legend-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.cal-legend-date { font-weight: 700; color: #7c3aed; flex-shrink: 0; }
.cal-legend-label { color: var(--text); }
.cal-legend-empty { color: var(--muted); font-style: italic; }

/* Calendar popup */
.cal-popup { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.45); }
.cal-popup-inner { background: var(--surface); border-radius: var(--radius); padding: 1.5rem; width: 320px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 1rem; }
.cal-popup-date { font-weight: 700; font-size: 1rem; color: var(--primary); }
.cal-popup-inner input { border: 1.5px solid var(--border); border-radius: 8px; padding: .55rem .8rem; font-size: .9rem; width: 100%; outline: none; }
.cal-popup-inner input:focus { border-color: var(--primary); }
.cal-popup-colors { display: flex; gap: .6rem; }
.cal-color-opt { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; transition: border-color .15s; }
.cal-color-opt.selected, .cal-color-opt:hover { border-color: var(--text); }
.cal-popup-actions { display: flex; gap: .6rem; }
.cal-popup-list { display: flex; flex-direction: column; gap: .4rem; max-height: 160px; overflow-y: auto; }
.cal-popup-item { display: flex; align-items: center; gap: .5rem; background: var(--bg); border-radius: 8px; padding: .35rem .6rem; font-size: .82rem; }
.cal-popup-item-text { flex: 1; color: var(--text); }
.cal-popup-item-del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: .85rem; padding: 0 .2rem; }
.cal-popup-item-del:hover { color: #ef4444; }

/* ── Diary ─────────────────────────────────────────── */
.btn-diary { background: #d97706; color: #fff; border: none; font-size: .85rem; padding: .4rem .9rem; border-radius: 8px; cursor: pointer; }
.btn-diary:hover { background: #b45309; }

.diary-modal { max-width: 520px; width: 100%; max-height: 85vh; display: flex; flex-direction: column; }

.diary-new-btn { margin-bottom: 1rem; width: 100%; }

.diary-entries { display: flex; flex-direction: column; gap: .7rem; overflow-y: auto; max-height: 55vh; padding-right: 4px; }
.diary-empty { color: var(--muted); font-style: italic; text-align: center; padding: 2rem 0; }

.diary-entry-card { border: 1.5px solid var(--border); border-radius: 10px; padding: .85rem 1rem; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.diary-entry-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.diary-entry-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .3rem; }
.diary-entry-date { font-size: .78rem; color: var(--muted); font-weight: 600; }
.diary-entry-mood { font-size: 1.1rem; }
.diary-entry-title { font-weight: 700; font-size: .95rem; color: var(--text); margin-bottom: .25rem; }
.diary-entry-preview { font-size: .82rem; color: var(--muted); line-height: 1.4; }

/* Editor */
.diary-editor-top { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.diary-back-btn { background: none; border: 1.5px solid var(--border); border-radius: 8px; padding: .3rem .8rem; cursor: pointer; font-size: .85rem; color: var(--primary); font-weight: 600; }
.diary-back-btn:hover { background: var(--bg); }
.diary-editor-date { font-weight: 700; color: var(--primary); font-size: 1rem; }

.diary-mood-row { display: flex; align-items: center; gap: .5rem; margin-bottom: .8rem; flex-wrap: wrap; }
.diary-mood-label { font-size: .82rem; color: var(--muted); font-weight: 600; }
.diary-mood-opt { font-size: 1.4rem; cursor: pointer; border-radius: 8px; padding: 2px 5px; border: 2px solid transparent; transition: border-color .15s; }
.diary-mood-opt.selected, .diary-mood-opt:hover { border-color: var(--primary); background: var(--bg); }

.diary-title-input { width: 100%; border: 1.5px solid var(--border); border-radius: 8px; padding: .6rem .9rem; font-size: 1rem; font-weight: 600; margin-bottom: .7rem; outline: none; }
.diary-title-input:focus { border-color: var(--primary); }
.diary-content-input { width: 100%; border: 1.5px solid var(--border); border-radius: 8px; padding: .7rem .9rem; font-size: .92rem; line-height: 1.6; min-height: 200px; resize: vertical; outline: none; font-family: inherit; }
.diary-content-input:focus { border-color: var(--primary); }
.diary-editor-actions { display: flex; gap: .7rem; margin-top: .9rem; }

.diary-edit-btn { margin-left: auto; background: var(--primary); color: #fff; border: none; border-radius: 7px; padding: .25rem .7rem; font-size: .8rem; cursor: pointer; font-weight: 600; }
.diary-edit-btn:hover { background: var(--primary-l); }

/* ── World Clock Bar ───────────────────────────────── */
.world-clock-bar {
  display: flex; align-items: center; justify-content: center; gap: 1.5rem;
  background: #1E1B4B; color: #C4B5FD; font-size: .82rem;
  padding: .35rem 1rem; font-family: 'Segoe UI', sans-serif;
}
.world-clock-item { display: flex; align-items: center; gap: .4rem; }
.wc-flag { font-size: 1rem; }
.wc-label { color: #A78BFA; font-weight: 600; }
.wc-time { color: #E9D5FF; font-weight: 700; letter-spacing: .3px; }
.world-clock-divider { color: #4C1D95; font-size: 1rem; }

/* ── Telugu Calendar Widget ────────────────────────── */
.telugu-cal-widget {
  background: linear-gradient(135deg, #1a0533, #2d1060);
  border-radius: 12px; padding: 1rem; margin-top: .8rem;
  border: 1px solid #4C1D95;
}
.telugu-cal-header {
  font-weight: 800; font-size: .9rem; color: #F59E0B;
  margin-bottom: .75rem; text-align: center; letter-spacing: .3px;
}
.tel-cal-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: .3rem 0; border-bottom: 1px solid rgba(139,92,246,.2);
  font-size: .78rem;
}
.tel-cal-row:last-of-type { border-bottom: none; }
.tel-cal-key { color: #A78BFA; font-weight: 600; flex-shrink: 0; margin-right: .5rem; }
.tel-cal-val { color: #E9D5FF; text-align: right; line-height: 1.4; }
.tel-cal-festival {
  margin-top: .6rem; background: rgba(245,158,11,.15);
  border: 1px solid rgba(245,158,11,.4); border-radius: 8px;
  padding: .4rem .6rem; font-size: .78rem; color: #FCD34D;
  text-align: center; font-weight: 600;
}

/* ── Telugu Calendar ───────────────────────────────── */
.btn-telugu-cal {
  padding: .45rem 1rem;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #1a0533; font-weight: 800; font-size: .85rem;
  border: none; border-radius: 8px; cursor: pointer; letter-spacing: .3px;
}
.btn-telugu-cal:hover { background: linear-gradient(135deg, #fbbf24, #f59e0b); }

.tc-overlay {
  position: fixed; inset: 0; z-index: 3000;
  background: #0d0221; overflow-y: auto;
}
.tc-container { max-width: 1100px; margin: 0 auto; padding: 1rem; }

/* Header */
.tc-header {
  display: flex; align-items: center; gap: 1rem;
  background: linear-gradient(135deg, #1a0533, #4c1d95);
  border-radius: 14px; padding: 1rem 1.5rem; margin-bottom: 1rem;
  position: relative;
}
.tc-nav-btn {
  background: rgba(255,255,255,.15); border: none; color: #fff;
  font-size: 2rem; width: 44px; height: 44px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tc-nav-btn:hover { background: rgba(255,255,255,.3); }
.tc-title { flex: 1; text-align: center; }
.tc-month-tel { font-size: 2.2rem; font-weight: 900; color: #f59e0b; line-height: 1; }
.tc-month-eng { font-size: 1.1rem; color: #c4b5fd; font-weight: 600; margin-top: .2rem; }
.tc-sam       { font-size: .82rem; color: #a78bfa; margin-top: .3rem; }
.tc-close-btn {
  position: absolute; top: .8rem; right: .8rem;
  background: rgba(255,255,255,.15); border: none; color: #fff;
  width: 34px; height: 34px; border-radius: 50%; font-size: 1rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.tc-close-btn:hover { background: #ef4444; }

/* Festival bar */
.tc-festival-bar {
  background: linear-gradient(90deg, #7c3aed, #4c1d95);
  color: #fde68a; padding: .6rem 1rem; border-radius: 10px;
  font-size: .82rem; margin-bottom: .8rem; line-height: 1.7;
}

/* Strip rows */
.tc-row {
  display: flex; gap: 4px; margin-bottom: 4px; align-items: stretch;
}

/* Day header cell */
.tc-day-hdr {
  width: 110px; min-width: 110px; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: .5rem .3rem; gap: .25rem; flex-shrink: 0;
}
.tc-day-eng { color: #fff; font-weight: 900; font-size: .78rem; letter-spacing: .5px; }
.tc-day-tel { color: rgba(255,255,255,.9); font-size: .82rem; font-weight: 700; }

/* Date cells */
.tc-cell {
  flex: 1; background: #fff; border-radius: 10px;
  padding: .5rem .45rem; min-height: 90px;
  border: 1.5px solid #e5e7eb; display: flex; flex-direction: column; gap: 2px;
  transition: box-shadow .15s;
}
.tc-cell:hover { box-shadow: 0 4px 16px rgba(91,33,182,.18); }
.tc-cell-top { display: flex; justify-content: space-between; align-items: flex-start; }
.tc-date-num { font-size: 1.6rem; font-weight: 900; line-height: 1; }
.tc-paksha   { font-size: .65rem; background: #ede9fe; color: #5b21b6; border-radius: 4px; padding: 1px 4px; font-weight: 700; margin-top: 3px; }
.tc-tithi    { font-size: .75rem; color: #1e1b4b; font-weight: 700; line-height: 1.3; }
.tc-nak      { font-size: .7rem; color: #6b7280; line-height: 1.3; }
.tc-fest-tag { font-size: .65rem; color: #c0392b; font-weight: 800; line-height: 1.3; margin-top: auto; }

.tc-today    { border: 2.5px solid #f59e0b !important; background: #fffbeb !important; }
.tc-special  { background: #f0fdf4 !important; }
.tc-festival-day { border-color: #f59e0b; }
.tc-empty    { background: transparent !important; border-color: transparent !important; cursor: default; }

@media (max-width: 700px) {
  .tc-day-hdr { width: 72px; min-width: 72px; }
  .tc-day-eng { font-size: .65rem; }
  .tc-date-num { font-size: 1.2rem; }
  .tc-tithi, .tc-nak { font-size: .65rem; }
}

/* ── Typing Indicator ─────────────────────────────── */
.typing-indicator { display:flex; align-items:center; gap:4px; padding:.4rem 1rem; }
.typing-indicator span { width:8px; height:8px; background:#9b59b6; border-radius:50%; animation:bounce 1.2s infinite; }
.typing-indicator span:nth-child(2) { animation-delay:.2s; }
.typing-indicator span:nth-child(3) { animation-delay:.4s; }
@keyframes bounce { 0%,80%,100%{transform:translateY(0)} 40%{transform:translateY(-8px)} }

/* ── Message actions ──────────────────────────────── */
.msg-actions { display:none; gap:4px; margin-top:4px; }
.msg-bubble:hover .msg-actions { display:flex; }
.msg-react-btn, .msg-delete-btn { background:none; border:none; cursor:pointer; font-size:.85rem; padding:2px 4px; border-radius:4px; opacity:.7; }
.msg-react-btn:hover, .msg-delete-btn:hover { opacity:1; background:#f0f0f0; }
.msg-meta-row { display:flex; align-items:center; justify-content:flex-end; gap:4px; margin-top:2px; }
.msg-status { font-size:.75rem; color:rgba(255,255,255,.75); font-weight:600; }
.msg-status.read { color:#a5f3fc; }
.msg-deleted em { color:#aaa; font-style:italic; font-size:.85rem; }
.msg-reactions { display:flex; flex-wrap:wrap; gap:4px; margin-top:4px; }
.reaction-chip { background:#f0f0f0; border-radius:12px; padding:2px 7px; font-size:.8rem; cursor:pointer; border:1px solid #ddd; }
.reaction-chip:hover { background:#e0e0e0; }

/* ── Reaction Picker ──────────────────────────────── */
.react-picker { position:fixed; background:#fff; border:1px solid #ddd; border-radius:10px; padding:8px 12px; display:flex; gap:8px; font-size:1.3rem; box-shadow:0 4px 16px rgba(0,0,0,.15); z-index:9999; bottom:80px; right:20px; }
.react-picker span { cursor:pointer; transition:transform .15s; }
.react-picker span:hover { transform:scale(1.4); }

/* ── Announcement Banner ──────────────────────────── */
.announcement-banner { position:fixed; top:60px; left:50%; transform:translateX(-50%); background:#7c3aed; color:#fff; padding:.6rem 1.5rem; border-radius:20px; display:flex; align-items:center; gap:1rem; z-index:8000; font-weight:600; box-shadow:0 4px 20px rgba(124,58,237,.4); }
.announcement-banner button { background:none; border:none; color:#fff; font-size:1.1rem; cursor:pointer; }

/* ── Profile Modal ────────────────────────────────── */
.profile-modal { max-width:480px; text-align:center; }
.profile-modal-avatar { width:90px; height:90px; border-radius:50%; background:#9b59b6; color:#fff; font-size:2.2rem; display:flex; align-items:center; justify-content:center; margin:0 auto 1rem; overflow:hidden; }
.profile-modal-avatar img { width:100%; height:100%; object-fit:cover; }
.profile-modal-name { font-size:1.4rem; font-weight:700; margin-bottom:1rem; }
.profile-modal-fields { display:grid; grid-template-columns:1fr 1fr; gap:.5rem .8rem; text-align:left; font-size:.9rem; }
.pm-field { background:#f8f4ff; border-radius:8px; padding:.4rem .7rem; }
.pm-label { font-size:.72rem; color:#9b59b6; font-weight:600; text-transform:uppercase; }
.pm-value { font-weight:500; color:#333; }

/* ── Gallery Modal ────────────────────────────────── */
.gallery-modal { max-width:600px; }
.gallery-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:.5rem; margin-top:1rem; }
.gallery-grid img { width:100%; aspect-ratio:1; object-fit:cover; border-radius:8px; cursor:pointer; transition:opacity .2s; }
.gallery-grid img:hover { opacity:.85; }
.gallery-empty { color:#aaa; text-align:center; padding:2rem; grid-column:1/-1; }

/* ── Group Chat Modal ─────────────────────────────── */
.group-chat-modal { max-width:520px; padding:0; display:flex; flex-direction:column; height:80vh; }
@media (max-width:600px) {
  .group-chat-modal { max-width:100vw; width:100vw; height:100dvh; border-radius:0; margin:0; }
}
.group-chat-header { background:#7c3aed; color:#fff; padding:.8rem 1.2rem; font-size:1.1rem; font-weight:700; border-radius:12px 12px 0 0; }
.group-chat-modal .chat-messages { flex:1; overflow-y:auto; padding:1rem; }
.group-chat-modal .chat-input-row { padding:.7rem 1rem; border-top:1px solid #eee; }

/* ── Member Search ────────────────────────────────── */
.members-header { display:flex; align-items:center; gap:.8rem; flex-wrap:wrap; margin-bottom:1rem; }
.member-search-input { flex:1; min-width:140px; padding:.4rem .8rem; border:1px solid #ddd; border-radius:20px; font-size:.9rem; outline:none; }
.member-search-input:focus { border-color:#9b59b6; }
.online-count-badge { background:#10b981; color:#fff; font-size:.78rem; font-weight:700; padding:.25rem .7rem; border-radius:12px; white-space:nowrap; }

/* ── Dark Mode ────────────────────────────────────── */
.btn-dark { background:none; border:1px solid #ccc; border-radius:8px; padding:.3rem .6rem; cursor:pointer; font-size:1rem; }
body.dark-mode { background:#1a1a2e; color:#e0e0e0; }
body.dark-mode .navbar { background:#16213e; border-bottom:1px solid #0f3460; }
body.dark-mode .member-card { background:#16213e; border-color:#0f3460; color:#e0e0e0; }
body.dark-mode .chat-drawer { background:#16213e; }
body.dark-mode .msg-bubble.sent { background:#7c3aed; color:#fff; }
body.dark-mode .msg-bubble.received { background:#1e1e3f; color:#e0e0e0; }
body.dark-mode .chat-input-row { background:#16213e; border-top:1px solid #0f3460; }
body.dark-mode #chatInput, body.dark-mode #groupChatInput { background:#1a1a2e; color:#e0e0e0; border-color:#0f3460; }
body.dark-mode .modal { background:#16213e; color:#e0e0e0; }
body.dark-mode .reaction-chip { background:#1e1e3f; border-color:#333; color:#e0e0e0; }
body.dark-mode .member-search-input { background:#1a1a2e; color:#e0e0e0; border-color:#0f3460; }
body.dark-mode .world-clock-bar { background:#16213e; border-bottom:1px solid #0f3460; }

/* ── Profile Completion Bar ───────────────────────── */
.profile-completion-bar { width:100%; height:5px; background:#eee; border-radius:3px; margin:.4rem 0 .2rem; overflow:hidden; }
.profile-completion-bar div { height:100%; background:linear-gradient(90deg,#9b59b6,#7c3aed); border-radius:3px; transition:width .4s; }

/* ── Active Members Showcase ──────────────────────── */
.active-members-showcase { text-align:center; padding:3rem 1.5rem; background:#f8f4ff; }
.active-members-showcase h2 { font-size:1.6rem; font-weight:700; color:#1e1b4b; margin-bottom:.4rem; }
.active-members-sub { color:#6b7280; margin-bottom:1.8rem; font-size:.95rem; }
.active-members-grid { display:flex; justify-content:center; gap:1.2rem; flex-wrap:wrap; margin-bottom:2rem; }
.active-member-card { background:#fff; border-radius:16px; padding:1.2rem 1rem; width:130px; box-shadow:0 2px 12px rgba(124,58,237,.1); text-align:center; transition:transform .2s; cursor:pointer; }
.active-member-card:hover { transform:translateY(-4px); }
.active-member-avatar { position:relative; width:64px; height:64px; border-radius:50%; margin:0 auto .7rem; overflow:hidden; background:#e9d5ff; display:flex; align-items:center; justify-content:center; border:3px solid #e9d5ff; }
.active-member-avatar.online { border-color:#10b981; }
.blurred-avatar { width:100%; height:100%; object-fit:cover; filter:blur(4px); }
.avatar-initial { font-size:1.6rem; font-weight:700; color:#7c3aed; filter:blur(3px); }
.active-online-dot { position:absolute; bottom:2px; right:2px; width:12px; height:12px; background:#10b981; border-radius:50%; border:2px solid #fff; }
.active-member-name { font-weight:700; font-size:.95rem; color:#1e1b4b; margin-bottom:.2rem; }
.active-member-occ { font-size:.78rem; color:#7c3aed; margin-bottom:.2rem; }
.active-member-group { font-size:.72rem; color:#9ca3af; background:#f3f4f6; border-radius:10px; padding:.1rem .5rem; display:inline-block; }
.hero-cta-btn { margin-top:.5rem; padding:.8rem 2.5rem; font-size:1rem; border-radius:25px; }

/* ── My Family Landing Showcase ───────────────────── */
.family-showcase { background:linear-gradient(135deg,#1e1b4b 0%,#4c1d95 50%,#7c3aed 100%); padding:4rem 2rem; margin-top:0; }
.family-showcase-inner { max-width:1100px; margin:0 auto; display:flex; gap:3rem; align-items:center; flex-wrap:wrap; }
.family-showcase-left { flex:1; min-width:280px; color:#fff; }
.family-showcase-badge { display:inline-block; background:rgba(255,255,255,.15); color:#fde68a; font-size:.78rem; font-weight:700; padding:.3rem .9rem; border-radius:20px; margin-bottom:1rem; letter-spacing:.05em; }
.family-showcase-left h2 { font-size:2.2rem; font-weight:800; margin:0 0 .75rem; }
.family-showcase-left p { font-size:1rem; color:rgba(255,255,255,.8); margin-bottom:1.5rem; line-height:1.6; }
.family-feature-list { display:flex; flex-direction:column; gap:.6rem; margin-bottom:2rem; }
.family-feature-item { display:flex; align-items:center; gap:.6rem; font-size:.92rem; color:rgba(255,255,255,.9); }
.family-feature-item span { color:#fff; }

.family-showcase-right { flex:1; min-width:280px; }
.family-showcase-card { background:#fff; border-radius:20px; padding:1.4rem; box-shadow:0 20px 60px rgba(0,0,0,.3); }
.fsc-header { font-weight:800; font-size:1.05rem; color:#1e1b4b; margin-bottom:.75rem; }
.fsc-today { background:linear-gradient(135deg,#fde68a,#fca5a5); color:#92400e; font-size:.78rem; font-weight:600; padding:.4rem .8rem; border-radius:12px; margin-bottom:1rem; }
.fsc-member { display:flex; gap:.75rem; align-items:flex-start; padding:.65rem 0; border-bottom:1px solid #f3f4f6; }
.fsc-member:last-child { border-bottom:none; }
.fsc-icon { font-size:1.8rem; flex-shrink:0; }
.fsc-name { font-weight:700; font-size:.9rem; color:#1e1b4b; margin-bottom:.2rem; }
.fsc-rel { background:#ede9fe; color:#7c3aed; font-size:.68rem; font-weight:600; padding:.1rem .45rem; border-radius:8px; margin-left:.3rem; }
.fsc-meta { font-size:.75rem; color:#6b7280; margin-bottom:.3rem; }
.fsc-links { display:flex; flex-wrap:wrap; gap:.3rem; }
.fsc-link { font-size:.72rem; background:#ede9fe; color:#7c3aed; padding:.15rem .5rem; border-radius:10px; font-weight:600; }

/* ── Calendar / Diary Feature Showcases ───────────── */
.feature-showcase { padding:4rem 2rem; margin-top:0; }
.feature-showcase-inner { max-width:1100px; margin:0 auto; display:flex; gap:3rem; align-items:center; flex-wrap:wrap; }
.feature-showcase.reverse .feature-showcase-inner { flex-direction:row-reverse; }
.feature-showcase-left { flex:1; min-width:280px; color:#fff; }
.feature-showcase-badge { display:inline-block; background:rgba(255,255,255,.15); color:#fde68a; font-size:.78rem; font-weight:700; padding:.3rem .9rem; border-radius:20px; margin-bottom:1rem; letter-spacing:.05em; }
.feature-showcase-left h2 { font-size:2.2rem; font-weight:800; margin:0 0 .75rem; }
.feature-showcase-left p { font-size:1rem; color:rgba(255,255,255,.8); margin-bottom:1.5rem; line-height:1.6; }
.feature-showcase-list { display:flex; flex-direction:column; gap:.6rem; margin-bottom:2rem; }
.feature-showcase-item { display:flex; align-items:center; gap:.6rem; font-size:.92rem; color:rgba(255,255,255,.9); }
.feature-showcase-item span { color:#fff; }
.feature-showcase-right { flex:1; min-width:280px; }
.feature-showcase-card { background:#fff; border-radius:20px; padding:1.4rem; box-shadow:0 20px 60px rgba(0,0,0,.3); }
.fs-card-header { font-weight:800; font-size:1.05rem; color:#1e1b4b; margin-bottom:.9rem; }

.calendar-showcase { background:linear-gradient(135deg,#0c4a6e 0%,#0369a1 50%,#0ea5e9 100%); }
.fs-cal-legend { display:flex; flex-direction:column; gap:.7rem; }
.fs-cal-legend-item { display:flex; align-items:center; gap:.6rem; font-size:.88rem; font-weight:600; color:#1e1b4b; padding:.55rem .7rem; background:#f8fafc; border-radius:10px; }
.fs-dot { width:12px; height:12px; border-radius:50%; flex-shrink:0; }

.diary-showcase { background:linear-gradient(135deg,#451a03 0%,#92400e 50%,#d97706 100%); }
.fs-diary-entry { padding:.75rem 0; border-bottom:1px solid #f3f4f6; }
.fs-diary-entry:last-child { border-bottom:none; }
.fs-diary-date { font-size:.75rem; color:#6b7280; font-weight:600; margin-bottom:.25rem; }
.fs-diary-mood { margin-left:.3rem; }
.fs-diary-title { font-weight:700; font-size:.92rem; color:#1e1b4b; margin-bottom:.2rem; }
.fs-diary-snippet { font-size:.8rem; color:#6b7280; }

/* ── Generic feature-showcase preview widgets ─────── */
.fs-info-list { display:flex; flex-direction:column; gap:.7rem; }
.fs-info-item { font-size:.88rem; font-weight:600; color:#1e1b4b; padding:.55rem .7rem; background:#f8fafc; border-radius:10px; }
.fs-chip-row { display:flex; flex-wrap:wrap; gap:.6rem; }
.fs-chip { font-size:.85rem; font-weight:700; color:#1e1b4b; background:#f1f5f9; border-radius:20px; padding:.55rem 1.1rem; }

.aria-showcase { background:linear-gradient(135deg,#581c87 0%,#7e22ce 50%,#a855f7 100%); }
.talknow-showcase { background:linear-gradient(135deg,#064e3b 0%,#047857 50%,#10b981 100%); }
.english-showcase { background:linear-gradient(135deg,#1e1b4b 0%,#3730a3 50%,#6366f1 100%); }
.health-showcase { background:linear-gradient(135deg,#134e4a 0%,#0f766e 50%,#2dd4bf 100%); }
.telugucal-showcase { background:linear-gradient(135deg,#7f1d1d 0%,#b91c1c 50%,#ef4444 100%); }
.astro-showcase { background:linear-gradient(135deg,#1e293b 0%,#334155 50%,#64748b 100%); }
.mygroups-showcase { background:linear-gradient(135deg,#164e63 0%,#0e7490 50%,#22d3ee 100%); }
.findphone-showcase { background:linear-gradient(135deg,#7c2d12 0%,#c2410c 50%,#fb923c 100%); }

@media (max-width:700px) {
  .feature-showcase.reverse .feature-showcase-inner { flex-direction:column; }
  .feature-showcase-left h2 { font-size:1.7rem; }
}

/* ── Chat Settings ─────────────────────────────────── */
.chat-header-actions { display:flex; align-items:center; gap:.5rem; }
.chat-settings-wrap { position:relative; }
/* Emoji glyphs ignore CSS `color`, so force them to a plain white
   silhouette (grayscale then invert) — that's the only reliable way to make
   them stand out against the purple header instead of rendering in their
   own muddy native colors. */
.chat-view-profile-btn { background:none; border:none; font-size:1.1rem; cursor:pointer; padding:.3rem; border-radius:8px; opacity:1; filter:grayscale(1) brightness(0) invert(1); }
.chat-view-profile-btn:hover { background:rgba(255,255,255,.15); }
.chat-settings-btn { background:none; border:none; font-size:1.1rem; cursor:pointer; padding:.3rem; border-radius:8px; opacity:1; filter:grayscale(1) brightness(0) invert(1); }
.chat-settings-btn:hover { background:rgba(255,255,255,.1); }
.chat-settings-dropdown { position:absolute; top:2.2rem; right:0; background:#fff; border-radius:14px; box-shadow:0 8px 32px rgba(0,0,0,.18); padding:1rem; min-width:230px; z-index:200; }
.csd-title { font-weight:700; font-size:.9rem; color:#1e1b4b; margin-bottom:.75rem; padding-bottom:.5rem; border-bottom:1px solid #f3f4f6; }
.csd-section { margin-bottom:.75rem; }
.csd-label { font-size:.8rem; font-weight:600; color:#374151; margin-bottom:.35rem; }
.csd-section select { width:100%; border:1px solid #e5e7eb; border-radius:8px; padding:.4rem .6rem; font-size:.85rem; color:#1e1b4b; outline:none; }
.csd-section select:focus { border-color:#7c3aed; }
.csd-toggle-row { display:flex; align-items:center; justify-content:space-between; font-size:.85rem; font-weight:600; color:#374151; cursor:pointer; }
.csd-toggle-row input[type=checkbox] { width:1.1rem; height:1.1rem; accent-color:#7c3aed; cursor:pointer; }
.csd-clear-btn { width:100%; background:#fee2e2; color:#dc2626; border:none; border-radius:10px; padding:.5rem; font-size:.85rem; font-weight:700; cursor:pointer; margin-top:.25rem; }
.csd-clear-btn:hover { background:#fecaca; }

/* ── My Family ─────────────────────────────────────── */
.btn-family { background:linear-gradient(135deg,#f59e0b,#ef4444); color:#fff; font-size:.78rem; padding:.35rem .8rem; border-radius:20px; border:none; cursor:pointer; position:relative; }
.btn-family:hover { opacity:.9; }
.btn-family.family-has-event::after { content:''; position:absolute; top:2px; right:4px; width:8px; height:8px; background:#fff; border-radius:50%; border:2px solid #ef4444; }

.family-modal { max-width:680px; max-height:85vh; overflow-y:auto; }

/* Bell & Notification styles */
.btn-bell { background:#7c3aed; color:#fff; border:none; font-size:.85rem; padding:.4rem .9rem; border-radius:8px; cursor:pointer; position:relative; }
.btn-bell:hover { background:#6d28d9; }
.notif-badge { position:absolute; top:-6px; right:-6px; background:#ef4444; color:#fff; font-size:.65rem; font-weight:700; min-width:18px; height:18px; border-radius:9px; display:flex; align-items:center; justify-content:center; padding:0 4px; }
.notif-item { padding:12px 16px; border-bottom:1px solid var(--border-color,#e5e7eb); }
.notif-item:last-child { border-bottom:none; }
.notif-unread { background:rgba(124,58,237,.08); }
.notif-msg { font-size:.92rem; color:var(--text-primary,#111); margin-bottom:4px; }
.notif-time { font-size:.75rem; color:var(--text-muted,#6b7280); }

.family-today-badges { display:flex; flex-wrap:wrap; gap:.5rem; margin-bottom:.8rem; }
.family-today-badge { background:linear-gradient(135deg,#fde68a,#fca5a5); color:#92400e; padding:.4rem .9rem; border-radius:20px; font-size:.85rem; font-weight:600; animation:pulse 1.5s infinite; }

.family-add-btn { margin-bottom:1rem; }

.family-list { display:flex; flex-direction:column; gap:.75rem; }

.family-card { display:flex; align-items:flex-start; justify-content:space-between; background:#f9fafb; border:1px solid #e5e7eb; border-radius:14px; padding:1rem; gap:.75rem; transition:box-shadow .2s; }
.family-card:hover { box-shadow:0 4px 16px rgba(0,0,0,.08); }
.family-card-left { display:flex; gap:.75rem; flex:1; min-width:0; }
.family-icon { font-size:2rem; flex-shrink:0; }
.family-card-info { flex:1; min-width:0; }
.family-card-name { font-weight:700; font-size:1rem; color:#1e1b4b; margin-bottom:.25rem; }
.family-relation { background:#ede9fe; color:#7c3aed; font-size:.72rem; font-weight:600; padding:.1rem .5rem; border-radius:10px; margin-left:.4rem; }
.family-card-meta { display:flex; flex-wrap:wrap; gap:.4rem; margin-bottom:.35rem; }
.family-meta { font-size:.78rem; color:#6b7280; background:#f3f4f6; padding:.15rem .5rem; border-radius:10px; }
.family-badge { font-size:.8rem; font-weight:700; padding:.2rem .7rem; border-radius:20px; animation:pulse 1.5s infinite; }
.family-badge.bday  { background:#fde68a; color:#92400e; }
.family-badge.anniv { background:#fce7f3; color:#9d174d; }
.family-location a { color:#7c3aed; font-weight:600; text-decoration:none; margin-left:.3rem; }
.family-notes { font-size:.8rem; color:#6b7280; margin-bottom:.3rem; font-style:italic; }
.family-links-row { display:flex; flex-wrap:wrap; gap:.4rem; margin-top:.3rem; }
.family-link-btn { display:inline-flex; align-items:center; gap:.25rem; font-size:.78rem; color:#7c3aed; background:#ede9fe; padding:.25rem .65rem; border-radius:14px; text-decoration:none; font-weight:600; }
.family-link-btn:hover { background:#ddd6fe; }

.family-form { display:flex; flex-direction:column; gap:.9rem; margin-top:.75rem; }
.family-form-row { display:flex; gap:.75rem; }
.family-form-row .family-form-group { flex:1; }
.family-form-group { display:flex; flex-direction:column; gap:.3rem; }
.family-form-group label { font-size:.82rem; font-weight:600; color:#374151; }
.family-form-group input, .family-form-group select, .family-form-group textarea { border:1px solid #d1d5db; border-radius:10px; padding:.5rem .75rem; font-size:.9rem; outline:none; width:100%; box-sizing:border-box; }
.family-form-group input:focus, .family-form-group select:focus, .family-form-group textarea:focus { border-color:#7c3aed; box-shadow:0 0 0 3px rgba(124,58,237,.12); }

.family-link-row { display:flex; gap:.5rem; align-items:center; margin-bottom:.4rem; }
.family-link-row .flink-label { flex:1; }
.family-link-row .flink-url   { flex:2; }
.family-add-link-btn { font-size:.82rem; margin-top:.2rem; }

/* ── My Groups (Family / Friends) ─────────────────── */
.my-groups-modal { max-width:520px; padding:0; display:flex; flex-direction:column; height:85vh; overflow:hidden; }
.my-groups-tabs { display:flex; border-bottom:2px solid var(--border); }
.mg-tab { flex:1; padding:.7rem; background:none; border:none; font-size:.95rem; font-weight:600; cursor:pointer; color:var(--muted); transition:all .2s; }
.mg-tab.active { color:#7c3aed; border-bottom:3px solid #7c3aed; margin-bottom:-2px; }
#myGroupsContent { display:flex; flex-direction:column; flex:1; overflow:hidden; }
.mg-members-section { padding:.75rem 1rem; border-bottom:1px solid var(--border); }
.mg-members-list { display:flex; flex-wrap:wrap; gap:.5rem; margin-bottom:.5rem; min-height:32px; }
.mg-member-chip { display:flex; align-items:center; gap:.3rem; background:#ede9fe; color:#5b21b6; border-radius:20px; padding:.25rem .65rem; font-size:.82rem; font-weight:600; }
.mg-member-chip .mg-remove { cursor:pointer; color:#9ca3af; font-size:.9rem; margin-left:.2rem; }
.mg-member-chip .mg-remove:hover { color:#ef4444; }
.mg-add-row { position:relative; }
.mg-add-row input { width:100%; padding:.5rem .8rem; border:1.5px solid var(--border); border-radius:8px; font-size:.85rem; outline:none; box-sizing:border-box; }
.mg-add-row input:focus { border-color:#7c3aed; }
.mg-search-results { position:absolute; top:100%; left:0; right:0; background:var(--surface); border:1.5px solid var(--border); border-radius:8px; z-index:10; max-height:150px; overflow-y:auto; display:none; }
.mg-search-results.open { display:block; }
.mg-search-item { padding:.5rem .8rem; cursor:pointer; font-size:.85rem; display:flex; align-items:center; gap:.5rem; }
.mg-search-item:hover { background:#ede9fe; }
.mg-chat-area { display:flex; flex-direction:column; flex:1; overflow:hidden; }
.mg-messages { flex:1; overflow-y:auto; padding:.75rem 1rem; display:flex; flex-direction:column; gap:.5rem; background:#f5f3ff; }
.mg-input-row { display:flex; gap:.5rem; padding:.6rem 1rem; border-top:1px solid var(--border); background:var(--surface); }
.mg-input-row input { flex:1; padding:.55rem .9rem; border:1.5px solid var(--border); border-radius:24px; font-size:.88rem; outline:none; }
.mg-input-row input:focus { border-color:#7c3aed; }
.mg-empty { text-align:center; color:#aaa; font-size:.85rem; padding:1rem; }
@media (max-width:600px) {
  .my-groups-modal { max-width:100vw; width:100vw; height:100dvh; border-radius:0; margin:0; }
}

/* ── Find My Phone ── */
.btn-find-phone { background:linear-gradient(135deg,#0ea5e9,#2563eb); color:#fff; font-weight:700; font-size:.85rem; border:none; border-radius:8px; padding:.45rem 1rem; cursor:pointer; transition:opacity .2s; }
.btn-find-phone:hover { opacity:.85; }

.fp-status { padding:.4rem 1rem; font-size:.85rem; font-weight:600; flex-shrink:0; }
.fp-online { color:#16a34a; }
.fp-offline { color:#6b7280; }
.fp-actions { display:flex; gap:.5rem; flex-wrap:wrap; padding:.4rem 1rem; flex-shrink:0; }
.fp-actions .btn { border:none; border-radius:8px; padding:.5rem .9rem; font-size:.8rem; font-weight:700; cursor:pointer; }
.fp-btn-ring { background:linear-gradient(135deg,#f59e0b,#f97316); color:#fff; }
.fp-btn-logout { background:linear-gradient(135deg,#ef4444,#b91c1c); color:#fff; }
.fp-btn-refresh { background:#e5e7eb; color:#374151; }
.fp-action-status { padding:.2rem 1rem .4rem; font-size:.8rem; color:#2563eb; min-height:1.1rem; flex-shrink:0; }
.fp-ping-list { flex:1; overflow-y:auto; padding:.3rem 1rem; display:flex; flex-direction:column; gap:.5rem; }
.fp-ping { display:flex; align-items:center; justify-content:space-between; gap:.6rem; border:1px solid #e5e7eb; border-radius:10px; padding:.55rem .75rem; }
.fp-ping.latest { border-color:#2563eb; background:rgba(37,99,235,.06); }
.fp-ping-when { font-size:.83rem; font-weight:700; color:#111827; }
.fp-ping.latest .fp-ping-when { color:#2563eb; }
.fp-ping-meta { font-size:.75rem; color:#6b7280; }
.fp-map-link { flex-shrink:0; font-size:.78rem; font-weight:700; color:#2563eb; text-decoration:none; border:1px solid #2563eb; border-radius:8px; padding:.35rem .6rem; }
.fp-map-link:hover { background:#2563eb; color:#fff; }
.fp-empty { text-align:center; color:#9ca3af; font-size:.83rem; padding:1.2rem .5rem; }
.fp-note { font-size:.72rem; color:#9ca3af; padding:.4rem 1rem .8rem; margin:0; flex-shrink:0; }

.fp-alarm-overlay { position:fixed; inset:0; z-index:99999; background:rgba(220,38,38,.96); display:flex; align-items:center; justify-content:center; animation:fpFlash 1s infinite; }
.fp-alarm-overlay.hidden { display:none; }
@keyframes fpFlash { 0%,100% { background:rgba(220,38,38,.96); } 50% { background:rgba(153,27,27,.96); } }
.fp-alarm-box { text-align:center; color:#fff; padding:2rem; }
.fp-alarm-icon { font-size:3.5rem; animation:fpShake .5s infinite; }
@keyframes fpShake { 0%,100% { transform:rotate(-8deg); } 50% { transform:rotate(8deg); } }
.fp-alarm-box h2 { margin:.6rem 0 .3rem; font-size:1.6rem; }
.fp-alarm-box p { margin:0 0 1.2rem; font-size:.95rem; opacity:.9; }
.fp-alarm-stop { background:#fff; color:#b91c1c; border:none; border-radius:10px; padding:.7rem 1.6rem; font-size:1rem; font-weight:800; cursor:pointer; }

body.dark-mode .fp-ping { border-color:#374151; }
body.dark-mode .fp-ping-when { color:#e5e7eb; }
body.dark-mode .fp-btn-refresh { background:#374151; color:#e5e7eb; }

/* Find My Phone — Lost Mode & IMEI */
.fp-btn-lostmode { background:#fff; color:#b91c1c; border:2px solid #ef4444 !important; }
.fp-btn-lostmode.active { background:linear-gradient(135deg,#dc2626,#7f1d1d); color:#fff; border:none !important; animation:fpPulse 1.2s infinite; }
@keyframes fpPulse { 0%,100% { box-shadow:0 0 0 0 rgba(220,38,38,.5); } 50% { box-shadow:0 0 0 6px rgba(220,38,38,0); } }
.fp-imei-row { display:flex; gap:.5rem; padding:.2rem 1rem; flex-shrink:0; }
.fp-imei-row input { flex:1; border:1px solid #d1d5db; border-radius:8px; padding:.5rem .7rem; font-size:.82rem; }
.fp-imei-row input:focus { border-color:#2563eb; outline:none; }
.fp-btn-imei { background:#2563eb; color:#fff; border:none; border-radius:8px; padding:.5rem .8rem; font-size:.8rem; font-weight:700; cursor:pointer; flex-shrink:0; }
.fp-imei-note { font-size:.72rem; color:#6b7280; padding:.15rem 1rem .3rem; margin:0; flex-shrink:0; }
body.dark-mode .fp-imei-row input { background:#16213e; border-color:#374151; color:#e5e7eb; }
body.dark-mode .fp-btn-lostmode { background:#16213e; }

/* Find My Phone — embedded map of latest location */
.fp-map-wrap { padding:.3rem 1rem 0; flex-shrink:0; }
.fp-map-embed { width:100%; height:190px; border:1px solid #e5e7eb; border-radius:12px; display:block; }
.fp-map-caption { font-size:.75rem; font-weight:700; color:#2563eb; padding:.3rem .1rem .1rem; }
body.dark-mode .fp-map-embed { border-color:#374151; }
