/* Freigabe-Oberfläche des Kerns. Markenneutral: alle Farben, die Schrift
   und die Radien kommen als --marke-* Variablen aus brand.yaml, die der
   Server in jede Seite schreibt (web/server.ts, markenStil). Hier stehen
   nur Rollen. Keine Schatten, keine Verläufe, viel Leerraum.
   Formensprache seit ADR 0017 (nach Apple-Gestaltungsprinzipien, Vorbild
   Ecofit ADR 0017): Satzschreibung, Hierarchie über Größe und Gewicht,
   Radien aus brand.yaml, Status als Punkt statt Randstreifen, Kopfleiste
   als Material, sofortige Rückmeldung beim Drücken. */

:root {
  color-scheme: light;

  /* Rollen der Oberfläche, abgeleitet aus den Marken-Tokens */
  --ink: var(--marke-ink);
  --ink-weich: var(--marke-muted);
  --linie: var(--marke-line);
  --linie-stark: var(--marke-faint);
  --bg: var(--marke-paper);
  --flaeche: var(--marke-card);
  --auf-dunkel: var(--marke-paper);
  /* Sekundärflächen: neutrale Buttons, Chips, Badges, Segment-Navigation */
  --fuellung: color-mix(in srgb, var(--marke-line) 55%, var(--marke-paper));
  /* Grund als Material unter der stehenden Kopfleiste */
  --bg-glas: color-mix(in srgb, var(--marke-paper) 78%, transparent);

  /* Akzent für "wartet" und Hinweise, sparsam */
  --gelb: var(--marke-amber);
  --gelb-weich: color-mix(in srgb, var(--marke-amber) 18%, var(--marke-card));
  --gelb-dunkel: var(--marke-amber700);
  /* Signal für Fehler und Ausfall */
  --koralle: var(--marke-amber700);
  --koralle-weich: color-mix(in srgb, var(--marke-amber700) 14%, var(--marke-card));
  --koralle-dunkel: var(--marke-amber700);
  /* Einzige Aktionsfarbe, auch Bestätigung */
  --gruen: var(--marke-tann);
  --gruen-weich: color-mix(in srgb, var(--marke-tann) 14%, var(--marke-card));
  --salbei: color-mix(in srgb, var(--marke-tann) 45%, var(--marke-card));
  --lavendel: var(--marke-faint);
  /* Fokusring: Akzentfarbe, kein Schatten */
  --fokus: var(--marke-amber700);
  --fokus-weich: color-mix(in srgb, var(--marke-amber) 40%, var(--marke-card));

  /* Radien aus brand.yaml: radius.card (Karten, Boxen), radius.btn (Felder,
     Buttons), radius.pill (Navigation, Badges, Chips) */
  --radius-karte: var(--marke-radius-card);
  --radius-feld: var(--marke-radius);
  --radius-pille: var(--marke-radius-pill);
  --radius-klein: calc(var(--marke-radius) * .8);
  /* Rückmeldung beim Drücken */
  --druck: transform 100ms ease-out;
  /* Zahlen (Zähler, Badges, Insights, Termine): fonts.mono aus brand.yaml */
  --mono: var(--marke-mono), SFMono-Regular, Menlo, Consolas, monospace;
  --serif-frei: var(--marke-sans), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --versal: var(--marke-sans), -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

body {
  font-family: var(--serif-frei);
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-optical-sizing: auto;
}

main { max-width: 900px; margin: 0 auto; padding: 0 16px 72px; }

/* Überschriften in Satzschreibung: Größe, Gewicht und Laufweite tragen die
   Hierarchie. Große Schrift läuft enger, kleine bleibt neutral. */
h1, h2, h3 { font-family: var(--versal); font-weight: 600; color: var(--ink); }
h1 { font-size: 1rem; margin: 0; letter-spacing: -.005em; }
h2 { font-size: 1.3rem; line-height: 1.2; letter-spacing: -.02em; margin: 40px 0 14px; }
h3 { font-size: 1rem; line-height: 1.3; letter-spacing: -.01em; margin: 22px 0 8px; }

a { color: var(--ink); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--fokus); outline-offset: 2px; }

/* Kundenvorschau: die Agentur sieht die Kundenansicht, die Session bleibt
   die eigene. Die Leiste macht den Modus unübersehbar und führt zurück. */
.vorschau-leiste {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius-karte);
  padding: 12px 16px;
  margin: 12px 0 0;
  font-size: .85rem;
}
.vorschau-leiste strong { font-family: var(--versal); font-weight: 600; margin-right: 8px; }
.vorschau-leiste form { flex: 0 0 auto; }
.vorschau-leiste button { width: auto; min-height: 0; padding: 9px 14px; font-size: .82rem; }

.abstand-oben { margin-top: 10px; }

/* ---------- Kopf ---------- */

/* Kopfleiste als Material: bleibt beim Scrollen stehen, der Inhalt läuft
   unscharf darunter durch. Statt harter Linie trennt nur eine feine Kante. */
