/* Bewertung (R3 Etappe 2, Epic #43): Befundzeilen mit Symbol und Aktion, Prüfpunkte, „Vor dem Flug“ und der Zustand am
   Drucken-Knopf. Nur Darstellung (ui-bewertung.js); Zustände kommen unverändert aus der Prüfung. Farben nur über die
   Tokens (tokens.css), Zustand immer mit Form (.sym) und Wort. Lädt nach planstand.css und navigation.css, damit die
   Reihenfolge hier gilt; grundstil.css bleibt die letzte Datei. */

/* ---------- Reihenfolge in der Übersicht (iPhone, iPad, Desktop): Urteil, Befunde, Prüfpunkte, Vor dem Flug, Wetter, Werte ---------- */
html:not([data-planstand="leer"]) .overview-top > .verdict { order: 1; }
html:not([data-planstand="leer"]) .overview-top > .pruefgruppen { order: 2; }
html:not([data-planstand="leer"]) .overview-top > .schritte { order: 3; }
html:not([data-planstand="leer"]) .overview-top > .wx-kurz { order: 4; }
html:not([data-planstand="leer"]) .overview-top > .kpis { order: 5; }
html:not([data-planstand="leer"]) .overview-top.urteil-zuerst > .verdict { order: 1; }
.pruefgruppen[hidden] { display: none; }
.pruefgruppen, .schritte { container-type: inline-size; }

/* ---------- Befundzeilen ---------- */
.verdict ul.bw-liste, .workspace .verdict ul.bw-liste { display: grid; gap: 0; margin: 8px 0 0; padding: 0; columns: auto; list-style: none; }
.bw-liste > .bw-befund, .more-issues > .bw-liste > .bw-befund { margin: 0; padding: 12px 0; border-top: 1px solid var(--t-sep); }
.bw-befund { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; align-items: start; break-inside: avoid; }
.bw-befund > .sym { --sym: calc(18px * var(--fs, 1)); margin-top: 0.15em; }
.bw-befund > .bw-text { min-width: 0; display: grid; gap: 4px; }
.bw-befund > .bw-aktion { grid-column: 2; justify-self: start; }
.bw-satz, .bw-titel { margin: 0; line-height: 1.4; }
.verdict .bw-titel { font-weight: 600; color: var(--t-label); }
.bw-titel small, .bw-satz small { font-weight: 400; color: var(--t-label-2); }
.verdict ul.bw-orte { display: grid; gap: 8px; margin: 2px 0 0; padding: 0; columns: auto; list-style: none; }
.bw-orte > li { margin: 0; padding: 0; line-height: 1.4; list-style: none; }
.verdict ul.bw-orte > li { display: block; list-style: none; }
.verdict ul.bw-orte > li:is(.bad, .na, .warn)::marker { content: none; }
.bw-gemeinsam { margin: 2px 0 0; line-height: 1.4; }
.bw-befund.bad .bw-satz, .bw-befund.bad .bw-titel { color: var(--t-bad-text); }
.bw-befund.bad .bw-orte { color: var(--t-label-1); }

/* Aktion: Textknopf in Akzentfarbe, 44 px hoch (Touch), wie eine Aktionszeile in iOS */
.bw-aktion { display: inline-flex; align-items: center; min-height: 44px; margin: -6px 0 -8px; padding: 0; border: 0; border-radius: var(--r-control); background: none; color: var(--t-accent);
  font: 600 calc(var(--schrift-text, 15px) * var(--fs, 1))/1.2 var(--font); text-transform: none; letter-spacing: 0; text-align: left; cursor: pointer; }
.bw-aktion::after { content: "›"; margin-left: 6px; font-weight: 400; }
.bw-aktion:hover:not(:disabled) { background: none; text-decoration: underline; }
@media (pointer: fine) { .bw-aktion { min-height: 36px; } }

