/* ============================================================
   Social Media Pipeline — helles Laborbild
   Weisse Flaechen, feine graue Linien, Konturensymbole, ruhige
   Bewegung. Alles Farbige ist Signal, nicht Dekoration.

   Nur hell. Keine dunkle Fassung: Das hier ist auf weisses Papier
   und Haarlinien gebaut - dieselben Regeln dunkel gespiegelt saehen
   nicht aus wie ein Labor, sondern wie ein Fehler.
   ============================================================ */

:root {
  /* Flaechen */
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --surface-3: #eceff3;

  /* Schrift */
  --fg: #11161d;
  --fg-2: #39424e;
  --muted: #6b7684;
  --faint: #99a2ad;

  /* Linien - das tragende Gestaltungsmittel. Deshalb drei Abstufungen. */
  --line: #e9ecf1;
  --line-strong: #dbe0e8;
  --line-kontrast: #c6ccd6;

  /* Signalfarben. Kuehl, gesaettigt, sparsam eingesetzt. */
  --accent: #0e7f95;
  --accent-hell: #16a3bd;
  --accent-fg: #ffffff;
  --accent-soft: #e3f4f7;
  --accent-line: #a8dde7;

  --danger: #c0392b;
  --danger-soft: #fdeceb;
  --ok: #1a7f4b;
  --ok-soft: #e7f5ed;
  --warn: #9a6b00;
  --warn-soft: #fdf3e0;
  --info: #2563a8;
  --info-soft: #e8f0fb;
  --neutral: #6b7684;
  --neutral-soft: #f0f2f5;

  /* Form */
  --radius: 10px;
  --radius-sm: 7px;
  --radius-xs: 5px;

  /* Schatten sind hier fast unsichtbar. Die Tiefe kommt aus den Linien. */
  --shadow: 0 1px 1px rgba(17, 22, 29, .03), 0 2px 8px rgba(17, 22, 29, .04);
  --shadow-lift: 0 2px 4px rgba(17, 22, 29, .05), 0 12px 28px rgba(17, 22, 29, .08);
  --shadow-ring: 0 0 0 3px var(--accent-soft);

  --ease: cubic-bezier(.2, .7, .3, 1);
  --ease-aus: cubic-bezier(.3, 0, .2, 1);

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

/* Muss VOR allem anderen stehen und alles schlagen: Mehrere Bauteile hier setzen
   display:flex oder display:inline-flex, und das hebelt das hidden-Attribut aus.
   Ergebnis waren leere Warnbalken und eine Plakette, die vom ersten Moment an
   "gespeichert" behauptete. */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  color: var(--fg);
  font: 15.5px/1.62 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  /* Millimeterpapier, sehr schwach. Man sieht es nicht bewusst, aber die Flaeche
     wirkt dadurch wie ein Arbeitsblatt und nicht wie eine leere Seite. */
  background-color: var(--bg);
  background-image:
    linear-gradient(to right, rgba(17, 22, 29, .022) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(17, 22, 29, .022) 1px, transparent 1px);
  background-size: 22px 22px;
  background-attachment: fixed;
}

/* ---------- Symbole ---------- */

/* Der Vorrat selbst wird nie gezeigt - er liefert nur die <symbol>-Vorlagen. */
.ikonen-vorrat { position: absolute; width: 0; height: 0; overflow: hidden; }

.ico {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  vertical-align: -.2em;
  /* Haarlinien sollen auch beim Skalieren Haarlinien bleiben. */
  vector-effect: non-scaling-stroke;
}
h1 .ico, h2 .ico { width: 1em; height: 1em; color: var(--accent); }
.warn > .ico { color: var(--warn); }
.ok-box > .ico { color: var(--ok); }
.warn > .ico, .ok-box > .ico { margin-right: .45rem; vertical-align: -.25em; }

/* Ein Knopf, der nur aus einem Symbol besteht. */
.ico-knopf {
  padding: .4rem;
  line-height: 0;
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
}
.ico-knopf .ico { width: 1.2rem; height: 1.2rem; }
.ico-knopf:hover {
  color: var(--fg);
  background: var(--surface-2);
  border-color: var(--line);
  transform: none;
  box-shadow: none;
}

/* ---------- Kopfzeile / Navigation ---------- */

header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: .6rem 1.6rem;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line-strong);
  flex-wrap: wrap;
}

/* Die feine Signallinie unter der Kopfzeile - das einzige Stueck Farbe dort. */
header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-line) 18%,
                              var(--accent-line) 82%, transparent);
  opacity: .8;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: var(--fg);
  font-weight: 620;
  letter-spacing: -.015em;
}
.brand-text { display: inline-flex; flex-direction: column; line-height: 1.08; font-size: .93rem; }
.brand-schwach {
  color: var(--muted);
  font-weight: 500;
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* Das Zeichen: ein Punkt in einem Ring, wie eine Statusleuchte am Geraet. */
.brand-zeichen {
  position: relative;
  width: 1.5rem; height: 1.5rem;
  border-radius: 50%;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  flex: none;
}
.brand-zeichen::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: .42rem; height: .42rem;
  border-radius: 50%;
  background: var(--accent);
}
.brand-zeichen::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0;
  animation: puls 3.2s var(--ease) infinite;
}
@keyframes puls {
  0%   { transform: scale(1);    opacity: .55; }
  70%  { transform: scale(1.55); opacity: 0; }
  100% { transform: scale(1.55); opacity: 0; }
}

nav { display: flex; gap: .15rem; flex-wrap: wrap; }

nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--muted);
  text-decoration: none;
  padding: .42rem .68rem;
  border-radius: var(--radius-xs);
  font-size: .89rem;
  font-weight: 520;
  white-space: nowrap;
  transition: color .16s var(--ease), background .16s var(--ease);
}
nav a .ico { color: var(--faint); transition: color .16s var(--ease), transform .2s var(--ease); }
nav a:hover { color: var(--fg); background: var(--surface-2); }
nav a:hover .ico { color: var(--accent); transform: translateY(-1px); }

nav a.aktiv { color: var(--fg); font-weight: 600; }
nav a.aktiv .ico { color: var(--accent); }
/* Der aktive Punkt bekommt eine Unterlinie, die sich aufzieht - der einzige
   Ort, an dem die Navigation sich bewegt. */
nav a.aktiv::after {
  content: "";
  position: absolute;
  left: .68rem; right: .68rem; bottom: .12rem;
  height: 1.5px;
  border-radius: 2px;
  background: var(--accent);
  transform-origin: left;
  animation: linie-auf .32s var(--ease-aus) both;
}
@keyframes linie-auf {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: 1; }
}

/* Marken-/Mandantenumschaltung: sieht aus wie ein Wahlschalter am Geraet. */
.tenant-switch {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin: 0;
  padding: .2rem .5rem .2rem .55rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.tenant-switch:focus-within { border-color: var(--accent); box-shadow: var(--shadow-ring); }
.tenant-switch .ico { color: var(--accent); width: 1rem; height: 1rem; }
.tenant-switch select {
  width: auto;
  margin: 0;
  padding: .18rem 1.2rem .18rem .1rem;
  border: 0;
  background: transparent;
  font-size: .86rem;
  font-weight: 600;
  color: var(--fg);
  max-width: 11rem;
}
.tenant-switch select:focus { outline: none; box-shadow: none; }

header nav { margin-left: .4rem; }
.benutzer { margin-left: auto; display: inline-flex; align-items: center; gap: .5rem; }
.benutzer-name { font-size: .85rem; color: var(--muted); }
.avatar {
  display: inline-grid;
  place-items: center;
  width: 1.7rem; height: 1.7rem;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  font: 600 .68rem/1 var(--mono);
  color: var(--fg-2);
  letter-spacing: .02em;
}
.logout { margin: 0; }

.login-box {
  max-width: 23rem;
  margin: 4rem auto;
  padding: 1.9rem 2rem;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
}

main {
  max-width: 66rem;
  margin: 0 auto;
  padding: 2rem 1.6rem 5rem;
  animation: rise .34s var(--ease) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Typografie ---------- */

h1 {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: 1.55rem;
  margin: 0 0 .35rem;
  font-weight: 640;
  letter-spacing: -.025em;
}
h2 {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1.02rem;
  margin: 2.1rem 0 .7rem;
  font-weight: 620;
  letter-spacing: -.008em;
}
h3 { font-weight: 620; letter-spacing: -.005em; }

/* Die Marke neben der Seitenueberschrift - leiser als die Ueberschrift selbst. */
.kopf-marke {
  font: 500 .78rem/1 var(--mono);
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .3rem .65rem;
  letter-spacing: .01em;
  white-space: nowrap;
}

.seiten-kopf {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.4rem;
}
.seiten-kopf > div:first-child { flex: 1 1 26rem; }
.seiten-kopf p { margin: .35rem 0 0; max-width: 46rem; }

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hell); }

