@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;600;700&family=Inter:wght@400;500;600&display=swap');
/* Fonts werden von Google geladen - kein Internet = Fallback auf System-Fonts, Design bleibt */

* { box-sizing: border-box; }
/* Verhindert, dass schnelles Doppel-Tippen auf Buttons (z.B. "+" fuer neue Nachricht)
   auf dem Handy als Zoom-Geste interpretiert wird - Pinch-Zoom bleibt sonst ueberall erlaubt. */
button, .member-card, .dm-conv, .dm-picker-item, .mention-option, .admin-user-card { touch-action: manipulation; }
:root {
  --red: #8a0a0a;
  --red-bright: #b91c1c;
  --red-glow: rgba(185, 28, 28, .45);
  --red-gradient: linear-gradient(135deg, var(--red-bright) 0%, var(--red) 100%);
  --red-gradient-hover: linear-gradient(135deg, #e0281f 0%, var(--red-bright) 100%);
  --bg: #0f1115;
  --bg2: #1a1d24;
  --bg3: #22252e;
  --border: #2a2d36;
  --muted: #888;
  --font-d: 'Rajdhani', sans-serif;
  --font-b: 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;
}
html { height: 100%; }
body { height: 100%; height: 100dvh; overflow: hidden; }
body {
  margin: 0;
  font-family: var(--font-b);
  background: var(--bg);
  color: #e8e8e8;
}
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); }
.hidden { display: none !important; }

/* ─── Lade-Platzhalter (Skeleton) ─── */
@keyframes skeletonPulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
.skeleton { background: var(--bg3); border-radius: 2px; animation: skeletonPulse 1.3s ease-in-out infinite; }
.skeleton-card {
  display: flex; gap: 12px; align-items: center; padding: 14px 16px;
  background: var(--bg2); border: 1px solid var(--border); margin-bottom: 10px;
}
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.skeleton-line { height: 10px; }

.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 40px 20px; text-align: center;
}
.empty-state-icon { font-size: 40px; opacity: .5; }
.empty-state-text { color: var(--muted); font-size: 14px; max-width: 280px; }

@keyframes viewFadeIn { from { opacity: 0; } to { opacity: 1; } }
.view:not(.hidden) { animation: viewFadeIn .18s ease; }

/* ─── Auth ─── */
.auth-screen {
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, #2a0a0a 0%, var(--bg) 60%);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.auth-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-top: 3px solid var(--red);
  width: 360px;
  padding: 36px 32px;
  box-shadow: 0 0 60px var(--red-glow);
}
.auth-box h1 {
  text-align: center; margin: 0 0 2px;
  font-family: var(--font-d); font-weight: 700; font-size: 24px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--red-bright);
}
.auth-logo {
  width: 200px; height: 200px; object-fit: contain; display: block; margin: 0 auto 4px;
}
.topbar-logo {
  height: 42px; width: auto; object-fit: contain; display: inline-block; vertical-align: middle;
}
.auth-sub {
  text-align: center; color: var(--muted); font-size: 11px;
  letter-spacing: 2px; text-transform: uppercase; margin-bottom: 26px;
}
.auth-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.auth-tab {
  flex: 1; padding: 8px; background: none; border: none;
  color: var(--muted); font-family: var(--font-d); font-size: 15px; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.auth-tab.active { color: var(--red-bright); border-bottom-color: var(--red-bright); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form button { margin-top: 4px; }
.auth-error { color: var(--red-bright); min-height: 18px; font-size: 12px; margin: 0; }
.auth-forgot { text-align: center; margin: 0; font-size: 12px; }
.auth-forgot a { color: var(--muted); }
.auth-forgot a:hover { color: var(--red-bright); }

/* ─── Form Fields (geteilt zwischen Auth & Profil) ─── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted);
}
.form-group label .sub { text-transform: none; letter-spacing: 0; color: #666; }
.auth-form input, .profile-form input, .admin-user-card .edit-form input,
.post-form input[type="text"] {
  padding: 9px 12px; border: 1px solid var(--border);
  background: var(--bg3); color: #fff; font-family: var(--font-b); font-size: 14px;
  outline: none; transition: border-color .15s;
}
.auth-form input:focus, .profile-form input:focus, .admin-user-card .edit-form input:focus,
.post-form input[type="text"]:focus {
  border-color: var(--red-bright);
}
.auth-form input[type=color], .profile-form input[type=color] { padding: 2px; height: 38px; }
.auth-form button, .profile-form button {
  padding: 10px; border: none;
  background: var(--red); color: #fff; cursor: pointer;
  font-family: var(--font-d); font-size: 15px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; transition: background .15s;
}
.auth-form button:hover, .profile-form button:hover { background: var(--red-bright); }

/* ─── App Layout ─── */
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; background: var(--bg); }
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 0 20px; height: 56px; flex-shrink: 0;
  background: var(--bg2); border-bottom: 1px solid var(--border);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-d); font-weight: 700; color: var(--red-bright);
  font-size: 19px; letter-spacing: 2px; text-transform: uppercase;
}
.header-divider { width: 1px; height: 24px; background: var(--border); }
.header-sub { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }

