/* Meldungen als Popup (#313, Muster Variante B vom 25.10.2026). Markup:
   templates/bausteine/meldungen.html, Verhalten: static/meldungen.js.
   Ohne Skript stehen sie im Fluss; erst data-popup (vom Skript) laesst sie
   schweben. Eigene Datei, weil auch die Anmeldeseiten sie zeigen und
   werkstatt.css dort bewusst nicht geladen wird (test_zugang_faktor_
   einrichten_seite). Die vier Stufenfarben stehen deshalb hier noch einmal;
   die Hinweiskaesten der Berichte (.werkstatt .flash-*) bleiben, wie sie
   sind. Muss NACH werkstatt.css geladen werden: .werkstatt .flash hat
   dieselbe Spezifitaet und setzt sonst Rand und Polster. */
.meldungen { font-family: 'IBM Plex Sans', system-ui, sans-serif; }
.meldungen-stapel { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.werkstatt .meldungen-stapel { margin: 12px 18px 0; }
.meldungen .flash {
  position: relative; display: flex; gap: 10px; align-items: flex-start; overflow: hidden;
  margin: 0; padding: 10px 6px 10px 12px; border-radius: 2px;
  font-size: calc(13px * var(--schriftskala, 1.08)); line-height: 1.4;
}
.meldungen .flash-success { --stufe: #2f7d4f; background: #f2f9f4; border: 1px solid #bcd8c6; color: #2f7d4f; }
.meldungen .flash-error { --stufe: #8c3a24; background: #fdf1ed; border: 1px solid #e3bcb1; color: #8c3a24; }
.meldungen .flash-warning { --stufe: #9a6a12; background: #fdf7e9; border: 1px solid #e3d0a1; color: #9a6a12; }
.meldungen .flash-info { --stufe: #2a5d8a; background: #f0f5fa; border: 1px solid #b7cde0; color: #2a5d8a; }
.meldungen .flash-zeichen {
  flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%;
  background: var(--stufe); color: #fff; font-weight: 600; font-size: calc(12px * var(--schriftskala, 1.08));
  display: flex; align-items: center; justify-content: center;
}
.meldungen .flash-inhalt { flex: 1; min-width: 0; }
.meldungen .flash-titel { font-weight: 600; font-size: calc(12px * var(--schriftskala, 1.08)); }
.meldungen .flash-zeit {
  margin-left: 6px; font-weight: 400; opacity: .65; white-space: nowrap;
  font-size: calc(11.5px * var(--schriftskala, 1.08)); font-variant-numeric: tabular-nums;
}
.meldungen .flash-text { overflow-wrap: anywhere; }
.meldungen .flash-zu, .meldungen .flash-balken { display: none; }
.meldungen[data-popup] .flash-zu {
  display: block; flex: none; width: 32px; height: 32px; margin: -4px 0; padding: 0;
  background: none; border: none; border-radius: 2px; color: inherit; cursor: pointer;
  font: inherit; font-size: 18px; line-height: 1;
}
.meldungen[data-popup] .flash-zu:hover { background: rgba(0, 0, 0, .06); }
.meldungen[data-popup] .flash-zu:focus-visible { outline: 2px solid currentColor; outline-offset: -2px; }
.meldungen[data-popup] .flash-balken {
  display: block; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: currentColor; opacity: .35; transform-origin: left;
}
.meldungen[data-popup] .flash-balken.laeuft { animation: meldung-ablauf 3s linear forwards; }
/* Zeiger oder Fokus auf der Meldung (static/meldungen.js): Balken haelt mit an. */
.meldungen[data-popup] .flash.angehalten .flash-balken { animation-play-state: paused; }
/* Mittig oben unter der Kopfzeile, 560 px, schmal: volle Breite mit 16 px Rand.
   Der Block selbst ist hoehenlos und klebt beim Scrollen oben (30 px Abstand
   wegen der roten Leiste der Testumgebung); der Stapel schwebt darin. */
.meldungen[data-popup] { position: sticky; top: 30px; height: 0; z-index: 50; }
.meldungen[data-popup] .meldungen-stapel,
.werkstatt .meldungen[data-popup] .meldungen-stapel {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: min(560px, calc(100% - 32px)); margin: 0;
}
.meldungen-fest[data-popup] { position: fixed; top: 30px; left: 0; right: 0; }
.meldungen[data-popup] .flash { box-shadow: 0 6px 18px rgba(0, 0, 0, .10); animation: meldung-rein .18s ease-out; }
@keyframes meldung-rein { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes meldung-ablauf { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .meldungen .flash, .meldungen .flash-balken { animation: none !important; } .meldungen .flash-balken { display: none !important; } }
/* Rueckfrage-Dialog (#339, Muster vom 31.10.2026), Verhalten: static/bestaetigen.js.
   Dieselbe Formensprache wie die Meldung oben: Kopf in der Stufenfarbe mit
   rundem Zeichen, Titel und ×, darunter weisser Rumpf, unten »Abbrechen« und
   rechts die Hauptantwort. Stufe »frage« = Farben von »Achtung« (gelb, ?),
   »gefahr« = Farben von »Fehler« (rot, !). Breite 480 ohne Satz (schmal),
   600 mit Satz (mittel), 720 Vorgabe. Der Dialog haengt im Werkstatt-Rahmen,
   die Knopfstile von .werkstatt gelten darin. */
.rf {
  --rf-stufe: #9a6a12; --rf-bg: #fdf7e9; --rf-rand: #e3d0a1;
  border: 1px solid var(--rf-rand); border-radius: 2px; padding: 0;
  width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 80px); margin-top: 12vh;
  background: #fff; color: #1a1c1a; box-shadow: 0 12px 32px rgba(0, 0, 0, .22);
  font-family: 'IBM Plex Sans', system-ui, sans-serif; font-size: calc(13px * var(--schriftskala, 1.08)); line-height: 1.45;
}
.rf.schmal { width: min(480px, calc(100vw - 32px)); }
.rf.mittel { width: min(600px, calc(100vw - 32px)); }
.rf[open] { display: flex; flex-direction: column; animation: meldung-rein .18s ease-out; }
.rf::backdrop { background: rgba(20, 24, 22, .38); }
.rf.st-gefahr { --rf-stufe: #8c3a24; --rf-bg: #fdf1ed; --rf-rand: #e3bcb1; }
.rf-kopf {
  display: flex; gap: 10px; align-items: center; padding: 10px 6px 10px 14px;
  background: var(--rf-bg); color: var(--rf-stufe); border-bottom: 1px solid var(--rf-rand);
}
.rf-zeichen {
  flex: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--rf-stufe); color: #fff; font-weight: 600; font-size: calc(12px * var(--schriftskala, 1.08));
  display: flex; align-items: center; justify-content: center;
}
.rf .rf-titel { flex: 1; min-width: 0; margin: 0; font-weight: 600; font-size: calc(13px * var(--schriftskala, 1.08)); overflow-wrap: anywhere; }
.rf-zu {
  flex: none; width: 32px; height: 32px; margin: -4px 0; padding: 0;
  background: none; border: none; border-radius: 2px; color: inherit; cursor: pointer;
  font: inherit; font-size: 18px; line-height: 1;
}
.rf-zu:hover { background: rgba(0, 0, 0, .06); }
.rf-zu:focus-visible { outline: 2px solid currentColor; outline-offset: -2px; }
.rf-rumpf { padding: 14px 16px 6px; overflow: auto; }
.rf-rumpf p { margin: 0 0 10px; }
.rf-satz { font-size: calc(13.5px * var(--schriftskala, 1.08)); overflow-wrap: anywhere; }
.rf-fuss {
  display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap;
  padding: 10px 16px; border-top: 1px solid #e8eae6; background: #f7f8f5;
}
/* Grosse Rueckfrage (<template> aus templates/bausteine/rueckfrage.html): Folgen,
   Abschnittsueberschrift, leiser Hinweis, Feld »Grund«, kleine Tabelle. */
.rf-folgen { margin: 0 0 10px; padding-left: 18px; }
.rf-folgen li { margin-bottom: 3px; }
.rf-abschnitt {
  margin: 12px 0 5px; color: #6b716b; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  font-size: calc(10.5px * var(--schriftskala, 1.08));
}
.rf-leise { color: #6b716b; font-size: calc(12px * var(--schriftskala, 1.08)); }
.rf-grund { display: block; margin: 4px 0 10px; color: #6b716b; font-size: calc(11.5px * var(--schriftskala, 1.08)); }
.rf-grund > span { display: block; margin-bottom: 3px; }
.rf-grund input {
  width: 100%; box-sizing: border-box; padding: 6px 8px; font: inherit; font-size: calc(13px * var(--schriftskala, 1.08));
  color: #1a1c1a; background: #fff; border: 1px solid #cdd2cc; border-radius: 2px;
}
.rf-grund input:focus-visible { outline: 2px solid #e0a33e; outline-offset: 0; border-color: #e0a33e; }
.rf-tabelle { margin: 2px 0 12px; border: 1px solid #e8eae6; }
.werkstatt .rf .rf-tabelle thead th { background: #f7f8f5; }
.werkstatt .rf tbody td { max-width: none; }
.werkstatt .rf .knopf { font-size: calc(12px * var(--schriftskala, 1.08)); padding: 5px 12px; }
.werkstatt .rf .knopf.gefahr { background: #8c3a24; border-color: #8c3a24; color: #fff; }
.werkstatt .rf .knopf.gefahr:hover { background: #a3452b; }
.werkstatt .rf .knopf[disabled] { opacity: .45; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .rf[open] { animation: none; } }
