/* ============================================================
   HAIX Workshop Tool - Styles
   CI-Farben: Akzent-Blau #002B53, Schwarz, Weiss
   (Rot nur noch fuer Warnungen/destruktive Aktionen)
   ============================================================ */

:root {
  --accent: #002B53;        /* CI-Blau */
  --accent-dark: #001B36;   /* dunklere Variante fuer Hover */
  --red: #e2001a;           /* nur fuer Fehler/Loeschen */
  --red-dark: #b30015;
  --black: #1a1a1a;
  --gray-9: #2c2c2c;
  --gray-6: #666;
  --gray-3: #d7d7d7;
  --gray-1: #f4f4f4;
  --white: #fff;
  --radius: 8px;
  --shadow: 0 1px 4px rgba(0,0,0,.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--black);
  background: var(--gray-1);
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0; }
h2 { font-size: 1.15rem; margin: 2rem 0 .75rem; border-bottom: 2px solid var(--accent); display: inline-block; padding-bottom: 2px; }
h3 { font-size: 1rem; margin: 1.5rem 0 .5rem; }

/* ---------- Topbar ---------- */
.topbar { background: var(--black); color: var(--white); }
.topbar-inner {
  max-width: none; margin: 0 auto; padding: 0 2rem;
  display: flex; align-items: center; gap: 1.5rem; height: 56px;
}
.brand { display: flex; align-items: center; gap: .6rem; }
.brand img { height: 30px; width: auto; display: block; }
.brand span { color: var(--white); font-weight: 400; font-size: 1rem; letter-spacing: 0; }
.brand:hover { text-decoration: none; }
.topbar nav { display: flex; gap: 1rem; flex: 1; }
.topbar nav a { color: #ddd; }
.topbar nav a:hover { color: var(--white); text-decoration: none; }
.userbox { display: flex; align-items: center; gap: .75rem; }
.username { color: #bbb; font-size: .9rem; }
/* Abmelden-Button auf dunkler Leiste: heller Text + heller Rahmen */
.userbox .btn-outline { color: var(--white); border-color: #777; }
.userbox .btn-outline:hover { border-color: var(--white); background: rgba(255,255,255,.1); filter: none; }

/* ---------- Hero (Startseite) ---------- */
.hero {
  position: relative; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); margin-bottom: 1.5rem; max-height: 320px;
}
.hero img { width: 100%; height: 320px; object-fit: cover; display: block; }
.hero-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 1.5rem 2rem;
  background: linear-gradient(to top, rgba(0,0,0,.65) 0%, rgba(0,0,0,.15) 55%, transparent 100%);
  color: var(--white);
}
.hero-overlay h1 { color: var(--white); font-size: 1.9rem; margin: 0; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.hero-overlay p { margin: .25rem 0 0; color: #eee; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
@media (max-width: 700px) {
  .hero, .hero img { max-height: 200px; height: 200px; }
  .hero-overlay h1 { font-size: 1.3rem; }
}

/* ---------- Anleitung ---------- */
.guide-banner {
  display: flex; align-items: center; gap: 1.25rem;
  background: var(--black); color: var(--white);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.1rem 1.5rem; margin-bottom: 1.5rem;
  border-left: 6px solid var(--accent);
  transition: transform .12s, box-shadow .12s;
}
.guide-banner:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.guide-banner-icon { font-size: 2.2rem; }
.guide-banner-text { display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.guide-banner-text strong { font-size: 1.15rem; }
.guide-banner-text span { color: #ccc; font-style: italic; font-size: .95rem; }
.guide-banner-arrow { font-size: 1.8rem; color: var(--accent); }

.guide { max-width: 860px; margin: 0 auto; }
.guide-hero { text-align: center; padding: 1.5rem 1rem 2rem; }
.guide-hero h1 { font-size: 1.8rem; }
.guide-slogan {
  font-size: 1.35rem; font-style: italic; font-weight: 700; color: var(--accent);
  margin: .75rem 0; line-height: 1.4;
}
.guide-card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.25rem 1.75rem; margin-bottom: 1.25rem;
}
.guide-card h2 { margin: 0 0 .75rem; border: none; display: block; font-size: 1.2rem; }
.guide-card ul, .guide-card ol { padding-left: 1.4rem; margin: .5rem 0; }
.guide-card li { margin-bottom: .5rem; line-height: 1.6; }
.guide-tldr { border-left: 6px solid var(--accent); }
.guide-highlight { border: 2px solid var(--accent); }
.guide-footer { text-align: center; padding: 1rem 0 2rem; }
.guide-footer .btn { font-size: 1.1rem; padding: .8rem 2rem; }

/* ---------- Layout ---------- */
.container { max-width: none; margin: 1.5rem 0 3rem; padding: 0 2rem; }
@media (max-width: 700px) { .container { padding: 0 1rem; } .topbar-inner { padding: 0 1rem; } }
.footer { text-align: center; color: var(--gray-6); font-size: .8rem; padding: 1rem 0 2rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: .5rem; }
.breadcrumb { font-size: .85rem; color: var(--gray-6); margin-bottom: .5rem; }
.lead { color: var(--gray-9); }
.muted { color: var(--gray-6); font-size: .85rem; }
.small { font-size: .8rem; }
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; align-items: start; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: .5rem 1rem; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer; font-size: .9rem;
  background: var(--gray-3); color: var(--black); text-decoration: none;
}
.btn:hover { text-decoration: none; filter: brightness(.95); }
.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-dark { background: var(--black); color: var(--white); }
.btn-outline { background: transparent; border-color: var(--gray-3); color: var(--black); }
.btn-small { padding: .25rem .6rem; font-size: .8rem; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.linklike { background: none; border: none; color: var(--accent); cursor: pointer; font-size: .85rem; padding: 0; }
.linklike:hover { text-decoration: underline; }
.linklike.danger { color: var(--red-dark); }
.linklike[disabled] { color: var(--gray-3); cursor: default; }
.danger-btn { color: var(--red-dark); border-color: #f5c2c2; }
.danger-btn:hover { background: #fdeaea; }

/* ---------- Formulare ---------- */
label { display: block; font-size: .85rem; color: var(--gray-9); margin-bottom: .75rem; }
input[type=text], input[type=password], input[type=email], textarea, select {
  display: block; width: 100%; padding: .5rem .65rem; margin-top: .25rem;
  border: 1px solid var(--gray-3); border-radius: var(--radius); font: inherit; background: var(--white);
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.5rem; }
.form-grid .span2 { grid-column: span 2; }
.form-grid .form-actions { grid-column: span 2; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span2, .form-grid .form-actions { grid-column: span 1; } }
.inline { display: inline; }
.input-small { display: inline-block; width: 160px; padding: .25rem .5rem; margin: 0; }
.chk-inline { display: flex; align-items: center; gap: .5rem; margin: .75rem 0; }
.chk-inline input { width: auto; margin: 0; }

/* ---------- Panels / Karten ---------- */
.panel { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem 1.5rem; margin: 1rem 0; }
.panel h2 { margin-top: 0; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; margin-top: 1rem; }
.ws-card {
  display: block; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.25rem; color: var(--black); border-top: 4px solid var(--accent);
}
.ws-card:hover { text-decoration: none; transform: translateY(-2px); transition: transform .15s; }
.ws-card h3 { margin: 0 0 .5rem; }
.ws-card p { margin: 0 0 .75rem; color: var(--gray-6); font-size: .9rem; }
.ws-meta { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .8rem; color: var(--gray-6); }
.empty-state { background: var(--white); border-radius: var(--radius); padding: 2.5rem; text-align: center; color: var(--gray-6); margin-top: 1rem; }

/* ---------- Flash ---------- */
.flash { padding: .65rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .9rem; }
.flash-ok { background: #e6f6e9; color: #1d6b2e; border: 1px solid #b7e4c0; }
.flash-error { background: #fdeaea; color: var(--red-dark); border: 1px solid #f5c2c2; }

/* ---------- Login ---------- */
.login-wrap { display: flex; justify-content: center; padding: 3rem 1rem; }
.login-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2rem; width: 100%; max-width: 400px; border-top: 4px solid var(--accent); }
.login-logo { font-weight: 800; font-size: 1.5rem; color: var(--accent); letter-spacing: 1px; text-align: center; margin-bottom: 1rem; }
.login-logo span { color: var(--black); font-weight: 400; font-size: 1.1rem; }

/* ---------- Kapitel-Liste ---------- */
.chapter-list { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.chapter-row { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; border-bottom: 1px solid var(--gray-1); }
.chapter-row:last-child { border-bottom: none; }
.chapter-row .chk { margin: 0; }
.chapter-row .chk input { width: 18px; height: 18px; }
.chapter-link { flex: 1; display: flex; flex-direction: column; color: var(--black); }
.chapter-link:hover strong { color: var(--accent); }
.chapter-link:hover { text-decoration: none; }
.chapter-meta { display: flex; gap: .75rem; font-size: .85rem; color: var(--gray-6); white-space: nowrap; }
.summary-actions { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }

/* ---------- Beitraege ---------- */
.entry { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.25rem; margin-bottom: .75rem; }
.entry-head { display: flex; gap: .75rem; align-items: baseline; flex-wrap: wrap; margin-bottom: .35rem; }
.entry-actions { margin-left: auto; display: flex; gap: .75rem; }
.entry-body { white-space: pre-line; }
.new-entry { margin-top: 1rem; }
.new-entry textarea { margin-bottom: .5rem; }
.entry-edit textarea { margin: .5rem 0; }

/* ---------- Bilder ---------- */
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.image-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: .75rem; }
.image-card img { width: 100%; height: 150px; object-fit: cover; border-radius: 4px; }
.image-meta { display: flex; flex-direction: column; font-size: .85rem; margin-top: .5rem; word-break: break-all; }
.ai-desc { margin-top: .5rem; font-size: .85rem; }
.ai-desc summary { cursor: pointer; color: var(--accent); }
.ai-desc div { background: var(--gray-1); border-radius: 4px; padding: .5rem .75rem; margin-top: .35rem; white-space: pre-line; }
.upload-form { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }

/* ---------- Umfragen ---------- */
.poll-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.25rem; margin-bottom: 1rem; }
.poll-head { display: flex; flex-direction: column; margin-bottom: .5rem; }
.poll-option { display: flex; align-items: center; gap: .5rem; margin: .35rem 0; font-size: .95rem; }
.poll-option input { width: auto; margin: 0; }
.poll-results { margin-top: .75rem; }
.poll-result-row { display: grid; grid-template-columns: 1fr 100px 70px; gap: .5rem; align-items: center; font-size: .85rem; margin: .3rem 0; }
.poll-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poll-bar { background: var(--gray-1); border-radius: 4px; height: 10px; overflow: hidden; }
.poll-bar-fill { background: var(--accent); height: 100%; }
.poll-num { text-align: right; color: var(--gray-6); }
.poll-admin { margin-top: .75rem; display: flex; gap: 1rem; }
.new-poll { margin-top: 1rem; }
.new-poll summary { list-style: none; }
.new-poll summary::-webkit-details-marker { display: none; }
.new-poll form { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.25rem; margin-top: .75rem; }

/* ---------- Zusammenfassungen ---------- */
.summary-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: .75rem; border-left: 4px solid var(--accent); }
.summary-card summary { cursor: pointer; padding: .9rem 1.25rem; display: flex; flex-direction: column; gap: .15rem; }
.summary-card summary:hover strong { color: var(--accent); }
.summary-body { padding: 0 1.5rem 1.25rem; }
.summary-inner { display: flex; gap: 1.25rem; align-items: flex-start; flex-wrap: wrap; padding: 0 1.5rem 1.25rem; }
.summary-inner .summary-body { padding: 0; flex: 1; min-width: 280px; }
.summary-flip { display: flex; flex-direction: column; align-items: center; gap: .25rem; flex: 0 0 320px; max-width: 100%; }
.summary-flip img {
  width: 100%; border-radius: 6px; border: 1px solid var(--gray-3);
  box-shadow: var(--shadow); cursor: zoom-in;
}
.summary-flip:hover { text-decoration: none; }
.markdown h2 { border: none; display: block; margin: 1.25rem 0 .5rem; font-size: 1.05rem; color: var(--accent-dark); }
.markdown h3 { margin: 1rem 0 .35rem; }
.markdown ul { margin: .35rem 0; padding-left: 1.4rem; }
.markdown p { margin: .5rem 0; }

/* ---------- Tabellen ---------- */
.table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.table th, .table td { text-align: left; padding: .6rem .9rem; border-bottom: 1px solid var(--gray-1); font-size: .9rem; }
.table th { background: var(--black); color: var(--white); font-weight: 600; }
.table tr:last-child td { border-bottom: none; }
.row-inactive td { color: var(--gray-6); background: #fafafa; }
.actions { white-space: nowrap; }

/* ---------- Admin ---------- */
.chapter-admin { border: 1px solid var(--gray-3); border-radius: var(--radius); padding: .5rem .9rem; margin-bottom: .5rem; }
.chapter-admin summary { cursor: pointer; padding: .25rem 0; }
.chapter-admin-actions { display: flex; gap: 1rem; padding: .5rem 0; }
.ws-danger-zone { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: .75rem; padding-top: .75rem; border-top: 1px dashed var(--gray-3); }
.member-row { display: flex; justify-content: space-between; align-items: center; padding: .35rem 0; border-bottom: 1px solid var(--gray-1); font-size: .9rem; }
.add-member { display: flex; gap: .5rem; margin-top: .75rem; }
.add-member select { margin: 0; flex: 1; }

/* ============================================================
   Live-Board: links grosse eigene Notiz, rechts Mini-Vorschauen
   ============================================================ */
.head-actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }

.color-picker { display: flex; gap: .35rem; align-items: center; }
.color-dot {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0;
}
.color-dot.sel { border-color: var(--black); }
.c-yellow { background: #fff3a3; } .c-green { background: #c9f2c7; } .c-blue { background: #cde4ff; }
.c-pink { background: #ffd6e8; } .c-orange { background: #ffe0b3; } .c-white { background: #ffffff; }

/* --- Bereichs-Tabs: Plenum + Arbeitsgruppen --- */
.group-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; margin-top: 1rem;
}
.group-tabs { display: flex; gap: .35rem; flex-wrap: wrap; }
.group-tab {
  border: 1px solid var(--gray-3); background: var(--white); cursor: pointer;
  padding: .45rem .9rem; border-radius: 999px; font-size: .9rem;
}
.group-tab:hover { border-color: var(--accent); }
.group-tab.active { background: var(--black); color: var(--white); border-color: var(--black); font-weight: 700; }
.group-bar-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* Bereichs-Banner: zeigt deutlich, in welcher Arbeitsgruppe man gerade ist */
.area-banner {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: #fff8e1; border: 1px solid #f0d580; border-left: 5px solid var(--accent);
  border-radius: var(--radius); padding: .6rem 1rem; margin-top: .75rem;
  font-size: 1rem;
}
.area-banner strong { color: var(--accent-dark); }

/* --- Gruppenergebnis-Karten im Plenum --- */
.group-results { display: flex; flex-direction: column; gap: .75rem; margin-bottom: .75rem; }
.result-card {
  background: var(--white); border: 2px solid var(--black); border-radius: 8px;
  padding: .6rem .8rem; box-shadow: var(--shadow);
}
.result-head { font-size: .85rem; margin-bottom: .4rem; }
.result-img { width: 100%; border-radius: 6px; cursor: zoom-in; margin-bottom: .4rem; }
.result-preview {
  font-size: .75rem; line-height: 1.5; max-height: 90px; overflow: hidden;
  white-space: pre-line; color: var(--gray-9);
  mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}
.result-actions { display: flex; gap: 1rem; margin-top: .35rem; }

.board-flex {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr) minmax(240px, 320px);
  gap: 1.5rem; align-items: start; margin-top: 1rem;
}
@media (max-width: 1250px) { .board-flex { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); } .gallery-panel { grid-column: span 2; } }
@media (max-width: 950px) { .board-flex { grid-template-columns: 1fr; } .gallery-panel { grid-column: span 1; } }

/* --- Eigene grosse Schreibflaeche --- */
.my-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.my-note {
  border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,.1);
}
.my-note .note-content {
  min-height: 62vh; padding: 1.25rem 1.5rem; font-size: 1.05rem; line-height: 1.65;
  outline: none; overflow-wrap: break-word;
}
.my-note .note-content:focus { box-shadow: inset 0 0 0 2px var(--accent); border-radius: var(--radius); }
.my-note .note-content ul, .my-note .note-content ol { margin: .35rem 0; padding-left: 1.5rem; }
.my-note .note-content:empty::before {
  content: attr(data-placeholder); color: rgba(0,0,0,.35); pointer-events: none;
}

/* Format-Toolbar (statisch ueber der eigenen Notiz) */
.fmt-static {
  display: flex; gap: .25rem;
  background: var(--black); border-radius: 6px; padding: .3rem .4rem;
}
.fmt-static button {
  background: none; border: none; color: var(--white); cursor: pointer;
  font-size: .85rem; padding: .15rem .5rem; border-radius: 4px;
}
.fmt-static button:hover { background: var(--accent); }

/* --- Mini-Vorschauen der anderen --- */
.others-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; flex-wrap: wrap; }
/* Masonry-Layout: Karten fliessen in Spalten, Hoehe variabel */
.others-grid { column-width: 180px; column-gap: .75rem; }
.mini-note {
  position: relative; border-radius: 6px; box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,.08); padding: .45rem .6rem .3rem;
  cursor: zoom-in; overflow: hidden; transition: transform .12s, box-shadow .12s;
  display: inline-block; width: 100%; margin: 0 0 .75rem;
  break-inside: avoid; -webkit-column-break-inside: avoid;
}
.mini-note:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 6px 16px rgba(0,0,0,.2); }
.note-new { animation: notePop .5s ease; }
@keyframes notePop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.mini-head { display: flex; justify-content: space-between; align-items: center; gap: .35rem; }
.mini-pin {
  background: none; border: none; cursor: pointer; font-size: .85rem;
  padding: 0 .1rem; opacity: .45; line-height: 1;
}
.mini-pin:hover { opacity: 1; color: var(--accent); }
.mini-author { font-size: .75rem; font-weight: 700; color: rgba(0,0,0,.7); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-del { font-size: .75rem; }
.mini-typing { font-size: .68rem; color: var(--accent-dark); font-style: italic; min-height: .9em; }
.mini-content {
  font-size: .68rem; line-height: 1.45; max-height: 130px; overflow: hidden;
  overflow-wrap: break-word; margin-top: .15rem; padding-bottom: .5rem;
}
.mini-content ul, .mini-content ol { margin: .15rem 0; padding-left: 1.1rem; }
.mini-fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 26px; pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,.85));
}

