/* ============================================================
 *  Assistentenbereich v2 – modernes, mobilfreundliches Design
 * ============================================================ */
:root {
  --ab-color: #EB0014;
  --ab-color-dark: #c2000f;
  --ab-color-soft: #fff1f2;
  --ab-bg: #fafafa;
  --ab-card: #ffffff;
  --ab-ink: #18181b;
  --ab-muted: #71717a;
  --ab-line: #ececef;
  --ab-radius: 16px;
  --ab-shadow: 0 1px 3px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.04);
}

/* Das hidden-Attribut muss IMMER gewinnen, auch gegen display:flex/grid o.ä. */
.ab-wrap [hidden] { display: none !important; }

.ab-wrap * { box-sizing: border-box; }
.ab-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px 80px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ab-ink);
  -webkit-font-smoothing: antialiased;
}

.ab-logo-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--ab-color);
  display: inline-block;
  box-shadow: 0 0 0 4px var(--ab-color-soft);
}

/* ---------- LOGIN ---------- */
.ab-login-wrap { min-height: 80vh; display: flex; align-items: center; justify-content: center; }
.ab-login-card {
  width: 100%; max-width: 400px;
  background: var(--ab-card);
  border: 1px solid var(--ab-line);
  border-radius: 24px;
  padding: 40px 32px;
  box-shadow: var(--ab-shadow);
  text-align: center;
}
.ab-login-card .ab-login-logo {
  max-width: 160px;
  max-height: 64px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0 auto 20px;
  display: block;
}
.ab-login-title { font-size: 24px; font-weight: 800; letter-spacing: -.5px; margin: 0 0 6px; }
.ab-login-sub { color: var(--ab-muted); font-size: 15px; margin: 0 0 28px; line-height: 1.5; }
.ab-login-form { text-align: left; }
.ab-field { display: block; margin-bottom: 16px; }
.ab-field span { display: block; font-size: 13px; font-weight: 600; color: var(--ab-muted); margin-bottom: 6px; }
.ab-field input {
  width: 100%; padding: 13px 15px;
  border: 1.5px solid var(--ab-line);
  border-radius: 12px; font-size: 16px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.ab-field input:focus { outline: none; border-color: var(--ab-color); box-shadow: 0 0 0 3px var(--ab-color-soft); }
.ab-error {
  background: var(--ab-color-soft); color: var(--ab-color-dark);
  border: 1px solid #fecdd3; padding: 12px 14px;
  border-radius: 12px; font-size: 14px; margin-bottom: 20px;
}
.ab-lost { display: inline-block; margin-top: 18px; color: var(--ab-muted); font-size: 13px; text-decoration: none; }
.ab-lost:hover { color: var(--ab-color); }

/* ---------- BUTTONS ---------- */
.ab-btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 12px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: transform .08s, background .15s, opacity .15s;
  font-family: inherit;
}
.ab-btn:active { transform: scale(.97); }
.ab-btn-primary { background: var(--ab-color); color: #fff; padding: 14px 22px; width: 100%; }
.ab-btn-primary:hover { background: var(--ab-color-dark); }
.ab-btn-sm { width: auto; padding: 10px 20px; font-size: 14px; }
.ab-btn:disabled { opacity: .5; cursor: default; }

/* ---------- HEADER ---------- */
.ab-header {
  position: sticky; top: 0; z-index: 20;
  margin: 0 -16px 20px; padding: 0 16px;
  background: rgba(250,250,250,.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--ab-line);
}
.ab-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; max-width: 640px; margin: 0 auto;
}
.ab-brand { display: flex; align-items: center; gap: 10px; }
.ab-brand-logo { height: 30px; width: auto; max-width: 140px; object-fit: contain; display: block; }
.ab-brand-text { font-weight: 800; font-size: 17px; letter-spacing: -.3px; }
.ab-user { display: flex; align-items: center; gap: 12px; }
.ab-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--ab-color); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
}
.ab-logout { color: var(--ab-muted); font-size: 14px; text-decoration: none; }
.ab-logout:hover { color: var(--ab-color); }