.nav-tabs {
  display: flex; flex-wrap: wrap; background: var(--bg2); border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.tab-btn, .tab-more-btn {
  padding: 11px 18px; background: none; border: none; color: var(--muted);
  font-family: var(--font-d); font-size: 15px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent; transition: color .15s, border-color .15s;
}
.tab-btn.active { color: #fff; border-bottom-color: var(--red-bright); }
.tab-btn:hover:not(.active) { color: #fff; }
.tab-btn.admin-tab { color: var(--red-bright); }
.tab-btn.admin-tab.active { color: #fff; }
.tab-icon { display: none; }

.tab-more { position: relative; }
.tab-more-btn:hover { color: #fff; }
.tab-more-btn.active { color: #fff; border-bottom-color: var(--red-bright); }
.tab-more-menu {
  position: absolute; top: 100%; left: 0; z-index: 50; min-width: 180px;
  background: var(--bg2); border: 1px solid var(--border); border-top: 2px solid var(--red-bright);
  display: flex; flex-direction: column; box-shadow: 0 8px 20px rgba(0,0,0,.4);
}
.tab-more-menu.hidden { display: none; }
.tab-more-menu .tab-btn {
  text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--border);
}
.tab-more-menu .tab-btn:last-child { border-bottom: none; }
.tab-more-menu .tab-btn.active { border-left: 2px solid var(--red-bright); background: var(--bg3); }

/* Ab hier ist genug Platz fuer alle Tabs direkt in der Leiste - das "Mehr"-Menue
   (urspruenglich fuers Handy gedacht) wird einfach "entpackt" und faellt weg. */
@media (min-width: 901px) {
  .tab-more-btn { display: none; }
  .tab-more { display: contents; }
  .tab-more-menu, .tab-more-menu.hidden { display: contents !important; }
  .tab-more-menu .tab-btn {
    text-align: center; padding: 11px 18px; border-bottom: 2px solid transparent;
  }
  .tab-more-menu .tab-btn.active { border-left: none; background: none; border-bottom-color: var(--red-bright); }
}

.readonly-banner {
  background: #1a1500; border-bottom: 1px solid #5a4500; color: #d4a017;
  font-size: 12px; padding: 7px 16px; text-align: center; flex-shrink: 0;
}

.user-box { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-box button {
  background: none; border: 1px solid var(--border); color: var(--muted);
  padding: 6px 14px; font-family: var(--font-b); font-size: 12px; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.user-box button:hover { border-color: var(--red-bright); color: var(--red-bright); }
#avatar-btn, #avatar-remove-btn {
  padding: 9px 16px; background: var(--red); border: none; color: #fff;
  font-family: var(--font-d); font-size: 13px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; cursor: pointer; transition: background .15s;
}
#avatar-btn:hover, #avatar-remove-btn:hover { background: var(--red-bright); }

.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-d); font-weight: 700; color: #fff; font-size: 13px;
  overflow: hidden; flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
#me-avatar, #me-name { cursor: pointer; }
#me-name:hover { color: var(--red-bright); }
.avatar-lg { width: 80px; height: 80px; font-size: 26px; }

/* ─── Profil ─── */
.profile-card { max-width: 420px; display: flex; flex-direction: column; gap: 24px; }
.profile-avatar-section {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.profile-avatar-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.profile-form {
  background: var(--bg2); border: 1px solid var(--border); padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
}
.profile-form h3 {
  margin: 0; font-family: var(--font-d); font-size: 13px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--border); padding-bottom: 8px;
}
.profile-form input:disabled { color: var(--muted); }
.profile-msg { font-size: 12px; min-height: 16px; margin: 0; color: #4ade80; }
.profile-msg.error { color: var(--red-bright); }
.profile-msg:empty { display: none; }

.view { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 20px; max-width: 800px; width: 100%; margin: 0 auto; }
#view-dm { max-width: 100%; padding: 0; overflow: hidden; display: flex; flex-direction: column; }
#view-chat { max-width: 100%; padding: 0; overflow: hidden; }
#view-orgchat {
  max-width: 100%; padding: 0; overflow: hidden; display: flex; flex-direction: column;
}
#view-orgchat .polls-header { padding: 14px 20px; margin: 0; flex-shrink: 0; border-bottom: 1px solid var(--border); }
#view-orgchat .chat-layout { flex: 1; min-height: 0; }

/* ─── Feed ─── */
.post-form {
  background: var(--bg2); border: 1px solid var(--border); border-top: 3px solid var(--red);
  padding: 14px; margin-bottom: 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.post-form textarea {
  width: 100%; min-height: 60px; resize: vertical; padding: 10px;
  border: 1px solid var(--border); background: var(--bg3); color: #fff;
  font-family: var(--font-b); font-size: 14px; outline: none; transition: border-color .15s;
}
.post-form textarea:focus { border-color: var(--red-bright); }
.post-form-row { display: flex; justify-content: space-between; align-items: center; }
.post-form-row input[type=file] { color: var(--muted); font-size: 13px; }
.post-form-row button, .chat-form button {
  background: var(--red); border: none; color: #fff; padding: 9px 20px; cursor: pointer;
  font-family: var(--font-d); font-size: 14px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; transition: background .15s;
}
.post-form-row button:hover, .chat-form button:hover { background: var(--red-bright); }

.posts-list { display: flex; flex-direction: column; gap: 14px; }
.post-card {
  background: var(--bg2); border: 1px solid var(--border); padding: 14px;
  transition: box-shadow .15s, transform .15s;
}
.post-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.35); transform: translateY(-1px); }
.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.post-head .name { font-weight: 600; }
.post-head .time { color: var(--muted); font-size: 12px; margin-left: auto; }
.post-content { white-space: pre-wrap; margin: 6px 0; line-height: 1.5; }
.post-image { max-width: 100%; border-radius: 4px; margin-top: 8px; display: block; cursor: zoom-in; }
.post-delete {
  background: none; border: 1px solid transparent; color: var(--muted); cursor: pointer;
  font-size: 11px; letter-spacing: .5px; text-transform: uppercase; padding: 3px 8px;
  transition: border-color .15s, color .15s;
}
.post-delete:hover { border-color: var(--red-bright); color: var(--red-bright); }

.load-more-btn {
  display: block; margin: 14px auto 0; background: none; border: 1px solid var(--border);
  color: var(--muted); cursor: pointer; padding: 8px 18px; font-family: var(--font-b);
  font-size: 12px; letter-spacing: .5px; text-transform: uppercase; transition: border-color .15s, color .15s;
}
.load-more-btn:hover { border-color: var(--red-bright); color: var(--red-bright); }

/* ─── Chat ─── */
.chat-layout { display: flex; gap: 0; height: 100%; }
.chat-main { flex: 1; display: flex; flex-direction: column; }
.messages-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding-bottom: 10px; }
.message { display: flex; gap: 10px; align-items: flex-start; padding: 4px 6px; transition: background .1s; }
.message:hover { background: var(--bg2); }
.message .bubble { padding: 4px 0; max-width: 70%; }
.message .name { font-weight: 600; font-size: 13px; }
.message .time { color: var(--muted); font-size: 11px; margin-left: 8px; }
.chat-img { max-width: 220px; border-radius: 4px; margin-top: 6px; display: block; cursor: zoom-in; }
.mention { color: var(--red-bright); font-weight: 600; }
.mention-me { background: rgba(185,28,28,.2); padding: 0 2px; border-radius: 2px; }
.bubble-mention { border-left: 2px solid var(--red-bright); padding-left: 8px !important; background: rgba(185,28,28,.08); }
.chat-form {
  display: flex; gap: 8px; padding: 12px 16px; background: var(--bg2);
  border-top: 1px solid var(--border); position: relative;
}
.mention-popup {
  position: absolute; bottom: 100%; left: 16px; right: 16px; margin-bottom: 4px;
  background: var(--bg2); border: 1px solid var(--border); border-bottom: 2px solid var(--red-bright);
  max-height: 220px; overflow-y: auto; box-shadow: 0 -4px 16px rgba(0,0,0,.4);
}
.mention-popup.hidden { display: none; }
.mention-option {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; font-size: 13px;
}
.mention-option:hover { background: var(--bg3); }
.chat-form input[type=text] {
  flex: 1; padding: 10px 12px; border: 1px solid var(--border);
  background: var(--bg3); color: #fff; font-family: var(--font-b); font-size: 14px;
  outline: none; transition: border-color .15s;
}
.chat-form input[type=text]:focus { border-color: var(--red-bright); }
.chat-form input[type=file] { color: var(--muted); width: 130px; font-size: 12px; }

.online-count {
  display: inline-block; background: #4ade80; color: #0a1f0f; border-radius: 10px;
  font-size: 10px; font-weight: 700; padding: 1px 6px; min-width: 16px; text-align: center;
  letter-spacing: 0; margin-left: 2px;
}
@keyframes onlinePulse {
  0%   { box-shadow: 0 0 0 0 rgba(74,222,128,.6); }
  70%  { box-shadow: 0 0 0 5px rgba(74,222,128,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}
.online-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #4ade80; flex-shrink: 0;
  animation: onlinePulse 2s ease-out infinite;
}
.member-online { color: #4ade80; font-weight: 600; }

.chat-online-bar {
  position: relative; padding: 8px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg2); flex-shrink: 0;
}
.online-toggle-btn {
  background: none; border: none; color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-b); font-size: 12px;
}
.online-toggle-btn:hover { color: #fff; }
.online-dropdown {
  position: absolute; top: 100%; left: 16px; z-index: 50; min-width: 180px; max-height: 260px;
  overflow-y: auto; background: var(--bg2); border: 1px solid var(--border);
  border-top: 2px solid var(--red-bright); box-shadow: 0 8px 20px rgba(0,0,0,.4);
}
.online-dropdown.hidden { display: none; }
.online-dropdown ul { list-style: none; padding: 8px 12px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.online-dropdown li { display: flex; align-items: center; gap: 8px; font-size: 13px; }

/* ─── Members / Admin ─── */
.members-list, .admin-users-list { display: flex; flex-direction: column; gap: 10px; }
.member-card, .admin-user-card {
  background: var(--bg2); border: 1px solid var(--border); padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
}
.member-card { cursor: pointer; transition: border-color .15s; }
.member-card:hover { border-color: var(--red-bright); }
.member-card .info, .admin-user-card .info { flex: 1; }
.member-card .name, .admin-user-card .name { font-weight: 600; }
.member-card .sub, .admin-user-card .sub { color: var(--muted); font-size: 12px; }
.badge-admin {
  background: none; border: 1px solid var(--red); color: var(--red-bright);
  font-size: 10px; letter-spacing: 1px; text-transform: uppercase; padding: 2px 7px; font-weight: 700;
}
.intro-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px;
}
.intro-card {
  background: var(--bg2); border: 1px solid var(--border); padding: 16px;
  display: flex; gap: 14px; align-items: flex-start;
}
.intro-body { flex: 1; min-width: 0; }
.intro-name { font-weight: 600; margin-bottom: 2px; }
.intro-text { margin-top: 8px; font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.intro-empty { color: var(--muted); font-style: italic; }
.intro-car { margin-top: 12px; display: flex; align-items: center; gap: 10px; }
.intro-car-img {
  width: 72px; height: 54px; object-fit: cover; border: 1px solid var(--border); flex-shrink: 0;
}
.intro-car-placeholder {
  display: flex; align-items: center; justify-content: center; background: var(--bg3); font-size: 20px;
}
.intro-car-caption { font-size: 12px; color: var(--muted); }

.admin-user-card .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-user-card button {
  background: none; border: 1px solid var(--border); color: var(--muted);
  padding: 6px 10px; font-family: var(--font-b); font-size: 12px; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.admin-user-card button.danger { color: var(--red-bright); border-color: var(--red); }
.admin-user-card button:hover { border-color: var(--red-bright); color: var(--red-bright); }
.admin-user-card { flex-wrap: wrap; }
.admin-user-card .edit-form {
  flex-basis: 100%; display: flex; gap: 8px; margin-top: 8px;
}
.admin-user-card .edit-form input { flex: 1; }
.badge-banned {
  background: none; border: 1px solid var(--border); color: var(--muted);
  font-size: 10px; letter-spacing: 1px; text-transform: uppercase; padding: 2px 7px; font-weight: 700;
}
.badge-kennzeichen {
  background: none; border: 1px solid var(--border); color: #ccc;
  font-size: 10px; letter-spacing: .5px; padding: 2px 7px; font-weight: 700;
  font-family: var(--font-d);
}

/* ─── Filter & Toast ─── */
.filter-setting-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 8px;
  padding: 14px 18px; gap: 16px;
}
.filter-setting-title { font-weight: 600; font-size: 15px; }
.filter-toggle-btn {
  min-width: 60px; padding: 6px 16px; border: none; border-radius: 20px;
  font-weight: 700; font-size: 13px; cursor: pointer; transition: background .2s;
}
.filter-toggle-btn.filter-on  { background: #16a34a; color: #fff; }
.filter-toggle-btn.filter-off { background: var(--bg3); color: var(--muted); }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg2); border: 1px solid var(--border); color: var(--text);
  padding: 10px 20px; border-radius: 8px; font-size: 14px; z-index: 9999;
  opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none;
  white-space: nowrap;
}
.toast.toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── Admin ─── */
#view-admin h2 {
  font-family: var(--font-d); font-size: 22px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; margin: 0 0 20px; color: #fff;
}
#view-admin h3 {
  margin-top: 28px; margin-bottom: 14px;
  font-family: var(--font-d); font-size: 13px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--border); padding-bottom: 8px;
}

.admin-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px; margin-bottom: 24px;
}
.stat-card {
  background: var(--bg2); border: 1px solid var(--border); border-top: 3px solid var(--red);
  padding: 12px; text-align: center;
}
.stat-card .stat-value { font-family: var(--font-d); font-size: 26px; font-weight: 700; color: var(--red-bright); }
.stat-card .stat-label { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-top: 4px; }

