/* Urteilsleiste (#54, urteilsleiste.js und urteilsleiste-ui.js): iPhone als Sheet in der festen Leiste über der Tab-Leiste,
   iPad und Desktop als Leiste oben an der Karte. Farben nur über die Tokens, Zustand immer mit Form (.sym) und Wort; die Flächen
   sind deckend (keine Transparenz über der Karte). Lädt nach bewertung.css. */
.urteilsleiste { position: relative; border-radius: var(--r-group, 12px); background: var(--t-surface); box-shadow: 0 0 0 1px var(--t-sep), 0 4px 14px rgba(0, 0, 0, .08); }
.urteilsleiste[hidden] { display: none; }
.urteilsleiste.bad { background: linear-gradient(var(--t-bad-soft), var(--t-bad-soft)), var(--t-surface); box-shadow: 0 0 0 1.5px var(--t-bad), 0 4px 14px rgba(0, 0, 0, .08); }
.urteilsleiste.warn { background: linear-gradient(var(--t-warn-soft), var(--t-warn-soft)), var(--t-surface); }
.ul-kopf { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 14px; border: 0; border-radius: inherit; background: none; color: var(--t-label);
  text-align: left; cursor: pointer; font: inherit; letter-spacing: 0; text-transform: none; }
.ul-kopf:hover:not(:disabled) { background: none; color: var(--t-label); border: 0; }
.ul-kopf:focus-visible { outline: 2px solid var(--t-accent); outline-offset: -3px; }
.ul-kopf > .sym { --sym: calc(30px * var(--fs, 1)); }
.ul-text { display: grid; gap: 3px; flex: 1 1 auto; min-width: 0; }
.ul-titel { display: block; font: 600 calc(var(--schrift-abschnitt, 17px) * var(--fs, 1))/1.25 var(--font); }
.urteilsleiste.bad .ul-titel { color: var(--t-bad-text); }
/* Briefing und Ausdruck neben dem Grün: gleiche Schrift wie der Titel */
.ul-zusatz { display: block; font: 600 calc(var(--schrift-abschnitt, 17px) * var(--fs, 1))/1.25 var(--font); }
.ul-zusatz .ul-z { gap: 6px; }
.ul-zusatz .sym { --sym: calc(18px * var(--fs, 1)); }
.ul-punkt { color: var(--t-label-3); }
.ul-zahlen { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--t-label-2); font: 400 calc(var(--schrift-neben, 14px) * var(--fs, 1))/1.3 var(--font); }
.ul-z { display: inline-flex; align-items: center; gap: 5px; }
.ul-z .sym { --sym: calc(14px * var(--fs, 1)); }
.ul-z.bad { color: var(--t-bad-text); font-weight: 600; }
.ul-beispiel { display: block; color: var(--t-label-2); font: 400 calc(var(--schrift-neben, 14px) * var(--fs, 1))/1.3 var(--font); }
.ul-mehr { flex: none; color: var(--t-accent); font: 500 calc(var(--schrift-text, 15px) * var(--fs, 1))/1.2 var(--font); white-space: nowrap; }
.ul-griff { display: none; }
.ul-liste { overflow: auto; overscroll-behavior: contain; border-radius: var(--r-group, 12px); background: var(--t-surface); box-shadow: 0 0 0 1px var(--t-sep), 0 10px 28px rgba(0, 0, 0, .22); }
.ul-liste[hidden] { display: none; }
.ul-befunde { margin: 0; padding: 0 14px 6px; list-style: none; }
.ul-befunde > .bw-befund { margin: 0; padding: 12px 0; border-top: 1px solid var(--t-sep); }
.ul-befunde > .bw-befund:first-child { border-top: 0; }
.urteilsleiste .bw-titel { font-weight: 600; color: var(--t-label); }
.urteilsleiste ul.bw-orte { display: grid; gap: 8px; margin: 2px 0 0; padding: 0; list-style: none; }
.urteilsleiste ul.bw-orte > li { display: block; list-style: none; }
.urteilsleiste ul.bw-orte > li:is(.bad, .na, .warn)::marker { content: none; }

/* Auf allen Breiten: Prüfpunkte würden die Kopfzeile der großen Karte über das Fenster hinaus vergrößern. */
.workspace-side.expanded .pruefgruppen { display: none !important; }
/* Der eigene Urteilsknopf der großen Karte ersetzt auch die mobile Urteilszeile. */
.workspace-side.expanded .urteil-satz { display: none !important; }

/* iPad und Desktop: oben an der Karte, klebt unter der Toolbar, solange die Karte im Bild ist; die Karte steht vor der Übersicht */
@media (min-width: 768px) {
  .urteilsleiste { position: sticky; top: calc(var(--toolbar-h) + 8px); z-index: 800; margin: 0 0 12px; }
  .ul-liste { position: absolute; left: 0; right: 0; top: calc(100% + 4px); max-height: min(50vh, 440px); }
  .inhalt .map-card { order: 1; }
  .inhalt .profil-card { order: 2; }
  .inhalt .overview { order: 3; }
  .inhalt #vorschlaege { order: 4; }
  html[data-planstand="leer"]:not([data-befund]) .inhalt .overview { order: 0; }
  /* große Karte: Kopfzeile (Übersicht) bleibt oben, die Befundtafel öffnet sich darunter im Bild */
  .inhalt .workspace-side.expanded .overview { order: 1 }
  .inhalt .workspace-side.expanded .map-card { order: 3; }
  .inhalt .workspace-side.expanded .profil-card { order: 4; }
  /* Fokus in der Karte nie unter der klebenden Leiste (WCAG 2.4.11) */
  #abschnitt-karte :is(a, button, input, select, summary, [tabindex]) { scroll-margin-top: calc(var(--toolbar-h) + 96px); }
}
@media (min-width: 768px) and (pointer: coarse) { .ul-kopf { min-height: 60px; } }

/* iPhone: Sheet über der Tab-Leiste; die Liste geht nach oben auf, die feste Höhe der Leiste bleibt dabei gleich */
@media screen and (max-width: 767px) {
  .urteilsleiste { box-shadow: 0 0 0 1px var(--t-sep); }
  .urteilsleiste.bad { box-shadow: 0 0 0 1.5px var(--t-bad); }
  .ul-kopf { min-height: 64px; padding: 24px 12px 10px; gap: 10px; }
  .ul-griff { display: block; position: absolute; top: 6px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--t-sep-solid); pointer-events: none; }
  /* „n Befunde ▾“ oben rechts neben dem Griff, damit der Titel die volle Breite hat */
  .ul-mehr { position: absolute; top: 4px; right: 12px; font-size: calc(var(--schrift-neben, 14px) * var(--fs, 1)); line-height: 1.2; }
  .ul-titel, .ul-zusatz { font-size: calc(var(--schrift-text, 16px) * var(--fs, 1)); }
  .ul-liste { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); max-height: min(62dvh, calc(100dvh - 230px)); }
}
/* nicht in der großen Karte, der Briefing-Ansicht, im Ausdruck und nach einem Rechenfehler */
.workspace-side.expanded .urteilsleiste, html[data-ansicht="briefing"] .urteilsleiste, html.rechenfehler .urteilsleiste { display: none; }
@media print { .urteilsleiste { display: none !important; } }
