/* ══════════════════════════════════════════════════════════════════════════
   PN-DETAIL — Beitrags-Detailseite (/beitrag/<id>) und die Bearbeiten-Seiten
   (/beitrag/<id>/edit, /kommentar/<id>/edit) im gemeinsamen PlayedNow-Design.
   ──────────────────────────────────────────────────────────────────────────
   Bausteine (Karte, Kicker, Folgen-Pille, Formularelemente) kommen aus
   pn-ui.css; hier nur Layout und die Angleichung der Altklassen aus
   theme.v2.css. Alles ist auf body.pn-ui begrenzt, kein !important.

   Grundsaetze (Feedback Daniel):
   · Genau EIN Rahmen je Flaeche; Unterteilungen nur per Abstand, Flaeche
     oder feiner Linie (#F3F4F6) — kein Kaestchen im Kaestchen.
   · Georgia fuer Titel, Live-Farben unveraendert.
   · Touch-Ziele >= 44px, Metadaten >= 12px, kein Ueberlauf ab 320px.
   ══════════════════════════════════════════════════════════════════════════ */

/* ══ Detailseite ════════════════════════════════════════════════════════ */
body.pn-ui.detail-page {
  --pn-detail-pad: clamp(1rem, 0.7rem + 1.5vw, 1.75rem);
  --pn-detail-line: #F3F4F6;
}

body.pn-ui.detail-page .detail-container.pn-page { padding-top: 1rem; }

/* Zurueck: Textlink mit 44px Trefferflaeche */
body.pn-ui.detail-page .back-link {
  display: inline-flex; align-items: center;
  min-height: 44px; margin: 0 0 0.5rem;
  font-size: 0.875rem; font-weight: 600; color: var(--bsn);
  text-decoration: none;
}
body.pn-ui.detail-page .back-link:hover { text-decoration: underline; text-underline-offset: 3px; }
body.pn-ui.detail-page .back-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* Die Beitragskarte: eine .pn-surface mit genau einem Rahmen */
body.pn-ui.detail-page .detail-card.pn-surface {
  display: flex; flex-direction: column;
  position: relative;
  overflow: visible;
  padding: var(--pn-detail-pad);
}
body.pn-ui.detail-page .detail-card .pn-card__eyebrow { margin: 0 0 1rem; }

/* Ausverkauft-Band: im Fluss statt absolut, folgt der Kartenrundung */
body.pn-ui.detail-page .detail-card .detail-ausverkauft-banner {
  position: static;
  margin: calc(-1 * var(--pn-detail-pad)) calc(-1 * var(--pn-detail-pad)) 1rem;
  border-radius: 15px 15px 0 0;
  font-size: 0.8125rem;
}
body.pn-ui.detail-page .detail-card .detail-ausverkauft-banner .badge-title { font-size: 0.75rem; }

/* Medien: eingerueckt (Kartenabstand), gerundet, ohne Rahmen */
body.pn-ui.detail-page .detail-card .detail-media {
  display: flex; flex-direction: column; gap: 0.75rem;
  margin: 0 0 1.25rem;
}
body.pn-ui.detail-page .detail-card .detail-media-img,
body.pn-ui.detail-page .detail-card .detail-media-video {
  display: block; width: 100%; margin: 0;
  border-radius: var(--pn-radius-sm);
}
body.pn-ui.detail-page .detail-card .detail-media-img { height: auto; cursor: zoom-in; }
body.pn-ui.detail-page .detail-card .detail-media-audio { width: 100%; margin: 0; }