/* Grundlage aufklappbar: eine Zeile „Grundlage“, die Fundstelle erst nach dem Öffnen */
.bw-grundlage { margin: 0; }
.bw-grundlage > summary { display: inline-flex; align-items: center; min-height: 32px; padding: 0; color: var(--t-label-2); font-size: calc(var(--schrift-neben, 13px) * var(--fs, 1)); cursor: pointer; list-style: none; }
.bw-grundlage > summary::-webkit-details-marker { display: none; }
.bw-grundlage > summary::after { content: "›"; margin-left: 6px; transition: transform 0.15s; }
.bw-grundlage[open] > summary::after { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .bw-grundlage > summary::after { transition: none; } }
.bw-grundlage .befund-quelle { display: block; padding-bottom: 4px; color: var(--t-label-2); font-size: calc(var(--schrift-neben, 13px) * var(--fs, 1)); }
.verdict .more-issues > summary { min-height: 44px; display: flex; align-items: center; color: var(--t-accent); font-weight: 600; cursor: pointer; }
.verdict .more-issues .bw-liste { margin-top: 0; }

/* „noch einzutragen“-Zeilen springen ins Feld: Pfeil statt gepunkteter Unterstreichung */
.bw-befund[role="button"][data-schritt] { text-decoration: none; cursor: pointer; }
.bw-befund[role="button"][data-schritt] .bw-satz::after { content: " ›"; color: var(--t-label-3); }

/* ---------- Prüfpunkte ---------- */
.pruefgruppen { display: block; padding-top: 6px; }
.bw-kopf { margin: 8px 0 2px; }
.bw-unter { margin: 14px 0 0; font: 600 calc(var(--schrift-neben, 13px) * var(--fs, 1))/1.3 var(--font); letter-spacing: 0.02em; text-transform: none; color: var(--t-label-2); }
.pruefgruppen ul.bw-gruppen { display: grid; margin: 4px 0 0; padding: 0; list-style: none; }
.bw-gruppe { margin: 0; padding: 0; border-top: 1px solid var(--t-sep); }
.bw-gruppe:first-child { border-top: 0; }
.bw-zeile { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "s t" "s d"; gap: 0 10px; align-items: center; width: 100%; min-height: var(--row-min);
  padding: 8px 0; border: 0; border-radius: 0; background: none; color: var(--t-label); text-align: left; text-transform: none; letter-spacing: 0; font: 400 calc(var(--schrift-text, 15px) * var(--fs, 1))/1.35 var(--font); box-shadow: none; }
button.bw-zeile { cursor: pointer; }
button.bw-zeile:hover:not(:disabled) { background: none; color: var(--t-label); }
button.bw-zeile::after { content: none; }
.bw-zeile > .sym { grid-area: s; --sym: calc(20px * var(--fs, 1)); }
.bw-gtitel { grid-area: t; font-weight: 600; }
.bw-gtext { grid-area: d; color: var(--t-label-2); font-size: calc(var(--schrift-neben, 14px) * var(--fs, 1)); }
.z-hinweis .bw-gtext { color: var(--t-warn-text); font-weight: 600; }
.z-einwand .bw-gtext, .z-einwand .bw-gtitel { color: var(--t-bad-text); }
.z-einwand .bw-gtext { font-weight: 600; }
.z-offen .bw-gtext, .z-na .bw-gtext { color: var(--t-open-text); }
.z-erledigt .bw-gtext { color: var(--t-ok-text); }
@container (min-width: 460px) {
  .bw-zeile { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "s t d"; gap: 0 12px; }
  .bw-gtext { text-align: right; }
}

/* ---------- Vor dem Flug ---------- */
.schritte { gap: 0; padding: 12px 0 0; }
.bw-vorkopf { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 2px; }
.bw-vorkopf .link-knopf { margin-left: auto; }
ul.bw-briefing { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.bw-briefing > li, .briefing-liste.bw-briefing > li { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 12px; padding: 6px 0; border-top: 1px solid var(--t-sep); border-radius: 0; background: none; }
.bw-briefing > li:first-child { border-top: 0; }
.bw-briefing label { display: flex; align-items: center; gap: 12px; min-height: var(--row-min); font-weight: 600; cursor: pointer; }
.bw-briefing input[type="checkbox"] { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--t-accent-fill); }
.bw-briefing .bp-zeit { padding-left: 34px; color: var(--t-label-2); font-size: calc(var(--schrift-neben, 14px) * var(--fs, 1)); }
.bw-briefing > li.an .bp-zeit { color: var(--t-ok-text); font-weight: 600; }
.bw-briefing .bp-quellen { padding: 0 0 4px 34px; font-size: calc(var(--schrift-neben, 13px) * var(--fs, 1)); }
@container (min-width: 520px) {
  .briefing-liste.bw-briefing > li { grid-template-columns: minmax(0, 1fr) auto; }
  .bw-briefing .bp-zeit { padding-left: 0; align-self: center; text-align: right; }
  .bw-briefing .bp-quellen { grid-column: 1 / -1; }
}
.bw-nicht { display: flex; align-items: flex-start; gap: 10px; margin: 10px 0 0; padding: 10px 12px; border-radius: var(--r-group); background: var(--t-surface-2); color: var(--t-label-1);
  font-size: calc(var(--schrift-neben, 14px) * var(--fs, 1)); line-height: 1.4; }