.muted { color: var(--muted); font-size: .9rem; }
.error { color: var(--danger); font-size: .9rem; }
.small { font-size: .84rem; }
.empty { color: var(--muted); }

/* Zahlen und Kennungen in Maschinenschrift - das macht den Laborton aus. */
code, kbd, samp, pre { font-family: var(--mono); font-size: .88em; }
code {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  padding: .08em .38em;
}

/* ---------- Tabellen ---------- */

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1rem 0;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
}
th, td {
  text-align: left;
  padding: .68rem .8rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: 0; }
th {
  font: 650 .7rem/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom-color: var(--line-strong);
  white-space: nowrap;
}
tbody tr { transition: background .14s var(--ease); }
tbody tr:hover { background: var(--accent-soft); }

/* ---------- Meldungen ---------- */

.warn, .ok-box {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: .75rem .95rem;
  border-radius: var(--radius-sm);
  border: 1px solid;
  border-left-width: 3px;
  margin: 1rem 0;
  font-size: .92rem;
  animation: rise .28s var(--ease) both;
}
.warn { background: var(--warn-soft); border-color: #eeddb8; border-left-color: var(--warn); color: #6d4b00; }
.ok-box { background: var(--ok-soft); border-color: #c5e5d3; border-left-color: var(--ok); color: #135c36; }
.warn a, .ok-box a { color: inherit; text-decoration: underline; }
.warn ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.warn li { margin: .2rem 0; }

/* ---------- Chips & Badges ---------- */

.badge, .chip {
  display: inline-block;
  padding: .14rem .5rem;
  border-radius: 999px;
  font: 560 .73rem/1.5 var(--mono);
  letter-spacing: .01em;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted);
  white-space: nowrap;
}
.s-published, .r-published { border-color: #c5e5d3; background: var(--ok-soft);     color: var(--ok); }
.s-failed, .r-failed       { border-color: #f3c9c4; background: var(--danger-soft); color: var(--danger); }
.s-partial, .s-publishing, .r-publishing { border-color: #eeddb8; background: var(--warn-soft); color: var(--warn); }
.s-approved                { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.s-review                  { border-color: #c9dbf4; background: var(--info-soft);   color: var(--info); }
.s-draft                   { border-color: var(--line-strong); background: var(--neutral-soft); color: var(--neutral); }
.r-pending                 { color: var(--muted); }
.targets .chip { margin-right: .25rem; }

/* ---------- Formulare ---------- */

form { margin: 1rem 0; }
.inline-form { display: inline-block; margin: 0; }

fieldset {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem 1.3rem;
  margin: 1.25rem 0;
  background: var(--surface);
  box-shadow: var(--shadow);
}
legend {
  padding: 0 .5rem;
  font: 650 .7rem/1.4 var(--mono);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

label { display: block; margin: .9rem 0; font-size: .9rem; font-weight: 540; }
label.inline { display: flex; align-items: center; gap: .55rem; margin: .55rem 0; font-weight: 450; }

input[type=text], input[type=url], input[type=password], input[type=number],
input[type=datetime-local], input[type=date], input[type=email], textarea, select {
  display: block;
  width: 100%;
  margin-top: .35rem;
  padding: .55rem .7rem;
  font: inherit;
  font-size: .95rem;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease),
              background .16s var(--ease);
}
input[type=number], input[type=datetime-local], input[type=date] {
  font-family: var(--mono);
  font-size: .9rem;
}
select { width: auto; }
textarea { resize: vertical; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: var(--faint); }

input:hover, textarea:hover, select:hover { border-color: var(--line-kontrast); }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--shadow-ring);
  background: var(--surface);
}
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 1.05em; height: 1.05em; }

/* ---------- Buttons ---------- */

button, .button-link {
  font: inherit;
  font-size: .91rem;
  font-weight: 560;
  padding: .52rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  transition: transform .14s var(--ease), box-shadow .16s var(--ease),
              background .16s var(--ease), border-color .16s var(--ease),
              color .16s var(--ease);
}
button .ico, .button-link .ico { width: 1.05rem; height: 1.05rem; color: var(--muted); transition: color .16s var(--ease); }
button:hover, .button-link:hover {
  border-color: var(--line-kontrast);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
button:hover .ico { color: var(--accent); }
button:active, .button-link:active { transform: translateY(0); box-shadow: none; }
button:focus-visible, .button-link:focus-visible,
a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button.primary, .button-link {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}
button.primary .ico, .button-link .ico { color: rgba(255, 255, 255, .85); }
button.primary:hover, .button-link:hover {
  background: var(--accent-hell);
  border-color: var(--accent-hell);
  color: var(--accent-fg);
}
button.primary:hover .ico, .button-link:hover .ico { color: #fff; }

/* Zurueckhaltend: fuer alles, was nicht die Haupthandlung der Seite ist. */
button.ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--fg-2);
}
button.ghost:hover { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
button.ghost:hover .ico { color: var(--accent); }

button.danger {
  color: var(--danger);
  border-color: #ecc4bf;
  background: var(--surface);
}
button.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
button.danger:hover .ico { color: var(--danger); }

button.small, .button-link.small { padding: .32rem .7rem; font-size: .83rem; }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.button-link.disabled { opacity: .45; pointer-events: none; }

.actions { display: flex; gap: .7rem; flex-wrap: wrap; align-items: center; margin-top: 1.25rem; }
.actions form { margin: 0; }
form.tight { margin: 0; display: inline-block; }
form.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
form.row input[type=text],
form.row input[type=password] { width: auto; flex: 1 1 16rem; margin-top: 0; }

/* Browser-Backends auf der Statusseite. Ein Verbinden-Knopf wie bei OAuth kann es
   hier nicht geben: Die Anmeldung braucht ein echtes Browserfenster fuer Passwort und
   Zwei-Faktor und laeuft auf dem eigenen Rechner, nicht auf dem Server. Statt eines
   Knopfes, der nichts ausloesen kann, klappt die Anleitung auf. */
details.verbinden-browser { display: inline-block; margin-bottom: .5rem; }
details.verbinden-browser > summary { list-style: none; cursor: pointer; display: inline-block; }
details.verbinden-browser > summary::-webkit-details-marker { display: none; }
details.verbinden-browser > p { margin: .6rem 0 .3rem; max-width: 26rem; }
details.verbinden-browser code { display: inline-block; }

/* ---------- Karten ---------- */

.card-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.35rem;
  margin: 1.1rem 0;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: box-shadow .18s var(--ease), transform .18s var(--ease);
}
.card-block:hover { box-shadow: var(--shadow-lift); }
.card-block h3 { margin: 0 0 .55rem; font-size: 1.02rem; display: flex; gap: .6rem; align-items: center; }

/* Wegklappbare Anbieter-Karten (Einrichtung) */
details.provider-card { padding: 0; overflow: hidden; }
details.provider-card > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: 1rem 1.25rem;
  font-weight: 640;
  font-size: 1.02rem;
  user-select: none;
}
details.provider-card > summary::-webkit-details-marker { display: none; }
details.provider-card > summary::before {
  content: "▸";
  color: var(--muted);
  transition: transform .15s var(--ease);
  display: inline-block;
}
details.provider-card[open] > summary::before { transform: rotate(90deg); }
details.provider-card:hover > summary { background: var(--surface-2); }
details.provider-card .summary-title { flex: 1 1 auto; }
details.provider-card .card-body { padding: 0 1.25rem 1.15rem; }

label.card {
  align-items: flex-start;
  gap: .75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: .9rem 1rem;
  margin: .6rem 0;
  cursor: pointer;
  background: var(--surface);
  transition: border-color .15s var(--ease), background .15s var(--ease), box-shadow .15s var(--ease);
}
label.card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
label.card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
label.card input { margin-top: .25rem; }

/* ---------- Checkliste / Assistent ---------- */

ol.checklist { padding-left: 0; list-style: none; counter-reset: step; }
ol.checklist li {
  counter-increment: step;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .8rem 1rem .8rem 3rem;
  margin: .55rem 0;
  position: relative;
  background: var(--surface);
}
ol.checklist li::before {
  content: counter(step);
  position: absolute; left: .8rem; top: .8rem;
  width: 1.5rem; height: 1.5rem;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 999px; font-size: .8rem; font-weight: 650;
}
ol.checklist li label { margin: 0; }

/* ---------- Kopier-Zeile ---------- */

.copyrow { display: flex; gap: .5rem; align-items: center; margin: .35rem 0 1rem; }
.copyrow input {
  flex: 1 1 auto; margin-top: 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: .85rem; color: var(--muted);
}
.copybtn { white-space: nowrap; }

code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: .86em;
  background: var(--surface-2);
  padding: .1rem .35rem;
  border-radius: 5px;
}
.preview {
  white-space: pre-wrap;
  background: var(--surface-2);
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

/* ---------- Medien ---------- */

.media { display: flex; gap: 1rem; flex-wrap: wrap; }
.media figure { margin: 0; max-width: 14rem; }
.media img { width: 100%; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); display: block; }

/* ---------- Datei-Upload: Dropzone + Vorschau + Fortschritt ---------- */

.dropzone {
  margin-top: .4rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 1.4rem 1rem;
  text-align: center;
  color: var(--muted);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color .15s var(--ease), background .15s var(--ease), color .15s var(--ease);
}
.dropzone:hover { border-color: var(--accent); color: var(--fg); }
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--fg);
}
.dropzone strong { color: var(--fg); }
.dropzone input[type=file] { display: none; }
.dropzone .dz-icon {
  font-size: 1.5rem; line-height: 1;
  display: inline-block; margin-bottom: .3rem;
  transition: transform .2s var(--ease);
}
.dropzone.dragover .dz-icon { transform: translateY(-3px); }

