/* Ausbildung (Paket 5): nachgezeichnetes Diagramm mit Ablesepfad (E21/D37), Briefing-Ansicht (D32),
   Übungsmodus (E22). Farben nur aus den Werten in styles.css, damit hell, dunkel und Druck stimmen. */

/* ---------- Diagramm mit Ablesepfad ---------- */
.trail-box, .nomo-box, .nomo-inhalt, .nomo-teil { min-width: 0; max-width: 100%; }
.nomo-teil { overflow-wrap: anywhere; }
.nomo-box { margin-top: 10px; border-top: 1px solid var(--rule); padding-top: 8px; }
.nomo-box > summary { cursor: pointer; font: 600 calc(14px * var(--fs, 1))/1.4 var(--f-body); color: var(--ink); }
.nomo-teil { margin: 12px 0 18px; }
.nomo-teil figcaption { font-size: calc(14px * var(--fs, 1)); color: var(--text); margin-bottom: 6px; }
.nomo-teil h4 { margin: 8px 0 4px; }
.nomo-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); }
svg.nomo { display: block; width: 100%; min-width: 560px; height: auto; font-family: var(--f-body); }
.nomo-feld { fill: none; stroke: var(--rule-strong); stroke-width: 1; }
.nomo-gitter { stroke: var(--rule); stroke-width: .6; }
.nomo-kurve { fill: none; stroke: var(--muted); stroke-width: 1.2; opacity: .75; }
.nomo-kurve-ruecken { stroke-dasharray: 5 3; }
.nomo-interp { fill: none; stroke: var(--accent); stroke-width: 1.2; stroke-dasharray: 4 3; opacity: .8; }
.nomo-ref { stroke: var(--ink); stroke-width: 1.6; }
.nomo-pfad { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.nomo-knoten { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.nomo-knoten.nomo-geklemmt { fill: var(--warn-strong); }
.nomo-nr { fill: #fff; font: 700 11px/1 var(--f-body); pointer-events: none; }
.nomo text { paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.nomo .nomo-nr { stroke: none; }
.nomo-achse { fill: var(--muted); font-size: 11px; }
.nomo-einheit { font-weight: 700; }
.nomo-titel-achse { fill: var(--text); font-size: 12px; font-weight: 600; }
.nomo-kurve-text { fill: var(--muted); font-size: 10px; }
.nomo-wert { fill: var(--ink); font-size: 12.5px; font-weight: 600; }
.nomo-ergebnis { fill: var(--accent); font-size: 14px; font-weight: 700; }
.nomo-fuss { fill: var(--muted); font-size: 10.5px; font-style: italic; }
.nomo-schritte { margin: 8px 0 4px; padding-left: 0; list-style: none; display: grid; gap: 2px; font-size: calc(14px * var(--fs, 1)); }
.nomo-z { display: inline-block; min-width: 1.4em; color: var(--accent); font-weight: 700; }
.nomo-weiter, .nomo-klemm { margin: 4px 0; font-size: calc(14px * var(--fs, 1)); }

/* ---------- Briefing-Ansicht (Beamer/Tablet) ---------- */
.briefing-knopf, .uebung-knopf { font-size: calc(13px * var(--fs, 1)); }
@media (max-width: 767px) { .briefing-knopf { display: none; } }
/* Schriftfaktor je Bildschirm: Beamer 1280×720 etwas kleiner, Full HD etwas größer; alle Größen folgen --fs */
html[data-ansicht="briefing"] { --fs: 1.3; --bl-h: max(420px, calc(100dvh - 88px)); scroll-padding-top: 76px; }
@media (max-width: 1366px), (max-height: 760px) { html[data-ansicht="briefing"] { --fs: 1.2; } }
@media (min-width: 1800px) and (min-height: 1000px) { html[data-ansicht="briefing"] { --fs: 1.4; } }
html[data-ansicht="briefing"] :is(#sheet, .site-head, .mobil-leiste, .page-head, #export, .site-foot, .map-hint, .map-expand, .overview-actions, .schritte, #uebung-panel,
  .move .fields.compact, .move .notes, .move .wx-raw, #warnings, .results details.more, .status-chip, .pf-groesse) { display: none !important; }
html[data-ansicht="briefing"] .wrap { max-width: none; padding: 72px clamp(16px, 2.5vw, 40px) 40px; gap: 24px; }
html[data-ansicht="briefing"] .workspace { grid-template-columns: 1fr; }
html[data-ansicht="briefing"] .workspace-side { position: static; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
html[data-ansicht="briefing"] .workspace-side > * { grid-area: auto; } /* Tablet (≤ 960 px): Flächennamen des Planungsrasters gelten hier nicht */
html[data-ansicht="briefing"] .workspace-side > .overview { grid-column: 1 / -1; }
html[data-ansicht="briefing"] .workspace-side .route-map { height: min(62vh, 560px) !important; min-height: 320px; }
html[data-ansicht="briefing"] .workspace .kpis { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
html[data-ansicht="briefing"] .workspace .kpi-val { font-size: calc(30px * var(--fs)); }
html[data-ansicht="briefing"] .workspace .kpi-sub { font-size: calc(13.5px * var(--fs)); }
html[data-ansicht="briefing"] .workspace .verdict-label { font-size: calc(28px * var(--fs)); }
html[data-ansicht="briefing"] .workspace .verdict ul, html[data-ansicht="briefing"] .workspace .verdict p { font-size: calc(14px * var(--fs)); }
html[data-ansicht="briefing"] .bar-top { font-size: calc(14px * var(--fs)); }
html[data-ansicht="briefing"] .bar-track { height: 16px; }
html[data-ansicht="briefing"] .moves { grid-template-columns: 1fr; }
html[data-ansicht="briefing"] :is(.card, .move).briefing-fokus { outline: 3px solid var(--accent); outline-offset: 4px; }
html[data-ansicht="briefing"] svg.nomo { max-width: 1100px; }
/* Seitenprofil: immer offen, Schrift und Linien wie im Vollbild (Maßstab in profil.js: 1,4 × --fs) */
html[data-ansicht="briefing"] .profil:not(.vollbild) .pf-inhalt { display: grid; min-height: 0; }
html[data-ansicht="briefing"] .profil:not(.vollbild) .pf-info { flex-basis: 0; white-space: normal; font-size: calc(13px * var(--fs)); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
html[data-ansicht="briefing"] .profil:not(.vollbild) :is(.pf-achse, .pf-asp-text, .pf-msa-text, .pf-platz-text, .pf-marke-text) { font-size: calc(13px * var(--fs)); }
html[data-ansicht="briefing"] .profil:not(.vollbild) .pf-stopp { font-size: calc(15px * var(--fs)); }
html[data-ansicht="briefing"] .profil:not(.vollbild) :is(.pf-bahn, .pf-bahn-rot) { stroke-width: 4.5; }
html[data-ansicht="briefing"] .profil:not(.vollbild) .pf-gelaende { stroke-width: 1.6; }
html[data-ansicht="briefing"] .profil:not(.vollbild) :is(.pf-msa, .pf-asp-rand) { stroke-width: 2; }
html[data-ansicht="briefing"] .profil:not(.vollbild) :is(.pf-wind, .wk-legende) { font-size: calc(13px * var(--fs)); }
html[data-ansicht="briefing"] .profil:not(.vollbild) .wk-kopf b { font-size: calc(14px * var(--fs)); }
/* Desktop/Beamer: „Karte und Profil“ füllt genau einen Bildschirm – Karte links groß, rechts das Profil über der
   ganzen Resthöhe, darunter das Winddreieck (Zeichnung links, Legende rechts). Feste Kartenhöhen: nichts springt. */
@media (min-width: 901px) {
  html[data-ansicht="briefing"] .workspace-side { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; }
  html[data-ansicht="briefing"] .workspace-side > :is(.map-card, .profil-card) { height: var(--bl-h); min-height: 0; box-sizing: border-box; }
  html[data-ansicht="briefing"] .workspace-side > .map-card { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 6px; }
  html[data-ansicht="briefing"] .workspace-side .route-map { height: 100% !important; min-height: 0; }
  html[data-ansicht="briefing"] .workspace-side > .profil-card { display: grid; grid-template-rows: minmax(0, 1fr); }
  html[data-ansicht="briefing"] .profil:not(.vollbild) { min-height: 0; grid-template-rows: auto minmax(0, 1fr); }
  html[data-ansicht="briefing"] .profil:not(.vollbild) .pf-inhalt { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto auto; row-gap: 8px; }
  html[data-ansicht="briefing"] .profil:not(.vollbild) .pf-flaeche { grid-column: 1; grid-row: 1; min-height: 0; }
  html[data-ansicht="briefing"] .profil:not(.vollbild) .pf-fuss { grid-column: 1; grid-row: 2; }
  html[data-ansicht="briefing"] .profil:not(.vollbild) .pf-legende[open] { max-height: 30vh; overflow-y: auto; }
  html[data-ansicht="briefing"] .profil:not(.vollbild) .pf-wind { grid-column: 1; grid-row: 3; height: clamp(170px, 27vh, 300px);
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr); grid-template-rows: auto minmax(0, 1fr); column-gap: 14px; padding: 8px 12px; }
  html[data-ansicht="briefing"] .profil:not(.vollbild) .pf-wind > .wk-kopf { grid-column: 1 / -1; }
  html[data-ansicht="briefing"] .profil:not(.vollbild) .pf-wind > :is(.wk-bild, .wk-leer) { grid-column: 1; grid-row: 2; }
  html[data-ansicht="briefing"] .profil:not(.vollbild) .pf-wind > :is(.wk-legende, .wk-gering) { grid-column: 2; grid-row: 2; align-self: center; }
}
.briefing-leiste { position: fixed; z-index: 1200; inset: 0 0 auto 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px clamp(12px, 2vw, 32px);
  background: var(--surface); border-bottom: 2px solid var(--accent); box-shadow: 0 4px 14px -8px rgba(0, 0, 0, .4); font-size: 16px; }
.briefing-leiste .bl-titel { font: 700 20px/1 var(--f-display); letter-spacing: .12em; text-transform: uppercase; color: var(--brand-fg); }
.briefing-leiste .bl-stand { min-width: 12em; font-weight: 600; color: var(--ink); }
.briefing-leiste .bl-hilfe { color: var(--muted); font-size: 14px; }
.briefing-leiste .bl-ende { margin-left: auto; }
.briefing-leiste button { min-height: 44px; min-width: 44px; font-size: 16px; }
.briefing-leiste kbd { font: 600 12px/1 var(--f-num); padding: 2px 5px; border: 1px solid currentColor; border-radius: 4px; margin-left: 6px; opacity: .8; }
@media print { .briefing-leiste { display: none !important; } }

/* ---------- Übungsmodus ---------- */
.uebung-panel { padding: 16px 18px; border: 2px dashed var(--warn-strong); background: var(--warn-bg); }
.uebung-panel h2 { margin: 0 0 8px; font: 700 calc(22px * var(--fs, 1))/1.2 var(--f-display); }
.uebung-tag { display: inline-block; padding: 2px 8px; margin-right: 8px; border-radius: 6px; background: var(--warn-strong); color: #111; font: 700 calc(14px * var(--fs, 1))/1.3 var(--f-body); letter-spacing: .08em; vertical-align: 3px; }
.uebung-kontext { margin: 0 0 6px; color: var(--ink); }
.uebung-gruppen { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin: 10px 0; }
.uebung-gruppe { margin: 0; padding: 10px 12px; border: 1px solid var(--rule-strong); border-radius: 10px; background: var(--surface); }
.uebung-gruppe legend { padding: 0 4px; font: 600 calc(13px * var(--fs, 1))/1 var(--f-display); letter-spacing: .14em; text-transform: uppercase; color: var(--brand-fg); }
.uebung-gruppe .fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.uebung-zwischen { margin-top: 8px; }
.uebung-zwischen summary { cursor: pointer; font-size: calc(13.5px * var(--fs, 1)); }
.uebung-urteil { display: block; min-height: 1.3em; font-size: calc(13px * var(--fs, 1)); font-weight: 600; }
.uebung-urteil.u-richtig { color: var(--ok); } .uebung-urteil.u-folgefehler { color: var(--warn); }
.uebung-urteil.u-knapp { color: var(--warn); } .uebung-urteil.u-falsch { color: var(--bad); }
.uebung-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 8px; }
.uebung-knoepfe button { min-height: 44px; }
.uebung-knopf[aria-pressed="true"] { background: var(--warn-strong); color: #111; border-color: var(--warn-strong); }
/* Ergebnisse der App ausblenden, bis „Lösung zeigen“ gewählt ist (Eingaben und Wetter bleiben sichtbar) */
html[data-uebung="an"]:not([data-uebung-loesung="an"]) :is(.kpi-val, .kpi-sub, .mv-bars > *, .move .profile, .trail-box, #legs > *, #navlog,
  #wb-summary, #wb-details, #load tfoot, .jstep-meta, .jleg-meta, .mv-head .pill, .verdict, .jleg-stop, .mv-warn) { visibility: hidden; }
html[data-uebung="an"]:not([data-uebung-loesung="an"]) :is(.kpis, .mv-bars, #legs) { position: relative; min-height: 44px; }
html[data-uebung="an"]:not([data-uebung-loesung="an"]) :is(.kpis, .mv-bars, #legs)::before { content: "Übung: Ergebnis ausgeblendet – „Lösung zeigen“ im Übungskasten"; position: absolute; inset: 0; display: grid; place-items: center; z-index: 1;
  font: 600 calc(14px * var(--fs, 1))/1.3 var(--f-body); color: var(--warn); background: repeating-linear-gradient(-45deg, var(--warn-bg), var(--warn-bg) 8px, transparent 8px, transparent 16px); border-radius: 12px; }
@media print { #uebung-panel { display: none !important; } }

/* ---------- Druck: Diagramme mit Ablesepfad (A4) ---------- */
@media print {
  .a4-diagramme .a4-diag-bewegung { break-before: page; }
  .a4-diagramme .a4-diag-bewegung:first-of-type { break-before: auto; }
  .a4-diagramme .nomo-teil { break-inside: avoid; margin: 2mm 0 5mm; }
  .a4-diagramme .nomo-scroll { overflow: visible; border: .2mm solid #999; border-radius: 0; }
  .a4-diagramme svg.nomo { min-width: 0; width: 100%; max-height: 92mm; }
  .a4-diagramme .nomo-schritte { font-size: 8.5pt; grid-template-columns: repeat(3, auto); column-gap: 5mm; }
  .a4-diagramme .nomo-weiter, .a4-diagramme .nomo-klemm, .a4-diagramme figcaption { font-size: 8.5pt; margin: 1mm 0; }
  .a4-diagramme h3 { margin: 0 0 1mm; font-size: 10.5pt; }
}