.bw-nicht > .sym { --sym: calc(18px * var(--fs, 1)); margin-top: 0.1em; }
.schritte .briefing-hinweis { margin: 10px 0 0; }
.bw-druckzeile { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--t-sep); }
.bw-dtext { display: grid; min-width: 0; font-size: calc(var(--schrift-neben, 14px) * var(--fs, 1)); color: var(--t-label-2); }
.bw-dtext b { color: var(--t-label); font-size: calc(var(--schrift-text, 15px) * var(--fs, 1)); }
.bw-aktion.bw-druck { margin: 0; padding: 0 16px; border-radius: var(--r-control); background: var(--t-fill); color: var(--t-accent-knopf); }
.bw-aktion.bw-druck::after { content: none; }
.bw-aktion.bw-druck:hover:not(:disabled) { background: var(--t-fill-strong); text-decoration: none; }

/* ---------- Drucken: Zustand am Knopf und im Dialog ---------- */
.drucken-zusatz { font-weight: 500; font-size: calc(12px * var(--fs, 1)); color: var(--t-label-2); }
.kopf-drucken[data-zustand="rot"] .drucken-zusatz { color: var(--t-bad-text); font-weight: 600; }
.kopf-drucken[data-zustand="offen"] .drucken-zusatz { color: var(--t-warn-text); font-weight: 600; }
.overview-actions .pilotlog-btn .drucken-zusatz { margin-left: 8px; }
@media (max-width: 767px) {
  /* iPhone: nur Symbolknopf, der Zustand als Punkt mit Form am Symbol (Text im Namen des Knopfs) */
  .kopf-knoepfe .kopf-drucken { position: relative; }
  .kopf-drucken .drucken-zusatz { display: none; }
  .kopf-drucken[data-zustand]::after { content: ""; position: absolute; top: 5px; right: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--t-warn); box-shadow: 0 0 0 2px var(--t-bar); }
  .kopf-drucken[data-zustand="rot"]::after { border-radius: 3px; background: var(--t-bad); }
}
.druck-urteil { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; padding: 0 18px; font: 600 calc(var(--schrift-text, 16px) * var(--fs, 1))/1.35 var(--font); color: var(--t-label); }
.druck-urteil[hidden] { display: none; }
.druck-urteil .sym { --sym: calc(22px * var(--fs, 1)); }
.druck-urteil-rot { color: var(--t-bad-text); }
/* R5 P4: Abhilfe mit Menge und Knopf direkt unter dem Urteil */
.urteil-abhilfe { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 8px 0 4px; }
.urteil-abhilfe p { flex: 1 1 260px; margin: 0; font: 400 calc(var(--schrift-text, 15px) * var(--fs, 1))/1.4 var(--font); color: var(--text); }
.urteil-abhilfe .bw-aktion { flex: none; }
#kopf-abhilfe { order: -3; }
#kopf-abhilfe[hidden] { display: none; }
.urteilsleiste > #kopf-abhilfe { padding: 0 14px 10px; }
.workspace-side:not(.expanded) #verdict > .urteil-abhilfe { display: none; }
.workspace-side.expanded #kopf-abhilfe { display: none; }
html[data-uebung="an"]:not([data-uebung-loesung="an"]) #kopf-abhilfe { display: none; }
html[data-ansicht="briefing"] .bw-aktion { display: none; }
@media print { .pruefgruppen, .bw-aktion, .drucken-zusatz { display: none !important; } }