.dz-previews { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .8rem; }
.dz-thumb {
  position: relative;
  width: 5rem; height: 5rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
  animation: pop .22s var(--ease) both;
}
.dz-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dz-thumb .dz-name {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-size: .6rem; padding: .15rem .25rem;
  background: color-mix(in srgb, var(--fg) 60%, transparent);
  color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@keyframes pop {
  from { opacity: 0; transform: scale(.9); }
  to   { opacity: 1; transform: none; }
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  margin: .9rem 0 .3rem;
  border: 1px solid var(--line);
}
.progress-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #fff));
  transition: width .18s var(--ease);
}
.progress-bar.indeterminate {
  width: 40% !important;
  animation: slide 1.1s var(--ease) infinite;
}
@keyframes slide {
  0%   { margin-left: -40%; }
  100% { margin-left: 100%; }
}
.upload-status { font-size: .85rem; color: var(--muted); }

/* Redaktionskalender */
.cal-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.cal-head h1 { margin: 0; flex: 1 1 auto; text-align: center; }
table.calendar { table-layout: fixed; min-width: 44rem; }
table.calendar th { text-align: center; }
td.cal-day { height: 6.5rem; vertical-align: top; padding: .35rem; }
td.cal-empty { background: var(--surface-2); }
.cal-num { font-size: .78rem; color: var(--muted); margin-bottom: .2rem; }
.cal-today { background: var(--accent-soft); }
.cal-today .cal-num { color: var(--accent); font-weight: 700; }
.cal-post {
  display: block; font-size: .72rem; line-height: 1.3;
  padding: .12rem .35rem; margin: .18rem 0;
  border-radius: 5px; text-decoration: none; color: var(--fg);
  background: var(--surface-2); border-left: 3px solid var(--line-strong);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  transition: filter .12s var(--ease);
}
.cal-post:hover { filter: brightness(.96); }
.cal-post.s-published { border-left-color: var(--ok); }
.cal-post.s-failed { border-left-color: var(--danger); }
.cal-post.s-approved { border-left-color: var(--accent); }
.cal-post.s-partial, .cal-post.s-publishing { border-left-color: var(--warn); }
.cal-time { color: var(--muted); }

/* Kennzahlen (Analytics) */
.metrics { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .4rem; }
.metric {
  font-size: .76rem; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line);
  padding: .1rem .45rem; border-radius: 999px;
}
.metric strong { color: var(--fg); }

/* Zeichenzähler im Editor */
.charcount { font-size: .82rem; color: var(--muted); margin: .2rem 0 .4rem; }
.charcount .over { color: var(--danger); font-weight: 600; }

/* Manuelle Zugangsdaten in der Statusliste (Bluesky/Discord) */
.manual-form { margin: 0 0 .5rem; display: flex; flex-direction: column; gap: .3rem; max-width: 24rem; }
.manual-form label { margin: 0; font-weight: 450; color: var(--muted); }
.manual-form input { margin-top: .1rem; }
.manual-form button { align-self: flex-start; }

/* kleiner Spinner fuer laufende Aktionen */
.spinner {
  width: 1em; height: 1em;
  border: 2px solid color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  display: inline-block;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */

@media (max-width: 40rem) {
  header { padding: .8rem 1rem; gap: 1rem; }
  main { padding: 1.4rem 1rem 3rem; }
  h1 { font-size: 1.45rem; }
  fieldset { padding: 1rem; }
  /* Tabellen auf kleinen Schirmen horizontal scrollbar statt gequetscht */
  .results table, .scroll-x { display: block; overflow-x: auto; }
}

/* ============================================================
   Mehrbenutzer-Betrieb + Feinschliff
   ============================================================ */

/* ---------- Wer ist angemeldet ---------- */

.benutzer {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin-left: auto;             /* schiebt sich und den Abmelden-Knopf nach rechts */
  padding: .3rem .7rem .3rem .3rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: .9rem;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.benutzer:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }

.avatar {
  display: grid;
  place-items: center;
  width: 1.75rem; height: 1.75rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-fg);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
}

/* Der Abmelden-Knopf rueckt hinter den Benutzer statt ihn nach links zu draengen. */
header .benutzer + .logout { margin-left: .6rem; }

@media (max-width: 900px) {
  .benutzer-name { display: none; }   /* auf schmalen Schirmen genuegt der Avatar */
  .benutzer { padding: .3rem; }
}

/* ---------- Wo bin ich gerade ---------- */

nav a.aktiv {
  color: var(--fg);
  background: var(--accent-soft);
  font-weight: 620;
}
nav a { position: relative; }
nav a.aktiv::after {
  content: "";
  position: absolute;
  left: .7rem; right: .7rem; bottom: .18rem;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  animation: unterstrich .26s var(--ease) both;
}
@keyframes unterstrich {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: 1; }
}

/* ---------- Inhalt kommt ruhig herein ----------
   Gestaffelt statt alles gleichzeitig: Das Auge folgt der Reihenfolge, statt
   von einem Schlag erschlagen zu werden. Nur die ersten Elemente bekommen einen
   Versatz - danach waere die Wartezeit spuerbar statt elegant. */

main > * { animation: rise .34s var(--ease) both; }
main > *:nth-child(1) { animation-delay: .02s; }
main > *:nth-child(2) { animation-delay: .06s; }
main > *:nth-child(3) { animation-delay: .10s; }
main > *:nth-child(4) { animation-delay: .14s; }
main > *:nth-child(n+5) { animation-delay: .16s; }

/* ---------- Leerzustand ----------
   Was ein neuer Benutzer als Erstes sieht. Ohne das steht er vor einer leeren
   Seite und weiss nicht, dass ihm nur eine Marke fehlt. */

.leerzustand {
  text-align: center;
  padding: 3.5rem 1.5rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}
.leerzustand .zeichen {
  display: grid;
  place-items: center;
  width: 3.25rem; height: 3.25rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.4rem;
  animation: pulsieren 2.8s var(--ease) infinite;
}
.leerzustand h2 { margin: 0 0 .5rem; font-size: 1.15rem; }
.leerzustand p { margin: 0 auto 1.4rem; max-width: 30rem; color: var(--muted); }

@keyframes pulsieren {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft); }
  50%      { box-shadow: 0 0 0 .6rem transparent; }
}

/* ---------- Feinschliff ---------- */

/* Sichtbarer Fokus fuer Tastaturbedienung - vorher sprang der Rahmen nur an
   manchen Elementen an. */
a:focus-visible, button:focus-visible, select:focus-visible,
input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Knopfdruck spuerbar machen */
button:not(:disabled):active, .button-link:active { transform: translateY(1px); }

/* Tabellenzeilen heben sich beim Ueberfahren leicht ab */
tbody tr { transition: background-color .16s var(--ease); }
tbody tr:hover { background: var(--surface-2); }

/* Wer Bewegung reduziert, bekommt keine Animationen. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============================================================
   Beitragsliste — Bild links, Inhalt rechts
   Die Tabelle davor zeigte nur Text und Status. Was in der Pipeline steht,
   erkennt man aber am Bild und am Termin - beides steht jetzt in der Zeile.
   ============================================================ */

.listen-kopf {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}
.listen-kopf h1 { margin: 0; flex: 1 1 auto; }

.ansicht-schalter { display: flex; gap: .3rem; }
.ansicht-schalter button {
  padding: .34rem .8rem;
  font-size: .85rem;
  border-radius: 999px;
  background: var(--surface);
}
.ansicht-schalter button[aria-pressed=true] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--fg);
  font-weight: 640;
}

/* ---------- Zeitschiene ----------
   Ein Tag = eine Spalte. Die Marken darin sind Links auf den Beitrag; ihre
   Farbe ist dieselbe Statusfarbe wie in der Liste darunter. */

