:root {
  --nav-bg:        #0b3d2a;
  --nav-text:      rgba(255, 255, 255, 0.48);
  --nav-active:    rgba(255, 255, 255, 0.95);
  --nav-active-bg: rgba(255, 255, 255, 0.11);
  --nav-hover-bg:  rgba(255, 255, 255, 0.06);

  --bg:            #f5f3ef;
  --surface:       #ffffff;
  --surface-alt:   #faf9f6;
  --border:        #e8e4dc;
  --border-light:  #f0ede7;

  --text:          #1a1a1a;
  --text-soft:     #6b7280;
  --muted:         #9ca3af;

  --green:         #0d6b4a;
  --green-dark:    #084d35;
  --green-light:   #e6f5ee;
  --green-glow:    rgba(13, 107, 74, 0.13);

  --gold:          #b8860b;
  --gold-soft:     #cd9b3a;
  --gold-glow:     rgba(184, 134, 11, 0.14);

  --online:        #16a34a;

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.07);
  --shadow:     0 4px 12px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-md:  0 8px 24px rgba(0,0,0,0.09), 0 3px 8px rgba(0,0,0,0.05);
}

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

html, body { height: 100%; margin: 0; overflow: hidden; }

body {
  display: grid;
  grid-template-rows: 64px 1fr auto;
  font-family: 'Cairo', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 55% 40% at 90% 10%, rgba(13,107,74,0.05) 0%, transparent 55%),
    radial-gradient(ellipse 50% 50% at 10% 95%, rgba(184,134,11,0.04) 0%, transparent 55%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { border: none; background: none; cursor: pointer; padding: 0; }

/* ─── Header ──────────────────────────────── */

.site-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  position: relative;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-emblem {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--green) 0%, var(--green-dark) 100%);
  color: rgba(255,255,255,0.9);
  box-shadow: 0 2px 10px var(--green-glow);
  flex-shrink: 0;
}

.brand-name {
  font-family: 'Amiri', serif;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.01em;
}

.search-wrap {
  flex: 1;
  max-width: 460px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 13px;
  color: var(--muted);
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 14px 9px 38px;
  background: var(--bg);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-wrap input::placeholder { color: var(--muted); }

.search-wrap input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
  background: var(--surface);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

.action-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--text-soft);
  background: var(--bg);
  border: 1px solid var(--border);
  position: relative;
  transition: background 0.15s, color 0.15s;
}

.action-btn:hover {
  background: var(--green-light);
  color: var(--green);
  border-color: rgba(13, 107, 74, 0.2);
}

.notif-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 2px solid var(--surface);
  transition: opacity 0.2s;
}

.user-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--green) 0%, var(--green-dark) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 2px 8px var(--green-glow);
  transition: transform 0.15s;
}

.user-btn:hover { transform: scale(1.05); }

/* ─── Layout ──────────────────────────────── */

.site-layout {
  display: grid;
  grid-template-columns: 80px 1fr 272px;
  overflow: hidden;
  min-height: 0;
}

/* ─── Left Nav ────────────────────────────── */

.left-nav {
  background: var(--nav-bg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
  scrollbar-width: none;
  min-height: 0;
}

.left-nav::-webkit-scrollbar { display: none; }

.nav-items,
.nav-bottom {
  display: flex;
  flex-direction: column;
  padding: 12px 8px;
  gap: 2px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 11px 6px;
  border-radius: 12px;
  color: var(--nav-text);
  transition: background 0.15s, color 0.15s;
  text-align: center;
}

.nav-item span {
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.nav-item:hover { background: var(--nav-hover-bg); color: rgba(255,255,255,0.8); }
.nav-item.active { background: var(--nav-active-bg); color: var(--nav-active); }

/* ─── Main Content ────────────────────────── */

.main-content {
  overflow-y: auto;
  min-height: 0;
  padding: 24px 24px 32px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.main-content::-webkit-scrollbar { width: 5px; }
.main-content::-webkit-scrollbar-track { background: transparent; }
.main-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

/* ─── Post Composer ───────────────────────── */

.post-composer {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.composer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--green) 0%, var(--green-dark) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.composer-field {
  flex: 1;
  min-width: 140px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.88rem;
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
}

.composer-field:hover {
  border-color: var(--green);
  background: var(--surface);
}

.composer-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
  flex-shrink: 0;
}

.composer-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.composer-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 9px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-soft);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.composer-btn:hover {
  background: var(--green-light);
  color: var(--green);
  border-color: rgba(13,107,74,0.2);
}

/* ─── Section Title ───────────────────────── */

.content-section { margin-bottom: 28px; }

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Amiri', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 14px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--border);
}

.section-title::before {
  content: '';
  width: 4px;
  height: 18px;
  border-radius: 4px;
  background: var(--green);
  flex-shrink: 0;
}

/* ─── Card Grid ───────────────────────────── */

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

/* ─── Group Card ──────────────────────────── */

.group-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
  cursor: pointer;
}

.group-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--green) 28%, var(--border));
}

.group-cover {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.group-emoji {
  font-size: 1.6rem;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.25));
  line-height: 1;
}