.kopf {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 0 -16px 28px;
  padding: 14px 16px;
  background: var(--bg-glas);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--linie);
}
.marke { display: flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.marke h1 { color: var(--ink-weich); padding-left: 12px; border-left: 1px solid var(--linie-stark); }
/* Segment-Navigation: der aktive Punkt ist eine helle Pille auf der Füllung. */
.kopf nav { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--fuellung); border-radius: var(--radius-pille); min-width: 0; }
.kopf nav a {
  font-size: .84rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  color: var(--ink-weich);
  padding: 7px 13px;
  border-radius: var(--radius-pille);
  transition: background-color .15s ease, color .15s ease, var(--druck);
  -webkit-tap-highlight-color: transparent;
}
.kopf nav a:hover { color: var(--ink); }
.kopf nav a:active { transform: scale(.97); }
.kopf nav a[aria-current="page"] { color: var(--ink); background: var(--flaeche); }

/* ---------- Handlungsaufforderung ---------- */

/* Die Aufforderung ist die Aktion der Seite: Fläche in der Aktionsfarbe. */
.cta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: var(--gruen);
  color: var(--auf-dunkel);
  border-radius: var(--radius-karte);
  padding: 20px 22px;
  text-decoration: none;
  margin-bottom: 12px;
  transition: var(--druck);
  -webkit-tap-highlight-color: transparent;
}
a.cta:active { transform: scale(.985); }
.cta.ruhig { background: var(--flaeche); color: var(--ink); border: 1px solid var(--linie); }
.cta strong { font-family: var(--versal); font-weight: 600; letter-spacing: -.01em; font-size: 1.1rem; line-height: 1.25; }
.cta span { font-size: .85rem; color: var(--ink-weich); }
.cta:not(.ruhig) span { color: var(--auf-dunkel); opacity: .8; }

/* ---------- Wochenplan ---------- */

.woche { margin-top: 26px; }
/* "Diese Woche" steht wie die anderen Wochen frei, die Überschrift reicht als Anker. */
.woche.box { background: none; border: 0; padding: 0; }
/* Überschrift und Fortschritt umbrechen sauber linksbündig, auch auf dem Handy. */
.woche h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.woche h2 .badge { margin: 0; font-family: var(--serif-frei); letter-spacing: 0; font-weight: 500; }
/* Alle Kacheln einer Reihe gleich hoch (stretch): leere und ausgefallene
   Termine stehen bündig neben Kacheln mit Vorschau. Termine und eigene
   Videos teilen sich das Raster, nach Zeit sortiert. */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 14px; align-items: stretch; }
.slot {
  --status: var(--linie-stark);
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius-karte);
  padding: 10px 10px 12px;
  text-decoration: none;
  min-height: 124px;
  min-width: 0;
  transition: border-color .15s ease, var(--druck);
  -webkit-tap-highlight-color: transparent;
}
/* Kachel als Spalte: Vorschau oben, Text darunter, Badges unten bündig.
   Der Abstandhalter (order 1) schiebt die Badges (order 2) an den Fuß. */
.slot::after { content: ""; order: 1; flex: 1 1 auto; margin: -3px 0; }
.slot .slot-badges { order: 2; }
a.slot:hover { border-color: var(--linie-stark); }
a.slot:active { transform: scale(.98); }
/* Drag-and-drop ohne Neuladen (plan.js, Vertrag #plan-inhalt, ADR 0012 bei Ecofit) */
.slot[draggable="true"] { cursor: grab; }
.slot.wird-gezogen { opacity: .5; border-style: dashed; }
.slot img { -webkit-user-drag: none; user-select: none; }
.slot.eingerastet { animation: einrasten .35s ease-out; border-color: var(--ink); }
@keyframes einrasten { from { transform: scale(1.04); background: var(--gelb-weich); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .slot.eingerastet { animation: none; } }
/* Während des Speicherns gesperrt, damit kein zweiter Zug auf altem Stand läuft. */
.plan-speichert .slot { pointer-events: none; }
.plan-speichert .slots { cursor: progress; }
/* Beim Ziehen treten Kacheln zurück, auf die nichts abgelegt werden kann. */
.plan-zieht .slot:not([data-ziel="1"]) { opacity: .4; }
.plan-zieht .slot.wird-gezogen { opacity: .5; }
/* Spezifischer als .slot.s-leer, sonst sieht man das Ziel auf leeren Terminen nicht. */
#plan-inhalt .slot.drop-ziel { background: var(--gelb-weich); border: 1px solid var(--ink); outline: 2px solid var(--gelb); outline-offset: 1px; }
.drag-hinweis { font-size: .84rem; margin: 6px 0 14px; }
@media (hover: none) { .drag-hinweis { display: none; } }
/* Vorschau oben in der Kachel, Radius konzentrisch zur Karte (Karte minus Innenabstand). */
.slot img, .slot .platzhalter { order: -1; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: calc(var(--radius-karte) - 10px); background: var(--bg); }
.slot-tag { font-size: .74rem; font-weight: 500; color: var(--ink-weich); padding: 2px 4px 0; font-variant-numeric: tabular-nums; }
.slot-status { display: flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 500; padding: 0 4px; }
/* Status als Punkt in der Statusfarbe statt farbigem Randstreifen. */
.slot-status::before, .detail-status > span:first-child::before, .monat-zeit::before, .gate-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status, var(--linie-stark));
  flex-shrink: 0;
}
.slot-titel { font-family: var(--versal); font-weight: 600; font-size: .86rem; line-height: 1.3; letter-spacing: -.005em; padding: 0 4px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.slot-hinweis { font-size: .78rem; color: var(--ink-weich); padding: 0 4px; }
.slot > .slot-badges { padding: 0 4px; }

.s-warten { --status: var(--gelb); }
.s-warten .slot-status { color: var(--gelb-dunkel); }
.s-geplant { --status: var(--salbei); }
.s-live { --status: var(--gruen); }
.s-arbeit { --status: var(--lavendel); }
.s-fehler { --status: var(--koralle); }
.s-fehler .slot-status { color: var(--koralle-dunkel); }
.s-abgelehnt { --status: var(--linie-stark); }
.slot.s-leer { background: transparent; border: 1.5px dashed var(--linie-stark); padding: 14px; }
.slot.s-leer .slot-status::before { display: none; }
.slot.s-leer .slot-tag, .slot.s-leer .slot-status, .slot.s-leer .slot-hinweis, .slot.s-leer > .slot-badges { padding: 0; }
.slot.s-ausgefallen { background: var(--koralle-weich); border-color: var(--koralle); --status: var(--koralle); padding: 14px; }
.slot.s-ausgefallen .slot-tag, .slot.s-ausgefallen .slot-status, .slot.s-ausgefallen .slot-hinweis { padding: 0; }
.slot.s-ausgefallen .slot-status { color: var(--koralle-dunkel); }

/* ---------- Detailseite ---------- */

/* Status frei über der Vorschau: Punkt und Statuswort groß, Termin gedämpft. */
.detail-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: 18px;
  font-size: .9rem;
}
.detail-status > span:first-child { display: inline-flex; align-items: center; gap: 8px; font-family: var(--versal); font-weight: 600; font-size: 1.3rem; line-height: 1.2; letter-spacing: -.02em; }
.detail-status > span:first-child::before { width: 10px; height: 10px; }
.detail-status > span:last-child { color: var(--ink-weich); }