/* --- Bilder: unter der eigenen Notiz (gross) und in der Zoom-Ansicht --- */
.my-images { margin-top: 1rem; display: flex; flex-direction: column; gap: .75rem; }
.img-item {
  display: flex; gap: .9rem; background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: .75rem; align-items: flex-start;
}
.img-item img { width: 110px; height: 110px; object-fit: cover; border-radius: 6px; display: block; }
.img-info { flex: 1; min-width: 0; }
.img-title { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; margin-bottom: .25rem; word-break: break-all; }
.img-ai {
  background: var(--gray-1); border-left: 3px solid var(--accent); border-radius: 4px;
  padding: .5rem .75rem; font-size: .85rem; max-height: 180px; overflow: auto;
}
.upload-form { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin-top: .75rem; }
.upload-more { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; width: 100%; }
.upload-more input[type=text] { flex: 1; min-width: 220px; margin: 0; }
.summary-actions-row { padding: 0 1.5rem 1rem; }

/* Thumbnails unter den Mini-Karten der anderen */
.mini-imgs { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .3rem; }
.mini-imgs img {
  width: 34px; height: 34px; object-fit: cover; border-radius: 4px;
  border: 1px solid rgba(0,0,0,.15);
}

/* Bilder in der Zoom-Ansicht */
.zoom-imgs { margin-top: 1rem; border-top: 1px dashed rgba(0,0,0,.2); padding-top: 1rem; display: flex; flex-direction: column; gap: .75rem; }
.zoom-imgs .img-item { background: rgba(255,255,255,.6); }