.zeitschiene {
  margin: 0 0 1.6rem;
  padding: .9rem 0 .3rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.tl-kopf {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0 1rem .7rem;
}
.tl-kopf h2 { margin: 0; font-size: 1rem; flex: 1 1 auto; }
.tl-kopf h2 .muted { font-weight: 400; margin-left: .5rem; }

.tl-spannen { display: flex; gap: .3rem; }
.tl-spanne {
  padding: .2rem .6rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: .78rem;
  color: var(--muted);
  text-decoration: none;
}
.tl-spanne:hover { color: var(--fg); border-color: var(--line-strong); }
.tl-spanne.aktiv { background: var(--accent-soft); border-color: var(--accent); color: var(--fg); font-weight: 620; }

.tl-rahmen { position: relative; }

.tl-bahn {
  display: flex;
  gap: 0;
  overflow-x: auto;
  /* Haeufen sich an einem Tag die Beitraege, waechst die Spalte - dann scrollt
     die Bahn nach unten weiter, statt die Seite auseinanderzuziehen. */
  max-height: 26rem;
  overflow-y: auto;
  padding: 0 1rem .8rem;
  scroll-padding-left: 1rem;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
}
.tl-bahn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Mit der Maus laesst sich die Bahn auch ziehen. Waehrend des Ziehens soll
   nichts markiert werden und keine Marke unter dem Zeiger aufspringen. */
.tl-bahn.zieht { cursor: grabbing; user-select: none; scroll-behavior: auto; }
.tl-bahn.zieht .tl-post { cursor: grabbing; }
.tl-bahn.zieht .tl-post:hover { transform: none; box-shadow: none; }

/* Pfeile links/rechts legt app.js an; sie liegen als schmale Streifen ueber den
   Raendern der Bahn und blenden sich nur ein, solange es dort weitergeht. */
.tl-pfeil {
  position: absolute;
  top: 0;
  bottom: .8rem;              /* das untere Polster der Bahn bleibt frei */
  width: 2.8rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s var(--ease);
  z-index: 4;
}
.tl-pfeil.links  { left: 0;  background: linear-gradient(to right, var(--surface) 40%, transparent); }
.tl-pfeil.rechts { right: 0; background: linear-gradient(to left,  var(--surface) 40%, transparent); }
.tl-pfeil span {
  display: grid;
  place-items: center;
  width: 1.8rem; height: 1.8rem;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 1.05rem;
  line-height: 1;
  transition: border-color .16s var(--ease), color .16s var(--ease);
}
.zeitschiene:hover .tl-pfeil:not([disabled]),
.tl-pfeil:focus-visible { opacity: 1; pointer-events: auto; }
.tl-pfeil:hover span { border-color: var(--accent); color: var(--accent); }
.tl-pfeil[disabled] { opacity: 0; pointer-events: none; }
.tl-tag {
  flex: 0 0 7.5rem;
  min-width: 7.5rem;
  padding: 0 .3rem;
  border-left: 1px solid var(--line);
}
.tl-tag:first-child { border-left: none; }
.tl-wochenende { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.tl-monat { border-left: 2px solid var(--line-strong); }

.tl-datum {
  position: sticky;
  top: 0;
  display: flex;
  align-items: baseline;
  gap: .35rem;
  padding: .15rem .2rem .4rem;
  font-size: .78rem;
  color: var(--muted);
  background: var(--surface);
}
.tl-wochentag { font-weight: 650; }
.tl-zahl { font-variant-numeric: tabular-nums; }

/* Heute: die Spalte, an der man sich orientiert. */
.tl-heute { background: var(--accent-soft); border-radius: var(--radius-sm); }
.tl-heute .tl-datum { color: var(--accent); background: transparent; }
.tl-heute .tl-datum::before {
  content: "";
  width: .4rem; height: .4rem;
  border-radius: 50%;
  background: var(--accent);
  align-self: center;
  animation: pulsieren 2.6s var(--ease) infinite;
}

.tl-marken { display: flex; flex-direction: column; gap: .3rem; min-height: 2.5rem; }

.tl-post {
  --status: var(--neutral);
  position: relative;
  display: block;
  padding: .3rem .45rem .35rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  border-left: 3px solid var(--status);
  background: color-mix(in srgb, var(--status) 8%, var(--surface));
  color: var(--fg);
  text-decoration: none;
  overflow: hidden;
  /* Gestaffelt hereinkommen: --i wird je Marke im Template hochgezaehlt. Der
     Deckel haelt die Welle kurz - sonst warten spaete Marken sekundenlang. */
  animation: tl-ein .42s var(--ease) both;
  animation-delay: calc(min(var(--i, 0), 18) * 45ms);
  transition: transform .16s var(--ease), box-shadow .16s var(--ease),
              border-color .16s var(--ease);
}
.tl-post:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-lift);
  border-color: var(--status);
  z-index: 2;
}
.tl-bild {
  width: 100%;
  height: 2.6rem;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  margin-bottom: .25rem;
}
.tl-zeit {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--status);
}
.tl-titel {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: .74rem;
  line-height: 1.3;
}
.tl-ziele {
  display: block;
  font-size: .66rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: .1rem;
}
.tl-fuss { padding: 0 1rem .3rem; margin: 0; }

@keyframes tl-ein {
  from { opacity: 0; transform: translateY(10px) scale(.96); }
  to   { opacity: 1; transform: none; }
}

/* Die Karten kommen einzeln herein statt der Block am Stueck - deshalb hier
   die Sammelanimation aus main > * abschalten. */
.beitragsliste { display: flex; flex-direction: column; gap: .9rem; animation: none; }

/* Jede Karte traegt ihre Statusfarbe in --status; Rand und Tönung greifen
   darauf zu. So steht die Zuordnung Status -> Farbe an genau einer Stelle. */
.beitrag {
  --status: var(--neutral);
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 1.1rem;
  padding: .9rem 1.1rem .9rem .95rem;
  background: color-mix(in srgb, var(--status) 5%, var(--surface));
  border: 1px solid var(--line);
  border-left: 4px solid var(--status);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow .18s var(--ease), border-color .18s var(--ease);
  animation: rise .38s var(--ease) both;
  animation-delay: calc(min(var(--i, 0), 10) * 45ms);
}
.beitrag:hover { box-shadow: var(--shadow-lift); }

.s-rand-draft     { --status: var(--neutral); }
.s-rand-review    { --status: var(--info); }
.s-rand-approved  { --status: var(--accent); }
.s-rand-published { --status: var(--ok); }
.s-rand-failed    { --status: var(--danger); }
.s-rand-partial, .s-rand-publishing { --status: var(--warn); }

/* ---------- Filter und Sortierung ---------- */

.filterleiste {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}
.sichten { display: flex; gap: .35rem; flex-wrap: wrap; flex: 1 1 auto; }
.sicht {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .32rem .75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: .87rem;
  font-weight: 550;
  text-decoration: none;
  transition: color .15s var(--ease), background .15s var(--ease), border-color .15s var(--ease);
}
.sicht:hover { color: var(--fg); border-color: var(--line-strong); }
.sicht.aktiv {
  color: var(--fg);
  background: var(--accent-soft);
  border-color: var(--accent);
  font-weight: 640;
}
.sicht-zahl {
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
  padding: 0 .38rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
}
.sicht.aktiv .sicht-zahl { background: var(--accent); color: var(--accent-fg); }

.sortieren { display: flex; align-items: center; gap: .45rem; margin: 0; }
.sortieren label { margin: 0; color: var(--muted); }
.sortieren select { margin-top: 0; padding: .3rem .5rem; font-size: .85rem; }

/* ---------- Bildspalte ---------- */

.beitrag-bild { display: flex; flex-direction: column; gap: .35rem; }
/* 4:5 - das Hochformat, in dem hier die meisten Beitragsbilder entstehen.
   Zusammen mit object-fit:contain wird nichts abgeschnitten: In der Uebersicht
   soll man das Bild wiedererkennen, nicht seinen Mittelteil. */
