@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Cairo:wght@300;400;500;600;700&display=swap');

: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);

  --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: rgba(13, 107, 74, 0.2);
}

.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-tag {
  display: inline-flex;
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  align-self: flex-start;
}

.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);
}

.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.5rem; font-weight: 700; 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;
}
.event-card:hover { box-shadow: var(--shadow-md); }

.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;
}
.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;
}

.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;
  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;
}

/* ─── 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: 64px 1fr; overflow: visible; }
  .main-content { overflow: visible; min-height: 0; }
  .left-nav { min-height: 100vh; }

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

  .main-content { padding: 16px 14px 24px; }

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

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

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

body.dark-theme {
  --bg:          #0f172a;
  --surface:     #1e293b;
  --surface-alt: #162237;
  --border:      #2d3d52;
  --border-light:#243347;
  --text:        #f1f5f9;
  --text-soft:   #94a3b8;
  --muted:       #64748b;
  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; }

/* ─── 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-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;
}

.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;
  flex: 1;
  min-width: 0;
}

.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-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); }

/* ─── 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;
}

/* ─── 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 p { font-size: 0.86rem; color: var(--muted); margin: 0; }

/* ─── 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; }

/* ─── 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);
}

/* ─── 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; }

.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);
}