/* ---------- COMPOSER ---------- */
.ab-composer {
  background: var(--ab-card); border: 1px solid var(--ab-line);
  border-radius: var(--ab-radius); padding: 16px;
  box-shadow: var(--ab-shadow); margin-bottom: 24px;
}
.ab-textarea {
  width: 100%; border: none; resize: none;
  font-size: 16px; font-family: inherit; color: var(--ab-ink);
  line-height: 1.55; background: transparent;
}
.ab-textarea:focus { outline: none; }
.ab-textarea::placeholder { color: #a1a1aa; }

.ab-preview {
  position: relative; margin-top: 12px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--ab-line);
}
.ab-preview img { display: block; width: 100%; max-height: 320px; object-fit: cover; }
.ab-preview-remove {
  position: absolute; top: 8px; right: 8px;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff; border: none;
  font-size: 18px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.ab-preview-remove:hover { background: rgba(0,0,0,.8); }

.ab-composer-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--ab-line);
}
.ab-composer-left { display: flex; align-items: center; gap: 12px; }
.ab-icon-btn {
  background: none; border: none; cursor: pointer; color: var(--ab-muted);
  padding: 6px; border-radius: 8px; display: flex; align-items: center;
  transition: background .15s, color .15s;
}
.ab-icon-btn:hover { background: var(--ab-color-soft); color: var(--ab-color); }
.ab-count { font-size: 13px; color: var(--ab-muted); }

/* ---------- FEED & POSTS ---------- */
.ab-feed { display: flex; flex-direction: column; gap: 14px; }
.ab-post {
  background: var(--ab-card); border: 1px solid var(--ab-line);
  border-radius: var(--ab-radius); padding: 18px;
  box-shadow: var(--ab-shadow); animation: ab-in .3s ease;
}
@keyframes ab-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ab-post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ab-post-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--ab-color-soft); color: var(--ab-color-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; flex-shrink: 0;
}
.ab-post-meta { flex: 1; min-width: 0; }
.ab-post-author { font-weight: 700; font-size: 15px; }
.ab-post-time { font-size: 13px; color: var(--ab-muted); }
.ab-post-del {
  background: none; border: none; cursor: pointer; color: #c4c4c8;
  font-size: 18px; padding: 4px 8px; border-radius: 8px; line-height: 1;
  transition: background .15s, color .15s;
}
.ab-post-del:hover { background: var(--ab-color-soft); color: var(--ab-color); }
.ab-post-body {
  font-size: 15px; line-height: 1.6; color: #27272a;
  white-space: pre-wrap; word-wrap: break-word;
}
.ab-post-body a { color: var(--ab-color); text-decoration: none; font-weight: 500; word-break: break-word; }
.ab-post-body a:hover { text-decoration: underline; }
.ab-post-image {
  display: block; margin-top: 12px; width: 100%;
  border-radius: 12px; border: 1px solid var(--ab-line);
  max-height: 480px; object-fit: cover; cursor: zoom-in;
}
.ab-mine { border-color: #fecdd3; }

/* ---------- ACTIONS (Like / Comment) ---------- */
.ab-actions {
  display: flex; align-items: center; gap: 8px;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--ab-line);
}
.ab-action {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
  color: var(--ab-muted); font-size: 14px; font-weight: 600;
  padding: 7px 12px; border-radius: 10px; font-family: inherit;
  transition: background .15s, color .15s;
}
.ab-action:hover { background: #f6f6f7; }
.ab-action svg { width: 18px; height: 18px; }
.ab-action.ab-liked { color: var(--ab-color); }
.ab-action.ab-liked svg { fill: var(--ab-color); stroke: var(--ab-color); }
.ab-like-pop { animation: ab-pop .3s ease; }
@keyframes ab-pop { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* ---------- COMMENTS ---------- */
.ab-comments { margin-top: 14px; display: none; }
.ab-comments.ab-open { display: block; }
.ab-comment-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.ab-comment {
  display: flex; gap: 10px; align-items: flex-start;
  background: #f9f9fa; border-radius: 12px; padding: 10px 12px;
}
.ab-comment-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: var(--ab-color-soft); color: var(--ab-color-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
}
.ab-comment-main { flex: 1; min-width: 0; }
.ab-comment-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ab-comment-author { font-weight: 700; font-size: 13px; }
.ab-comment-time { font-size: 12px; color: var(--ab-muted); }
.ab-comment-body { font-size: 14px; line-height: 1.5; color: #3f3f46; margin-top: 2px; word-wrap: break-word; }
.ab-comment-body a { color: var(--ab-color); }
.ab-comment-del {
  background: none; border: none; cursor: pointer; color: #c4c4c8;
  font-size: 15px; line-height: 1; padding: 2px 6px; border-radius: 6px;
}
.ab-comment-del:hover { color: var(--ab-color); }
.ab-comment-form { display: flex; gap: 8px; align-items: center; }
.ab-comment-input {
  flex: 1; border: 1.5px solid var(--ab-line); border-radius: 20px;
  padding: 9px 14px; font-size: 14px; font-family: inherit; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.ab-comment-input:focus { outline: none; border-color: var(--ab-color); box-shadow: 0 0 0 3px var(--ab-color-soft); }
.ab-comment-send {
  background: var(--ab-color); color: #fff; border: none; cursor: pointer;
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, transform .08s;
}
.ab-comment-send:hover { background: var(--ab-color-dark); }
.ab-comment-send:active { transform: scale(.92); }
.ab-comment-send svg { width: 16px; height: 16px; }

/* ---------- EMPTY / SKELETON ---------- */
.ab-empty { text-align: center; padding: 60px 20px; color: var(--ab-muted); }
.ab-empty-emoji { font-size: 40px; margin-bottom: 12px; }
.ab-skeleton {
  height: 90px; border-radius: var(--ab-radius);
  background: linear-gradient(90deg, #f0f0f2 25%, #e8e8ea 50%, #f0f0f2 75%);
  background-size: 200% 100%; animation: ab-shimmer 1.4s infinite;
}
@keyframes ab-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- TOAST ---------- */
.ab-toast {
  position: fixed; left: 50%; bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ab-ink); color: #fff; padding: 12px 20px;
  border-radius: 12px; font-size: 14px; font-weight: 500;
  opacity: 0; transition: opacity .25s, transform .25s;
  z-index: 100; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 90%;
}
.ab-toast.ab-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- LIGHTBOX ---------- */
.ab-lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,.9);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px; cursor: zoom-out;
  opacity: 0; transition: opacity .2s;
}
.ab-lightbox.ab-show { opacity: 1; }
.ab-lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

/* ---------- MOBILE ---------- */
@media (max-width: 600px) {
  .ab-wrap { padding: 0 12px 80px; }
  .ab-login-card { padding: 32px 24px; border-radius: 20px; }
  .ab-brand-text { font-size: 16px; }
  .ab-action { padding: 7px 10px; }
}

/* ============================================================
 *  v2.3 – Tabs, Datei-Anhänge, Mediathek
 * ============================================================ */

/* ---------- TABS ---------- */
.ab-tabs {
  display: flex;
  gap: 4px;
  margin: 0 auto 20px;
  max-width: 640px;
  background: #f0f0f2;
  padding: 4px;
  border-radius: 12px;
}
.ab-tab {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--ab-muted);
  padding: 10px 16px;
  border-radius: 9px;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.ab-tab-active {
  background: #fff;
  color: var(--ab-ink);
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.ab-pane { display: none; }
.ab-pane-active { display: block; }

/* ---------- DATEI-CHIP im Composer ---------- */
.ab-file-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--ab-color-soft);
  border: 1px solid #fecdd3;
  border-radius: 10px;
  color: var(--ab-color-dark);
  font-size: 14px;
  font-weight: 500;
}
.ab-file-chip svg { flex-shrink: 0; }
#ab-file-chip-name {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ab-file-remove {
  background: none; border: none; cursor: pointer;
  color: var(--ab-color-dark); font-size: 18px; line-height: 1;
  padding: 2px 6px; border-radius: 6px;
}
.ab-file-remove:hover { background: rgba(0,0,0,.06); }