.karussell {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.kar-spur {
  display: flex;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.kar-spur::-webkit-scrollbar { display: none; }
.kar-bild {
  flex: 0 0 100%;
  scroll-snap-align: center;
  display: block;
  height: 100%;
}
.kar-bild img { width: 100%; height: 100%; object-fit: contain; display: block; }
/* Datei nicht mehr am Platz - der Beitrag zeigt es hier statt eines
   zerbrochenen Bildsymbols. */
.kar-bild.bild-weg {
  display: grid;
  place-items: center;
  align-content: center;
  gap: .2rem;
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 10%, var(--surface-2));
  font-size: 1.2rem;
  text-decoration: none;
}
.kar-bild.bild-weg .small { font-size: .7rem; }

.kar-zaehler {
  position: absolute;
  top: .35rem; right: .35rem;
  padding: .05rem .4rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 600;
  color: #fff;
  background: color-mix(in srgb, #000 55%, transparent);
  backdrop-filter: blur(4px);
  pointer-events: none;
}

/* Pfeile und Punkte legt app.js an - ohne JavaScript bleibt das Wischen. */
.kar-pfeil {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 1.7rem; height: 1.7rem;
  padding: 0;
  display: grid; place-items: center;
  border: none;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
  color: #fff;
  background: color-mix(in srgb, #000 45%, transparent);
  opacity: 0;
  transition: opacity .15s var(--ease), background .15s var(--ease);
}
.karussell:hover .kar-pfeil, .kar-pfeil:focus-visible { opacity: 1; }
.kar-pfeil:hover { background: color-mix(in srgb, #000 70%, transparent); box-shadow: none; transform: translateY(-50%); }
.kar-pfeil.vor { right: .3rem; }
.kar-pfeil.zurueck { left: .3rem; }
.kar-pfeil[disabled] { opacity: 0 !important; }

.kar-punkte {
  position: absolute;
  left: 0; right: 0; bottom: .35rem;
  display: flex; justify-content: center; gap: .25rem;
  pointer-events: none;
}
.kar-punkt {
  width: .35rem; height: .35rem;
  border-radius: 50%;
  background: color-mix(in srgb, #fff 55%, transparent);
  transition: background .15s var(--ease), transform .15s var(--ease);
}
.kar-punkt.aktiv { background: #fff; transform: scale(1.25); }

/* Kein Bild hinterlegt: quadratisch und damit flacher als eine Bildkachel -
   reine Textbeitraege bleiben in der Liste kompakt. */
.bild-fehlt {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: .2rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
  text-decoration: none;
  font-size: 1.4rem;
}
.bild-fehlt .small { font-size: .75rem; }
.dateien-hinweis { text-align: center; }

/* ---------- Textspalte ---------- */

.beitrag-text { display: flex; flex-direction: column; gap: .45rem; min-width: 0; }
.beitrag-kopf { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }

.beitrag-titel {
  font-weight: 620;
  font-size: 1.02rem;
  line-height: 1.35;
  color: var(--fg);
  text-decoration: none;
}
.beitrag-titel:hover { color: var(--accent); }

.beitrag-auszug {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Ziele mit Termin ---------- */

.ziele { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: auto; padding-top: .3rem; }
.ziel {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  padding: .28rem .6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.ziel-name { font-size: .8rem; font-weight: 600; }
.ziel-zeit { font-size: .72rem; color: var(--muted); white-space: nowrap; }

.ziel.r-published { border-color: transparent; background: color-mix(in srgb, var(--ok) 14%, transparent); }
.ziel.r-published .ziel-name { color: var(--ok); }
.ziel.r-failed { border-color: transparent; background: color-mix(in srgb, var(--danger) 14%, transparent); }
.ziel.r-failed .ziel-name { color: var(--danger); }
.ziel.r-publishing { border-color: transparent; background: color-mix(in srgb, var(--warn) 16%, transparent); }
.ziel.r-publishing .ziel-name { color: var(--warn); }
/* Termin verstrichen, aber noch nichts draussen - meist fehlt die Freigabe. */
.ziel.spaet { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.ziel.spaet .ziel-zeit { color: var(--warn); font-weight: 600; }

/* ---------- Kachelraster ---------- */

.beitragsliste.raster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1rem;
}
.beitragsliste.raster .beitrag {
  grid-template-columns: 1fr;
  gap: .7rem;
  padding: .85rem;
}
.beitragsliste.raster .beitrag-auszug { -webkit-line-clamp: 2; line-clamp: 2; }

@media (max-width: 40rem) {
  .beitrag { grid-template-columns: 9rem 1fr; gap: .8rem; padding: .7rem .8rem; }
  .beitrag-auszug { -webkit-line-clamp: 2; line-clamp: 2; }
}

/* ============================================================
   Beitragsmaske — links schreiben, rechts steuern
   Vorher stand alles untereinander: Ergebnistabelle, Medien, Formular,
   Plattformtexte. Jetzt liegt der Text oben, das Beiwerk klappt auf.
   ============================================================ */

.beitrag-kopfzeile {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .3rem 1rem;
  align-items: start;
  padding-bottom: .9rem;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--line);
}
.bk-titel { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.bk-titel h1 { margin: 0; font-size: 1.35rem; }
.bk-meta { margin: 0; grid-column: 1; }
.bk-meta code { font-size: .78em; }
.bk-aktionen {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-start;
}
.bk-aktionen form { margin: 0; }

.beitrag-maske {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(17rem, 1fr);
  gap: 1.2rem;
  align-items: start;
  margin: 0;
}
.bm-haupt, .bm-seite { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }

.feld-block {
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.feld-block > h2 {
  margin: 0 0 .7rem;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}
.feld-block label { margin: .7rem 0; }
.feld-block > label:first-child { margin-top: 0; }
.feld-block p:last-child { margin-bottom: 0; }

/* Der Haupttext bekommt Gewicht - er ist der Grund, warum man hier ist. */
.feld-gross { font-size: .95rem; font-weight: 600; }
.feld-gross textarea { font-size: 1rem; line-height: 1.6; min-height: 14rem; }
.feld-gross input { font-size: 1rem; }

/* Speichern bleibt in Reichweite, ohne den Text zu verdecken: eigener
   Streifen mit Grund, nicht ein frei schwebender Knopf. */
.bm-speichern {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  padding: .7rem 0 .2rem;
  background: linear-gradient(to top, var(--bg) 62%, transparent);
}
.bm-speichern button { box-shadow: var(--shadow-lift); }

details.notiz > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: .9rem;
  display: flex;
  gap: .5rem;
  align-items: baseline;
}
details.notiz > p { margin: .6rem 0 0; font-size: .88rem; }

/* Ausklappbares: Plattformtexte, eigene Uhrzeiten */
details.ausklapp > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  user-select: none;
}
details.ausklapp > summary::-webkit-details-marker { display: none; }
details.ausklapp > summary::before {
  content: "▸";
  transition: transform .15s var(--ease);
  display: inline-block;
}
details.ausklapp[open] > summary::before { transform: rotate(90deg); }
details.ausklapp > summary:hover { color: var(--fg); }
details.ausklapp > summary .muted { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: auto; }
details.ausklapp[open] > summary { margin-bottom: .6rem; }
details.ausklapp.flach { border: none; box-shadow: none; padding: 0; background: none; margin-top: .8rem; }

/* ---------- Ziele als Schalter ---------- */

.ziel-wahl { display: flex; flex-direction: column; gap: .3rem; }
.ziel-schalter {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin: 0;
  padding: .4rem .55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.ziel-schalter:hover { border-color: var(--line-strong); }
.ziel-schalter:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); font-weight: 620; }

/* ---------- Veröffentlichung: eine Karte je Ziel ---------- */

.ziel-karten { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.ziel-karte {
  --status: var(--line-strong);
  padding: .55rem .7rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--status);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--status) 5%, var(--surface));
}
.ziel-karte.r-published { --status: var(--ok); }
.ziel-karte.r-failed    { --status: var(--danger); }
.ziel-karte.r-publishing { --status: var(--warn); }
.ziel-karte.spaet       { --status: var(--warn); }

.zk-kopf { display: flex; align-items: center; gap: .5rem; justify-content: space-between; }
.zk-name { font-weight: 640; font-size: .9rem; }
.zk-zeile { display: flex; align-items: baseline; gap: .5rem; justify-content: space-between; margin-top: .15rem; }
.zk-zeit { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.zk-link { font-size: .78rem; white-space: nowrap; }
.zk-hinweis { margin: .3rem 0 0; font-size: .74rem; color: var(--warn); }
.zk-fehler {
  margin: .35rem 0 0;
  font-size: .76rem;
  color: var(--danger);
  word-break: break-word;
}
.zk-technik { margin: .3rem 0 0; font-size: .7rem; }
.veroeffentlichung .metrics { margin-top: .35rem; }

/* ---------- Bildergalerie ---------- */

.galerie { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .8rem; }
.galerie-bild {
  width: 5.5rem; height: 5.5rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  overflow: hidden;
  cursor: zoom-in;
  display: grid;
  place-items: center;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), border-color .15s var(--ease);
}
.galerie-bild img { width: 100%; height: 100%; object-fit: cover; display: block; }
.galerie-bild:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--accent); }
.galerie-bild.fehlt {
  cursor: default;
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 10%, var(--surface-2));
  align-content: center;
  gap: .15rem;
  font-size: 1.1rem;
}
.galerie-bild.fehlt .small { font-size: .68rem; }

/* ---------- Leuchtkasten ---------- */

.leuchtkasten {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2.5rem 1rem;
  /* Bewusst als rgba statt color-mix: Der Grund muss dunkel sein, auch wo
     backdrop-filter nicht greift. */
  background: rgba(10, 9, 8, .88);
  backdrop-filter: blur(6px);
}
.leuchtkasten.offen { display: flex; animation: rise .2s var(--ease) both; }
body.kasten-offen { overflow: hidden; }

.lk-buehne { margin: 0; max-width: min(92vw, 1100px); max-height: 88vh; display: flex; flex-direction: column; gap: .5rem; }
.lk-buehne img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  display: block;
  margin: 0 auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.lk-buehne img.gewechselt { animation: lk-ein .28s var(--ease) both; }
@keyframes lk-ein {
  from { opacity: 0; transform: scale(.985); }
  to   { opacity: 1; transform: none; }
}
.lk-buehne figcaption {
  text-align: center;
  color: rgba(255, 255, 255, .75);
  font-size: .78rem;
  word-break: break-all;
}

.lk-zu, .lk-pfeil {
  border: none;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 0;
  transition: background .15s var(--ease), transform .15s var(--ease);
}
.lk-zu { position: absolute; top: 1rem; right: 1rem; width: 2.4rem; height: 2.4rem; font-size: 1rem; }
.lk-pfeil { width: 3rem; height: 3rem; font-size: 1.7rem; flex: 0 0 auto; }
.lk-zu:hover, .lk-pfeil:hover { background: rgba(255, 255, 255, .25); box-shadow: none; transform: none; }
.lk-zaehler {
  position: absolute;
  bottom: 1.1rem; left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, .8);
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, .12);
  padding: .15rem .7rem;
  border-radius: 999px;
}