/* Cover gradient classes */
.cover-teal    { background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%); }
.cover-indigo  { background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%); }
.cover-rose    { background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%); }
.cover-amber   { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.cover-emerald { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.cover-violet  { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); }

.group-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

/* Group tags */
.group-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.group-tag {
  display: inline-flex;
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tag-stadt    { background: #e0f2fe; color: #0369a1; }
.tag-business { background: #e0e7ff; color: #3730a3; }
.tag-familie  { background: #fce7f3; color: #9d174d; }
.tag-hobby    { background: #fef3c7; color: #92400e; }
.tag-sport    { background: #d1fae5; color: #065f46; }
.tag-community{ background: #f3e8ff; color: #6b21a8; }

.group-body h3 {
  margin: 0;
  font-family: 'Amiri', serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.group-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.meta-count {
  font-size: 0.79rem;
  color: var(--text-soft);
}

.meta-online {
  font-size: 0.79rem;
  font-weight: 600;
  color: var(--online);
  display: flex;
  align-items: center;
  gap: 4px;
}

.meta-online::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--online);
  display: inline-block;
  flex-shrink: 0;
}

/* Group buttons */
.group-btn {
  margin-top: auto;
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 0.82rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
  align-self: stretch;
  text-align: center;
}

.btn-view {
  background: var(--green-light);
  color: var(--green);
  border: 1px solid rgba(13,107,74,0.15);
}

.btn-view:hover { background: var(--green); color: #fff; }

.btn-join {
  background: var(--green);
  color: #fff;
  box-shadow: 0 2px 8px var(--green-glow);
}

.btn-join:hover {
  background: var(--green-dark);
  box-shadow: 0 4px 14px rgba(13,107,74,0.25);
}

/* ─── Stats Panel ─────────────────────────── */

.stats-panel {
  border-left: 1px solid var(--border);
  background: var(--surface);
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.stats-header {
  padding: 20px 18px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.stats-header h3 {
  margin: 0;
  font-family: 'Amiri', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--green-dark);
}

.stats-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
}

.stat-card {
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 14px 15px;
}

.stat-card-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

/* Online members */
.online-members {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.online-member {
  display: flex;
  align-items: center;
  gap: 10px;
}

.member-av {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  position: relative;
}

.member-av::after {
  content: '';
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid var(--surface-alt);
}

.member-name {
  font-size: 0.83rem;
  color: var(--text);
  font-weight: 500;
}

/* Event items */
.event-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}

.event-item:last-child { border-bottom: none; }

.event-badge {
  background: var(--green-light);
  color: var(--green-dark);
  padding: 4px 7px;
  border-radius: 8px;
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
  flex-shrink: 0;
  min-width: 38px;
}

.event-info strong {
  display: block;
  font-size: 0.83rem;
  color: var(--text);
  margin-bottom: 2px;
  font-weight: 600;
}

.event-info span {
  font-size: 0.74rem;
  color: var(--muted);
}

/* Suggestion items */
.suggestion-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}

.suggestion-item:last-child { border-bottom: none; }

.suggestion-av {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.suggestion-text {
  flex: 1;
  min-width: 0;
}

.suggestion-text strong {
  display: block;
  font-size: 0.81rem;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-text span {
  font-size: 0.72rem;
  color: var(--muted);
}

.join-mini-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--green-light);
  color: var(--green);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.join-mini-btn:hover { background: var(--green); color: #fff; }

/* Avatar color variants */
.av-rose    { background: linear-gradient(140deg, #f472b6, #db2777); }
.av-teal    { background: linear-gradient(140deg, #2dd4bf, #0d9488); }
.av-indigo  { background: linear-gradient(140deg, #818cf8, #4338ca); }
.av-amber   { background: linear-gradient(140deg, #fbbf24, #d97706); }
.av-violet  { background: linear-gradient(140deg, #a78bfa, #7c3aed); }
.av-emerald { background: linear-gradient(140deg, #34d399, #059669); }

/* ─── Footer ──────────────────────────────── */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 13px 24px;
}

.footer-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.footer-nav a {
  font-size: 0.82rem;
  color: var(--text-soft);
  transition: color 0.15s;
}

.footer-nav a:hover { color: var(--green); }
.footer-dot { color: var(--muted); }

/* ─── Utility ────────────────────────────── */
.hidden { display: none !important; }
.av-green { background: linear-gradient(140deg, var(--green), var(--green-dark)); }
.empty-msg { font-size: 0.86rem; color: var(--muted); text-align: center; padding: 20px 0; }

/* Suggestion avatar tag-based colors */
.sav-stadt    { background: linear-gradient(140deg, #0891b2, #0e7490); }
.sav-business { background: linear-gradient(140deg, #6366f1, #4338ca); }
.sav-familie  { background: linear-gradient(140deg, #f43f5e, #e11d48); }
.sav-hobby    { background: linear-gradient(140deg, #f59e0b, #d97706); }
.sav-sport    { background: linear-gradient(140deg, #10b981, #059669); }
.sav-community{ background: linear-gradient(140deg, #8b5cf6, #7c3aed); }

/* ─── Post Feed ───────────────────────────── */
#postsFeed { display: flex; flex-direction: column; gap: 12px; }

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.post-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--green) 28%, var(--border));
}

.post-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }

.post-av {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: grid; place-items: center;
  font-size: 0.72rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.post-meta { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.post-author { font-weight: 600; font-size: 0.9rem; }
.post-group-tag { font-size: 0.76rem; color: var(--green); font-weight: 500; }
.post-time { font-size: 0.74rem; color: var(--muted); }
.post-content { margin: 0 0 14px; font-size: 0.9rem; line-height: 1.65; }

.post-actions {
  display: flex; gap: 2px;
  border-top: 1px solid var(--border-light);
  padding-top: 10px;
}

.post-act {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 8px;
  font-size: 0.8rem; color: var(--text-soft);
  transition: background 0.15s, color 0.15s;
}
.post-act:hover { background: var(--bg); color: var(--text); }
.post-act.liked { color: var(--green); }

/* ─── Post Composer ───────────────────────── */
.composer-expand {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.composer-exp-inner { display: flex; gap: 12px; margin-bottom: 12px; }

.composer-textarea {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem; font-family: 'Cairo', sans-serif;
  resize: none; outline: none; line-height: 1.6; min-height: 72px; max-height: 220px; overflow-y: auto;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.composer-textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-glow); background: var(--surface); }

.composer-exp-footer { display: flex; align-items: center; justify-content: space-between; }
.char-count { font-size: 0.75rem; color: var(--muted); }

.btn-cancel {
  padding: 7px 14px; border-radius: 9px;
  font-size: 0.83rem; font-weight: 500; font-family: 'Cairo', sans-serif;
  color: var(--text-soft); background: var(--bg); border: 1px solid var(--border);
  transition: background 0.15s; cursor: pointer;
}
.btn-cancel:hover { background: var(--border-light); }

.btn-post {
  padding: 7px 18px; border-radius: 9px;
  font-size: 0.83rem; font-weight: 700; font-family: 'Cairo', sans-serif;
  color: #fff; background: var(--green);
  box-shadow: 0 2px 8px var(--green-glow);
  transition: background 0.15s, opacity 0.15s; cursor: pointer; border: none;
}
.btn-post:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.btn-post:not(:disabled):hover { background: var(--green-dark); }

/* ─── View Header ─────────────────────────── */
.view-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; gap: 14px; flex-wrap: wrap;
}
.view-title { font-family: 'Amiri', serif; font-size: 1.6rem; font-weight: 700; letter-spacing: -0.01em; margin: 0; }


.view-act-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 9px;
  font-size: 0.84rem; font-weight: 600; font-family: 'Cairo', sans-serif;
  background: var(--green); color: #fff;
  transition: background 0.15s; cursor: pointer; border: none;
}
.view-act-btn:hover { background: var(--green-dark); }

/* ─── Filter Chips ────────────────────────── */
.filter-chips { display: flex; gap: 7px; margin-bottom: 18px; flex-wrap: wrap; }

.chip {
  padding: 5px 14px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 500; font-family: 'Cairo', sans-serif;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-soft);
  transition: all 0.15s; cursor: pointer;
}
.chip:hover { border-color: var(--green); color: var(--green); }
.chip.active { background: var(--green); color: #fff; border-color: var(--green); }

.search-inline-wrap { position: relative; display: flex; align-items: center; flex: 1; max-width: 280px; }
.search-inline-wrap svg { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
.search-inline {
  width: 100%; padding: 8px 12px 8px 32px;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--bg); color: var(--text);
  font-size: 0.86rem; font-family: 'Cairo', sans-serif;
  outline: none; transition: border-color 0.2s;
}
.search-inline:focus { border-color: var(--green); background: var(--surface); }

/* ─── Events Page ─────────────────────────── */
.events-list { display: flex; flex-direction: column; gap: 14px; }

.event-card {
  display: flex; background: var(--surface);
  border: 1px solid var(--border); border-radius: 16px;
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.event-card:hover {
  box-shadow: var(--shadow-md); transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--green) 28%, var(--border));
}

.event-cover {
  width: 80px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}

.event-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 5px; }

.event-top { display: flex; align-items: center; gap: 10px; }
.event-date { font-size: 0.79rem; font-weight: 600; color: var(--green); }
.event-time { font-size: 0.79rem; color: var(--muted); }
.event-name { margin: 0; font-family: 'Amiri', serif; font-size: 1rem; font-weight: 700; }

.event-loc {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.79rem; color: var(--text-soft);
}

.event-desc { margin: 0; font-size: 0.83rem; color: var(--text-soft); font-weight: 300; line-height: 1.55; flex: 1; }

.event-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.event-att { font-size: 0.78rem; color: var(--muted); }

.event-rsvp {
  padding: 7px 14px; border-radius: 9px;
  font-size: 0.8rem; font-weight: 600; font-family: 'Cairo', sans-serif;
  background: var(--green); color: #fff;
  box-shadow: 0 2px 8px var(--green-glow);
  transition: background 0.15s; cursor: pointer; border: none;
}
.event-rsvp:hover { background: var(--green-dark); }
.event-rsvp.attending { background: var(--green-light); color: var(--green); box-shadow: none; border: 1px solid rgba(13,107,74,.15); }
.event-rsvp.attending:hover { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }

/* ─── Messages Page ───────────────────────── */
.convos-list { display: flex; flex-direction: column; gap: 2px; }

.convo-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: 13px;
  cursor: pointer; transition: background 0.15s;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
}
.convo-item:hover { background: var(--bg); }

.convo-av {
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center;
  font-size: 0.76rem; font-weight: 700; color: #fff; flex-shrink: 0;
  overflow: hidden;
}

.convo-body { flex: 1; min-width: 0; }
.convo-top { display: flex; justify-content: space-between; margin-bottom: 3px; }
.convo-name { font-weight: 600; font-size: 0.9rem; }
.convo-time { font-size: 0.74rem; color: var(--muted); }
.convo-bot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.convo-last { font-size: 0.82rem; color: var(--text-soft); font-weight: 300; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.convo-badge {
  background: var(--green); color: #fff;
  font-size: 0.62rem; font-weight: 700;
  min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 9px; display: grid; place-items: center; flex-shrink: 0;
}

/* ─── Profile Page ────────────────────────── */
.profile-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden;
  margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.profile-cover-strip {
  height: 110px;
  background:
    radial-gradient(ellipse 70% 90% at 85% 60%, rgba(255,255,255,0.09) 0%, transparent 55%),
    radial-gradient(ellipse 50% 70% at 15% 25%, rgba(255,255,255,0.12) 0%, transparent 50%),
    linear-gradient(135deg, var(--green-dark) 0%, var(--green) 60%, #0a8a5a 100%);
}
.profile-info-row {
  display: flex; align-items: flex-end; gap: 14px;
  padding: 0 20px 20px; margin-top: -34px;
}
.profile-av {
  width: 80px; height: 80px; border-radius: 22px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--green), var(--green-dark));
  color: #fff; font-weight: 700; font-size: 1.6rem;
  border: 4px solid var(--surface);
  flex-shrink: 0; overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.profile-av-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-details { flex: 1; min-width: 0; padding-bottom: 2px; }
.profile-details h1 { font-family: 'Amiri', serif; font-size: 1.35rem; margin: 0 0 1px; line-height: 1.2; }
.profile-handle { font-size: 0.82rem; color: var(--green); font-weight: 600; margin: 0 0 4px; }
.profile-meta-line { font-size: 0.79rem; color: var(--text-soft); font-weight: 300; margin: 0; }
.profile-active-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 0.76rem; font-weight: 600; color: var(--online);
}
.profile-active-badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--online); display: inline-block; flex-shrink: 0;
}
.profile-bio { font-size: 0.84rem; color: var(--text-soft); margin: 5px 0 0; line-height: 1.5; }
.profile-edit-btn {
  padding: 8px 16px; border-radius: 10px;
  font-size: 0.82rem; font-weight: 600; font-family: 'Cairo', sans-serif;
  background: var(--bg); border: 1px solid var(--border); color: var(--text-soft);
  align-self: flex-end; margin-bottom: 2px; transition: background 0.15s, color 0.15s, border-color 0.15s; cursor: pointer;
  flex-shrink: 0;
}
.profile-edit-btn:hover { background: var(--green-light); color: var(--green); border-color: rgba(13,107,74,0.2); }

.profile-stats-row { display: flex; gap: 10px; margin-bottom: 20px; }
.pstat {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: 13px; padding: 14px 10px; text-align: center; box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, transform 0.15s;
}
.pstat strong { display: block; font-family: 'Amiri', serif; font-size: 1.35rem; font-weight: 700; margin-bottom: 2px; color: var(--text); }
.pstat span { font-size: 0.73rem; color: var(--muted); }

/* ─── Group Detail ────────────────────────── */
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 9px;
  font-size: 0.84rem; font-weight: 500; font-family: 'Cairo', sans-serif;
  color: var(--text-soft); background: var(--surface);
  border: 1px solid var(--border); margin-bottom: 16px;
  transition: background 0.15s, color 0.15s; cursor: pointer;
}
.back-btn:hover { background: var(--bg); color: var(--text); }

.gd-header { border-radius: 16px; margin-bottom: 12px; overflow: hidden; }
.gd-overlay {
  display: flex; align-items: center; gap: 14px;
  padding: 22px 20px; background: rgba(0,0,0,.28); backdrop-filter: blur(2px);
}
.gd-emoji { font-size: 2.2rem; line-height: 1; flex-shrink: 0; }
.gd-info { flex: 1; color: #fff; }
.gd-info h1 { font-family: 'Amiri', serif; font-size: 1.25rem; margin: 0 0 4px; }
.gd-info p { margin: 0; font-size: 0.82rem; opacity: .8; }

.gd-join-btn {
  padding: 8px 16px; border-radius: 10px;
  background: #fff; color: var(--green-dark);
  font-weight: 700; font-size: 0.84rem; font-family: 'Cairo', sans-serif;
  flex-shrink: 0; cursor: pointer; border: none; transition: opacity .15s;
}
.gd-join-btn:hover { opacity: .88; }

.gd-leave-btn {
  padding: 8px 16px; border-radius: 10px;
  background: rgba(255,255,255,.15); color: #fff;
  font-weight: 600; font-size: 0.84rem; font-family: 'Cairo', sans-serif;
  border: 1px solid rgba(255,255,255,.3); flex-shrink: 0;
  cursor: pointer; transition: background .15s;
}
.gd-leave-btn:hover { background: rgba(255,255,255,.25); }

.group-desc { font-size: 0.87rem; color: var(--text-soft); font-weight: 300; margin: 0 0 18px; line-height: 1.65; }

/* ─── Tabs ────────────────────────────────── */
.tab-bar { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab-btn {
  padding: 10px 18px; font-size: 0.88rem; font-weight: 600; font-family: 'Cairo', sans-serif;
  color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color .15s, border-color .15s; cursor: pointer; white-space: nowrap; flex-shrink: 0;
  background: none; border-top: none; border-left: none; border-right: none;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--green); border-bottom-color: var(--green); }

/* ─── Members Grid ────────────────────────── */
.members-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.member-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; font-size: 0.82rem; font-weight: 500; text-align: center;
  cursor: pointer; transition: box-shadow .15s;
}
.member-card:hover { box-shadow: var(--shadow); }
.member-av {
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center;
  font-size: 0.76rem; font-weight: 700; color: #fff;
  overflow: hidden; flex-shrink: 0;
}

/* ─── Toast ───────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #111827; color: #fff;
  padding: 10px 22px; border-radius: 10px;
  font-size: 0.86rem; font-weight: 500; font-family: 'Cairo', sans-serif;
  opacity: 0; transition: opacity .22s, transform .22s;
  z-index: 9999; pointer-events: none; white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── Responsive ──────────────────────────── */

@media (max-width: 1100px) {
  .site-layout { grid-template-columns: 80px 1fr 240px; }
}

@media (max-width: 900px) {
  .site-layout { grid-template-columns: 72px 1fr; }
  .stats-panel { display: none; }
}

@media (max-width: 640px) {
  html, body { overflow: auto; height: auto; }
  .site-layout { grid-template-columns: 1fr; overflow: visible; }
  .main-content { overflow: visible; min-height: 0; }

  /* Left rail → fixed bottom navigation bar so every item (incl. Settings) is always reachable */
  .left-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    flex-direction: row; min-height: 0; height: auto;
    overflow-x: auto; overflow-y: hidden;
    border-top: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 -4px 18px rgba(0,0,0,0.16);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .left-nav .nav-items { flex-direction: row; flex: 1; padding: 6px; gap: 2px; justify-content: space-around; }
  .left-nav .nav-bottom { flex-direction: row; flex: 0 0 auto; padding: 6px 8px 6px 0; }
  .left-nav .nav-item { width: auto; flex: 1 0 auto; padding: 8px 12px; }
  .left-nav .nav-item span { display: none; }                 /* icon-only to fit the row */
  .left-nav .nav-item[data-nav="feedback"] { display: none; } /* Feedback stays in the footer */

  .site-header { gap: 10px; padding: 0 14px; }
  .brand-name { display: none; }
  .search-wrap { max-width: none; }

  .main-content { padding: 16px 14px 24px; }
  .site-footer { padding-bottom: 18px; margin-bottom: calc(66px + env(safe-area-inset-bottom)); }

  .composer-divider,
  .composer-actions { display: none; }

  .card-grid { grid-template-columns: 1fr; }

  /* Tab bars (profile/group) scroll horizontally instead of overflowing the page */
  .tab-bar { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tab-bar::-webkit-scrollbar { display: none; }
  .tab-btn { padding: 10px 13px; font-size: 0.82rem; }
  .profile-stats-row { gap: 8px; }
}

/* ─── Dark Theme ──────────────────────────────────── */

body.dark-theme {
  --bg:          #0f172a;
  --surface:     #1e293b;
  --surface-alt: #162237;
  --border:      #2d3d52;
  --border-light:#243347;
  --text:        #f1f5f9;
  --text-soft:   #94a3b8;
  --muted:       #64748b;
  --gold:        #d4af37;
  --gold-soft:   #e0c158;
  --gold-glow:   rgba(212, 175, 55, 0.16);
  background-image:
    radial-gradient(ellipse 55% 40% at 90% 10%, rgba(13,107,74,0.07) 0%, transparent 55%),
    radial-gradient(ellipse 50% 50% at 10% 95%, rgba(184,134,11,0.04) 0%, transparent 55%);
}

body.dark-theme .site-header,
body.dark-theme .stats-panel,
body.dark-theme .site-footer {
  background: var(--surface);
  border-color: var(--border);
}

body.dark-theme .search-wrap input,
body.dark-theme .search-inline {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text);
}

body.dark-theme .composer-textarea,
body.dark-theme .chat-input,
body.dark-theme .comment-input,
body.dark-theme .setting-select {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text);
}

body.dark-theme .composer-textarea::placeholder,
body.dark-theme .chat-input::placeholder,
body.dark-theme .comment-input::placeholder,
body.dark-theme .search-wrap input::placeholder,
body.dark-theme .search-inline::placeholder { color: var(--muted); }

body.dark-theme .action-btn { background: var(--bg); border-color: var(--border); }
body.dark-theme .chip       { background: var(--surface); border-color: var(--border); }
body.dark-theme select { color-scheme: dark; }

/* ─── Compact Mode ────────────────────────────────── */

body.compact-mode .post-card          { padding: 12px 14px; }
body.compact-mode .main-content       { padding: 14px 18px 24px; }
body.compact-mode .content-section    { margin-bottom: 18px; }
body.compact-mode .group-body         { padding: 10px 12px 12px; }
body.compact-mode .event-body         { padding: 10px 12px; }
body.compact-mode .setting-row        { padding: 11px 16px; }

/* ─── Settings Layout ─────────────────────────────── */

.settings-layout {
  display: grid;
  grid-template-columns: 192px 1fr;
  gap: 20px;
  align-items: start;
}

.settings-nav {
  position: sticky;
  top: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: var(--shadow-sm);
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 11px;
  font-size: 0.84rem;
  font-weight: 500;
  font-family: 'Cairo', sans-serif;
  color: var(--text-soft);
  text-align: left;
  width: 100%;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.settings-nav-item svg { flex-shrink: 0; }
.settings-nav-item:hover  { background: var(--bg); color: var(--text); }
.settings-nav-item.active { background: var(--green-light); color: var(--green); font-weight: 600; }

.settings-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.settings-section-title {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin: 14px 0 6px 2px;
}

.settings-section-title:first-child { margin-top: 0; }

/* ─── Settings Card & Row ─────────────────────────── */

.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.12s;
}

.setting-row:last-child { border-bottom: none; }
.setting-row:hover { background: var(--bg); }

.setting-row-label { flex: 1; min-width: 0; }

.setting-row-label strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  line-height: 1.3;
}

.setting-row-label span {
  font-size: 0.77rem;
  color: var(--text-soft);
  font-weight: 300;
  line-height: 1.4;
}

/* ─── Toggle Switch ───────────────────────────────── */

.toggle {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
}

.toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.toggle-track {
  display: block;
  width: 46px;
  height: 27px;
  border-radius: 999px;
  background: var(--border);
  position: relative;
  transition: background 0.24s ease;
  flex-shrink: 0;
}

.toggle input:checked ~ .toggle-track { background: var(--green); }

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 5px rgba(0,0,0,0.22);
  transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toggle input:checked ~ .toggle-track .toggle-thumb {
  transform: translateX(19px);
}

/* ─── Theme Cards ─────────────────────────────────── */

.theme-cards {
  display: flex;
  gap: 10px;
  padding: 16px;
  flex-wrap: wrap;
}

.theme-card {
  flex: 1;
  min-width: 76px;
  border: 2px solid var(--border);
  border-radius: 13px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
  background: none;
  padding: 0;
}

.theme-card:hover { transform: translateY(-2px); border-color: var(--text-soft); }

.theme-card.selected {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
}

.theme-card-preview {
  height: 56px;
  position: relative;
  overflow: hidden;
}

.theme-card-preview.light { background: #f0ede7; }
.theme-card-preview.dark  { background: #0f172a; }
.theme-card-preview.auto  { background: linear-gradient(135deg, #f0ede7 50%, #0f172a 50%); }

.theme-card-preview-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 18px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
}

.theme-card-preview.light .theme-card-preview-bar { background: #ffffff; }
.theme-card-preview.dark  .theme-card-preview-bar { background: #1e293b; }
.theme-card-preview.auto  .theme-card-preview-bar { background: linear-gradient(135deg, #ffffff 50%, #1e293b 50%); }

.theme-card-preview-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.theme-card-preview.light .theme-card-preview-dot { background: #e8e4dc; }
.theme-card-preview.dark  .theme-card-preview-dot { background: #334155; }
.theme-card-preview.auto  .theme-card-preview-dot { background: #94a3b8; }

.theme-card-label {
  padding: 8px 10px;
  font-size: 0.79rem;
  font-weight: 600;
  font-family: 'Cairo', sans-serif;
  text-align: center;
  color: var(--text-soft);
  background: var(--surface);
}

.theme-card.selected .theme-card-label { color: var(--green); }

/* ─── Color Swatches ──────────────────────────────── */

.color-swatches {
  display: flex;
  gap: 11px;
  padding: 16px 18px;
  flex-wrap: wrap;
  align-items: center;
}

.color-swatch {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  transition: transform 0.18s, box-shadow 0.18s;
  border: 2.5px solid transparent;
  outline: none;
}

.color-swatch:hover { transform: scale(1.12); }

.color-swatch.selected {
  border-color: var(--text);
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5.5px var(--text);
  transform: scale(1.08);
}

.color-swatch::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,0.9);
  font-size: 1rem;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.18s;
  border-radius: 9px;
  background: rgba(0,0,0,0.15);
}

.color-swatch.selected::after { opacity: 1; }

/* ─── Segmented Control ───────────────────────────── */

.seg-control {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
}

.seg-btn {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  font-family: 'Cairo', sans-serif;
  color: var(--text-soft);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  cursor: pointer;
  white-space: nowrap;
}

.seg-btn.active {
  background: var(--surface);
  color: var(--green);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* ─── Setting Select & Input ──────────────────────── */

.setting-select {
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.84rem;
  font-family: 'Cairo', sans-serif;
  outline: none;
  cursor: pointer;
  min-width: 148px;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  flex-shrink: 0;
}

.setting-select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
}

.setting-input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.84rem;
  font-family: 'Cairo', sans-serif;
  outline: none;
  width: 160px;
  transition: border-color 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.setting-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
  background: var(--surface);
}

/* ─── Settings Action Buttons ─────────────────────── */

.setting-link-btn {
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 0.81rem;
  font-weight: 600;
  font-family: 'Cairo', sans-serif;
  color: var(--green);
  background: var(--green-light);
  border: 1px solid rgba(13,107,74,0.15);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.setting-link-btn:hover { background: var(--green); color: #fff; }

.btn-warning {
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 0.81rem;
  font-weight: 600;
  font-family: 'Cairo', sans-serif;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.btn-warning:hover { background: #fef3c7; border-color: #f59e0b; }

.btn-danger {
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 0.81rem;
  font-weight: 700;
  font-family: 'Cairo', sans-serif;
  color: #fff;
  background: #ef4444;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
}

.btn-danger:hover { background: #dc2626; }

/* ─── Delete buttons ──────────────────────────────── */
.gd-delete-btn {
  background: rgba(239,68,68,0.18);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,0.35);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s;
  line-height: 1;
}
.gd-delete-btn:hover { background: rgba(239,68,68,0.35); }

.item-delete-btn {
  background: none;
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
  opacity: 0.45;
  padding: 0 2px;
  line-height: 1;
  transition: opacity 0.15s;
  margin-left: auto;
}
.item-delete-btn:hover { opacity: 1; }

/* ─── Danger Zone ─────────────────────────────────── */

.danger-zone { border-color: #fecaca !important; }
.danger-zone .setting-row:hover { background: #fff5f5; }

body.dark-theme .danger-zone { border-color: #450a0a !important; }
body.dark-theme .danger-zone .setting-row:hover { background: rgba(239,68,68,0.06); }

/* ─── Settings Responsive ─────────────────────────── */

@media (max-width: 800px) {
  .settings-layout { grid-template-columns: 1fr; gap: 0; }
  .settings-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    border-radius: 13px;
    margin-bottom: 14px;
  }
  .settings-nav-item { flex: 1; min-width: 80px; justify-content: center; flex-direction: column; gap: 4px; padding: 10px 8px; font-size: 0.72rem; }
}

/* ─── Functional Settings Effects ─────────────────── */

/* Online status: hide green dot when onlineStatus is off */
body.hide-online .member-av::after { display: none; }

/* Disabled section (notifications sub-options when push is off) */
.disabled-section {
  opacity: 0.42;
  pointer-events: none;
  user-select: none;
  transition: opacity 0.22s;
}

/* Privacy badge on profile */
.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: 'Cairo', sans-serif;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  vertical-align: middle;
  margin-left: 6px;
}

body.dark-theme .privacy-badge { background: rgba(251,191,36,0.12); color: #fcd34d; border-color: rgba(252,211,77,0.25); }

/* Online dot on profile avatar */
.profile-av { position: relative; }
.profile-online-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #22c55e;
  border: 2.5px solid var(--surface);
}

/* ─── RTL Layout ──────────────────────────────────── */
[dir="rtl"] .site-layout { direction: rtl; }
[dir="rtl"] .site-header { direction: rtl; }
/* Each panel resets direction so internal layouts stay correct */
[dir="rtl"] .left-nav,
[dir="rtl"] .main-content,
[dir="rtl"] .stats-panel { direction: ltr; }
/* Text content flips */
[dir="rtl"] .main-content { direction: rtl; }
[dir="rtl"] .stats-panel  { direction: rtl; }
/* Left/right border swap on stats panel */
[dir="rtl"] .stats-panel  { border-left: none; border-right: 1px solid var(--border); }
/* Settings layout */
[dir="rtl"] .settings-layout { direction: rtl; }
[dir="rtl"] .settings-content { direction: rtl; }
/* Text alignment for RTL content */
[dir="rtl"] .post-content,
[dir="rtl"] .group-desc,
[dir="rtl"] .event-desc,
[dir="rtl"] .member-modal-bio { text-align: right; }
/* Inputs */
[dir="rtl"] input,
[dir="rtl"] textarea { text-align: right; }
/* Nav stays LTR (column layout with icons) */
[dir="rtl"] .left-nav { direction: ltr; }

/* ─── Chat View ───────────────────────────────────── */

.main-content.view-chat {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.chat-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.chat-delete-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  transition: background .15s, color .15s;
}
.chat-delete-btn:hover { background: rgba(239,68,68,.1); color: #f87171; }

.chat-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.chat-peer {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 1;
}

.chat-peer-info strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.chat-peer-status {
  font-size: 0.75rem;
  color: var(--online);
  font-weight: 500;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.msg-row { display: flex; align-items: flex-end; gap: 8px; }
.msg-me   { justify-content: flex-end; }
.msg-them { justify-content: flex-start; }

.msg-av {
  width: 30px; height: 30px;
  border-radius: 9px;
  display: grid; place-items: center;
  font-size: 0.62rem; font-weight: 700; color: #fff;
  flex-shrink: 0; overflow: hidden;
}

.msg-bubble {
  max-width: 68%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.55;
  position: relative;
}

.msg-bubble-me {
  background: var(--green);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.msg-bubble-them {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.msg-time {
  display: block;
  font-size: 0.68rem;
  margin-top: 4px;
  opacity: 0.65;
  text-align: right;
}

.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.88rem;
  font-family: 'Cairo', sans-serif;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
  background: var(--surface);
}

.chat-send-btn {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--green); color: #fff;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.15s;
  border: none; cursor: pointer;
}

.chat-send-btn:hover { background: var(--green-dark); transform: scale(1.05); }

/* ─── Post Comments ───────────────────────────────── */

.post-comments {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.comment-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.comment-av {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 0.6rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
  margin-top: 2px;
}

.comment-bubble {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 8px 12px;
  min-width: 0;
  width: 100%;
}

.comment-author {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.comment-text {
  display: block;
  font-size: 0.84rem;
  color: var(--text);
  line-height: 1.5;
}

.comment-time {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 3px;
}

.comment-body { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }

.comment-actions { display: flex; gap: 6px; padding-left: 2px; }

.comment-act {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: none;
  font-size: 0.75rem; color: var(--text-soft);
  padding: 3px 8px; border-radius: 6px;
  cursor: pointer; transition: background .12s, color .12s;
}
.comment-act:hover { background: var(--bg); color: var(--text); }
.comment-act-delete:hover { background: rgba(239,68,68,.1); color: #f87171; }

.comment-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.84rem;
  font-family: 'Cairo', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}

.comment-input:focus { border-color: var(--green); background: var(--surface); }

.comment-send-btn {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: var(--green-light); color: var(--green);
  border: none; cursor: pointer; flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.comment-send-btn:hover { background: var(--green); color: #fff; }

/* ─── Notifications Panel ─────────────────────────── */

.notif-panel {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 320px;
  box-shadow: var(--shadow-md);
  z-index: 999;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px) scale(0.97);
  transition: opacity 0.18s, transform 0.18s;
}

.notif-panel.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.notif-clear-all {
  font-size: 0.78rem;
  font-weight: 500;
  font-family: 'Cairo', sans-serif;
  color: var(--green);
  cursor: pointer;
  transition: opacity 0.15s;
}

.notif-clear-all:hover { opacity: 0.7; }

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.12s;
  cursor: pointer;
}

.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg); }
.notif-item--link:hover { background: var(--green-light); }
.notif-item--link:active { opacity: 0.8; }

.notif-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 0.83rem;
  color: var(--muted);
}

.notif-av {
  width: 36px; height: 36px;
  border-radius: 11px;
  display: grid; place-items: center;
  font-size: 0.68rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.notif-body {
  flex: 1;
  min-width: 0;
}

.notif-body span:first-child {
  display: block;
  font-size: 0.83rem;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 3px;
}

.notif-time {
  font-size: 0.72rem;
  color: var(--muted);
}

/* ─── Nav Style Preview Cards ─────────────────────── */

.nav-style-preview {
  display: flex;
  gap: 10px;
  padding: 10px 18px 16px;
}

.nav-preview-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.nav-preview-inner {
  display: flex;
  width: 100%;
  height: 52px;
  border-radius: 11px;
  overflow: hidden;
  border: 2px solid var(--border);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.nav-preview-card.selected .nav-preview-inner {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
}

.nav-preview-sidebar {
  width: 22px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 0;
}

.nav-preview-dunkel { background: #0b3d2a; }
.nav-preview-akzent { background: var(--green); }
.nav-preview-hell   { background: #ffffff; border-right: 1px solid #e8e4dc; }

.nav-preview-body { flex: 1; background: var(--bg); }

.nav-preview-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.45);
  flex-shrink: 0;
}

.nav-preview-hell .nav-preview-dot { background: rgba(0,0,0,0.18); }

.nav-preview-label {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-soft);
}

.nav-preview-card.selected .nav-preview-label { color: var(--green); font-weight: 700; }

/* ─── Reaction Picker (floating) ─────────────────── */
.float-reaction-picker {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 10px;
  display: flex;
  gap: 3px;
  box-shadow: var(--shadow-md);
  z-index: 500;
  opacity: 0;
  transform: translateY(4px) scale(0.92);
  transition: opacity 0.14s, transform 0.14s;
  white-space: nowrap;
}

.float-reaction-picker.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.reaction-opt {
  font-size: 1.2rem;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  cursor: pointer;
  transition: transform 0.12s, background 0.12s;
  line-height: 1;
  background: none;
}
.reaction-opt:hover { transform: scale(1.3); background: var(--bg); }
.reaction-opt.active { background: var(--green-light); }

.reaction-icon-active { font-size: 15px; line-height: 1; display: inline-flex; align-items: center; }
.post-act.reacted { color: var(--green); }
.post-act-bookmark { margin-left: auto; }
.post-act-bookmark.saved { color: var(--green); }
.post-act-delete:hover { color: #f87171; }
.post-act-report:hover { color: #f59e0b; }
.comment-act-report:hover { background: rgba(245,158,11,.1); color: #f59e0b; }

/* ─── Profile Tabs ────────────────────────────────── */
.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--green);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  margin-left: 5px;
  vertical-align: middle;
}

/* ─── Connections Grid ────────────────────────────── */
.connections-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.connection-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  text-align: center;
  transition: box-shadow 0.15s, transform 0.15s;
}
.connection-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.connection-av {
  width: 46px; height: 46px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 0.76rem; font-weight: 700; color: #fff;
}

.connection-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}

.connection-loc {
  font-size: 0.72rem;
  color: var(--muted);
}

/* ─── Member Modal ────────────────────────────────── */
.member-modal-body {
  align-items: center !important;
  text-align: center;
}

.member-modal-av {
  width: 72px; height: 72px;
  border-radius: 20px;
  display: grid; place-items: center;
  font-size: 1.2rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
  box-shadow: var(--shadow);
}

.member-modal-name {
  margin: 0 0 4px;
  font-family: 'Amiri', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.member-modal-meta {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-soft);
}

.member-modal-bio {
  margin: 8px 0 0;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.55;
}

.member-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.member-connected {
  background: var(--green-light) !important;
  color: var(--green) !important;
  border: 1px solid rgba(13,107,74,0.2) !important;
  box-shadow: none !important;
}

.member-modal-groups {
  width: 100%;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.member-group-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ─── Member Card Private ─────────────────────────── */
.member-av-wrap {
  position: relative;
  display: inline-flex;
}
.member-lock-badge {
  position: absolute;
  bottom: -4px;
  right: -6px;
  font-size: 0.68rem;
  line-height: 1;
  background: var(--surface);
  border-radius: 50%;
  padding: 1px;
}
.member-card--private .member-av {
  opacity: 0.55;
  filter: grayscale(0.4);
}

/* ─── Admin Panel ─────────────────────────────────── */
.admin-user-list { display: flex; flex-direction: column; gap: 10px; }
.admin-user-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px;
}
.admin-user-av {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; font-size: .78rem; font-weight: 700; color: #fff;
}
.admin-user-info {
  flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.admin-user-info strong { font-size: .88rem; }
.admin-user-info span  { font-size: .76rem; color: var(--text-soft); }
.admin-user-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.admin-badge {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  background: var(--green-light); color: var(--green-dark);
  font-size: .7rem; font-weight: 700; vertical-align: middle;
}
.ban-badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  background: rgba(239,68,68,.12); color: #f87171;
  font-size: .72rem; font-weight: 600;
}
.ban-duration-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.ban-dur-btn {
  padding: 10px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: .85rem;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.ban-dur-btn:hover { background: var(--green-light); border-color: var(--green); color: var(--green-dark); }
.ban-dur-permanent { border-color: rgba(239,68,68,.4); color: #f87171; }
.ban-dur-permanent:hover { background: rgba(239,68,68,.1); border-color: #f87171; color: #f87171; }

/* ─── Private Profile Wall ────────────────────────── */
.member-modal-av--blur {
  filter: blur(3px);
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
}
.private-profile-wall {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  text-align: center;
}
.private-profile-icon {
  font-size: 1.6rem;
}
.private-profile-msg {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-soft);
  line-height: 1.5;
}

/* ─── Search Results ──────────────────────────────── */
.search-result-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: var(--green-light);
  color: var(--green-dark);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  flex-shrink: 0;
}

/* ─── Page Transitions ────────────────────────────── */
@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.main-content.page-enter { animation: pageIn 0.2s ease-out; }

/* ─── Modal ───────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.42);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.18s;
}
.modal-overlay.show { opacity: 1; }
.modal-overlay.show .modal-box { transform: scale(1) translateY(0); }

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 480px;
  max-width: 100%;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  box-shadow: var(--shadow-md);
  transform: scale(0.96) translateY(14px);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.modal-header h2 {
  font-family: 'Amiri', serif;
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.modal-close-btn {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: grid; place-items: center;
  color: var(--text-soft);
  background: var(--bg);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.modal-close-btn:hover { background: var(--border-light); color: var(--text); }

.modal-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-field { display: flex; flex-direction: column; gap: 6px; }

.modal-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.modal-input, .modal-textarea {
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 10px 14px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  font-family: 'Cairo', sans-serif;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  line-height: 1.6;
}
.modal-input:focus, .modal-textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
  background: var(--surface);
}
.modal-textarea { resize: none; }

.modal-tag-grid { display: flex; flex-wrap: wrap; gap: 7px; }

.modal-tag-btn {
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 0.8rem; font-weight: 500; font-family: 'Cairo', sans-serif;
  background: var(--bg); border: 1px solid var(--border); color: var(--text-soft);
  cursor: pointer; transition: all 0.15s;
}
.modal-tag-btn:hover { border-color: var(--green); color: var(--green); }

.modal-tag-suggestions {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 8px;
}

.modal-tag-chip {
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.77rem; font-weight: 500; font-family: 'Cairo', sans-serif;
  background: var(--bg); border: 1px solid var(--border); color: var(--text-soft);
  cursor: pointer; transition: all 0.15s;
}
.modal-tag-chip:hover { border-color: var(--green); color: var(--green); background: var(--green-light); }
.modal-tag-chip.selected { background: var(--green); color: #fff; border-color: var(--green); }

.modal-cover-upload-row {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-cover-photo-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-cover-photo-preview {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.modal-cover-remove-btn {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-family: 'Cairo', sans-serif;
  color: #e11d48;
  background: none;
  border: 1px solid #e11d48;
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.modal-cover-remove-btn:hover { background: #fff0f3; }

.modal-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--bg);
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 500;
  font-family: 'Cairo', sans-serif;
  color: var(--text-soft);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  align-self: flex-start;
}
.modal-upload-btn:hover {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-light);
}

/* ── Connection Requests ─────────────────────────── */
.req-section-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.78rem; font-weight: 700;
  color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.req-section-badge {
  background: var(--green); color: #fff;
  font-size: 0.7rem; font-weight: 700;
  border-radius: 999px; padding: 1px 7px;
}

.req-dot {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--green); color: #fff;
  font-size: 0.65rem; font-weight: 700;
  border-radius: 999px; padding: 0 5px; min-width: 16px; height: 16px;
  vertical-align: middle; margin-left: 3px;
}

.req-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }

.req-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}

.req-av {
  width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center;
  font-size: 0.85rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.req-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.req-name { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.req-sub  { font-size: 0.75rem; color: var(--text-soft); }

.req-btns { display: flex; gap: 7px; flex-shrink: 0; }

.req-btn-accept {
  padding: 6px 14px; border-radius: 9px; border: none;
  background: var(--green); color: #fff;
  font-size: 0.8rem; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: background 0.15s;
}
.req-btn-accept:hover { background: var(--green-dark); }

.req-btn-decline {
  padding: 6px 14px; border-radius: 9px;
  border: 1.5px solid var(--border); background: transparent;
  color: var(--text-soft); font-size: 0.8rem; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: border-color 0.15s, color 0.15s;
}
.req-btn-decline:hover { border-color: #e11d48; color: #e11d48; }

.req-btn-sent {
  opacity: 0.7; cursor: default; font-style: italic;
}

.req-divider {
  height: 1px; background: var(--border-light); margin: 16px 0;
}

/* ── New Chat Modal ───────────────────────────────── */
.new-chat-list {
  max-height: 340px;
  overflow-y: auto;
  margin: 0 -20px;
}

.new-chat-divider {
  padding: 6px 20px 4px;
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.new-chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.12s;
}
.new-chat-item:hover { background: var(--bg); }

.new-chat-av {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 0.85rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

.new-chat-info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 1px;
}

.new-chat-name {
  font-size: 0.88rem; font-weight: 600; color: var(--text);
}

.new-chat-sub {
  font-size: 0.77rem; color: var(--text-soft);
}

.new-chat-badge {
  font-size: 0.7rem; font-weight: 600;
  color: var(--green);
  background: var(--green-light);
  border-radius: 999px;
  padding: 2px 8px;
  flex-shrink: 0;
}
.modal-tag-btn.selected { background: var(--green); color: #fff; border-color: var(--green); }

.modal-cover-row { display: flex; gap: 8px; flex-wrap: wrap; }

.modal-cover-btn {
  width: 38px; height: 38px;
  border-radius: 11px;
  border: 2.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}
.modal-cover-btn:hover { transform: scale(1.1); }
.modal-cover-btn.selected {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text);
  transform: scale(1.06);
}

.modal-emoji-row { display: flex; flex-wrap: wrap; gap: 7px; }

.modal-emoji-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--bg);
  font-size: 1.1rem;
  cursor: pointer;
  display: grid; place-items: center;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.modal-emoji-btn:hover { background: var(--surface); transform: scale(1.1); }
.modal-emoji-btn.selected { border-color: var(--green); background: var(--green-light); }

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border-light);
}

/* ─── Input Validation ────────────────────────────── */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60%  { transform: translateX(-4px); }
  40%, 80%  { transform: translateX(4px); }
}

.modal-input.input-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.15);
  animation: shake 0.35s ease;
}

/* ─── Profile Stat Hover ──────────────────────────── */
.pstat[data-action] { cursor: pointer; }
.pstat[data-action]:hover { box-shadow: var(--shadow); }

/* ─── Dark Mode: Date & Time Inputs ──────────────── */
body.dark-theme input[type="date"],
body.dark-theme input[type="time"] {
  color-scheme: dark;
  background: var(--bg);
  border-color: var(--border);
  color: var(--text);
}

/* ─── Load More Button ────────────────────────────── */
.load-more-btn {
  padding: 9px 28px; border-radius: 10px;
  font-size: 0.84rem; font-weight: 600; font-family: 'Cairo', sans-serif;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-soft);
  cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s;
  box-shadow: var(--shadow-sm);
}
.load-more-btn:hover { background: var(--green-light); color: var(--green); border-color: rgba(13,107,74,0.2); }

/* ─── Empty State ─────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  padding: 36px 20px; gap: 10px; text-align: center;
}
.empty-state-icon { font-size: 2.4rem; line-height: 1; opacity: 0.55; }
.empty-state-line { display: inline-flex; color: var(--green); opacity: 0.85; }
.empty-state-line svg { width: 46px; height: 46px; }
.empty-state p { font-size: 0.86rem; color: var(--muted); margin: 0; }
.empty-state-line, .empty-state-icon {
  filter: drop-shadow(1px 0 0 var(--bg)) drop-shadow(-1px 0 0 var(--bg)) drop-shadow(0 1px 0 var(--bg)) drop-shadow(0 -1px 0 var(--bg));
}

/* ─── Loading skeletons (shimmer) ─────────────────── */
@keyframes skelShimmer { 0% { background-position: -200px 0; } 100% { background-position: calc(200px + 100%) 0; } }
.skel {
  border-radius: 6px;
  background: var(--border);
  background-image: linear-gradient(90deg, transparent 0, rgba(255,255,255,0.35) 50%, transparent 100%);
  background-size: 200px 100%; background-repeat: no-repeat;
  animation: skelShimmer 1.2s ease-in-out infinite;
}
body.dark-theme .skel { background-image: linear-gradient(90deg, transparent 0, rgba(255,255,255,0.08) 50%, transparent 100%); }
.skel-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px 16px;
}
.skel-av { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; }
.skel-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.skel-line { height: 11px; width: 100%; }
.skel-line.short { width: 55%; }
.skel-row {
  display: flex; flex-direction: column; gap: 9px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 10px;
}
.skel-post {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 18px; margin-bottom: 16px;
  display: flex; flex-direction: column; gap: 11px;
}
.skel-post-head { display: flex; align-items: center; gap: 12px; margin-bottom: 3px; }
.skel-post .skel-av { width: 38px; height: 38px; border-radius: 11px; }

/* ─── Message Request Info ────────────────────────── */
.msg-request-info {
  display: flex; align-items: center; gap: 14px;
  padding: 4px 0 8px;
}

/* ─── Group Cover Responsive ──────────────────────── */
@media (max-width: 640px) {
  .gd-overlay { padding: 14px; }
  .gd-emoji { font-size: 1.6rem; }
}

/* ─── Page Back Animation ─────────────────────────── */
@keyframes pageBack {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}
.main-content.page-back { animation: pageBack 0.18s ease-out; }

/* Swipe paging — new page slides in from the direction of travel */
@keyframes slideFromRight { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes slideFromLeft  { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: none; } }
.main-content.page-slide-l { animation: slideFromRight 0.22s ease-out; }
.main-content.page-slide-r { animation: slideFromLeft 0.22s ease-out; }

/* Mobile page-dot indicator — disabled now that the bottom nav bar shows the current view.
   (Swipe gesture still works; kept styles for potential reuse.) */
.swipe-dots { display: none; }
@media (max-width: 640px) {
  .swipe-dots.show {
    display: none; align-items: center; gap: 7px;
    position: fixed; left: 50%; transform: translateX(-50%); bottom: 14px; z-index: 45;
    padding: 8px 13px; border-radius: 22px;
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border: 1px solid var(--border); box-shadow: 0 6px 20px rgba(0,0,0,0.16);
  }
  .swipe-dot {
    width: 7px; height: 7px; padding: 0; border: none; border-radius: 50%;
    background: var(--muted); opacity: 0.45; cursor: pointer; transition: all 0.22s ease;
  }
  .swipe-dot.active { opacity: 1; background: var(--green); width: 20px; border-radius: 4px; }
}

/* ─── Dark Mode: Tag Chips ───────────────────────── */
body.dark-theme .tag-stadt    { background: rgba(14,165,233,0.15);  color: #38bdf8; }
body.dark-theme .tag-business { background: rgba(99,102,241,0.15);  color: #a5b4fc; }
body.dark-theme .tag-familie  { background: rgba(244,63,94,0.15);   color: #fda4af; }
body.dark-theme .tag-hobby    { background: rgba(245,158,11,0.15);  color: #fcd34d; }
body.dark-theme .tag-sport    { background: rgba(16,185,129,0.15);  color: #6ee7b7; }
body.dark-theme .tag-community{ background: rgba(139,92,246,0.15);  color: #c4b5fd; }

/* ─── Post Images ─────────────────────────────────── */
.post-imgs {
  margin: 0 0 12px;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  gap: 3px;
}
/* 1 image: natural size, no cropping */
.post-imgs[data-count="1"] {
  grid-template-columns: 1fr;
}
.post-imgs[data-count="1"] > .post-img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  background: var(--bg);
  border-radius: 12px;
}
/* 2 images: side by side */
.post-imgs[data-count="2"] {
  grid-template-columns: 1fr 1fr;
}
/* 3+ images: 2-col grid */
.post-imgs[data-count="3"],
.post-imgs[data-count="4"] {
  grid-template-columns: 1fr 1fr;
}
/* default grid img sizing */
.post-imgs:not([data-count="1"]) > .post-img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 0;
  display: block;
  cursor: pointer;
}
.post-imgs[data-count="1"] > .post-img { cursor: zoom-in; }
.post-imgs:not([data-count="1"]) > .post-img { cursor: zoom-in; }

/* ─── Composer Image Preview ──────────────────────── */
.composer-img-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 12px 0;
}
.composer-img-item {
  position: relative;
  flex-shrink: 0;
}
.composer-img-thumb {
  display: block;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
}
.composer-img-remove {
  position: absolute;
  top: 3px; right: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  display: grid; place-items: center;
  cursor: pointer;
  border: none;
  transition: background 0.15s;
}
.composer-img-remove:hover { background: rgba(0,0,0,0.85); }

.composer-img-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 9px;
  font-size: 0.8rem; font-weight: 500; font-family: 'Cairo', sans-serif;
  background: var(--bg); border: 1px solid var(--border); color: var(--text-soft);
  cursor: pointer; transition: background 0.15s, color 0.15s;
}
.composer-img-btn:hover {
  background: var(--green-light);
  color: var(--green);
  border-color: rgba(13,107,74,0.2);
}

/* ─── Chat Attach Button ──────────────────────────── */
.chat-attach-btn {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--bg); color: var(--text-soft);
  border: 1px solid var(--border);
  flex-shrink: 0; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.chat-attach-btn:hover {
  background: var(--green-light);
  color: var(--green);
  border-color: rgba(13,107,74,0.2);
}

/* Voice: mic button + recording bar */
.chat-mic-btn {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--bg); color: var(--text-soft);
  border: 1px solid var(--border);
  flex-shrink: 0; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.chat-mic-btn:hover { background: var(--green-light); color: var(--green); border-color: rgba(13,107,74,0.2); }
.chat-rec-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
}
.chat-rec-bar.hidden { display: none; }
.chat-rec-cancel, .chat-rec-send {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; flex-shrink: 0; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg); color: var(--text-soft);
}
.chat-rec-send { background: var(--green); color: #fff; border-color: var(--green); }
.chat-rec-send:hover { background: var(--green-dark); }
.chat-rec-dot { width: 11px; height: 11px; border-radius: 50%; background: #ef4444; animation: recPulse 1s ease-in-out infinite; flex-shrink: 0; }
.chat-rec-timer { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); }
@keyframes recPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }

/* Voice message bubble */
.msg-audio-wrap { display: flex; align-items: center; gap: 8px; min-width: 200px; }
.msg-audio-icon { font-size: 1rem; flex-shrink: 0; }
.msg-audio { height: 36px; max-width: 220px; }
.msg-audio-dur { font-size: 0.72rem; color: var(--text-soft); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.msg-bubble-me .msg-audio-dur { color: rgba(255,255,255,0.8); }

/* ─── Chat Image Preview Bar ──────────────────────── */
.chat-img-preview-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
  flex-shrink: 0;
}
.chat-img-preview-item {
  position: relative;
  flex-shrink: 0;
}
.chat-img-thumb-preview {
  width: 48px; height: 48px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
}

/* ─── Chat Image Bubble ───────────────────────────── */
.msg-imgs {
  display: grid;
  gap: 3px;
  margin-bottom: 6px;
  border-radius: 10px;
  overflow: hidden;
}
.msg-imgs[data-count="1"] { grid-template-columns: 1fr; }
.msg-imgs[data-count="2"] { grid-template-columns: 1fr 1fr; }
.msg-imgs[data-count="3"],
.msg-imgs[data-count="4"] { grid-template-columns: 1fr 1fr; }

.msg-imgs[data-count="1"] > .msg-img {
  max-width: 220px;
  max-height: 200px;
  object-fit: contain;
  background: rgba(0,0,0,0.05);
  border-radius: 10px;
  display: block;
  cursor: zoom-in;
}
.msg-imgs:not([data-count="1"]) > .msg-img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

/* ─── Image Lightbox ──────────────────────────────── */
.img-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.18s;
  cursor: zoom-out;
}
.img-lightbox.show { opacity: 1; }
.img-lightbox-img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 8px 48px rgba(0,0,0,0.6);
  pointer-events: none;
}
.img-lightbox-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 300;
  line-height: 1;
  display: grid; place-items: center;
  cursor: pointer;
  border: none;
  transition: background 0.15s;
}
.img-lightbox-close:hover { background: rgba(255,255,255,0.25); }

/* ─── Profile Edit Modal ──────────────────────────── */
.profile-edit-photo-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 2px 0 6px;
}
.profile-edit-av {
  width: 72px; height: 72px;
  border-radius: 18px;
  display: grid; place-items: center;
  font-size: 1.3rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.profile-edit-photo-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* @ prefix input */
.modal-prefix-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 11px;
  overflow: hidden;
  background: var(--bg);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.modal-prefix-wrap:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
  background: var(--surface);
}
.modal-prefix {
  padding: 10px 2px 10px 14px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  user-select: none;
  flex-shrink: 0;
}
.modal-prefix-input {
  flex: 1;
  padding: 10px 14px 10px 4px;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none;
  color: var(--text);
}

/* ─── Settings Konto Profile Card ─────────────────── */
.konto-profile-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 6px;
  box-shadow: var(--shadow-sm);
}
.konto-av {
  width: 56px; height: 56px;
  border-radius: 16px;
  display: grid; place-items: center;
  font-size: 1.1rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.konto-profile-info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.konto-profile-info strong {
  font-size: 0.95rem; font-weight: 700; color: var(--text);
}
.konto-profile-info span {
  font-size: 0.79rem; color: var(--text-soft);
}
.konto-profile-info em {
  font-size: 0.79rem; color: var(--muted); font-style: italic;
}

/* ── Auth Screen ─────────────────────────────────── */
#authOverlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 60% 50% at 80% 15%, rgba(13,107,74,0.08) 0%, transparent 55%),
    radial-gradient(ellipse 55% 55% at 15% 90%, rgba(184,134,11,0.05) 0%, transparent 55%);
  padding: 24px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px 36px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-md);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.auth-brand-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.auth-tagline {
  font-size: 0.82rem;
  color: var(--text-soft);
  margin: 0 0 24px 0;
}

.auth-tabs {
  display: flex;
  gap: 0;
  background: var(--bg);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
}

.auth-tab {
  flex: 1;
  padding: 7px 0;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.auth-tab.active {
  background: var(--surface);
  color: var(--green);
  box-shadow: var(--shadow-sm);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.auth-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.auth-input {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--surface-alt);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
  background: var(--surface);
}

.auth-error {
  font-size: 0.82rem;
  color: #e11d48;
  min-height: 18px;
  font-weight: 500;
}

.auth-submit {
  margin-top: 4px;
  padding: 11px 0;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.auth-submit:hover { background: var(--green-dark); }
.auth-submit:active { transform: scale(0.98); }
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
/* Consent checkboxes (register form + consent gate) */
.auth-check {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  font-size: 0.82rem; line-height: 1.5; color: var(--text-soft); text-align: start;
}
.auth-check input { flex: none; width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--green); cursor: pointer; }
.auth-check a { color: var(--green); font-weight: 600; }
.consent-title { font-family: 'Amiri', serif; font-size: 1.4rem; margin: 6px 0 4px; text-align: center; }
.consent-intro { font-size: 0.88rem; color: var(--text-soft); text-align: center; margin: 0 0 14px; line-height: 1.55; }
.consent-logout {
  font: inherit; font-size: 0.84rem; color: var(--text-soft); background: none; border: 0;
  cursor: pointer; padding: 4px; align-self: center;
}
.consent-logout:hover { color: var(--text); text-decoration: underline; }
.auth-legal {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 6px;
  margin-top: 18px; font-size: 0.78rem; color: var(--muted);
}
.auth-legal a { color: var(--text-soft); text-decoration: none; }
.auth-legal a:hover { color: var(--green); text-decoration: underline; }

/* Settings → Rechtliches: whole row is a link */
.legal-row { color: var(--text); text-decoration: none; }
.legal-row > span { color: var(--text-soft); }
.legal-row:hover strong { color: var(--green); }

.dark-theme .auth-input {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.12);
}

.dark-theme .auth-input:focus {
  background: rgba(255,255,255,0.08);
  border-color: var(--green);
}

.dark-theme .auth-tabs {
  background: rgba(0,0,0,0.2);
  border-color: rgba(255,255,255,0.08);
}

.dark-theme .auth-tab.active {
  background: rgba(255,255,255,0.07);
}

.dark-theme .auth-card {
  background: var(--surface);
  border-color: var(--border);
}

/* ─── Avatar cropper (drag to reposition, slider to zoom) ─── */
.cropper-overlay {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(0,0,0,0.72);
  display: grid; place-items: center;
  opacity: 0; transition: opacity .2s ease;
  padding: 16px;
}
.cropper-overlay.show { opacity: 1; }
.cropper-box-wrap {
  background: var(--card); border-radius: 22px; padding: 22px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.35);
  max-width: 100%;
}
.cropper-title { font-weight: 700; font-size: 1rem; color: var(--text); }
.cropper-stage {
  position: relative; overflow: hidden; border-radius: 22px;
  background: #000; cursor: grab; touch-action: none; user-select: none;
  max-width: 78vw; max-height: 78vw;
}
.cropper-stage:active { cursor: grabbing; }
.cropper-img {
  position: absolute; max-width: none; user-select: none;
  -webkit-user-drag: none; will-change: left, top, width, height;
}
.cropper-ring {
  position: absolute; inset: 0; border-radius: 22px; pointer-events: none;
  border: 3px solid rgba(255,255,255,0.92);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.25) inset;
}
.cropper-zoom { display: flex; align-items: center; gap: 12px; width: 100%; }
.cropper-zoom-ico { color: var(--text-soft); line-height: 1; }
.cropper-zoom input[type=range] {
  flex: 1; height: 4px; accent-color: var(--green); cursor: pointer;
}
.cropper-actions { display: flex; gap: 10px; width: 100%; }
.cropper-actions button { flex: 1; }

/* ─── Daily Ayah card ─── */
.ayah-card {
  position: relative; overflow: hidden;
  background:
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='46' height='46'><g fill='none' stroke='%23ffffff' stroke-opacity='0.05'><rect x='11.5' y='11.5' width='23' height='23'/><rect x='11.5' y='11.5' width='23' height='23' transform='rotate(45 23 23)'/></g></svg>"),
    linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  color: #fff; border-radius: 18px; padding: 18px 22px 20px;
  margin-bottom: 20px; box-shadow: 0 8px 26px var(--green-glow);
}
.ayah-card::before {
  content: ''; position: absolute; inset: 8px;
  border: 1px solid rgba(212,175,55,0.34); border-radius: 12px;
  pointer-events: none;
}
/* Corner arabesque flourish (khatam star) */
.ayah-card::after {
  content: ''; position: absolute; right: -26px; bottom: -26px;
  width: 120px; height: 120px; pointer-events: none; opacity: 0.5;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'><g fill='none' stroke='%23d4af37' stroke-opacity='0.55' stroke-width='1.2'><rect x='34' y='34' width='52' height='52'/><rect x='34' y='34' width='52' height='52' transform='rotate(45 60 60)'/><circle cx='60' cy='60' r='10'/></g></svg>") center/contain no-repeat;
}
.ayah-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; position: relative; }
.ayah-badge { font-size: 1.05rem; color: #f0d68c; }
.ayah-title {
  font-weight: 700; font-size: 0.82rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.82);
}
.ayah-ref {
  margin-inline-start: auto; font-size: 0.76rem; font-weight: 600; color: #f0d68c;
  background: rgba(212,175,55,0.18); border: 1px solid rgba(212,175,55,0.4);
  padding: 2px 11px; border-radius: 20px;
}
.ayah-ar {
  font-family: 'Amiri', serif; font-size: 1.6rem; line-height: 2.1;
  text-align: center; margin: 10px 0 14px;
}
.ayah-trans {
  font-size: 0.9rem; line-height: 1.6; opacity: 0.95;
  text-align: center; font-style: italic; margin: 0;
  border-top: 1px solid rgba(212,175,55,0.28); padding-top: 13px;
}

/* ─── Muhasaba journal ─────────────────────────────── */
/* An evening notebook page: warm paper, gold hairline frame, ruled writing lines. */
.jn-wrap {
  --jn-paper:  #fffdf8;
  --jn-accent: var(--green);
  --jn-gold:   var(--gold);
  --jn-edge:   color-mix(in srgb, var(--gold) 28%, var(--border));
  --jn-rule:   color-mix(in srgb, var(--gold) 20%, transparent);
  --jn-line:   1.85em;
  max-width: 680px;
}
body.dark-theme .jn-wrap {
  --jn-paper:  color-mix(in srgb, var(--surface) 94%, var(--gold));
  --jn-accent: color-mix(in srgb, var(--green) 35%, #a7f3d0);
  --jn-edge:   color-mix(in srgb, var(--gold) 30%, var(--border));
  --jn-rule:   color-mix(in srgb, var(--gold) 15%, transparent);
}

/* The page */
.jn-page {
  position: relative;
  background: var(--jn-paper);
  border: 1px solid var(--jn-edge);
  border-radius: 18px;
  padding: 26px 30px 24px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 18px 40px -18px rgba(40,30,10,0.28), 0 2px 6px rgba(0,0,0,0.05);
  animation: jnRise 0.5s cubic-bezier(.2,.7,.2,1) both;
}
/* inner hairline — the manuscript double rule */
.jn-page::after {
  content: ''; position: absolute; inset: 7px; pointer-events: none;
  border: 1px solid var(--jn-rule); border-radius: 12px;
}
body.dark-theme .jn-page { box-shadow: 0 18px 40px -16px rgba(0,0,0,0.6), 0 2px 6px rgba(0,0,0,0.3); }

/* Head: big day numeral + weekday / month, tools on the trailing side */
.jn-page-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding-bottom: 16px; border-bottom: 1px solid var(--jn-rule);
}
.jn-day { display: flex; align-items: center; gap: 12px; }
.jn-day-num {
  font-family: 'Amiri', serif; font-size: 3rem; font-weight: 700; line-height: 0.9;
  color: var(--jn-accent); min-width: 1.2em; text-align: center;
}
.jn-day-meta { display: flex; flex-direction: column; line-height: 1.25; }
.jn-day-weekday { font-family: 'Amiri', serif; font-size: 1.25rem; font-weight: 700; color: var(--text); }
.jn-day-month { font-size: 0.82rem; color: var(--text-soft); }
.jn-review-tag {
  font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; vertical-align: 1px;
  color: var(--jn-gold); background: var(--gold-glow); padding: 2px 8px; border-radius: 12px; margin-inline-start: 6px;
}
.jn-page.is-review { --jn-accent: var(--gold); }

.jn-page-tools { display: flex; align-items: center; gap: 8px; }
.jn-streak {
  font-size: 0.8rem; font-weight: 700; white-space: nowrap;
  color: var(--jn-gold); background: var(--gold-glow);
  border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
  padding: 4px 12px; border-radius: 20px;
}
.jn-date-pick {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px; cursor: pointer;
  color: var(--text-soft); border: 1px solid var(--jn-edge); background: transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.jn-date-pick:hover, .jn-date-pick:focus-within { color: var(--jn-accent); border-color: var(--jn-accent); }
.jn-date-pick svg { width: 16px; height: 16px; pointer-events: none; }
/* the native input covers the icon invisibly, so a tap opens the system date picker */
.jn-date-input {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;
  border: 0; padding: 0; color-scheme: light dark;
}
.jn-date-input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.jn-today-btn {
  font: inherit; font-size: 0.78rem; font-weight: 600; cursor: pointer;
  color: var(--green); background: none; border: 1px solid color-mix(in srgb, var(--green) 40%, var(--border));
  padding: 5px 12px; border-radius: 10px; transition: background 0.15s;
}
body.dark-theme .jn-today-btn { color: color-mix(in srgb, var(--green) 45%, #fff); }
.jn-today-btn:hover { background: var(--green-glow); }

.jn-intro {
  font-size: 0.86rem; line-height: 1.65; color: var(--text-soft);
  margin: 14px 0 0; max-width: 52ch;
}

/* Prompt with khatam ornament */
.jn-ornament {
  display: flex; align-items: center; gap: 12px; margin: 22px 0 10px; color: var(--jn-gold);
}
.jn-ornament::before, .jn-ornament::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--gold) 45%, transparent));
}
.jn-ornament::after { background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 45%, transparent), transparent); }
.jn-ornament svg { width: 24px; height: 24px; opacity: 0.9; }
.jn-prompt {
  font-family: 'Amiri', serif; font-size: 1.55rem; line-height: 1.45; text-align: center; text-wrap: balance;
  color: var(--text); margin: 0 auto 24px; max-width: 30ch;
}

.jn-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: -10px 0 22px; }
.jn-milestone {
  font-size: 0.76rem; font-weight: 700; color: var(--jn-gold);
  background: var(--gold-glow); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
  padding: 3px 11px; border-radius: 20px;
}
.jn-longest {
  font-size: 0.76rem; font-weight: 600; color: var(--text-soft);
  border: 1px solid var(--jn-edge); padding: 3px 11px; border-radius: 20px;
}

/* Fields: label with icon, writing on ruled lines */
.jn-field { margin-bottom: 20px; }
.jn-label, .jn-entry-sec-label {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Amiri', serif; font-size: 1.08rem; font-weight: 700; color: var(--jn-accent);
  margin-bottom: 4px;
}
.jn-sec-icon {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 26px; height: 26px; border-radius: 50%;
  color: var(--jn-gold); background: var(--gold-glow);
}
.jn-sec-icon svg { width: 15px; height: 15px; }
.jn-textarea {
  display: block; width: 100%; resize: none; field-sizing: content;
  font: inherit; font-size: 0.98rem; line-height: var(--jn-line); color: var(--text);
  padding: 0 4px; margin: 0; border: 0; border-radius: 0;
  background-color: transparent;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--jn-line) - 1px), var(--jn-rule) calc(var(--jn-line) - 1px), var(--jn-rule) var(--jn-line));
  background-attachment: local;
  min-height: calc(var(--jn-line) * 2);
  transition: background-image 0.2s;
}
.jn-textarea[rows="4"] { min-height: calc(var(--jn-line) * 4); }
.jn-textarea::placeholder { color: var(--muted); font-style: italic; }
.jn-textarea:focus {
  outline: none;
  --jn-rule: color-mix(in srgb, var(--jn-accent) 35%, transparent);
}
.jn-field:has(.jn-textarea:focus) .jn-sec-icon { color: #fff; background: var(--jn-accent); }

.jn-save-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--jn-rule);
}
.jn-private { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--muted); }
.jn-private svg { width: 13px; height: 13px; }
.jn-save-btn { padding: 10px 30px; border-radius: 11px; font-size: 0.88rem; letter-spacing: 0.01em; }

/* Earlier entries — a timeline down the page */
.jn-past { margin-top: 38px; }
.jn-past-title {
  font-family: 'Amiri', serif; font-size: 1.3rem; font-weight: 700;
  color: var(--text); margin: 0 0 16px;
}
.jn-timeline { position: relative; }
.jn-timeline::before {
  content: ''; position: absolute; top: 18px; bottom: 18px; inset-inline-start: 27px; width: 1px;
  background: linear-gradient(var(--jn-edge), transparent);
}
.jn-entry {
  position: relative; display: flex; gap: 16px; align-items: flex-start; margin-bottom: 14px;
  animation: jnRise 0.45s cubic-bezier(.2,.7,.2,1) both;
}
.jn-entry:nth-child(2) { animation-delay: 0.05s; }
.jn-entry:nth-child(3) { animation-delay: 0.1s; }
.jn-entry:nth-child(n+4) { animation-delay: 0.15s; }
.jn-entry-day {
  position: relative; z-index: 1; flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--jn-paper); border: 1px solid var(--jn-edge);
  box-shadow: 0 4px 12px -4px rgba(0,0,0,0.15);
}
.jn-entry-num { font-family: 'Amiri', serif; font-size: 1.35rem; font-weight: 700; line-height: 1; color: var(--jn-accent); }
.jn-entry-mon { font-size: 0.64rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-soft); margin-top: 2px; }
.jn-entry-body {
  position: relative; flex: 1; min-width: 0;
  background: var(--jn-paper); border: 1px solid var(--jn-edge); border-radius: 14px;
  padding: 14px 18px 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.jn-entry-body:hover { border-color: color-mix(in srgb, var(--gold) 50%, var(--border)); box-shadow: 0 8px 22px -12px rgba(40,30,10,0.3); }
.jn-entry-date { font-family: 'Amiri', serif; font-size: 1.08rem; font-weight: 700; color: var(--text); margin-bottom: 8px; padding-inline-end: 64px; }
.jn-entry-sec { margin-bottom: 10px; }
.jn-entry-sec:last-child { margin-bottom: 0; }
.jn-entry-sec-label { font-size: 0.92rem; gap: 7px; margin-bottom: 2px; }
.jn-entry-sec-label .jn-sec-icon { width: 21px; height: 21px; }
.jn-entry-sec-label .jn-sec-icon svg { width: 12px; height: 12px; }
.jn-entry-sec-text {
  font-size: 0.9rem; line-height: 1.65; color: var(--text); white-space: pre-wrap;
  padding-inline-start: 28px;
}
.jn-entry-acts { position: absolute; top: 10px; inset-inline-end: 10px; display: flex; gap: 2px; }
.jn-entry-act {
  display: inline-flex; background: none; border: none; color: var(--text-soft); cursor: pointer;
  padding: 6px; border-radius: 8px; opacity: 0.55; transition: opacity 0.15s, color 0.15s, background 0.15s;
}
.jn-entry-body:hover .jn-entry-act { opacity: 0.85; }
.jn-entry-act:hover { opacity: 1 !important; color: var(--jn-accent); background: var(--gold-glow); }
.jn-entry-del:hover { color: #e05252; background: rgba(224,82,82,0.08); }
.jn-empty-past {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 12px; margin: 0; padding: 34px 24px; line-height: 1.6;
  background: var(--jn-paper); border: 1px dashed var(--jn-edge); border-radius: 16px;
}
.jn-empty-past p { margin: 0; color: var(--text-soft); font-size: 0.9rem; font-style: italic; max-width: 320px; }
.jn-empty-icon { color: var(--jn-gold); opacity: 0.85; }
.jn-empty-icon svg { width: 40px; height: 40px; display: block; }

/* Header action (lock) */
.jn-head-actions { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
.jn-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-soft);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.jn-icon-btn:hover { color: var(--green); border-color: color-mix(in srgb, var(--green) 35%, var(--border)); }
.jn-icon-btn svg { width: 17px; height: 17px; }

@keyframes jnRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .jn-page, .jn-entry { animation: none; } }

@media (max-width: 600px) {
  .jn-page { padding: 20px 18px 18px; border-radius: 16px; }
  .jn-page::after { inset: 5px; }
  .jn-day-num { font-size: 2.5rem; }
  .jn-prompt { font-size: 1.3rem; }
  .jn-entry { gap: 10px; }
  .jn-entry-day { width: 46px; height: 46px; }
  .jn-timeline::before { inset-inline-start: 22px; }
  .jn-entry-num { font-size: 1.15rem; }
  .jn-entry-body { padding: 12px 14px 14px; }
  .jn-entry-sec-text { padding-inline-start: 0; }
}

/* Lock screen */
.jn-lock {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px;
  max-width: 360px; margin: 40px auto 0; padding: 34px 28px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
}
.jn-lock-icon { color: var(--green); }
.jn-lock-icon svg { width: 44px; height: 44px; }
.jn-lock-title { font-family: 'Amiri', serif; font-size: 1.3rem; font-weight: 700; margin: 4px 0 0; }
.jn-lock-hint { color: var(--text-soft); font-size: 0.88rem; margin: 0 0 6px; line-height: 1.5; }
.jn-pin-input {
  width: 160px; text-align: center; letter-spacing: 0.4em; font-size: 1.2rem;
  padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); transition: border-color 0.15s, box-shadow 0.15s;
}
.jn-pin-input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-glow); }
.jn-pin-input.input-error { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.15); animation: shake 0.35s ease; }

/* Lock menu modal items */
.jn-menu-item {
  text-align: start; font: inherit; font-size: 0.92rem; font-weight: 600; cursor: pointer;
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
  padding: 13px 16px; color: var(--text); transition: border-color 0.15s, background 0.15s;
}
.jn-menu-item:hover { border-color: color-mix(in srgb, var(--green) 35%, var(--border)); }
.jn-menu-danger { color: #e05252; }
.jn-menu-danger:hover { border-color: #e05252; background: rgba(224,82,82,0.06); }

/* ─── Frosted plates ──────────────────────────────── */
/* Text that sits directly on the patterned background gets a soft see-through plate:
   near-white in light mode, deep navy in dark mode. Placed after the base rules so it wins. */
.view-title, .jn-past-title, .settings-section-title, .tab-bar, .empty-state p {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 14px -6px rgba(40, 30, 10, 0.25);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  text-shadow: none;
}
body.dark-theme .view-title, body.dark-theme .jn-past-title,
body.dark-theme .settings-section-title, body.dark-theme .tab-bar, body.dark-theme .empty-state p {
  background: rgba(10, 16, 30, 0.62);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 14px -6px rgba(0, 0, 0, 0.6);
}
.view-title, .jn-past-title { display: inline-block; width: fit-content; padding: 3px 16px 5px; border-radius: 12px; }
.settings-section-title { width: fit-content; padding: 3px 10px; border-radius: 8px; color: var(--text-soft); }
.empty-state p { width: fit-content; padding: 6px 14px; border-radius: 10px; color: var(--text-soft); }
.tab-bar { border-radius: 12px; padding: 0 6px; border-bottom: 2px solid var(--border); }
/* Section titles and empty states inside a .content-section panel already sit on a card */
.content-section .empty-state p,
body.dark-theme .content-section .empty-state p {
  background: none; border: 0; box-shadow: none; padding: 0;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
/* ─── New-user onboarding ─── */
.onboard-body { gap: 4px; }
.onboard-sub { font-size: 0.9rem; color: var(--text-soft); margin: 0 0 6px; line-height: 1.5; }
.onboard-photo-btn {
  width: 100%; padding: 11px; border-radius: 12px; cursor: pointer;
  background: var(--green-light); color: var(--green); border: 1px dashed var(--green);
  font-weight: 600; font-size: 0.9rem; font-family: inherit; margin-bottom: 8px;
}
.onboard-section-title {
  font-weight: 700; font-size: 0.82rem; color: var(--text-soft);
  text-transform: uppercase; letter-spacing: 0.04em; margin: 10px 0 6px;
}
.onboard-list { display: flex; flex-direction: column; gap: 8px; }
.onboard-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 8px 10px;
}
.onboard-item-ic {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 0.95rem;
}
.onboard-item-name { flex: 1; min-width: 0; font-weight: 600; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onboard-chip-btn {
  flex-shrink: 0; padding: 6px 14px; border-radius: 20px; cursor: pointer;
  background: var(--green); color: #fff; border: none; font-weight: 600; font-size: 0.82rem; font-family: inherit;
  transition: background 0.15s;
}
.onboard-chip-btn.done { background: var(--green-light); color: var(--green); cursor: default; }
.onboard-done { width: 100%; }

/* ─── Per-message menu (report / delete) ─── */
.msg-menu-btn {
  flex-shrink: 0; align-self: center;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: none; border: none; cursor: pointer; padding: 0;
  color: var(--text-soft); opacity: 0.4;
  transition: opacity 0.15s, background 0.15s;
}
.msg-menu-btn:hover { opacity: 1; background: rgba(128,128,128,0.14); }
.msg-row:hover .msg-menu-btn { opacity: 0.75; }

/* Dropdown shared by comment + message menus (positioned in JS, anchored to the ⋯ button) */
.comment-dropdown {
  position: absolute; z-index: 1400;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 26px rgba(0,0,0,0.20);
  padding: 4px; min-width: 150px;
}
.comment-drop-item {
  display: block; width: 100%; text-align: left; white-space: nowrap;
  padding: 9px 12px; border-radius: 7px;
  background: none; border: none; cursor: pointer;
  font-size: 0.86rem; font-family: inherit; color: var(--text);
}
.comment-drop-item:hover { background: rgba(128,128,128,0.12); }
.comment-drop-delete { color: #ef4444; }

/* Keep --card defined — it's referenced throughout the app's markup but was never declared,
   which left some cards/dropdowns transparent. */
:root { --card: var(--surface); }

/* Full-bleed scene background — sits behind all content; cards/header stay opaque so text
   is unaffected. Dark mode keeps its own slate theme (body.dark-theme wins by specificity). */
body {
  background-image: url('../img/paper-bg.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Show the scene in dark mode too, under a dark scrim so the interface stays dark. */
body.dark-theme {
  background-image:
    linear-gradient(rgba(12,18,32,0.74), rgba(12,18,32,0.74)),
    url('../img/paper-bg.jpg');
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

/* Let the scene show through the left nav at ~75% opacity (fallback: solid for old browsers). */
.left-nav {
  background: var(--nav-bg);
  background: color-mix(in srgb, var(--nav-bg) 75%, transparent);
}

/* Content sections (news feed, my groups, …) get their own container so their titles/lists
   don't sit directly on the scene. */
.content-section {
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

/* All boxes at 85% opacity, so the background shows faintly through (text stays crisp —
   only the fill is translucent). The Stats panel joins in so the scene reaches the right side. */
.post-card, .group-card, .event-card, .member-card, .post-composer,
.composer-expand, .settings-card, .stats-panel {
  background-color: var(--surface);
  background-color: color-mix(in srgb, var(--surface) 85%, transparent);
}
/* Dark mode force-sets .stats-panel opaque (in the header/stats/footer block) — re-apply the
   translucent fill so the scene shows through on the right side in dark mode too. */
body.dark-theme .stats-panel {
  background: color-mix(in srgb, var(--surface) 85%, transparent);
}

/* Header + footer at 91% opacity so a hint of the scene shows through the top/bottom bars. */
.site-header, .site-footer {
  background-color: var(--surface);
  background-color: color-mix(in srgb, var(--surface) 80%, transparent);
}
body.dark-theme .site-header, body.dark-theme .site-footer {
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}

