/* ════════════════════════════════════════════════════════════════════
   Kunden-Portal — Design-System
   Hell, ruhig, vertrauenswuerdig. Bewusste Tokens statt Default-Tailwind.
   ════════════════════════════════════════════════════════════════════ */

:root {
  /* Farben (OKLCH-tauglich gedacht, hier als hsl/hex fuer breite Compat) */
  --bg:        #f6f7f9;
  --surface:   #ffffff;
  --surface-2: #f0f2f5;
  --border:    #e2e6eb;
  --border-strong: #cfd5dd;

  --text:      #14181f;
  --text-soft: #525a66;
  --text-faint:#8b94a1;

  --brand:     #2b6ef2;   /* Lukas-Blau */
  --brand-600: #1f57c8;
  --brand-tint:#e9f0fe;

  --green:     #1f9d5b;
  --green-tint:#e6f6ee;
  --red:       #d93a3a;
  --red-tint:  #fdecec;
  --amber:     #c97a11;
  --amber-tint:#fdf3e3;

  --ring:      var(--brand);

  /* Typo */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", monospace;

  /* Radius + Schatten (weicher, mehrschichtig = mehr Tiefe) */
  --r-sm: 9px;
  --r:    15px;
  --r-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(18, 24, 31, .05), 0 2px 6px rgba(18, 24, 31, .04);
  --shadow:    0 2px 8px rgba(18, 24, 31, .05), 0 12px 28px rgba(18, 24, 31, .07);
  --shadow-lg: 0 8px 24px rgba(18, 24, 31, .08), 0 30px 70px rgba(18, 24, 31, .14);
  --brand-grad: linear-gradient(135deg, #3b7bff 0%, #2b6ef2 55%, #1f57c8 100%);

  /* Layout */
  --maxw: 1080px;
  --header-h: 64px;
}

* { box-sizing: border-box; }

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(900px 480px at 100% -5%, #eef3ff, transparent 60%),
    radial-gradient(700px 420px at -10% 8%, #f0f4fb, transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.14; letter-spacing: -0.02em; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.55rem); font-weight: 700; }
h2 { font-size: clamp(1.3rem, 1.05rem + 1.1vw, 1.7rem); font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }
p  { margin: 0; text-wrap: pretty; }

a { color: var(--brand-600); text-underline-offset: 3px; }

/* ── Globaler Focus-Ring (A11y, aus dem Review-Learning) ───────────── */
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Skip-Link */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
  background: var(--text);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--r-sm);
}

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn {
  --_bg: var(--surface);
  --_fg: var(--text);
  --_bd: var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 560;
  font-size: 0.95rem;
  line-height: 1;
  padding: 11px 18px;
  border-radius: var(--r-sm);
  border: 1px solid var(--_bd);
  background: var(--_bg);
  color: var(--_fg);
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease,
              color .16s ease, box-shadow .16s ease, transform .06s ease;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary {
  --_fg: #fff;
  --_bd: transparent;
  background: var(--brand-grad);
  box-shadow: 0 1px 2px rgba(31, 87, 200, .25), 0 6px 16px rgba(43, 110, 242, .28);
}
.btn-primary:hover { background: var(--brand-grad); filter: brightness(1.06); box-shadow: 0 2px 4px rgba(31, 87, 200, .28), 0 10px 24px rgba(43, 110, 242, .34); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost { --_bg: transparent; --_bd: transparent; }
.btn-ghost:hover { background: var(--surface-2); }

.btn-danger { --_fg: var(--red); --_bd: var(--border-strong); }
.btn-danger:hover { background: var(--red-tint); border-color: var(--red); }

.btn-block { width: 100%; }
.btn-lg { padding: 14px 22px; font-size: 1rem; }

/* ── Formular-Elemente ─────────────────────────────────────────────── */
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field > label { font-weight: 560; font-size: 0.9rem; color: var(--text); }
.hint { font-size: 0.82rem; color: var(--text-faint); }

input[type="email"], input[type="password"], input[type="text"],
select, textarea {
  font: inherit;
  width: 100%;
  padding: 11px 13px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  color: var(--text);
  transition: border-color .16s ease, box-shadow .16s ease;
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-tint);
}
textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23525a66' d='M6 8 0 1.4 1.4 0 6 5.2 10.6 0 12 1.4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

/* ── Cards / Panels ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}

/* ── Badges ────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.78rem; font-weight: 600;
  padding: 3px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-soft);
}
.badge-pending { background: var(--amber-tint); color: var(--amber); }
.badge-done    { background: var(--green-tint); color: var(--green); }
.badge-rejected{ background: var(--red-tint);   color: var(--red); }

/* ── Toast / Feedback ──────────────────────────────────────────────── */
.toast-wrap {
  position: fixed; right: 18px; bottom: 18px; z-index: 200;
  display: grid; gap: 10px; max-width: min(92vw, 380px);
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--text); color: #fff;
  padding: 13px 16px; border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  animation: toast-in .22s ease;
}
.toast-success { background: #14543a; }
.toast-error   { background: #7d1f1f; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── Utilities ─────────────────────────────────────────────────────── */
.muted { color: var(--text-soft); }
.faint { color: var(--text-faint); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ════════════════════════════════════════════════════════════════════
   Login-Seite
   ════════════════════════════════════════════════════════════════════ */
.login-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 15% -10%, var(--brand-tint), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, #eef4ff, transparent 55%),
    var(--bg);
}
.login-card {
  width: 100%;
  max-width: 410px;
  padding: clamp(26px, 4vw, 38px);
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}
.login-brand {
  display: flex; align-items: center; gap: 11px;
  margin-bottom: 26px;
}
.login-brand .logo { width: 40px; height: 40px; }
.login-brand b { font-size: 1.05rem; letter-spacing: -0.01em; }
.login-brand span { display: block; font-size: 0.8rem; color: var(--text-faint); }
.login-card h1 { font-size: 1.5rem; margin-bottom: 6px; }
.login-card .sub { color: var(--text-soft); margin-bottom: 26px; font-size: 0.95rem; }
.form-error {
  display: none;
  margin-bottom: 16px; padding: 11px 14px;
  background: var(--red-tint); color: var(--red);
  border: 1px solid #f3c2c2; border-radius: var(--r-sm);
  font-size: 0.88rem;
}
.form-error.show { display: block; }
.login-foot { margin-top: 22px; text-align: center; font-size: 0.82rem; color: var(--text-faint); }

/* ════════════════════════════════════════════════════════════════════
   Portal-Shell
   ════════════════════════════════════════════════════════════════════ */
.app-header {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 clamp(16px, 4vw, 32px);
  background: rgba(255, 255, 255, .72);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(226, 230, 235, .8);
  box-shadow: 0 1px 0 rgba(255,255,255,.6), 0 6px 20px -12px rgba(18,24,31,.18);
}
.app-header .brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-family: var(--font-display); letter-spacing: -0.01em; }
.app-header .brand .logo { width: 30px; height: 30px; }
.app-header .project-name { color: var(--text-soft); font-weight: 500; }
.app-header .spacer { flex: 1; }
.app-header .user-chip {
  font-size: 0.85rem; color: var(--text-soft);
  display: none;
}
@media (min-width: 620px) { .app-header .user-chip { display: inline; } }

.shell { max-width: var(--maxw); margin: 0 auto; padding: clamp(20px, 4vw, 38px) clamp(16px, 4vw, 32px) 80px; }

.page-head { margin-bottom: 26px; }
.page-head h1 { margin-bottom: 6px; }
.page-head p { color: var(--text-soft); max-width: 60ch; }

/* ── Tabs ──────────────────────────────────────────────────────────── */
.tabs {
  position: sticky; top: var(--header-h); z-index: 30;
  display: flex; gap: 10px;
  padding: 11px clamp(16px, 4vw, 32px);
  background: rgba(247, 248, 250, .72);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid rgba(226, 230, 235, .7);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
/* zentriert die Gruppe; bei Overflow auf Mobile bleibt sie scrollbar */
.tab:first-child { margin-left: auto; }
.tab:last-child  { margin-right: auto; }
.tab {
  --_tint: var(--surface-2);
  --_fg: var(--text-soft);
  --_active-bg: var(--surface);
  --_active-bd: var(--border);
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: var(--_tint);
  color: var(--_fg);
  font: inherit; font-weight: 560; font-size: 0.92rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
/* leicht unterschiedliche Farb-Hinterlegung pro Tab */
.tab[data-tab="editor"] { --_tint: rgba(43,110,242,.09);  --_fg: #1f57c8; --_active-bg: rgba(43,110,242,.15);  --_active-bd: rgba(43,110,242,.45); }
.tab[data-tab="wishes"] { --_tint: rgba(124,77,229,.10);  --_fg: #6a34c9; --_active-bg: rgba(124,77,229,.16);  --_active-bd: rgba(124,77,229,.45); }
.tab[data-tab="upload"] { --_tint: rgba(13,148,107,.11);  --_fg: #0c7a55; --_active-bg: rgba(13,148,107,.17);  --_active-bd: rgba(13,148,107,.45); }
.tab[data-tab="posts"]  { --_tint: rgba(201,122,17,.12);  --_fg: #b0680f; --_active-bg: rgba(201,122,17,.18);  --_active-bd: rgba(201,122,17,.45); }
.tab:hover { background: var(--_active-bg); }
.tab[aria-selected="true"] {
  background: var(--_active-bg);
  color: var(--_fg);
  border-color: var(--_active-bd);
  box-shadow: var(--shadow-sm);
  font-weight: 650;
}
.tab .tab-icon { width: 18px; height: 18px; }
/* hidden-Attribut MUSS gewinnen (sonst zeigt .tab den Tab trotzdem an) */
.tab[hidden], [hidden] { display: none !important; }

.tabpanel { display: none; }
.tabpanel.active { display: block; animation: fade-in .2s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── Empty / Loading states ────────────────────────────────────────── */
.state {
  display: grid; place-items: center; text-align: center;
  gap: 10px; padding: 56px 24px; color: var(--text-soft);
}
.state .state-icon { font-size: 2rem; }
.state h3 { color: var(--text); }

/* ════════════════════════════════════════════════════════════════════
   Seite 1 — Website-Editor
   ════════════════════════════════════════════════════════════════════ */
.editor-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r);
}
.editor-bar .count {
  font-size: 0.85rem; color: var(--text-soft);
  background: var(--surface-2); padding: 5px 11px; border-radius: 999px;
}
.editor-bar .count b { color: var(--brand-600); }
/* Buehne: Vorschau links + Austausch-Spalte rechts. Die ganze Portal-Seite
   scrollt; der iframe hat volle Inhaltshoehe (keine eigene Box), die Spalte
   klebt per sticky daneben. */
.editor-stage { display: flex; gap: 16px; align-items: flex-start; }
.editor-frame-wrap {
  position: relative; flex: 1; min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  min-height: 420px;
}
/* Hoehe wird per JS auf die volle Inhaltshoehe gesetzt -> die Portal-Seite scrollt */
.editor-frame { width: 100%; height: auto; min-height: 420px; border: 0; display: block; background: #fff; }

.editor-side {
  width: 268px; flex-shrink: 0;
  position: sticky; top: 16px; align-self: flex-start;
  max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 14px;
}
.editor-side .gallery-head h2 { font-size: 1.02rem; }
/* Austausch-Spalte: Bilder nach Abschnitt/Panel gruppiert, je Gruppe nebeneinander */
.editor-side-grouped { display: block; }
.side-group-head {
  font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-soft); margin: 16px 0 7px;
}
.side-group-head:first-child { margin-top: 0; }
.side-group-row {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px;
}
@media (max-width: 860px) {
  .editor-stage { flex-direction: column; }
  .editor-side { width: 100%; position: static; max-height: none; order: -1; }
  .side-group-row { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
}

/* Edit-Popover */
.edit-pop {
  position: fixed; z-index: 90;
  width: min(420px, 92vw);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  padding: 16px;
}
.edit-pop h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); margin-bottom: 10px; }
.edit-pop .loc { font-size: 0.82rem; color: var(--text-soft); margin-bottom: 10px; word-break: break-word; }
.edit-pop textarea { min-height: 90px; margin-bottom: 12px; }
.edit-pop .row { display: flex; gap: 8px; justify-content: flex-end; }

/* ════════════════════════════════════════════════════════════════════
   Seite 3 — Bilder-Upload
   ════════════════════════════════════════════════════════════════════ */
.dropzone {
  display: grid; place-items: center; gap: 10px; text-align: center;
  padding: 44px 24px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease, color .16s ease;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--brand); color: var(--text); }
.dropzone.dragover { border-color: var(--brand); background: var(--brand-tint); color: var(--brand-600); }
.dropzone .dz-icon { font-size: 2.1rem; }
.dropzone .dz-main { font-weight: 600; color: var(--text); }

.upload-list { display: grid; gap: 12px; margin-top: 18px; }
.upload-item {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center;
  padding: 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface);
}
.upload-item img { width: 56px; height: 56px; object-fit: cover; border-radius: var(--r-sm); background: var(--surface-2); }
.upload-item .meta { min-width: 0; }
.upload-item .fname { font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item .fsize { font-size: 0.8rem; color: var(--text-faint); }
.upload-item .prog { height: 5px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 7px; }
.upload-item .prog > span { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s ease; }

/* ── Galerie (Self-Service: hochladen + loeschen) ──────────────────── */
.gallery-selector-row { display: flex; gap: 8px; align-items: center; }
.gallery-selector-row select { flex: 1; min-width: 0; }
.gallery-selector-row .btn { flex: 0 0 auto; white-space: nowrap; }
.gallery-wrap { margin-top: 26px; }
.gallery-head { display: flex; align-items: baseline; gap: 10px; }
.gallery-head h2 { font-size: 1.05rem; }
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}
.gallery-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease, opacity .2s ease;
}
.gallery-item:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.gallery-item img,
.gallery-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Video-Kachel: kleines ▶-Abzeichen unten rechts */
.gallery-item--video { background: #0c1116; }
.kp-media-badge {
  position: absolute; bottom: 4px; right: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(8, 12, 16, .72); color: #fff;
  display: grid; place-items: center; font-size: 10px; line-height: 1;
  pointer-events: none;
}
.gallery-item.deleting { opacity: .4; pointer-events: none; }
.gallery-item.kp-grid-done { outline: 3px solid var(--green); outline-offset: 1px; }
/* "+"-Kachel: leerer Rahmen zum Hinzufuegen eines neuen Bildes */
.gallery-item.gallery-add {
  display: grid; place-items: center; cursor: pointer;
  border: 2px dashed var(--border); background: var(--surface-2);
  color: var(--muted); box-shadow: none;
}
.gallery-item.gallery-add:hover,
.gallery-item.gallery-add:focus-visible {
  border-color: var(--brand); color: var(--brand);
  background: rgba(43, 110, 242, .06); transform: translateY(-2px);
}
.gallery-add-plus { font-size: 30px; line-height: 1; font-weight: 300; }
/* frisch hinzugefuegtes Bild markieren */
.gallery-item.kp-add-new { position: relative; }
.kp-add-badge {
  position: absolute; bottom: 4px; left: 4px;
  background: var(--green); color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 6px; line-height: 1.4;
}
/* Galerie-Fotos gross, wie auf der Website */
.gallery.gallery--large { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.gallery--large .gallery-item { aspect-ratio: 4 / 3; }
.gallery--large .gallery-act, .gallery--large .gallery-del { width: 32px; height: 32px; font-size: 15px; }
.gallery-del {
  position: absolute; top: 6px; right: 6px;
  width: 28px; height: 28px; border-radius: 8px;
  border: 0; cursor: pointer;
  background: rgba(18, 24, 31, .6); color: #fff;
  font-size: 13px; line-height: 1;
  display: grid; place-items: center;
  opacity: 0; transform: scale(.9);
  transition: opacity .12s ease, transform .12s ease, background-color .12s ease;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.gallery-item:hover .gallery-del, .gallery-del:focus-visible { opacity: 1; transform: scale(1); }
.gallery-del:hover { background: var(--red); }
@media (hover: none) { .gallery-del { opacity: 1; } } /* Touch: Loeschen immer sichtbar */

/* Austausch-Knopf (oben links) */
.gallery-act {
  position: absolute; top: 6px; left: 6px;
  width: 28px; height: 28px; border-radius: 8px;
  border: 0; cursor: pointer;
  background: rgba(18, 24, 31, .6); color: #fff;
  font-size: 13px; line-height: 1;
  display: grid; place-items: center;
  opacity: 0; transform: scale(.9);
  transition: opacity .12s ease, transform .12s ease, background-color .12s ease;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.gallery-item:hover .gallery-act, .gallery-act:focus-visible { opacity: 1; transform: scale(1); }
.gallery-act:hover { background: var(--brand); }
@media (hover: none) { .gallery-act { opacity: 1; } }

/* ── Beiträge (Posts: erstellen / bearbeiten / loeschen) ───────────── */
.btn-sm { padding: 7px 13px; font-size: 0.85rem; }

.post-form { padding: 20px; margin-bottom: 26px; }
.post-img-row { display: flex; gap: 8px; flex-wrap: wrap; }
.post-form-preview {
  display: block; margin-top: 12px;
  max-height: 220px; width: auto; max-width: 100%;
  border-radius: var(--r-sm); border: 1px solid var(--border); object-fit: cover;
}
.post-form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }

.posts-list { display: grid; gap: 16px; }
.post-card {
  display: grid; grid-template-columns: 160px 1fr; gap: 0;
  border: 1px solid var(--border); border-radius: var(--r);
  background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden;
  transition: opacity .2s ease, box-shadow .12s ease;
}
.post-card:hover { box-shadow: var(--shadow); }
.post-card.deleting { opacity: .4; pointer-events: none; }
.post-card-img { width: 100%; height: 100%; min-height: 130px; object-fit: cover; display: block; background: var(--surface-2); }
.post-card-body { padding: 16px 18px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.post-card-body h3 { font-size: 1.1rem; }
.post-card-text { color: var(--text-soft); white-space: pre-wrap; word-break: break-word; }
.post-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 6px; flex-wrap: wrap; }
.post-card-actions { display: flex; gap: 6px; }
.post-card:not(:has(.post-card-img)) { grid-template-columns: 1fr; }

@media (max-width: 560px) {
  .post-card { grid-template-columns: 1fr; }
  .post-card-img { max-height: 200px; min-height: 0; }
}

/* ── Aktivitaets-Liste (changes) ───────────────────────────────────── */
.activity { display: grid; gap: 10px; margin-top: 22px; }
.activity h2 { font-size: 1rem; margin-bottom: 4px; }
.act-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 15px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface);
}
.act-item .act-icon { font-size: 1.1rem; line-height: 1.4; }
.act-item .act-body { flex: 1; min-width: 0; }
.act-item .act-loc { font-weight: 560; font-size: 0.92rem; }
.act-item .act-detail { font-size: 0.86rem; color: var(--text-soft); word-break: break-word; }
.act-item .act-time { font-size: 0.78rem; color: var(--text-faint); margin-top: 2px; }

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 560px) {
  .upload-item { grid-template-columns: 44px 1fr; }
  .upload-item img { width: 44px; height: 44px; }
  .upload-item .actions { grid-column: 1 / -1; }
}