@media (max-width: 60rem) {
  .beitrag-maske { grid-template-columns: 1fr; }
  .beitrag-kopfzeile { grid-template-columns: 1fr; }
  .beitrag-kopfzeile .bk-aktionen { grid-column: 1; grid-row: auto; justify-content: flex-start; margin-top: .5rem; }
  .lk-pfeil { width: 2.4rem; height: 2.4rem; font-size: 1.3rem; }
}

/* ---------- Anmelde-Assistent (Browser-Plattformen) ---------- */

.schritte { list-style: none; margin: 1.5rem 0; padding: 0; }
.schritte > .schritt {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.1rem 1.3rem;
  margin-bottom: 1rem;
}
.schritte > .schritt h2 { margin: 0 0 .6rem; font-size: 1.05rem; }
.schritte > .schritt[hidden] { display: none; }

/* Das Standbild vom Server. Feste Seitenverhaeltnisse verhindern, dass die
   Seite bei jedem Frame springt, solange noch kein Bild da ist. */
.fernbild {
  position: relative;
  aspect-ratio: 1280 / 800;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: crosshair;
  /* Bedienbar per Tastatur: der Rahmen zeigt, dass Tastendruecke ankommen. */
  outline-offset: 2px;
}
.fernbild:focus-visible { outline: 2px solid var(--accent); }
.fernbild img { width: 100%; height: 100%; display: block; object-fit: contain; }
.fernbild-leer {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--muted); font-size: .9rem;
  /* Der Hinweis liegt UEBER dem Bild - ohne das hier fingen seine Pixel jeden
     Klick ab, der eigentlich in den Browser auf dem Server gehoert. */
  pointer-events: none;
}
/* display:grid oben schlaegt sonst das [hidden] des Browsers - die Schicht
   bliebe fuer immer sichtbar, sobald das erste Bild da ist. */
.fernbild-leer[hidden] { display: none; }
.fernbild-fuss { display: flex; gap: .6rem; align-items: center; margin: .5rem 0 0; }
.tipps { margin: .8rem 0; }
.tipps .copyrow { margin-bottom: .3rem; }

/* ---------- Offline-Entwürfe ----------
   Dieselbe Kartenform wie die Beitragsliste, aber mit der Bildspalte links als
   Streifen: ein Entwurf hat oft ein Karussell, und beim Sichten will man alle
   Bilder sehen, nicht nur das erste. */

.ent-quelle {
  margin: 0 0 1.2rem;
  padding: .7rem .9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.ent-quelle > summary { cursor: pointer; font-weight: 560; }
.ent-quelle > summary::marker { color: var(--muted); }
.ent-quelle p { margin: .6rem 0 .4rem; }
.ent-upload { margin-top: .7rem; align-items: center; }

.ent-liste { display: flex; flex-direction: column; gap: .9rem; animation: none; }

.entwurf {
  display: grid;
  grid-template-columns: 12rem 1fr;
  gap: 1.1rem;
  padding: .9rem 1.1rem .9rem .95rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--neutral);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: rise .38s var(--ease) both;
  animation-delay: calc(min(var(--i, 0), 10) * 45ms);
}
/* Schon übernommen: tritt zurück, damit der Blick bei den offenen bleibt. */
.entwurf.ent-drin { border-left-color: var(--ok); opacity: .72; }
.entwurf.ent-drin:hover { opacity: 1; }

.ent-bilder { display: flex; flex-direction: column; gap: .4rem; }
.ent-bild {
  display: block;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.ent-bild img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ent-bild:hover { border-color: var(--accent); }

.ent-text { display: flex; flex-direction: column; gap: .55rem; min-width: 0; }
.ent-text .beitrag-titel { margin: 0; font-size: 1.06rem; }

/* Der Text steht so da, wie er rausgeht - Zeilenumbrüche sind Teil des Beitrags.
   Deshalb <pre> mit Umbruch statt <p>, und gedeckelt, damit eine lange Fassung
   nicht die ganze Liste auseinanderzieht. */
.ent-vorschau {
  margin: 0;
  padding: .6rem .75rem;
  max-height: 22rem;
  overflow: auto;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: .89rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ent-variante > summary { cursor: pointer; font-size: .87rem; color: var(--muted); }
.ent-variante[open] > summary { margin-bottom: .35rem; }

.ent-hinweise {
  margin: 0;
  padding: .5rem .75rem .5rem 1.7rem;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  background: color-mix(in srgb, var(--warn) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--line));
}
/* Was die Plattform nach dem Import ablehnen würde, wiegt schwerer als ein
   Schönheitsfehler im Ordner - deshalb die stärkere Farbe. */
.ent-hinweise.ent-probleme {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  border-color: color-mix(in srgb, var(--danger) 40%, var(--line));
}
.ent-hinweise li + li { margin-top: .2rem; }

.ent-aktionen { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: auto; padding-top: .3rem; }
.ent-aktionen form { margin: 0; }

@media (max-width: 40rem) {
  .entwurf { grid-template-columns: 1fr; gap: .7rem; padding: .8rem; }
  .ent-bilder { flex-direction: row; overflow-x: auto; }
  .ent-bild { flex: 0 0 8rem; }
}

/* ---------- Bild von der KI ----------
   Zwei Schritte: vorschlagen (billig) und erzeugen (kostet). Deshalb steht der
   Preis am Knopf und nicht im Kleingedruckten. */

.bild-ki { margin-top: 1.2rem; }
.ki-leiste { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin: .8rem 0; }
.ki-leiste form { margin: 0; }

.ki-idee {
  margin-top: .8rem;
  padding: .8rem .9rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
}
/* Schon erzeugt: tritt zurück, damit der Blick bei den offenen Vorschlägen bleibt. */
.ki-idee.ki-fertig { border-left-color: var(--ok); }

.ki-kopf { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .3rem; }
.ki-idee p { margin: .2rem 0 .5rem; }
.ki-idee form { margin: .6rem 0 0; }
.ki-idee label { margin: 0 0 .5rem; }
/* Der Prompt ist Maschinentext - monospace macht sichtbar, dass er wörtlich so rausgeht. */
.ki-idee textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .84rem;
  line-height: 1.5;
}
.ki-idee .galerie { margin: .5rem 0; }
.ki-aktionen { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
/* Der Preis steht IM Knopf. Auf dem dunklen .primary trägt die normale
   muted-Farbe nicht - deshalb dort die Schriftfarbe des Knopfes, nur blasser. */
.ki-aktionen button .muted { font-weight: 400; color: inherit; opacity: .72; }
.ki-aktionen button[disabled] { opacity: .5; cursor: not-allowed; }

/* Lagebericht des Claude-Assistenten: was gefunden wurde, Zeile für Zeile.
   Eine Tabelle, weil es genau das ist — Merkmal und Befund. */
.zugang-lage { width: auto; margin: .7rem 0; }
.zugang-lage td { padding: .3rem .8rem .3rem 0; border: none; vertical-align: middle; }
.zugang-lage td:first-child { color: var(--muted); font-size: .87rem; white-space: nowrap; }
.zugang-lage code { font-size: .8rem; }
.zugang-lage .chip { margin-right: .4rem; }

/* Wo man einen Zugang pflegt: die Adressen der Portale, gleich unter dem
   jeweiligen Block. Sie stehen an mehreren Stellen der Oberfläche und kommen
   überall aus derselben Quelle im Code. */
.pflege-links { margin: .6rem 0; padding-left: 1.1rem; font-size: .87rem; }
.pflege-links li { margin: .2rem 0; color: var(--muted); }
.pflege-links a { color: var(--accent); }
.pflege-fuss { margin: .6rem 0 0; }
.pflege-fuss a { color: var(--accent); }

/* Laufende Claude-Anmeldung: hebt sich ab, weil sie nur zwischen zwei Klicks
   existiert und man sie nicht übersehen soll. */
.anmeldung-lauf {
  margin: .8rem 0;
  padding: .9rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
}
.anmeldung-lauf p { margin: .4rem 0; }
.anmeldung-lauf form { margin-top: .8rem; }

/* ---------- Konsole der Claude-Anmeldung ----------
   Das, was in einem Terminal stünde: Ausgabe lesen, Zeile tippen. Serverseitig
   eingeblendet, damit es auch ohne JavaScript da ist. */

.konsole-schicht {
  position: fixed;
  inset: 0;
  z-index: 999;
  /* Jedes direkte Kind von <main> traegt eine Einblend-Animation, und eine
     Animation macht einen eigenen Stapelkontext auf. Hier ausdruecklich aus:
     sonst waere das Fenster in seinem eigenen Kontext gefangen und die naechste
     Karte legte sich darueber - genau so war es. */
  animation: none;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(20, 18, 15, .55);
  backdrop-filter: blur(2px);
  animation: rise .2s var(--ease) both;
}
.konsole-fenster {
  width: min(52rem, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
}
.konsole-kopf { display: flex; align-items: center; gap: .7rem; margin-bottom: .7rem; }
.konsole-kopf form { margin-left: auto; }
.konsole-adresse { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin: .6rem 0; }

/* Die Ausgabe der CLI, so wie sie kommt. Dunkel, weil es eine Konsole ist. */
.konsole-text {
  margin: .6rem 0;
  padding: .8rem .9rem;
  min-height: 8rem;
  max-height: 40vh;
  overflow: auto;
  border-radius: var(--radius-sm);
  background: #1c1e22;
  color: #e6e2da;
  border: 1px solid #34383e;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .82rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.konsole-eingabe { display: flex; align-items: center; gap: .5rem; margin: .6rem 0 .3rem; }
.konsole-eingabe input { flex: 1 1 auto; margin-top: 0; }
/* Der Prompt macht sichtbar, dass hier wirklich in die Konsole getippt wird. */
.konsole-zeichen { color: var(--accent); font-weight: 700; font-family: ui-monospace, monospace; }

@media (max-width: 40rem) {
  .konsole-schicht { padding: .6rem; }
  .konsole-eingabe { flex-wrap: wrap; }
}

/* Die Schritte im Anmelde-Modal: was zu tun ist, in der Reihenfolge. */
.konsole-schritte { margin: .6rem 0; padding-left: 1.4rem; }
.konsole-schritte li { margin: .45rem 0; line-height: 1.5; }
.konsole-schritte li:first-child { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }

/* Schrittfolge im Anmelde-Assistenten: was dran ist, was erledigt, was wartet. */
.schrittfolge { list-style: none; margin: .8rem 0; padding: 0; }
.schrittfolge li { display: flex; gap: .8rem; padding: .6rem 0; border-top: 1px solid var(--line); }
.schrittfolge li:first-child { border-top: none; }
.schritt-nr {
  flex: none;
  width: 1.7rem; height: 1.7rem;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: .82rem; font-weight: 700;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--line);
}
.schrittfolge .aktiv .schritt-nr { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.schrittfolge .erledigt .schritt-nr { background: var(--ok); color: #fff; border-color: var(--ok); }
/* Noch nicht dran: sichtbar, aber zurückgenommen — man soll sehen, was kommt. */
.schrittfolge .offen { opacity: .5; }
.schritt-inhalt { min-width: 0; flex: 1 1 auto; }
.schritt-inhalt p { margin: .3rem 0; }
.schritt-inhalt .copyrow { margin-top: .4rem; }
.schritt-inhalt .ki-leiste { margin: .4rem 0 0; }

/* ---------- Planen ---------- */
.themenliste { display: flex; flex-direction: column; gap: .5rem; margin: .8rem 0 0; }
.thema {
  display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap;
  padding: .6rem .8rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  text-decoration: none; color: var(--fg);
}
.thema:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.thema .muted { flex: 1 1 100%; }
.planer-zeile { display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: flex-end; }
.planer-zeile label { flex: 1 1 14rem; margin: .7rem 0; }
.planer-zeile input[type=number] { width: 6rem; }

/* Die Reihe, zu der ein Beitrag gehört: von hier zu den Geschwistern. */
.serie { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin-top: .4rem; }
.serie-teil {
  display: grid; place-items: center;
  width: 1.6rem; height: 1.6rem;
  border-radius: 50%;
  font-size: .78rem; font-weight: 650;
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--muted); text-decoration: none;
}
.serie-teil:hover { border-color: var(--accent); color: var(--fg); }
.serie-teil.hier { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }

/* Das Ergebnis der Planung, direkt auf der Seite statt nach einem Sprung. */
.planergebnis { margin-top: 1.2rem; border-left: 3px solid var(--ok); }
.ergebnisliste { margin: .6rem 0; padding-left: 1.2rem; }
.ergebnisliste li { margin: .35rem 0; }
.ergebnisliste a { font-weight: 560; }
.ergebnisliste .muted { display: block; font-size: .82rem; }

/* ---------- Geteilte Vorschau ----------
   Eigene, sehr schlichte Seite: keine Navigation, kein Umschalter. Wer sie
   sieht, hat keinen Zugang zum System und soll auch keinen Eindruck davon
   bekommen — nur den einen Beitrag. */
body.geteilt main { max-width: 44rem; }
.geteilt-kopf { margin-bottom: 1.4rem; }
.geteilt-kopf h1 { margin: .3rem 0; font-size: 1.5rem; line-height: 1.25; }
.geteilt-fuss { margin-top: 1.6rem; padding-top: .8rem; border-top: 1px solid var(--line); }

/* Größer als in der Arbeitsansicht: Hier wird das Bild beurteilt, nicht
   wiedererkannt. Auf dem Handy nimmt es die ganze Breite. */
body.geteilt .galerie { gap: .7rem; }
body.geteilt .galerie-bild { width: 16rem; height: auto; aspect-ratio: 4 / 5; }
body.geteilt .galerie-bild img { object-fit: contain; background: var(--surface-2); }
@media (max-width: 34rem) {
  body.geteilt .galerie-bild { width: 100%; }
}

.kanal { padding: .6rem 0; border-top: 1px solid var(--line); }
.kanal:first-of-type { border-top: none; }
.kanal-kopf { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; margin-bottom: .3rem; }
.kanal .preview { margin: .4rem 0 0; }

/* Bild aus dem Beitrag nehmen: das × sitzt auf dem Bild, aber außerhalb des
   Vorschau-Knopfes — sonst öffnete jeder Löschklick zuerst die Lightbox. */
.galerie-platz { position: relative; display: inline-block; }
.bild-weg {
  position: absolute; top: -.4rem; right: -.4rem;
  width: 1.5rem; height: 1.5rem; padding: 0;
  display: grid; place-items: center;
  border-radius: 50%; line-height: 1;
  font-size: 1rem; font-weight: 700;
  background: var(--surface); color: var(--danger);
  border: 1px solid var(--line-strong);
  opacity: 0; transition: opacity .15s var(--ease);
}
.galerie-platz:hover .bild-weg,
.bild-weg:focus-visible { opacity: 1; }
.bild-weg:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
/* Ohne Zeigegerät gibt es kein Hover — dort immer sichtbar. */
@media (hover: none) { .bild-weg { opacity: 1; } }

/* Die Anbieterwahl steht einmal über den Erzeugen-Knöpfen und gilt für alle. */
.anbieter-wahl { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: .6rem 0; }
.anbieter-wahl select { margin-top: 0; width: auto; }

/* Die Beitragsliste im geteilten Plan: eine Zeile je Beitrag, ganz anklickbar. */
.plan-zeile {
  display: flex; gap: .8rem; align-items: center;
  padding: .6rem 0; border-top: 1px solid var(--line);
  text-decoration: none; color: var(--fg);
}
.plan-zeile:first-of-type { border-top: none; }
.plan-zeile:hover .plan-text strong { color: var(--accent); }
.plan-bild {
  flex: none; width: 3.6rem; aspect-ratio: 4 / 5;
  display: grid; place-items: center; overflow: hidden;
  border-radius: var(--radius-sm); background: var(--surface-2);
  border: 1px solid var(--line);
}
.plan-bild img { width: 100%; height: 100%; object-fit: cover; }
.plan-text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
/* Im geteilten Plan ist die Zeitschiene reine Anzeige - keine Spannen-Umschalter. */
body.geteilt .zeitschiene { margin-bottom: 1.2rem; }

/* Plan teilen: sitzt über der Liste, klappt auf, wenn ein Link aktiv ist. */
.plan-teilen {
  margin: 0 0 1.1rem;
  padding: .7rem .9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.plan-teilen > summary { cursor: pointer; font-weight: 560; }
.plan-teilen p { margin: .6rem 0 .4rem; }
.plan-teilen form.row { margin-top: .6rem; }
.plan-teilen select { margin-top: 0; width: auto; }


/* ============================================================
   Laborbild — Bauteile, die es vorher nicht gab, und
   Nachschaerfungen an bestehenden. Steht am Ende, damit es
   gewinnt, ohne dass oben etwas geloescht werden muss.
   ============================================================ */

/* ---------- Abschnitt als Geraeteblende ---------- */

.feld-block {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem 1.5rem;
  margin: 1.1rem 0;
  box-shadow: var(--shadow);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.feld-block:focus-within { border-color: var(--accent-line); box-shadow: var(--shadow-lift); }
.feld-block > h2:first-child { margin-top: 0; }

/* Die Schrittnummer vor der Ueberschrift. Maschinenschrift, Ring, keine Fuellung -
   wie eine Beschriftung an einem Bedienfeld. */
h2 .schritt {
  display: inline-grid;
  place-items: center;
  width: 1.55rem; height: 1.55rem;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  font: 650 .78rem/1 var(--mono);
}

/* ---------- Zwischenspeicher-Anzeige ---------- */

.speicher-anzeige {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font: 500 .76rem/1.5 var(--mono);
  white-space: nowrap;
  transition: opacity .3s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.speicher-anzeige .ico { width: 1rem; height: 1rem; color: var(--faint); }
/* Kurz nach dem Speichern faerbt sie sich, dann wird sie wieder still. Der
   Zwischenspeicher soll bemerkt, aber nicht beachtet werden. */
.speicher-anzeige.frisch { color: var(--ok); border-color: #c5e5d3; background: var(--ok-soft); }
.speicher-anzeige.frisch .ico { color: var(--ok); animation: haken-auf .4s var(--ease-aus) both; }
@keyframes haken-auf {
  from { transform: scale(.6); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}

/* ---------- Bilddeutungen ---------- */

.notizen { display: grid; gap: .8rem; margin-top: 1.1rem; }

.notizen .notiz {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: start;
  padding: .9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  animation: rise .3s var(--ease) both;
}
.notizen .notiz-bilder { display: flex; gap: .35rem; flex-wrap: wrap; max-width: 12rem; }
.notizen .notiz-bilder img {
  width: 3.4rem; height: 3.4rem;
  object-fit: cover;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  transition: transform .18s var(--ease);
}
.notizen .notiz-bilder img:hover { transform: scale(1.12); z-index: 2; }
.notizen .notiz-text { min-width: 0; }
.notizen .notiz-text .chip { margin: 0 .3rem .45rem 0; }
.notizen .notiz-text textarea {
  margin-top: .25rem;
  font-size: .9rem;
  background: var(--surface-2);
  border-color: var(--line);
}
.notizen .notiz-text textarea:focus { background: var(--surface); }
.notizen .notiz-text p { margin: .35rem 0 0; }
.notizen .notiz > .ico-knopf { align-self: start; }

@media (max-width: 40rem) {
  .notizen .notiz { grid-template-columns: 1fr auto; }
  .notizen .notiz-bilder { grid-column: 1 / -1; max-width: none; }
}

/* ---------- Themenvorschlaege ---------- */

.themenliste { display: grid; gap: .55rem; margin-top: 1rem; }
.themenliste .thema {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .25rem .8rem;
  padding: .8rem .95rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-decoration: none;
  color: var(--fg);
  transition: border-color .16s var(--ease), background .16s var(--ease),
              transform .16s var(--ease), box-shadow .16s var(--ease);
  animation: rise .3s var(--ease) both;
}
.themenliste .thema strong { font-weight: 600; letter-spacing: -.005em; }
.themenliste .thema .muted { grid-column: 1 / -1; }
.themenliste .thema:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  transform: translateX(2px);
  box-shadow: var(--shadow);
}
/* Die Vorschlaege laufen nacheinander ein statt alle auf einmal. */
.themenliste .thema:nth-child(1) { animation-delay: .02s; }
.themenliste .thema:nth-child(2) { animation-delay: .06s; }
.themenliste .thema:nth-child(3) { animation-delay: .10s; }
.themenliste .thema:nth-child(4) { animation-delay: .14s; }
.themenliste .thema:nth-child(5) { animation-delay: .18s; }
.themenliste .thema:nth-child(6) { animation-delay: .22s; }

/* ---------- Ziel-Schalter ---------- */

.ziel-wahl { display: flex; flex-wrap: wrap; gap: .5rem; margin: .6rem 0 .2rem; }
.ziel-schalter {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin: 0;
  padding: .42rem .8rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: .87rem;
  font-weight: 520;
  cursor: pointer;
  transition: border-color .16s var(--ease), background .16s var(--ease), color .16s var(--ease);
}
.ziel-schalter:hover { border-color: var(--line-kontrast); background: var(--surface-2); }
.ziel-schalter:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.planer-zeile { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.planer-zeile > label { flex: 1 1 13rem; margin-top: .4rem; }
.feld-gross input, .feld-gross textarea { font-size: 1rem; }

/* ---------- Dropzone ---------- */

.dropzone {
  border: 1.5px dashed var(--line-kontrast);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
  transition: border-color .18s var(--ease), background .18s var(--ease),
              color .18s var(--ease);
}
.dropzone:hover { border-color: var(--accent-line); background: var(--accent-soft); color: var(--fg-2); }
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.dz-thumb { border-radius: var(--radius-xs); border: 1px solid var(--line-strong); }

/* ---------- Fortschritt: der Laufbalken ---------- */

.progress {
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar { background: var(--accent); border-radius: 999px; }
.progress-bar.indeterminate {
  background: linear-gradient(90deg, transparent, var(--accent-hell), transparent);
}

/* Ein Knopf, der wartet, bekommt einen wandernden Schimmer statt eines Spinners. */
button[data-wartend] {
  position: relative;
  overflow: hidden;
  pointer-events: none;
  opacity: .8;
}
button[data-wartend]::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
  animation: schimmer 1.2s linear infinite;
}
@keyframes schimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

/* ---------- Karten ---------- */

.card-block {
  border-color: var(--line-strong);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease),
              transform .18s var(--ease);
}
.card-block:hover {
  border-color: var(--line-kontrast);
  box-shadow: var(--shadow-lift);
  transform: translateY(-1px);
}

/* ---------- Ruhe, wenn gewuenscht ---------- */

/* Wer im System Bewegung abgestellt hat, bekommt hier keine. Das ist keine
   Hoeflichkeit, sondern fuer manche Menschen die Bedingung dafuer, dass sie die
   Oberflaeche ueberhaupt benutzen koennen. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Das Symbol in der Dropzone ist ein echtes Konturensymbol, kein Pfeilzeichen. */
.dropzone .dz-icon { display: inline-block; line-height: 0; }
.dropzone .dz-icon .ico { width: 1.6rem; height: 1.6rem; }

/* ---------- Hintergrundauftraege ---------- */

/* Anker unter der klebenden Kopfzeile: Ohne Abstand verschwindet das Sprungziel
   (etwa #bild-ki nach "Bildideen vorschlagen") genau hinter ihr. */
[id] { scroll-margin-top: 5.5rem; }

/* Der Hinweis "laeuft gerade" auf der Beitragsseite. */
.laeuft-box { align-items: center; }
.laeuft-box > .ico { color: var(--accent); animation: puls-ico 1.8s var(--ease) infinite; }
.laeuft-box a { margin-left: .35rem; font-weight: 600; }
@keyframes puls-ico { 50% { opacity: .35; } }

/* Zurueckhaltender Verweis im Knopf-Look - neben der Haupthandlung. */
.button-link.ghost-link {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--fg-2);
}
.button-link.ghost-link:hover {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent);
}

.auftrag-block .auftrag-meldung {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: 1rem;
}
.auftrag-block .progress { margin: .9rem 0 .5rem; height: .45rem; }