/* ─── Admin Beitrags-Moderation ─── */
.admin-posts-list { display: flex; flex-direction: column; gap: 8px; }
.admin-post-row {
  background: var(--bg2); border: 1px solid var(--border); padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
}
.admin-post-row .info { flex: 1; min-width: 0; }
.admin-post-row .name { font-weight: 600; font-size: 13px; }
.admin-post-row .excerpt {
  color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-post-row .thumb { width: 36px; height: 36px; border-radius: 4px; object-fit: cover; }
.admin-post-row .time { color: var(--muted); font-size: 11px; white-space: nowrap; }

/* ─── Admin Einladungscodes ─── */
.invite-create-btn {
  background: var(--red); border: none; color: #fff; padding: 9px 18px; cursor: pointer;
  font-family: var(--font-d); font-size: 14px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; margin-bottom: 12px; transition: background .15s;
}
.invite-create-btn:hover { background: var(--red-bright); }
.new-invite-box {
  background: var(--bg2); border: 1px solid var(--red);
  padding: 10px 14px; margin-bottom: 12px; font-weight: 600; color: var(--red-bright);
  font-family: var(--font-d); letter-spacing: .5px;
}
.invites-list { display: flex; flex-direction: column; gap: 8px; }
.invite-row {
  background: var(--bg2); border: 1px solid var(--border); padding: 10px 14px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.invite-row .invite-code { font-family: 'Rajdhani', monospace; font-weight: 700; letter-spacing: 1px; }
.invite-row .sub { color: var(--muted); font-size: 12px; }
.invite-row .invite-status {
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase; margin-left: auto;
}
.invite-row .invite-status.open { color: #4ade80; }
.invite-row .invite-status.used { color: var(--muted); }

/* ─── Abstimmungen ─── */
.polls-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; }
.polls-header h2 {
  font-family: var(--font-d); font-size: 22px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; margin: 0; color: #fff;
}
.poll-options-list { display: flex; flex-direction: column; gap: 8px; }
#poll-question, .poll-options-list input {
  padding: 9px 12px; border: 1px solid var(--border); background: var(--bg3); color: #fff;
  font-family: var(--font-b); font-size: 14px; outline: none; transition: border-color .15s;
  width: 100%;
}
#poll-question:focus, .poll-options-list input:focus { border-color: var(--red-bright); }

.poll-card { background: var(--bg2); border: 1px solid var(--border); border-left: 3px solid var(--red); padding: 14px; }
.poll-question { font-family: var(--font-d); font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.poll-meta { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.poll-closed-badge {
  background: none; border: 1px solid var(--border); color: var(--muted);
  font-size: 10px; letter-spacing: 1px; text-transform: uppercase; padding: 2px 7px;
  margin-left: 8px; font-weight: 700;
}

.poll-option-row { margin-bottom: 8px; }
.poll-option-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.poll-option-label.voted { color: #4ade80; font-weight: 600; }
.poll-bar-bg { height: 5px; background: var(--bg3); }
.poll-bar { height: 100%; background: var(--red); transition: width .4s; }
.poll-bar.voted { background: #4ade80; }

.poll-vote-btn {
  width: 100%; background: var(--bg3); border: 1px solid var(--border); color: #fff;
  padding: 9px 12px; font-size: 13px; text-align: left; cursor: pointer;
  font-family: var(--font-b); margin-bottom: 6px; transition: border-color .15s, background .15s;
}
.poll-vote-btn:hover { border-color: var(--red-bright); background: var(--bg2); }

.poll-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* ─── Garage ─── */
.garage-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.vehicle-card {
  background: var(--bg2); border: 1px solid var(--border); display: flex; flex-direction: column;
  transition: box-shadow .15s, transform .15s;
}
.vehicle-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.35); transform: translateY(-1px); }
.vehicle-img { width: 100%; height: 180px; object-fit: cover; display: block; cursor: zoom-in; }
.vehicle-img-placeholder { width: 100%; height: 100px; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 32px; }
.vehicle-body { padding: 12px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.vehicle-title { font-family: var(--font-d); font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.vehicle-mods { font-size: 13px; color: #ccc; white-space: pre-wrap; line-height: 1.5; }
.vehicle-footer { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--border); }
.vehicle-edit-form {
  border-top: 1px solid var(--border); padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.vehicle-edit-form input[type="text"],
.vehicle-edit-form textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border);
  background: var(--bg3); color: #fff; font-family: var(--font-b); font-size: 13px;
  outline: none; transition: border-color .15s;
}
.vehicle-edit-form input[type="text"]:focus,
.vehicle-edit-form textarea:focus { border-color: var(--red-bright); }
.vehicle-edit-form textarea { min-height: 60px; resize: vertical; }
.vehicle-edit-file { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }

/* ─── Termine ─── */
.event-card { background: var(--bg2); border: 1px solid var(--border); border-left: 3px solid var(--red); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.event-title { font-family: var(--font-d); font-size: 17px; font-weight: 700; }
.event-meta { font-size: 12px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.event-meta span::before { margin-right: 4px; }
.event-relative { color: var(--red-bright); font-weight: 600; }
.event-desc { font-size: 13px; color: #ccc; white-space: pre-wrap; line-height: 1.5; }
.rsvp-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.rsvp-btn {
  background: none; border: 1px solid var(--border); color: var(--muted);
  padding: 5px 12px; font-family: var(--font-b); font-size: 12px; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.rsvp-btn:hover { border-color: var(--red-bright); color: var(--red-bright); }
.rsvp-btn.active-yes  { border-color: #4ade80; color: #4ade80; background: rgba(74,222,128,.1); }
.rsvp-btn.active-no   { border-color: var(--red-bright); color: var(--red-bright); background: rgba(185,28,28,.1); }
.rsvp-btn.active-maybe { border-color: #d4a017; color: #d4a017; background: rgba(212,160,23,.1); }
.route-btn {
  background: none; border: 1px solid var(--border); color: var(--muted);
  padding: 5px 12px; font-family: var(--font-b); font-size: 12px; cursor: pointer;
  text-decoration: none; transition: border-color .15s, color .15s; display: inline-flex; align-items: center; gap: 4px;
}
.route-btn:hover { border-color: var(--red-bright); color: var(--red-bright); }

.location-row { display: flex; gap: 8px; }
.location-row input { flex: 1; }
.location-row button {
  background: var(--bg3); border: 1px solid var(--border); color: var(--muted);
  padding: 0 14px; font-size: 16px; cursor: pointer; transition: border-color .15s, color .15s; flex-shrink: 0;
}
.location-row button:hover { border-color: var(--red-bright); color: var(--red-bright); }
.location-row button:disabled { opacity: .5; cursor: wait; }

/* ─── Reaktionen ─── */
.reaction-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.reaction-btn {
  background: none; border: 1px solid var(--border); color: var(--muted); padding: 3px 8px;
  font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 4px;
  transition: border-color .15s, background .15s, transform .1s;
}
.reaction-btn:hover { border-color: var(--red-bright); background: var(--bg3); }
.reaction-btn:active { transform: scale(.8); }
.reaction-btn.reacted { border-color: var(--red-bright); background: rgba(185,28,28,.15); color: #fff; }
.reaction-btn .count { font-size: 11px; }

/* ─── Formular-Textarea in neuen Views ─── */
#vehicle-mods, #event-desc {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  background: var(--bg3); color: #fff; font-family: var(--font-b); font-size: 14px;
  outline: none; transition: border-color .15s;
}
#vehicle-mods:focus, #event-desc:focus { border-color: var(--red-bright); }
input[type="datetime-local"] {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  background: var(--bg3); color: #fff; font-family: var(--font-b); font-size: 14px;
  outline: none; transition: border-color .15s; color-scheme: dark;
}
input[type="datetime-local"]:focus { border-color: var(--red-bright); }

/* ─── Mitglieder-Profil Modal ─── */
@keyframes overlayFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalPopIn { from { opacity: 0; transform: scale(.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.member-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.75); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: overlayFadeIn .15s ease;
}
.member-modal-overlay.hidden { display: none; }
.member-modal {
  position: relative; background: var(--bg2); border: 1px solid var(--border);
  border-top: 3px solid var(--red); width: 100%; max-width: 520px; max-height: 85vh;
  overflow-y: auto; padding: 24px;
  display: flex; flex-direction: column; gap: 20px;
  animation: modalPopIn .2s cubic-bezier(.2,.8,.3,1);
}
.member-modal-bio {
  font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
  padding: 12px 14px; background: var(--bg3); border-left: 2px solid var(--red-bright);
}
.member-modal-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; color: var(--muted); font-size: 16px; cursor: pointer;
}
.member-modal-close:hover { color: #fff; }
.member-modal-header { display: flex; gap: 16px; align-items: flex-start; }
.member-modal-info { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.member-modal-name { font-family: var(--font-d); font-size: 20px; font-weight: 700; letter-spacing: .5px; }
.member-modal-sub { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.member-modal-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.member-modal-vehicles h3 {
  font-family: var(--font-d); font-size: 13px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border);
  padding-bottom: 8px; margin-bottom: 12px;
}
.modal-vehicle-list { display: flex; flex-direction: column; gap: 10px; }

.recovery-modal { text-align: center; align-items: center; }
.recovery-modal h2 { font-family: var(--font-d); font-size: 18px; letter-spacing: 1px; margin: 0; }
.recovery-code-box {
  font-family: var(--font-d); font-size: 26px; font-weight: 700; letter-spacing: 3px;
  background: var(--bg3); border: 1px solid var(--red); color: var(--red-bright);
  padding: 14px 20px; user-select: all;
}
.recovery-ack-label { display: flex; align-items: center; gap: 8px; font-size: 13px; }

/* ─── Bild-Vergrößerung ─── */
.lightbox-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  cursor: zoom-out; animation: overlayFadeIn .15s ease;
}
.lightbox-overlay.hidden { display: none; }
.lightbox-overlay img {
  max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 0 40px rgba(0,0,0,.6);
  animation: modalPopIn .2s cubic-bezier(.2,.8,.3,1);
}
.modal-vehicle-row {
  display: flex; gap: 10px; align-items: center;
  background: var(--bg3); border: 1px solid var(--border); padding: 10px;
}
.modal-vehicle-thumb { width: 60px; height: 45px; object-fit: cover; flex-shrink: 0; cursor: zoom-in; }
.modal-vehicle-thumb-placeholder { width: 60px; height: 45px; background: var(--bg2); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.modal-vehicle-info .v-title { font-weight: 600; font-size: 14px; }
.modal-vehicle-info .v-mods { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ─── DM-Badge ─── */
.dm-badge {
  display: inline-block; background: var(--red-bright); color: #fff;
  border-radius: 10px; font-size: 10px; font-weight: 700; padding: 1px 5px;
  min-width: 16px; text-align: center; margin-left: 4px; vertical-align: middle;
}

/* ─── Marktplatz ─── */
.market-filter {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px;
}
.mcat-btn {
  padding: 5px 12px; background: var(--bg2); border: 1px solid var(--border);
  color: var(--muted); font-size: 12px; font-family: var(--font-d); font-weight: 600;
  letter-spacing: .5px; text-transform: uppercase; cursor: pointer; transition: all .15s;
}
.mcat-btn.active, .mcat-btn:hover { background: var(--red); border-color: var(--red); color: #fff; }
.dark-select {
  padding: 9px 12px; border: 1px solid var(--border); background: var(--bg3);
  color: #fff; font-family: var(--font-b); font-size: 14px; outline: none; width: 100%;
}
.market-list { display: flex; flex-direction: column; gap: 14px; }
.market-item {
  display: flex; gap: 0; background: var(--bg2); border: 1px solid var(--border);
  border-top: 3px solid var(--red); overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.market-item:hover { border-color: var(--red-bright); box-shadow: 0 4px 16px rgba(0,0,0,.35); transform: translateY(-1px); }
.market-sold { opacity: .6; }
.market-img { width: 160px; height: 130px; object-fit: cover; flex-shrink: 0; cursor: zoom-in; }
.market-img-placeholder {
  width: 160px; height: 130px; background: var(--bg3); display: flex;
  align-items: center; justify-content: center; font-size: 36px; flex-shrink: 0;
}
.market-body { flex: 1; padding: 12px; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.market-top { display: flex; gap: 8px; align-items: center; }
.market-cat {
  font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted);
  background: var(--bg3); border: 1px solid var(--border); padding: 2px 6px;
}
.market-sold-badge {
  font-size: 10px; letter-spacing: 1px; text-transform: uppercase;
  background: #333; color: var(--muted); padding: 2px 6px;
}
.market-title { font-family: var(--font-d); font-size: 17px; font-weight: 700; }
.market-price { color: var(--red-bright); font-weight: 700; font-size: 15px; }
.market-desc { font-size: 13px; color: var(--muted); }
.market-footer {
  display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 8px;
  border-top: 1px solid var(--border); flex-wrap: wrap;
}
.market-seller { font-size: 13px; font-weight: 600; }
.market-date { font-size: 11px; color: var(--muted); margin-left: auto; }
.market-actions { display: flex; gap: 6px; }

/* ─── Event-Fotoalbum ─── */
.event-photos-section { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.event-photos-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ephoto-label { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
.ephoto-upload-btn {
  font-size: 11px; padding: 4px 10px; background: var(--bg3); border: 1px solid var(--border);
  color: var(--muted); cursor: pointer; transition: all .15s;
}
.ephoto-upload-btn:hover { border-color: var(--red-bright); color: #fff; }
.event-gallery { display: flex; flex-wrap: wrap; gap: 6px; }
.ephoto { position: relative; }
.ephoto-img { width: 90px; height: 70px; object-fit: cover; display: block; border: 1px solid var(--border); cursor: zoom-in; }
.ephoto-del {
  position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.7);
  border: none; color: #fff; font-size: 10px; cursor: pointer; padding: 1px 4px; line-height: 1;
}
.ephoto-cap { font-size: 10px; color: var(--muted); max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Direktnachrichten ─── */
.dm-layout { display: flex; flex: 1; min-height: 0; gap: 0; }
.dm-sidebar {
  width: 240px; flex-shrink: 0; border-right: 1px solid var(--border);
  background: var(--bg2); display: flex; flex-direction: column; overflow-y: auto; min-height: 0;
}
.dm-sidebar-header {
  padding: 10px 14px; font-family: var(--font-d); font-size: 13px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
}
.dm-new-btn {
  background: var(--accent); color: #fff; border: none; border-radius: 50%;
  width: 22px; height: 22px; font-size: 18px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  padding: 0 0 1px 0;
}
.dm-new-btn:hover { background: #991b1b; }
.dm-picker {
  border-bottom: 1px solid var(--border); background: var(--bg2); flex-shrink: 0;
}
.dm-picker input {
  width: 100%; box-sizing: border-box; padding: 8px 12px; background: var(--bg3);
  border: none; border-bottom: 1px solid var(--border); color: var(--text);
  font-size: 13px; outline: none;
}
.dm-picker-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px; cursor: pointer;
  transition: background .15s;
}
.dm-picker-item:hover { background: var(--bg3); }
.dm-picker-name { font-size: 14px; font-weight: 500; }
.dm-conv {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer;
  border-bottom: 1px solid var(--border); transition: background .15s;
}
.dm-conv:hover, .dm-conv.active { background: var(--bg3); }
.dm-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.dm-avatar-img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.dm-conv-info { flex: 1; min-width: 0; }
.dm-conv-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.dm-conv-last { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-unread { background: var(--red-bright); color: #fff; border-radius: 10px; font-size: 10px; padding: 1px 5px; font-weight: 700; }
.dm-main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: var(--bg2); }
.dm-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  flex: 1; text-align: center; padding: 20px;
}
.dm-empty-icon { font-size: 40px; opacity: .5; }
.dm-empty-text { color: var(--muted); font-size: 14px; max-width: 260px; }
.dm-header {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  border-bottom: 1px solid var(--border); background: var(--bg2); flex-shrink: 0;
}
.dm-header-name { font-family: var(--font-d); font-size: 16px; font-weight: 700; }
.dm-back-btn {
  display: none; background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 20px; padding: 0 4px 0 0; line-height: 1;
}
.dm-back-btn:hover { color: #fff; }
.dm-messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; -webkit-overflow-scrolling: touch; }
.dm-form {
  display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border);
  background: var(--bg2); flex-shrink: 0; align-items: center;
}
.dm-form input[type=text] {
  flex: 1; padding: 9px 12px; border: 1px solid var(--border);
  background: var(--bg3); color: #fff; font-family: var(--font-b); font-size: 14px; outline: none;
}
.dm-form input[type=text]:focus { border-color: var(--red-bright); }
.dm-form button {
  background: var(--red); border: none; color: #fff; padding: 9px 18px; cursor: pointer;
  font-family: var(--font-d); font-size: 14px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; transition: background .15s; white-space: nowrap;
}
.dm-form button:hover { background: var(--red-bright); }
.dm-file-btn { cursor: pointer; font-size: 18px; color: var(--muted); padding: 4px; }
.dm-msg { display: flex; }
.dm-mine { justify-content: flex-end; }
.dm-theirs { justify-content: flex-start; }
.dm-bubble {
  max-width: 70%; background: var(--bg3); border: 1px solid var(--border);
  padding: 8px 12px; font-size: 14px; position: relative;
}
.dm-mine .dm-bubble { background: var(--red); border-color: var(--red); }
.dm-time { font-size: 10px; color: rgba(255,255,255,.5); margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.dm-del-btn { background: none; border: none; color: rgba(255,255,255,.4); cursor: pointer; font-size: 10px; padding: 0; }
.dm-del-btn:hover { color: #fff; }
.dm-open-btn {
  background: var(--red); border: none; color: #fff; padding: 5px 12px; cursor: pointer;
  font-family: var(--font-d); font-size: 12px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; transition: background .15s;
}
.dm-open-btn:hover { background: var(--red-bright); }

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .chat-layout { flex-direction: column; }
  .messages-list { max-height: 55vh; }
}

@media (max-width: 720px) {
  .view { padding: 14px; }
  .topbar { padding: 0 14px; gap: 10px; }
  .header-sub { display: none; }
  .message .bubble { max-width: 80%; }

  /* Nachrichten auf dem Handy: wie bei WhatsApp - erst die Liste, per Tap auf ein
     Gespraech wechselt die Ansicht komplett zum Chat (mit Zurueck-Button). */
  .dm-sidebar { width: 100%; }
  .dm-main { display: none; }
  .dm-back-btn { display: block; }
  #view-dm.dm-chat-open .dm-sidebar { display: none; }
  #view-dm.dm-chat-open .dm-main { display: flex; }

  /* Bottom-Nav-Leiste wie bei nativen Apps: bleibt normaler Flex-Teilnehmer von .app,
     wird per "order" einfach ans Ende (= unten) verschoben statt fixiert - dadurch
     schrumpft der Inhaltsbereich automatisch korrekt, nichts wird verdeckt. */
  .nav-tabs {
    order: 1; flex-wrap: nowrap; border-bottom: none; border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0); min-height: 64px;
  }
  .tab-btn, .tab-more-btn {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; padding: 12px 2px; border-bottom: none; border-top: 3px solid transparent;
  }
  .tab-btn.active, .tab-more-btn.active { border-bottom: none; border-top-color: var(--red-bright); }
  .tab-icon { display: block; font-size: 28px; line-height: 1; position: relative; }
  .tab-label { display: none; }
  .tab-icon .dm-badge {
    position: absolute; top: -6px; right: -10px; margin-left: 0; padding: 0 5px; font-size: 10px;
  }
  .tab-more-menu { top: auto; bottom: 100%; left: auto; right: 0; margin-bottom: 4px; }
  .tab-more-menu .tab-btn { flex-direction: row; justify-content: flex-start; gap: 8px; }
  .tab-more-menu .tab-icon { display: inline-block; font-size: 16px; }
  .tab-more-menu .tab-label { display: inline; }
}

@media (max-width: 480px) {
  .auth-box { width: 88vw; padding: 24px; }
  .brand { font-size: 16px; }
  .header-divider { display: none; }
  #me-name { display: none; }
  .post-form-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .post-form-row button { width: 100%; }
  .chat-form { flex-wrap: wrap; }
  .chat-form input[type=text] { flex-basis: 100%; }
  .chat-form input[type=file] { flex: 1; width: auto; }
  .chat-form button { flex: 1; }
  .member-card, .admin-user-card { flex-wrap: wrap; }
  .admin-user-card .actions { width: 100%; justify-content: flex-end; }
  .message .bubble { max-width: 90%; }
  .profile-avatar-actions { flex-direction: column; }
}