/* ---------- DATEI-ANHANG im Post ---------- */
.ab-post-file {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 14px;
  background: #f7f7f8;
  border: 1px solid var(--ab-line);
  border-radius: 12px;
  text-decoration: none;
  color: var(--ab-ink);
  transition: background .15s, border-color .15s;
}
.ab-post-file:hover { background: #f0f0f2; border-color: #ddd; }
.ab-post-file svg { color: var(--ab-color); flex-shrink: 0; }
.ab-post-file-name {
  flex: 1; min-width: 0; font-size: 14px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ab-post-file-dl {
  font-size: 13px; font-weight: 600; color: var(--ab-color);
  flex-shrink: 0;
}

/* ---------- MEDIATHEK: Upload-Bereich ---------- */
.ab-media-upload { margin-bottom: 20px; }
.ab-media-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 32px 20px;
  border: 2px dashed #d4d4d8;
  border-radius: var(--ab-radius);
  background: var(--ab-card);
  color: var(--ab-muted);
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background .15s, color .15s;
}
.ab-media-drop:hover,
.ab-media-drop-over {
  border-color: var(--ab-color);
  background: var(--ab-color-soft);
  color: var(--ab-color-dark);
}
.ab-media-drop svg { color: var(--ab-color); }
.ab-media-drop-text { font-size: 15px; font-weight: 600; color: var(--ab-ink); }
.ab-media-drop-text strong { color: var(--ab-color); }
.ab-media-drop-hint { font-size: 13px; }

.ab-media-uploading {
  display: flex; flex-direction: column; gap: 8px;
  padding: 20px; border-radius: var(--ab-radius);
  background: var(--ab-card); border: 1px solid var(--ab-line);
}
.ab-media-uploading span { font-size: 14px; color: var(--ab-muted); }
.ab-media-progress {
  height: 6px; border-radius: 3px; background: #f0f0f2; overflow: hidden;
}
.ab-media-progress span {
  display: block; height: 100%; width: 40%;
  background: var(--ab-color); border-radius: 3px;
  animation: ab-progress 1.1s infinite ease-in-out;
}
@keyframes ab-progress {
  0% { margin-left: -40%; } 100% { margin-left: 100%; }
}

.ab-media-readonly {
  margin: 0 0 20px; padding: 14px 16px;
  background: var(--ab-card); border: 1px solid var(--ab-line);
  border-radius: 12px; font-size: 14px; color: var(--ab-muted);
}

/* ---------- MEDIATHEK: Grid ---------- */
.ab-media-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.ab-media-card {
  position: relative;
  background: var(--ab-card);
  border: 1px solid var(--ab-line);
  border-radius: var(--ab-radius);
  overflow: hidden;
  box-shadow: var(--ab-shadow);
  animation: ab-in .3s ease;
}
.ab-media-link { display: block; text-decoration: none; color: inherit; }
.ab-media-thumb {
  height: 130px;
  background-size: cover;
  background-position: center;
  background-color: #f0f0f2;
}
.ab-media-thumb-icon {
  display: flex; align-items: center; justify-content: center;
}
.ab-media-thumb-icon svg { width: 40px; height: 40px; }
.ab-media-document svg { color: #6366f1; }
.ab-media-video svg { color: #ec4899; }
.ab-media-info { padding: 12px 14px; }
.ab-media-title {
  font-size: 14px; font-weight: 600; color: var(--ab-ink);
  line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ab-media-meta { font-size: 12px; color: var(--ab-muted); margin-top: 3px; }
.ab-media-del {
  position: absolute; top: 8px; right: 8px;
  width: 30px; height: 30px; border-radius: 8px;
  background: rgba(255,255,255,.92); border: 1px solid var(--ab-line);
  color: var(--ab-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.ab-media-del:hover { background: var(--ab-color); color: #fff; border-color: var(--ab-color); }

@media (max-width: 600px) {
  .ab-media-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .ab-media-thumb { height: 100px; }
}
@media (max-width: 380px) {
  .ab-media-grid { grid-template-columns: 1fr; }
}

/* ============================================================
 *  v2.4 – Like-Namen & Teilnehmerliste
 * ============================================================ */

/* ---------- Like: Zähler als eigener Klickbereich ---------- */
.ab-likes-show {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  margin: -2px -4px -2px 0;
  border-radius: 6px;
  transition: background .15s;
}
.ab-likes-show:hover { background: rgba(0,0,0,.06); }

/* ---------- Liste der Likenden ---------- */
.ab-likers {
  margin-top: 10px;
  padding: 10px 12px;
  background: #f9f9fa;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ab-ink);
  animation: ab-in .2s ease;
}
.ab-likers-label { color: var(--ab-muted); font-weight: 600; margin-right: 4px; }
.ab-likers-loading, .ab-likers-empty { color: var(--ab-muted); font-size: 13px; }
.ab-liker {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--ab-line);
  border-radius: 20px;
  padding: 3px 10px;
  margin: 2px 4px 2px 0;
  font-weight: 500;
}
.ab-liker-me {
  background: var(--ab-color-soft);
  border-color: #fecdd3;
  color: var(--ab-color-dark);
}

/* ---------- Teilnehmerliste ---------- */
.ab-users-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.ab-users-count {
  font-size: 14px;
  font-weight: 700;
  color: var(--ab-muted);
}
.ab-users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ab-user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--ab-card);
  border: 1px solid var(--ab-line);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--ab-shadow);
  animation: ab-in .25s ease;
}
.ab-user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--ab-color-soft); color: var(--ab-color-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; flex-shrink: 0;
}
.ab-user-name { font-size: 15px; font-weight: 600; color: var(--ab-ink); }