/* --- Galerie-Sidebar: alle Bilder aller Teilnehmer --- */
.gallery-list { display: flex; flex-direction: column; gap: .75rem; max-height: 75vh; overflow-y: auto; padding-right: .25rem; }
.gal-item {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: .5rem; border: 1px solid rgba(0,0,0,.06);
}
.gal-item > img {
  width: 100%; max-height: 170px; object-fit: cover; border-radius: 6px;
  display: block; cursor: zoom-in;
}
.gal-meta { display: flex; flex-direction: column; margin: .4rem 0 .2rem; word-break: break-all; font-size: .85rem; }
.gal-actions { display: flex; gap: .7rem; flex-wrap: wrap; }
.gallery-upload { margin: 0 0 .75rem; }
.gallery-upload .btn { font-size: .85rem; padding: .4rem .7rem; }
.gal-ai {
  background: var(--gray-1); border-left: 3px solid var(--accent); border-radius: 4px;
  padding: .5rem .7rem; font-size: .8rem; margin-top: .4rem; max-height: 220px; overflow: auto;
}

/* Umfragen-Button + Modal */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--accent); color: var(--white); font-size: .72rem; font-weight: 700;
  vertical-align: middle;
}
.polls-modal-body { max-height: 75vh; overflow-y: auto; }
.polls-modal-body .poll-card { box-shadow: none; border: 1px solid var(--gray-3); }
.polls-modal-body .new-poll { margin-top: 1rem; }
.polls-modal-body .new-poll form { box-shadow: none; border: 1px solid var(--gray-3); }