/* Galerie (Snap-Scroll) */
body.pn-ui.detail-page .detail-gallery { position: relative; margin: 0 0 1.25rem; }
body.pn-ui.detail-page .gallery-track {
  display: flex; gap: 0.5rem;
  overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-radius: var(--pn-radius-sm);
}
body.pn-ui.detail-page .gallery-track::-webkit-scrollbar { display: none; }
body.pn-ui.detail-page .gallery-slide {
  flex: 0 0 100%; scroll-snap-align: center;
  display: flex; align-items: center; justify-content: center;
  min-width: 0;
  background: var(--bg);
  border-radius: var(--pn-radius-sm);
  overflow: hidden;
}
body.pn-ui.detail-page .gallery-img {
  display: block; width: 100%; height: auto;
  max-height: 70vh; object-fit: contain;
  cursor: zoom-in;
}
body.pn-ui.detail-page .gallery-video,
body.pn-ui.detail-page .gallery-audio { width: 100%; }
body.pn-ui.detail-page .gallery-dots { display: flex; justify-content: center; gap: 6px; margin-top: 0.6rem; }
body.pn-ui.detail-page .gallery-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #D1D5DB;
  transition: background-color 0.2s ease;
}
body.pn-ui.detail-page .gallery-dot.active { background: var(--bsn); }
body.pn-ui.detail-page .gallery-count {
  position: absolute; top: 0.6rem; right: 0.6rem;
  display: inline-flex; align-items: center; gap: 0.2rem;
  padding: 0.2rem 0.6rem;
  background: rgba(42, 51, 63, 0.85); color: #fff;
  border-radius: 999px;
  font-size: 0.75rem; font-weight: 700;
  pointer-events: none;
}
body.pn-ui.detail-page .gallery-arrow {
  position: absolute; top: 50%; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; padding: 0;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4); color: #fff;
  border: 0; border-radius: 50%;
  font: inherit; font-size: 1.5rem; font-weight: 700; line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
body.pn-ui.detail-page .gallery-arrow:hover { background: rgba(0, 0, 0, 0.65); }
body.pn-ui.detail-page .gallery-arrow:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body.pn-ui.detail-page .gallery-arrow.left { left: 0.6rem; }
body.pn-ui.detail-page .gallery-arrow.right { right: 0.6rem; }
@media (max-width: 768px) {
  body.pn-ui.detail-page .gallery-arrow { display: none; }
}

/* Lightbox */
body.pn-ui.detail-page .gallery-lightbox {
  position: fixed; inset: 0; z-index: 9999;
  display: none; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.92);
  cursor: zoom-out;
}
body.pn-ui.detail-page .gallery-lightbox.open { display: flex; }
body.pn-ui.detail-page .gallery-lightbox img { max-width: 96vw; max-height: 94vh; object-fit: contain; border-radius: 8px; }
body.pn-ui.detail-page .gallery-lightbox .lb-hint {
  position: absolute; bottom: 1.2rem; left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.75); font-size: 0.8125rem;
}

/* Titel: nur echter Spieltitel sichtbar, in Georgia, nie gekuerzt */
body.pn-ui.detail-page .detail-card .pn-card__title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.6rem, 1.25rem + 1.4vw, 2.2rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

body.pn-ui.detail-page .detail-card .detail-source-lang {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem; color: var(--muted);
}

/* Halle: kleine dunkle Pille (Flaeche, kein Rahmen) */
body.pn-ui.detail-page .detail-card .detail-halle {
  display: inline-flex; align-items: center; gap: 0.3rem;
  align-self: flex-start;
  margin: 0 0 1rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8125rem;
}
body.pn-ui.detail-page .detail-card.has-banner .detail-halle { margin-top: 0; }
body.pn-ui.detail-page .detail-halle svg { flex: 0 0 auto; }

body.pn-ui.detail-page .detail-card .detail-content {
  margin: 0 0 1rem;
  font-size: 1.0625rem; line-height: 1.7;
  color: var(--pn-ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
body.pn-ui.detail-page .detail-content .detail-link {
  color: var(--bsn); text-decoration: underline; text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

body.pn-ui.detail-page .detail-card .detail-edit-link { align-self: flex-start; margin: 0 0 0.5rem; }

/* Autorzeile + Aktionen wie card-meta der Spielkarte */
body.pn-ui.detail-page .detail-card .card-meta {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--pn-detail-line);
}
body.pn-ui.detail-page .detail-card .meta-author { font-size: 0.875rem; }
body.pn-ui.detail-page .detail-card .meta-author-name a {
  color: inherit; text-decoration: none;
}
body.pn-ui.detail-page .detail-card .meta-author-name a:hover { text-decoration: underline; text-underline-offset: 2px; }
body.pn-ui.detail-page .detail-card .meta-author-name a:focus-visible,
body.pn-ui.detail-page .detail-card .detail-avatar-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
/* Avatar-Link: 44px Trefferflaeche bei 32px Bild (Abstand per negativem Rand ausgeglichen) */
body.pn-ui.detail-page .detail-card .detail-avatar-link {
  display: inline-flex; flex: 0 0 auto;
  padding: 6px; margin: -6px;
  text-decoration: none;
}
body.pn-ui.detail-page .detail-card .meta-date { font-size: 0.8125rem; }

/* Like, Aufrufe, Teilen, Merken: 44px, gleicher Stil wie in der Karte */
body.pn-ui.detail-page .detail-actions .detail-like-btn,
body.pn-ui.detail-page .detail-actions .detail-share-btn,
body.pn-ui.detail-page .detail-actions .detail-bm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
  min-width: 44px; min-height: 44px;
  padding: 0 0.6rem;
  background: none; border: 0; border-radius: 999px;
  font-family: inherit; font-size: 0.8125rem; font-weight: 600; line-height: 1.2;
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, color 0.15s ease;
}
body.pn-ui.detail-page .detail-actions .detail-like-btn:hover,
body.pn-ui.detail-page .detail-actions .detail-share-btn:hover,
body.pn-ui.detail-page .detail-actions .detail-bm-btn:hover { background: var(--bg); color: var(--bsn); }
body.pn-ui.detail-page .detail-actions .detail-like-btn:focus-visible,
body.pn-ui.detail-page .detail-actions .detail-share-btn:focus-visible,
body.pn-ui.detail-page .detail-actions .detail-bm-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body.pn-ui.detail-page .detail-actions .detail-like-btn.liked { color: #B91C1C; }
body.pn-ui.detail-page .detail-actions svg { flex: 0 0 auto; }
body.pn-ui.detail-page .detail-actions .detail-share-btn svg { stroke: currentColor; }
body.pn-ui.detail-page .detail-actions .detail-share-btn { margin-left: auto; }
body.pn-ui.detail-page .detail-actions .detail-views {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0 0.4rem;
  font-size: 0.8125rem;
  color: var(--muted);
}
body.pn-ui.detail-page .detail-actions .detail-views svg { stroke: currentColor; }
/* Schmale Screens: Wort "Aufrufe" (und unter 360px auch "Teilen") nur fuer
   Screenreader, damit Like, Teilen und Merken in jeder Sprache in einer Zeile
   bleiben. Der Teilen-Knopf behaelt sein aria-label. */
@media (max-width: 360px) {
  body.pn-ui.detail-page .detail-share-btn__label {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%);
    white-space: nowrap; border: 0;
  }
}
@media (max-width: 420px) {
  body.pn-ui.detail-page .detail-views__label {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%);
    white-space: nowrap; border: 0;
  }
}

/* ── Kommentare: eigene Flaeche, ruhige Liste ohne Kaestchen ───────────── */
body.pn-ui.detail-page .comments-section.pn-surface {
  max-width: none;
  margin: 1.5rem 0 0;
  padding: var(--pn-detail-pad);
}
body.pn-ui.detail-page .comments-heading {
  margin: 0 0 1rem;
  font-family: var(--pn-serif);
  font-size: 1.4rem; font-weight: 400; line-height: 1.2;
  color: var(--bsn);
}

body.pn-ui.detail-page .comments-section .comment-item {
  margin: 0;
  padding: 0.9rem 0 0.4rem;
  background: none;
  border-radius: 0;
  border-top: 1px solid var(--pn-detail-line);
  min-width: 0;
}
body.pn-ui.detail-page .comment-list > .comment-item:first-child { padding-top: 0; border-top: 0; }
body.pn-ui.detail-page .comments-section .comment-children {
  margin: 0.25rem 0 0;
  padding-left: 1.25rem;
  border-left: 0;
}
body.pn-ui.detail-page .comments-section .comment-children[hidden] { display: none; }
/* Ab der dritten Ebene nicht weiter einruecken (kein Ueberlauf auf 320px) */
body.pn-ui.detail-page .comments-section .comment-children .comment-children .comment-children { padding-left: 0; }
@media (max-width: 560px) {
  body.pn-ui.detail-page .comments-section .comment-children { padding-left: 0.75rem; }
}
/* Redaktion: dezente Flaeche statt Rahmen; nur oben ein Orange-Balken links
   (Farbe/Balken setzt das Bestands-Attribut, hier nur Abstaende). */