.feed {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius-karte);
  overflow: hidden;
  max-width: 470px;
  margin: 0 auto;
}
.feed-kopf { display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-size: .88rem; border-bottom: 1px solid var(--linie); }
.feed-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  /* Wie das Favicon: Initiale der Wortmarke auf der Markenfläche, die Farbe setzt markenStil aus brand.yaml. */
  background: var(--bg);
  border: 1px solid var(--linie);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--marke-sans); font-weight: 700; font-size: 1.05rem; line-height: 1;
  flex-shrink: 0;
}
.feed-bilder { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
.feed-bilder img, .feed-bilder .platzhalter { width: 100%; flex-shrink: 0; scroll-snap-align: center; aspect-ratio: 4 / 5; object-fit: cover; }
.feed-bilder .platzhalter { background: var(--bg); }
.feed-bilder img { scroll-margin-top: 80px; }
.fakt { margin: 0 0 6px; color: var(--ink-weich); font-size: .9rem; }
.fakt + details, .hinweis + details { margin-top: 12px; }
.box .pruefliste { margin: 10px 0 14px; }
form.box h3 { margin: 0 0 6px; }
form.box details { margin: 0 0 12px; }
/* Carousel-Punkte wie bei Instagram, aber als Anker auf die Kacheln. */
.feed-punkte { display: flex; justify-content: center; gap: 6px; padding: 10px 8px 4px; }
.feed-punkte a { width: 7px; height: 7px; border-radius: 50%; background: var(--linie-stark); display: block; }
.feed-punkte a:hover, .feed-punkte a:focus-visible { background: var(--ink); }
.feed-caption { padding: 12px 14px 16px; font-size: .88rem; line-height: 1.5; }
.feed-tags { color: var(--ink-weich); margin-top: 8px; font-size: .85rem; }

/* ---------- Boxen und Formulare ---------- */

/* Boxen laufen auf die Breite ihres Containers. Nur die Freigabestrecke
   steht in .spalte, damit Aktionen und Feed-Vorschau gleich breit sind. */
.spalte { max-width: 470px; margin: 0 auto; }

.box {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius-karte);
  padding: 18px 20px;
  margin: 14px 0 0;
}
/* Aufklapper: Satzschreibung, Pfeil rechts, dreht beim Öffnen. */
summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--versal);
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: -.005em;
  -webkit-tap-highlight-color: transparent;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "";
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--ink-weich);
  border-bottom: 2px solid var(--ink-weich);
  transform: translateY(-2px) rotate(45deg);
  transition: transform .2s ease;
  flex-shrink: 0;
}
details[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
details[open] > summary { margin-bottom: 12px; }
.box > h2:first-child, .box > h3:first-child { margin-top: 0; }
.box ul { margin: 0; padding-left: 20px; }
.box li { margin: 4px 0; }

.onboarding p { margin: 12px 0 0; color: var(--ink-weich); max-width: 62ch; }

/* Ablauf in vier Schritten. Die kurze Linie über jedem Schritt in der
   Markenfarbe, keine Icons, kein Akzent je Schritt. */
.schritte {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.schritte li { display: flex; flex-direction: column; gap: 6px; }
.schritte li::before { content: ""; display: block; width: 40px; height: 3px; border-radius: var(--radius-pille); background: var(--gruen); margin-bottom: 12px; }
.schritt-nr { font-family: var(--mono); font-size: .74rem; color: var(--ink-weich); font-variant-numeric: tabular-nums; }
.schritte strong { font-family: var(--versal); font-weight: 600; font-size: .98rem; letter-spacing: -.01em; }
.schritte li > span:last-child { font-size: .85rem; line-height: 1.5; color: var(--ink-weich); }
.schritte em { font-style: normal; font-weight: 500; color: var(--ink); }
.onboarding .schritte-fuss {
  margin: 24px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--linie);
  font-size: .85rem;
  max-width: none;
}

@media (max-width: 820px) { .schritte { grid-template-columns: repeat(2, 1fr); gap: 22px; } }
@media (max-width: 520px) { .schritte { grid-template-columns: 1fr; gap: 20px; } }

/* Auch Felder ohne type-Attribut: input[type="text"] greift dort nicht,
   der Attributselektor prüft das Attribut, nicht den effektiven Typ. */
textarea, select, input:not([type]), input[type="email"], input[type="password"], input[type="number"], input[type="text"] {
  width: 100%;
  font: inherit;
  padding: 11px 12px;
  border-radius: var(--radius-feld);
  border: 1px solid var(--linie-stark);
  background: var(--flaeche);
  color: var(--ink);
  transition: border-color .15s ease, outline-color .15s ease;
}
/* Fokus als ruhiger Ring in der Akzentfarbe um das Feld, kein Schatten. */
textarea:focus-visible, select:focus-visible, input:focus-visible {
  outline: 3px solid var(--fokus-weich);
  outline-offset: 0;
  border-color: var(--fokus);
}
textarea { margin: 6px 0 14px; }
select { margin: 6px 0 14px; height: 44px; }
input[type="email"], input[type="password"], input[type="text"] { margin: 6px 0 14px; }

/* Formularseiten laufen schmaler als der Wochenplan: bei 900 px reißen
   Beschriftung und Eingabefeld zu weit auseinander. */
.formular { max-width: 620px; margin: 0 auto; }
/* Beschriftetes Eingabefeld: label, optionaler Hinweis und Feld stehen
   immer untereinander. label ist von Haus aus inline, ohne diesen Block
   rutschen Beschriftung und Feld nebeneinander. */
.feld { display: block; margin-bottom: 18px; }
.feld > label { display: block; margin-bottom: 6px; }
.feld > input { display: block; width: 100%; margin: 0 0 8px; }
.feld > input:last-child { margin-bottom: 0; }
.feldhinweis { margin: 0 0 8px; font-size: .8rem; color: var(--ink-weich); }

/* Kachel-Texte: ein Formular je Kachel, sichtbar voneinander getrennt. */
.slide-text { margin-top: 20px; }
.slide-text + .slide-text { padding-top: 20px; border-top: 1px solid var(--linie); }
.slide-text h3 { margin: 0 0 14px; }
label { font-size: .86rem; font-weight: 500; color: var(--ink); }

/* Buttons in Satzschreibung. Rückmeldung sofort beim Drücken (nicht erst
   beim Loslassen): leicht kleiner und dunkler, 100 ms. */
button {
  font-family: var(--versal);
  font-size: .92rem;
  font-weight: 600;
  letter-spacing: -.005em;
  border: 1px solid transparent;
  border-radius: var(--radius-feld);
  padding: 13px 18px;
  min-height: 48px;
  cursor: pointer;
  width: 100%;
  background: var(--fuellung);
  color: var(--ink);
  transition: filter .15s ease, var(--druck);
  -webkit-tap-highlight-color: transparent;
}
button:hover { filter: brightness(.96); }
button:active { filter: brightness(.9); transform: scale(.97); }
.zeile { display: flex; gap: 10px; flex-wrap: wrap; }
.zeile form { flex: 1; min-width: 180px; }
.ok { background: var(--gruen); color: var(--auf-dunkel); }
.neutral { background: var(--fuellung); border-color: transparent; }
.warn { background: var(--koralle); color: var(--auf-dunkel); }

.leer { color: var(--ink-weich); }
.fehler { color: var(--koralle-dunkel); background: var(--koralle-weich); border-radius: var(--radius-feld); padding: 12px; }
.hinweis { color: var(--koralle-dunkel); font-weight: 500; }

/* ---------- Banner ---------- */

/* Banner: getönte Fläche ohne Rahmen, die Farbe trägt die Art der Meldung. */
.banner {
  background: var(--gelb-weich);
  border: 1px solid transparent;
  border-radius: var(--radius-karte);
  padding: 14px 18px;
  margin-bottom: 14px;
  font-size: .92rem;
  animation: auftauchen .25s ease-out;
}
@keyframes auftauchen { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.banner.ruhig { background: var(--flaeche); border-color: var(--linie); color: var(--ink-weich); }
.banner.erfolg { background: var(--gruen-weich); }
.banner.warnung { background: var(--koralle-weich); }

/* ---------- Mix-Einstellungen ---------- */

.mix-zeile { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--linie); }
.mix-zeile:last-of-type { border-bottom: 0; }
.mix-eingabe { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.mix-eingabe input { width: 76px; text-align: right; }

/* ---------- Chips, Karten, Badges ---------- */

.chips { margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: .85rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--fuellung);
  border: 1px solid transparent;
  border-radius: var(--radius-pille);
  padding: 7px 14px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: background-color .15s ease, var(--druck);
  -webkit-tap-highlight-color: transparent;
}
.chip:hover { background: var(--linie); }
.chip:active { transform: scale(.97); }
.chip.aktiv { background: var(--ink); color: var(--flaeche); border-color: var(--ink); }
@media (pointer: coarse) { .chip { min-height: 44px; } }

.karte {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius-karte);
  padding: 10px 14px 10px 10px;
  margin: 10px 0;
  text-decoration: none;
  transition: border-color .15s ease, var(--druck);
  -webkit-tap-highlight-color: transparent;
}
.karte:hover { border-color: var(--linie-stark); }
a.karte:active { transform: scale(.99); }
.karte img, .karte .platzhalter { width: 60px; height: 60px; object-fit: cover; border-radius: calc(var(--radius-karte) - 10px); background: var(--bg); flex-shrink: 0; }
.karte div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.karte strong { font-family: var(--versal); font-weight: 600; font-size: .92rem; letter-spacing: -.005em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.karte small { color: var(--ink-weich); }

/* Verlauf: Karte mit Vorschau, Achsen, Auszug, Termin, Kennzahlen und Links */
.verlauf-karte { align-items: flex-start; }
.verlauf-karte:hover { border-color: var(--linie); }
.verlauf-bild { flex-shrink: 0; }
.verlauf-karte strong a { text-decoration: none; }
.verlauf-karte strong a:hover { text-decoration: underline; }
.verlauf-auszug { font-size: .84rem; color: var(--ink-weich); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.verlauf-insights { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 2px 0 0; font-size: .78rem; color: var(--ink-weich); }
.verlauf-insights .zahl { color: var(--ink); }
.verlauf-links { font-size: .82rem; }
.verlauf-paket { color: var(--ink-weich); }

/* Zahlen in Zählern, Badges, Insights und Terminen: Monoschrift der Marke, Tabellenziffern.
   Die Terminzeile der Plan-Kachel (.slot-tag) bleibt in der Sans, in der Mono bricht sie bei 165 px um. */
.zahl, .termin-zeit, .monat-datum { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.badges { margin: 6px 0; }
.badge {
  display: inline-block;
  font-size: .74rem;
  font-weight: 500;
  line-height: 1.4;
  background: var(--fuellung);
  border: 1px solid transparent;
  border-radius: var(--radius-pille);
  padding: 2px 9px;
  margin-right: 5px;
}
.b-draft { background: var(--linie); border-color: var(--lavendel); }
.b-pending_review { background: var(--gelb-weich); border-color: var(--gelb); }
.b-approved, .b-scheduled { background: var(--gruen-weich); border-color: var(--salbei); }
.b-published { background: var(--gruen); border-color: var(--gruen); color: var(--auf-dunkel); }
.b-failed { background: var(--koralle); border-color: var(--koralle); color: var(--auf-dunkel); }
.b-rejected { background: var(--linie); border-color: var(--linie-stark); color: var(--ink-weich); }
.b-test { background: var(--ink); border-color: var(--ink); color: var(--gelb); }

/* ---------- Technik, Log ---------- */

.technik { margin-top: 28px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius-karte); padding: 16px 20px; }
.technik summary { font-size: .88rem; color: var(--ink-weich); }

.log {
  background: var(--ink);
  color: var(--auf-dunkel);
  font-family: var(--mono);
  padding: 14px;
  border-radius: var(--radius-feld);
  font-size: .74rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 70vh;
  overflow-y: auto;
}

/* Schmal: Navigation in einer Zeile zum Wischen, sonst frisst die stehende
   Kopfleiste mit drei Zeilen Pillen den halben Bildschirm. */
@media (max-width: 760px) {
  .kopf { flex-direction: column; align-items: stretch; gap: 10px; padding: 10px 16px; }
  .kopf nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .kopf nav::-webkit-scrollbar { display: none; }
  .kopf nav a { flex: 0 0 auto; }
}
@media (max-width: 560px) {
  .marke .wortmarke { font-size: 1.45rem; }
  h2 { font-size: 1.18rem; margin-top: 32px; }
  .slots { grid-template-columns: 1fr; }
}

/* Meta-Verbindungstest: ein Eintrag je Prüfschritt, Status vorn. */
.pruefliste { list-style: none; padding-left: 0 !important; }
.pruefliste li { margin: 10px 0; }
.pruefliste li strong { font-family: var(--versal); font-weight: 600; font-size: .82rem; margin-right: 8px; }
.pruefliste li.schritt-ok strong { color: var(--gruen); }
.pruefliste li.schritt-hinweis strong { color: var(--gelb-dunkel); }
.pruefliste li.schritt-fehler strong { color: var(--koralle); }

/* Inhalt eines Beitrags: alle Textfelder untereinander */
.inhalt dl { margin: 0; }
.inhalt dt { font-size: .8rem; font-weight: 500; color: var(--ink-weich); margin-top: 14px; }
/* Lange Links (UTM) brechen um, sonst schiebt die Seite auf dem Handy seitlich. */
.inhalt dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.inhalt ol, .inhalt ul { margin: 4px 0 0; padding-left: 20px; }

/* ---------- Freigabe (Etappe 6) ---------- */

/* Medientyp als Text-Icon und Säule in Termin-Kacheln und Listen */
.slot-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.slot-badges .badge { margin-right: 0; }
.badge.medientyp { background: var(--flaeche); border-color: var(--linie-stark); }
.badge.m-reel { border-color: var(--gruen); }
.badge.m-karussell { border-color: var(--gelb); }

/* Übersicht der nächsten Termine über dem Wochenplan */
.termin-liste { list-style: none; margin: 0; padding: 0; }
.termin-liste li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid var(--linie);
  font-size: .88rem;
}
.termin-liste li:last-child { border-bottom: 0; }
.termin-liste .badge { margin-right: 0; }
.termin-zeit { font-size: .78rem; color: var(--ink-weich); min-width: 136px; }

/* Vorschau: Feed-Kopf mit Medientyp, Hinweis bei fehlenden Medien */
.feed-typ { margin-left: auto; font-size: .76rem; color: var(--ink-weich); }
.feed-bilder .platzhalter { display: flex; align-items: center; justify-content: center; }
.medien-hinweis {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: var(--gelb-weich);
  font-size: .85rem;
  text-align: left;
}
.platzhalter .medien-hinweis { border-radius: var(--radius-feld); margin: 16px; }
.medien-hinweis strong { font-family: var(--versal); font-weight: 600; font-size: .9rem; }

/* Karussell wie im Feed: ein Bild je Breite, Wischen mit Einrasten, Zähler oben rechts */
.karussell-reihe { display: flex; width: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.karussell-reihe::-webkit-scrollbar { display: none; }
.karussell-reihe figure { margin: 0; flex: 0 0 100%; scroll-snap-align: start; position: relative; }
.karussell-reihe img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; }
.karussell-reihe figcaption {
  position: absolute;
  top: 8px;
  right: 8px;
  background: color-mix(in srgb, var(--ink) 80%, transparent);
  color: var(--auf-dunkel);
  font-family: var(--mono);
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
  border-radius: var(--radius-pille);
  padding: 3px 9px;
}

/* Caption mit hervorgehobener erster Zeile, Untertitel des Reels */
.erste-zeile { font-weight: 700; }
.feed-untertitel { padding: 12px 14px 0; border-bottom: 1px solid var(--linie); }
.feldtitel { font-size: .8rem; font-weight: 500; color: var(--ink-weich); }
.untertitel-liste { margin: 6px 0 12px; padding-left: 22px; font-size: .86rem; }
.untertitel-liste li { margin: 3px 0; }
.inhalt .kicker { font-size: .8rem; font-weight: 500; color: var(--ink-weich); }

/* Voice-Gate: bestanden oder Fehlerliste mit Code, Status als Punkt */
.gate h3 { margin: 0 0 6px; }
.gate-ok { --status: var(--gruen); }
.gate-fehler { --status: var(--koralle); }
.gate-status { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; }
.gate-ok .gate-status { color: var(--gruen); }
.gate-fehler .gate-status { color: var(--koralle-dunkel); }
.gate-liste { margin: 10px 0 0; font-size: .85rem; }
.gate-liste code, .gate-liste + .fehler code { font-family: var(--mono); font-size: .76rem; background: var(--bg); border-radius: var(--radius-klein); padding: 1px 5px; }

/* Freigeben gesperrt: Gründe über dem deaktivierten Knopf */
.sperre-liste { margin: 8px 0 10px; font-size: .86rem; color: var(--koralle-dunkel); }
button:disabled { opacity: .45; cursor: not-allowed; filter: none; transform: none; }

/* Bearbeiten: Kacheln als eigene Gruppen */
.bearbeiten form { margin-top: 12px; }
.kachel-feld { border: 1px solid var(--linie); border-radius: var(--radius-feld); padding: 10px 12px 0; margin: 0 0 14px; }
.kachel-feld legend { font-size: .82rem; font-weight: 600; padding: 0 6px; }

/* Historie und Events */
.historie h3 { margin: 0 0 8px; }
.event-liste { margin: 10px 0 0; padding-left: 20px; font-size: .84rem; }
.event-liste li { margin: 8px 0; }
.event-liste small { color: var(--ink-weich); }

/* Werkzeuge im Technik-Block, Links als Knöpfe */
.werkzeuge { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.button, .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-family: var(--versal);
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: -.005em;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-feld);
  padding: 10px 18px;
  background: var(--fuellung);
  color: var(--ink);
  transition: filter .15s ease, var(--druck);
  -webkit-tap-highlight-color: transparent;
}
.button-link:hover, .button:hover { filter: brightness(.96); }
.button:active, .button-link:active { filter: brightness(.9); transform: scale(.97); }

/* Gegencheck als Checkliste */
.checkliste { list-style: none; padding: 0; margin: 12px 0 16px; }
.checkliste li { padding: 8px 0; border-bottom: 1px solid var(--linie); }
.checkliste li:last-child { border-bottom: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-family: var(--serif-frei); font-size: .9rem; font-weight: 400; color: var(--ink); cursor: pointer; }
.check input { margin-top: 4px; width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--gruen); }

/* YouTube-Paket und Übersicht */
.paket-liste { margin: 10px 0; }
.reel-liste { list-style: none; padding: 0; margin: 0; }
.reel-liste .karte { align-items: flex-start; }
.reel-liste .karte strong a { text-decoration: none; }

/* ---------- Achsen, Filter, Wochen und Monat (Weboberfläche Etappe 1) ---------- */

/* Kernbotschaft, Segment, Hook-Typ und Kanal als Badges (web/achsen.ts) */
.achsen { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.achsen .badge { margin-right: 0; }
.badge.achse { background: var(--flaeche); }
.badge.a-kernbotschaft { border-color: var(--gruen); }
.badge.a-segment { border-color: var(--salbei); }
.badge.a-hook_typ { border-color: var(--linie-stark); }
.badge.a-kanal { border-color: var(--linie-stark); color: var(--ink-weich); }
.badge.achse.fehlt { color: var(--ink-weich); border-style: dashed; border-color: var(--linie-stark); background: transparent; }
.detail-achsen { margin: -4px 0 14px; }
.termin-liste .achsen { flex-basis: 100%; }
/* Kompakt (Plan-Kacheln, Termin-Zeile): Hook-Typ und Kanal als gedämpfte Textzeile unter den Badges */
.achsen.kompakt { min-width: 0; }
.achsen.kompakt .badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.achsen-zeile { flex-basis: 100%; font-size: .76rem; color: var(--ink-weich); line-height: 1.3; }

/* Filterchips je Achse mit Trefferzahl, einklappbar (offen nur mit aktivem Filter) */
.achsen-filter { margin-bottom: 14px; }
details.filter { margin-bottom: 8px; }
details.filter > summary { justify-content: flex-start; padding: 6px 0 8px; }
details.filter > summary::after { margin-left: 6px; }
details.filter[open] > summary { margin-bottom: 4px; }
.filter-zahl { font-family: var(--serif-frei); font-size: .76rem; font-weight: 500; color: var(--ink-weich); }
.filter-reihe, .filter-aktiv { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.filter-reihe .chips, .filter-aktiv .chips { margin-bottom: 8px; }
.filter-titel { font-size: .8rem; font-weight: 500; color: var(--ink-weich); min-width: 96px; }

/* Blättern in Wochen und Monaten */
.blaettern { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 14px; }
.blaettern-titel { font-size: .82rem; font-weight: 500; color: var(--ink-weich); margin-left: 4px; }

/* Balance-Hinweise im Wochenkopf: Akzent nur als getönte Fläche, offene Termine gedämpft */
.balance-hinweise, .box .balance-hinweise { list-style: none; margin: -4px 0 12px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.balance-hinweise li { font-size: .84rem; border-radius: var(--radius-feld); padding: 6px 12px; }
.balance-warnung { background: var(--gelb-weich); color: var(--ink); }
.balance-offen { color: var(--ink-weich); background: var(--fuellung); }

/* Monatsansicht: Wochenzeilen Mo bis So, mobil eine Liste je Tag */
.monat-kopfzeile, .monat-woche { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: auto; gap: 6px; }
.monat-kopfzeile span { font-size: .78rem; font-weight: 500; color: var(--ink-weich); padding: 0 4px; }
.monat-woche-block { margin-top: 14px; }
.monat-wochenkopf { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; font-size: .82rem; }
.monat-wochenkopf .balance-hinweise { margin: 0; }
.monat-tag { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius-feld); padding: 6px; height: auto; min-height: 92px; display: flex; flex-direction: column; gap: 6px; min-width: 0; overflow: hidden; }
.monat-tag.anderer-monat { background: transparent; }
.monat-tag.anderer-monat .monat-datum { color: var(--linie-stark); }
.monat-tag.heute { border-color: var(--ink); }
.monat-datum { font-size: .76rem; color: var(--ink-weich); }
.monat-wochentag { display: none; }
.monat-karte { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--linie); border-radius: calc(var(--radius-feld) - 4px); padding: 5px; text-decoration: none; background: var(--flaeche); min-width: 0; transition: border-color .15s ease, var(--druck); }
a.monat-karte:hover { border-color: var(--linie-stark); }
a.monat-karte:active { transform: scale(.97); }
.monat-karte.s-leer { background: transparent; border-style: dashed; }
.monat-karte.s-leer .monat-zeit::before { display: none; }
.monat-karte.s-ausgefallen { background: var(--koralle-weich); --status: var(--koralle); }
.monat-zeit { display: flex; align-items: flex-start; gap: 5px; font-size: .7rem; color: var(--ink-weich); min-width: 0; }
.monat-zeit::before { width: 6px; height: 6px; margin-top: .45em; }
/* Lange Badges kürzen statt über den Zellenrand laufen: .achsen löst sich in die Badge-Reihe auf. */
.monat-karte .slot-badges { min-width: 0; max-width: 100%; }
.monat-karte .achsen { display: contents; }
.monat-karte .badge { font-size: .62rem; padding: 1px 6px; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 560px) {
  .monat-kopfzeile { display: none; }
  .monat-woche { display: flex; flex-direction: column; gap: 6px; }
  .monat-tag { min-height: 0; padding: 8px; }
  .monat-tag.tag-leer { display: none; }
  .monat-wochentag { display: inline; }
  .filter-titel { min-width: 0; flex-basis: 100%; }
}

/* ---------- Vorschau je Kanal (Etappe 2) ---------- */

/* Umschalter als Links (?kanal=), ohne JS: Segment-Pille wie die Navigation */
.kanal-vorschau { max-width: 470px; margin: 0 auto; }
.kanal-tabs { display: flex; gap: 2px; margin: 0 0 12px; padding: 3px; background: var(--fuellung); border-radius: var(--radius-pille); }
.kanal-tab {
  flex: 1;
  text-align: center;
  padding: 7px 10px;
  border-radius: var(--radius-pille);
  color: var(--ink-weich);
  text-decoration: none;
  font-size: .84rem;
  font-weight: 500;
  transition: background-color .15s ease, color .15s ease, var(--druck);
  -webkit-tap-highlight-color: transparent;
}
.kanal-tab:hover { color: var(--ink); }
.kanal-tab:active { transform: scale(.97); }
.kanal-tab.aktiv { background: var(--flaeche); color: var(--ink); }

/* Kachel 4:5 */
.kachel-rahmen { width: 100%; }
.kachel-rahmen img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; }

/* Reel 9:16 mit Caption-Overlay unten links wie in der Reel-Ansicht */
.feed-bilder.feed-reel { justify-content: center; background: var(--ink); }
.reel-rahmen { position: relative; width: min(100%, calc(72vh * 9 / 16)); aspect-ratio: 9 / 16; margin: 0 auto; background: var(--ink); }
.reel-rahmen video, .reel-rahmen img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feed-bilder .reel-rahmen img { aspect-ratio: auto; }
.reel-overlay {
  position: absolute;
  left: 0; right: 0; bottom: 48px;
  padding: 0 14px 6px;
  color: var(--auf-dunkel);
  font-size: .85rem;
  line-height: 1.4;
  pointer-events: none;
  /* Lesbarkeit auf dem Video wie in der echten Reel-Ansicht, keine Gestaltung der Oberfläche. */
  text-shadow: 0 1px 3px color-mix(in srgb, var(--ink) 70%, transparent);
}
.reel-overlay-kopf { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.reel-overlay-kopf .feed-avatar { width: 26px; height: 26px; font-size: .85rem; text-shadow: none; }
.reel-overlay-zeile { margin: 0; display: flex; gap: 4px; }
.reel-overlay-zeile span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.reel-overlay-zeile .mehr { color: color-mix(in srgb, var(--auf-dunkel) 75%, transparent); flex-shrink: 0; }

/* Caption: nach 125 Zeichen gekürzt, "mehr" klappt per details auf. Kein Pfeil, Fließtext wie im Feed. */
.feed-absender { font-weight: 700; }
.caption-mehr > summary { display: block; font: inherit; letter-spacing: 0; }
.caption-mehr > summary::after { content: none; }
.caption-mehr[open] summary { display: none; }
.feed-caption .mehr { color: var(--ink-weich); }

/* YouTube Shorts: Video, darunter Titel fett, Kanal, Beschreibung zum Aufklappen */
.shorts-text { padding: 12px 14px 16px; }
.shorts-titel { margin: 0 0 10px; font-size: 1rem; font-weight: 700; line-height: 1.35; }
.shorts-kanal { display: flex; align-items: center; gap: 8px; font-size: .88rem; margin-bottom: 10px; }
.shorts-beschreibung summary { justify-content: flex-start; font-family: var(--serif-frei); font-size: .85rem; font-weight: 500; color: var(--ink-weich); }
.shorts-beschreibung summary::after { margin-left: 6px; }
.shorts-beschreibung p { margin: 8px 0 0; font-size: .86rem; line-height: 1.5; }

@media (max-width: 560px) {
  .kanal-vorschau, .kanal-vorschau .feed { max-width: none; width: 100%; }
  .kanal-vorschau .feed { border-radius: 0; border-left: 0; border-right: 0; }
  .kanal-vorschau { margin: 0 -16px; width: auto; }
  .kanal-vorschau .kanal-tabs { margin: 0 16px 12px; }
}

/* ---------- Bewegung, Transparenz, Kontrast (ADR 0017) ---------- */

/* Weniger Bewegung: kein Skalieren und Einblenden, Farbwechsel bleiben. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
  button:active, .button:active, .button-link:active, a.slot:active, a.karte:active, a.cta:active, a.monat-karte:active, .chip:active, .kopf nav a:active, .kanal-tab:active { transform: none; }
  summary::after { transition: none; }
}
/* Weniger Transparenz: Kopfleiste als feste Fläche. */
@media (prefers-reduced-transparency: reduce) {
  .kopf { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
/* Mehr Kontrast: Flächen bekommen klare Rahmen. */
@media (prefers-contrast: more) {
  .slot, .box, .karte, .banner, .chip, .badge, button, .button, .button-link, .kopf nav, .kanal-tabs, .monat-tag, .monat-karte { border-color: var(--ink); }
  .kopf { background: var(--bg); }
  .kopf nav a[aria-current="page"], .kanal-tab.aktiv { outline: 1px solid var(--ink); }
}