/* QR-Code Handy-Upload */
.qr-body { text-align: center; }
.qr-body img { border: 1px solid var(--gray-3); border-radius: 8px; margin: .5rem auto; display: block; }
.qr-url { word-break: break-all; font-family: monospace; font-size: .75rem; }

/* Bild-Grossansicht */
.modal-xl { max-width: 900px; }
.img-zoom { max-height: 80vh; overflow: auto; }
.img-zoom img { width: 100%; height: auto; border-radius: 6px; display: block; }

/* Zoom-Ansicht */
.modal-lg { max-width: 780px; }
.modal-head-actions { display: flex; gap: 1rem; align-items: center; white-space: nowrap; }
.note-zoom {
  min-height: 240px; max-height: 70vh; overflow: auto;
  font-size: 1rem; line-height: 1.65; border-radius: 0 0 var(--radius) var(--radius);
}
.note-zoom ul, .note-zoom ol { margin: .35rem 0; padding-left: 1.5rem; }

/* Vollbild-Modus: Notiz fixieren und live verfolgen */
.modal-backdrop.full { padding: 0; }
.modal-backdrop.full .modal {
  max-width: none; width: 100vw; height: 100vh; max-height: 100vh;
  border-radius: 0; display: flex; flex-direction: column;
}
.modal-backdrop.full .modal-body { flex: 1; max-height: none; }
.modal-backdrop.full .note-zoom {
  max-height: none; font-size: 1.25rem; line-height: 1.75;
  padding: 2rem 8vw;
}