body.pn-ui.detail-page .comments-section .comment-item.comment-redaktion {
  margin-top: 0.4rem;
  padding: 0.75rem 0.85rem 0.35rem;
  background: #FFF6F0;
  border-top-color: transparent;
  border-radius: var(--pn-radius-sm);
}
body.pn-ui.detail-page .comments-section .comment-item.comment-redaktion--top { padding-left: 0.9rem; }

body.pn-ui.detail-page .comment-header {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0.25rem 0.5rem;
  margin: 0 0 0.3rem;
  min-width: 0;
}
body.pn-ui.detail-page .comment-avatar,
body.pn-ui.detail-page .comment-avatar-img {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
}
body.pn-ui.detail-page .comment-avatar-img { object-fit: cover; }
body.pn-ui.detail-page .comment-avatar {
  background: var(--bsn); color: #fff;
  font-size: 0.75rem; font-weight: 700;
}
body.pn-ui.detail-page .comment-author {
  min-width: 0;
  font-size: 0.875rem; font-weight: 700;
  color: var(--bsn);
  overflow-wrap: anywhere;
}
body.pn-ui.detail-page .comment-badge {
  display: inline-flex; align-items: center;
  padding: 0.1rem 0.55rem;
  background: var(--accent); color: var(--bsn);
  border-radius: 999px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em;
}
body.pn-ui.detail-page .comment-date { font-size: 0.78rem; color: var(--muted); }
body.pn-ui.detail-page .comment-source-lang { margin: 0 0 0.25rem; font-size: 0.78rem; color: var(--muted); }
body.pn-ui.detail-page .comment-text {
  margin: 0;
  font-size: 0.95rem; line-height: 1.55;
  color: var(--pn-ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
body.pn-ui.detail-page .comment-annotation {
  display: flex; align-items: flex-start; gap: 0.5rem;
  margin-top: 0.6rem;
  padding: 0.6rem 0.8rem;
  background: var(--bsn); color: #fff;
  border-radius: var(--pn-radius-sm);
  font-size: 0.82rem; line-height: 1.5;
}
body.pn-ui.detail-page .comment-annotation svg { flex: 0 0 auto; margin-top: 1px; }
body.pn-ui.detail-page .comment-media { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
body.pn-ui.detail-page .comment-media-open {
  display: inline-flex; padding: 0;
  background: none; border: 0; border-radius: 8px;
  cursor: zoom-in;
}
body.pn-ui.detail-page .comment-media-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body.pn-ui.detail-page .comment-media-img { display: block; min-width: 44px; min-height: 44px; }

/* Kommentar-Aktionen: randlose Textknoepfe mit 44px */
body.pn-ui.detail-page .comment-actions {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0.15rem;
  margin: 0.2rem 0 0 -0.6rem;
}
body.pn-ui.detail-page .comment-actions .comment-like-btn,
body.pn-ui.detail-page .comment-actions .reply-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
  min-width: 44px; min-height: 44px;
  margin: 0;
  padding: 0 0.6rem;
  background: none; border: 0; border-radius: 999px;
  font-family: inherit; font-size: 0.8125rem; font-weight: 600; line-height: 1.2;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
body.pn-ui.detail-page .comment-actions .toggle-replies { color: var(--bsn); }
body.pn-ui.detail-page .comment-actions .comment-like-btn:hover,
body.pn-ui.detail-page .comment-actions .reply-btn:hover { background: var(--bg); color: var(--bsn); opacity: 1; text-decoration: none; }
body.pn-ui.detail-page .comment-actions .comment-like-btn:focus-visible,
body.pn-ui.detail-page .comment-actions .reply-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body.pn-ui.detail-page .comment-actions .comment-like-btn.liked { color: #B91C1C; }

/* Kommentar-Formular mit pn-input / pn-btn--dark */
body.pn-ui.detail-page .comment-form {
  display: flex; flex-direction: column; gap: 0.75rem;
  margin-top: 1.25rem;
}
body.pn-ui.detail-page .comment-list + .comment-form {
  padding-top: 1.25rem;
  border-top: 1px solid var(--pn-detail-line);
}
body.pn-ui.detail-page .comment-form .pn-input { width: 100%; }
body.pn-ui.detail-page .comment-form .comment-textarea { min-height: 7.5rem; resize: vertical; line-height: 1.5; }
body.pn-ui.detail-page .comment-form .reply-info {
  align-items: center; flex-wrap: wrap; gap: 0.25rem 0.5rem;
  margin: 0;
  font-size: 0.875rem;
}
body.pn-ui.detail-page .comment-form .reply-cancel {
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 0.5rem;
  color: #B91C1C; font-size: 0.8125rem; font-weight: 600;
}
body.pn-ui.detail-page .comment-media-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
body.pn-ui.detail-page .comment-media-upload .comment-image-btn { width: auto; height: auto; padding: 0 0.75rem; color: var(--muted); }
body.pn-ui.detail-page .comment-media-upload:focus-within .comment-image-btn { outline: 2px solid var(--accent); outline-offset: 2px; }
body.pn-ui.detail-page .comment-image-preview img { display: block; max-width: 120px; max-height: 80px; border-radius: 6px; }
body.pn-ui.detail-page .comment-field-hint {
  display: flex; align-items: center; gap: 0.35rem;
  margin: 0;
  font-size: 0.8125rem; color: var(--muted);
}
body.pn-ui.detail-page .comment-field-hint svg { flex: 0 0 auto; }
body.pn-ui.detail-page .comment-form .comment-submit-btn { align-self: flex-end; padding: 0 1.4rem; }
body.pn-ui.detail-page .comment-form .comment-submit-btn:disabled { opacity: 0.6; cursor: default; }
body.pn-ui.detail-page .comment-status {
  margin-top: 0.75rem; padding: 0.6rem 0.8rem;
  border-radius: var(--pn-radius-sm);
  font-size: 0.875rem;
}
body.pn-ui.detail-page .comment-status[hidden] { display: none; }
body.pn-ui.detail-page .comment-status.is-ok { background: #E8F5E9; color: #2E7D32; }
body.pn-ui.detail-page .comment-status.is-warn { background: #FFF3E0; color: #B45309; }
body.pn-ui.detail-page .comment-status.is-error { background: #FCE4EC; color: #B91C1C; }

body.pn-ui.detail-page .detail-id-line {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--pn-gutter) 2.5rem;
  box-sizing: border-box;
  font-size: 0.75rem; color: var(--muted);
  text-align: center;
  overflow-wrap: anywhere;
}
body.pn-ui.detail-page .detail-id-line strong { color: var(--bsn); }

@media (prefers-reduced-motion: reduce) {
  body.pn-ui.detail-page .detail-actions .detail-like-btn,
  body.pn-ui.detail-page .detail-actions .detail-share-btn,
  body.pn-ui.detail-page .detail-actions .detail-bm-btn,
  body.pn-ui.detail-page .comment-actions .comment-like-btn,
  body.pn-ui.detail-page .comment-actions .reply-btn,
  body.pn-ui.detail-page .gallery-arrow,
  body.pn-ui.detail-page .gallery-dot { transition: none; }
  body.pn-ui.detail-page .detail-like-btn:active,
  body.pn-ui.detail-page .detail-bm-btn:active,
  body.pn-ui.detail-page .detail-fw-btn:active,
  body.pn-ui.detail-page .comment-submit-btn:active { transform: none; }
  body.pn-ui.detail-page .gallery-track { scroll-behavior: auto; }
}

/* ══ Bearbeiten-Seiten (Beitrag + Kommentar) ═════════════════════════════ */
body.pn-ui .edit-container .edit-card { min-width: 0; }
body.pn-ui .edit-container .pn-heading { margin-bottom: 1.25rem; }
body.pn-ui .edit-field { margin: 0 0 1.25rem; min-width: 0; }
body.pn-ui .edit-label {
  display: block;
  margin: 0 0 0.45rem;
  font-size: 0.875rem; font-weight: 600;
  color: var(--pn-ink);
}
body.pn-ui .edit-hint { margin-top: 0.4rem; font-size: 0.8125rem; color: var(--muted); }
body.pn-ui .edit-container .pn-input,
body.pn-ui .edit-container .pn-select { width: 100%; }
body.pn-ui .edit-container .edit-textarea { min-height: 10rem; resize: vertical; line-height: 1.55; }
body.pn-ui .edit-container .edit-error {
  margin: 0 0 1.1rem; padding: 0.7rem 0.9rem;
  background: #FEF2F2; color: #B91C1C;
  border-radius: var(--pn-radius-sm);
  font-size: 0.9rem;
}
body.pn-ui .edit-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
body.pn-ui .edit-actions .edit-save { flex: 1 1 12rem; min-height: 48px; font-size: 1rem; }
body.pn-ui .edit-actions .edit-cancel { flex: 0 1 auto; min-height: 48px; font-size: 1rem; }
body.pn-ui .edit-danger-zone {
  margin-top: 1.75rem; padding-top: 1.25rem;
  border-top: 1px solid #F3F4F6;
}
body.pn-ui .edit-danger-title {
  margin: 0 0 0.6rem;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
}
body.pn-ui .edit-container .pn-btn.edit-delete {
  width: 100%; min-height: 48px; margin-top: 0.75rem;
  color: #B91C1C; border-color: #FECACA;
}
body.pn-ui .edit-danger-zone .pn-btn.edit-delete { margin-top: 0; }
body.pn-ui .edit-container .pn-btn.edit-delete:hover { background: #FEF2F2; border-color: #B91C1C; }
body.pn-ui .edit-container .pn-btn.edit-delete svg { width: 16px; height: 16px; }

/* Galerie-Verwaltung: Zeilen als Flaeche statt Rahmen */
body.pn-ui .edit-gallery { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 0.75rem; }
body.pn-ui .edit-media-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem;
  min-width: 0;
  padding: 0.5rem 0.6rem;
  background: var(--bg);
  border-radius: var(--pn-radius-sm);
  transition: background-color 0.15s ease, opacity 0.15s ease;
}
body.pn-ui .edit-media-row.is-removed { opacity: 0.45; }
body.pn-ui .edit-media-row.is-rotated { background: #FFF1E6; }
body.pn-ui .edit-media-thumb {
  flex: none;
  width: 64px; height: 64px;
  object-fit: cover;
  border-radius: 8px;
  background: #EEF0F3;
}
body.pn-ui .edit-media-pending {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: var(--muted);
}
/* Vorschau der Drehung — die Datei selbst wird erst beim Speichern gedreht. */
body.pn-ui .edit-media-thumb[data-rot="90"]  { transform: rotate(90deg); }
body.pn-ui .edit-media-thumb[data-rot="180"] { transform: rotate(180deg); }
body.pn-ui .edit-media-thumb[data-rot="270"] { transform: rotate(270deg); }
body.pn-ui .edit-media-pos {
  min-width: 2rem;
  font-size: 0.8125rem; font-weight: 700; color: var(--muted);
  text-align: center;
}
body.pn-ui .edit-media-actions {
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.35rem;
  margin-left: auto;
  min-width: 0;
}
body.pn-ui .edit-media-actions .pn-btn.edit-media-btn { width: 44px; padding: 0; font-size: 1rem; }
body.pn-ui .edit-media-actions .pn-btn.edit-media-btn:disabled { opacity: 0.35; cursor: default; }
body.pn-ui .edit-media-actions .pn-btn.edit-media-btn.danger { color: #B91C1C; }
body.pn-ui .edit-container .pn-btn.edit-add-label { width: 100%; min-height: 48px; }
body.pn-ui .edit-media-add:focus-within .edit-add-label { outline: 2px solid var(--accent); outline-offset: 2px; }
body.pn-ui .edit-new-list { margin-top: 0.45rem; font-size: 0.8125rem; color: var(--muted); overflow-wrap: anywhere; }

@media (prefers-reduced-motion: reduce) {
  body.pn-ui .edit-media-row { transition: none; }
}