/* Praesenz */
#presence-bar { display: flex; gap: .35rem; flex-wrap: wrap; }
.presence-chip {
  background: var(--gray-1); border: 1px solid var(--gray-3); border-radius: 999px;
  padding: .15rem .6rem .15rem 1.4rem; font-size: .75rem; position: relative;
}
.presence-chip::before {
  content: ''; position: absolute; left: .5rem; top: 50%; transform: translateY(-50%);
  width: 8px; height: 8px; border-radius: 50%; background: #2eb85c;
}
.presence-chip.me { border-color: var(--accent); }

/* Sync-Indikator */
.sync-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: #2eb85c; vertical-align: middle;
  animation: pulse 2s infinite;
}
.sync-dot.off { background: var(--red); animation: none; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

/* Umfrage-Popup */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 5000;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal {
  background: var(--white); border-radius: var(--radius); box-shadow: 0 10px 40px rgba(0,0,0,.35);
  width: 100%; max-width: 440px; border-top: 4px solid var(--accent);
  animation: notePop .3s ease;
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: .9rem 1.25rem; border-bottom: 1px solid var(--gray-1); font-weight: 700;
}
.modal-body { padding: 1rem 1.25rem 1.25rem; }

/* Umfrage-Zielauswahl */
.target-box { border: 1px solid var(--gray-3); border-radius: var(--radius); padding: .5rem .9rem; margin: .75rem 0; }
.target-box legend { font-size: .8rem; padding: 0 .3rem; color: var(--gray-6); }
.target-box .chk-inline { margin: .25rem 0; }
.poll-vote { margin-top: .5rem; }

/* ---------- "Frag den Workshop" ---------- */
.ask-form { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.ask-form select { width: auto; min-width: 200px; margin: 0; }
.ask-form input[type=text] { flex: 1; min-width: 260px; margin: 0; }
#ask-status { margin-top: .5rem; }
.ask-item { border-top: 1px solid var(--gray-1); margin-top: 1rem; padding-top: .75rem; }
.ask-q { font-weight: 700; margin-bottom: .35rem; }
.ask-a { background: var(--gray-1); border-left: 3px solid var(--accent); border-radius: 4px; padding: .75rem 1rem; }

/* ---------- Ladeindikator ---------- */
.spinner {
  display: inline-block; width: 16px; height: 16px; border: 2px solid var(--gray-3);
  border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }
