/* RIFFBIRD Auswahl in zwei Ebenen (Auftrag 153, Bernd Runde 49): erst die Branche als große Marke, darunter die Berufe zum Ankreuzen.
   Braucht ci.css (Rollen der Fläche) und formular.css (das freie Feld ist ein rb-ff). Skript: auswahl.js. Beschreibung: FORMULAR.md, Abschnitt 9.
   Steht auf jeder Fläche (rb-hell, rb-hell rb-weiss, rb-dunkel): Farben nur über die Rollen. Bewegung nur über transform und opacity. */
.rb-aw { display: grid; gap: 10px; min-width: 0; }
.rb-aw > input[type="hidden"] { color: inherit; }   /* sonst trägt das versteckte Feld die Farbe des Browsers (CI-Prüfung: Farben nur aus Tokens) */

/* ---------- Ebene 1: die Gruppen (Branchen). Große Marken, eine ist offen ---------- */
.rb-aw-gruppen { display: flex; flex-wrap: wrap; gap: 8px; }
.rb-aw-g { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: 0; padding: 0 14px; border: 0; border-radius: var(--rb-r-feld); background: var(--rb-feld); box-shadow: inset 0 0 0 1px var(--rb-feld-rand); color: var(--rb-kopf); font: var(--rb-w-mittel) var(--rb-t-2)/1.2 var(--rb-schrift); font-stretch: 100%; letter-spacing: 0; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color var(--rb-dauer), box-shadow var(--rb-dauer), color var(--rb-dauer), transform var(--rb-dauer) var(--rb-aus); }
.rb-aw-g:active { transform: scale(0.97); }
@media (hover: hover) { .rb-aw-g:hover { box-shadow: inset 0 0 0 2px var(--rb-kopf); } }
.rb-aw-g:focus-visible, .rb-seite .rb-aw-g:focus-visible { outline: 2px solid var(--rb-fokus, var(--rb-petrol)); outline-offset: 3px; border-radius: var(--rb-r-feld); }
.rb-aw-g[aria-expanded="true"] { background: var(--rb-kopf); box-shadow: none; color: var(--rb-fl); }
/* In dieser Gruppe ist etwas gewählt: Zahl in Grün, auch wenn die Gruppe zu ist */
.rb-aw-hat:not([aria-expanded="true"]) { background: var(--rb-hauch); box-shadow: inset 0 0 0 2px var(--rb-kopf); }
/* Die Zahl sitzt auf der Ecke der Marke: So ändert die Marke ihre Breite nicht, wenn etwas gewählt wird */
.rb-aw-zahl { position: absolute; top: -7px; right: -5px; display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; box-shadow: 0 0 0 2px var(--rb-fl); background: var(--rb-gruen); color: var(--rb-petrol); font-style: normal; font-size: var(--rb-t-1); line-height: 1; font-weight: var(--rb-w-kopf); font-variant-numeric: tabular-nums; animation: rb-aw-plopp 0.34s var(--rb-aus) both; }

/* ---------- Ebene 2: die Einträge (Berufe) der offenen Gruppe ---------- */
.rb-aw-feld { display: grid; gap: 10px; flex: 1 1 100%; grid-column: 1 / -1; min-width: 0; padding: 12px 12px 14px; border-radius: var(--rb-r-feld); background: var(--rb-hauch); }
.rb-aw-rein { animation: rb-aw-auf 0.3s var(--rb-aus) both; }
.rb-aw-rein .rb-aw-b { animation: rb-aw-auf 0.32s var(--rb-aus) both; animation-delay: calc(var(--i, 0) * 16ms); }
.rb-aw-kopf { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; margin: 0; padding-inline: 4px; font-size: var(--rb-t-1); line-height: 1.3; color: var(--rb-tx); }
.rb-aw-kopf b { font-weight: var(--rb-w-mittel); color: var(--rb-kopf); }
.rb-aw-eintraege { display: flex; flex-wrap: wrap; gap: 8px 6px; }
/* Sichtbar 38 px hoch, zu treffen 46 px: Die Fläche reicht über das Pseudoelement in die Lücke zwischen den Reihen */
.rb-aw-b { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 38px; min-width: 44px; margin: 0; padding: 0 14px 0 9px; border: 0; border-radius: var(--rb-r-pille); background: var(--rb-fl); box-shadow: inset 0 0 0 1px var(--rb-feld-rand); color: var(--rb-kopf); font: var(--rb-w-text) var(--rb-t-2)/1.2 var(--rb-schrift); font-stretch: 100%; letter-spacing: 0; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color var(--rb-dauer), box-shadow var(--rb-dauer), transform var(--rb-dauer) var(--rb-aus); }
.rb-aw-b::before { content: ""; position: absolute; inset: -4px -3px; border-radius: inherit; }
.rb-aw-b:active { transform: scale(0.96); }
@media (hover: hover) { .rb-aw-b:hover { box-shadow: inset 0 0 0 2px var(--rb-kopf); } }
.rb-aw-b:focus-visible, .rb-seite .rb-aw-b:focus-visible { outline: 2px solid var(--rb-fokus, var(--rb-petrol)); outline-offset: 3px; border-radius: var(--rb-r-pille); }
.rb-aw-kreis { display: grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--rb-feld-rand); transition: background-color 0.18s, box-shadow 0.18s; }
.rb-aw-kreis svg { width: 14px; height: 14px; fill: none; stroke: var(--rb-petrol); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(0.3); transition: opacity 0.16s, transform 0.36s var(--rb-aus); }
.rb-aw-b[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--rb-kopf); font-weight: var(--rb-w-mittel); }
.rb-aw-b[aria-pressed="true"] .rb-aw-kreis { background: var(--rb-gruen); box-shadow: none; }
.rb-aw-b[aria-pressed="true"] .rb-aw-kreis svg { opacity: 1; transform: none; }

/* ---------- Was in anderen Gruppen gewählt ist: bleibt sichtbar, einzeln abwählbar ---------- */
.rb-aw-auch { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding-inline: 4px; font-size: var(--rb-t-1); line-height: 1.3; color: var(--rb-tx); }
.rb-aw-auch-l { display: contents; }
.rb-aw-x { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; min-width: 44px; margin: 0; padding: 0 8px 0 12px; border: 0; border-radius: var(--rb-r-pille); background: var(--rb-hauch); box-shadow: inset 0 0 0 1px var(--rb-feld-rand); color: var(--rb-kopf); font: var(--rb-w-mittel) var(--rb-t-1)/1.2 var(--rb-schrift); font-stretch: 100%; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.rb-aw-x::before { content: ""; position: absolute; inset: -6px -2px; border-radius: inherit; }
.rb-aw-x svg { flex: none; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
@media (hover: hover) { .rb-aw-x:hover { box-shadow: inset 0 0 0 2px var(--rb-kopf); } }
.rb-aw-x:focus-visible, .rb-seite .rb-aw-x:focus-visible { outline: 2px solid var(--rb-fokus, var(--rb-petrol)); outline-offset: 3px; border-radius: var(--rb-r-pille); }

/* ---------- Freies Feld und Meldung ---------- */
.rb-aw-frei { --rb-ff-h: 52px; }
.rb-aw-meldung { margin: 0; padding-inline: 4px; font-size: var(--rb-t-1); line-height: 1.4; font-weight: var(--rb-w-mittel); color: var(--rb-fehlertext); animation: rb-aw-auf 0.28s var(--rb-aus) both; }
.rb-aw-meldung:empty { display: none; }
.rb-aw-fehlt .rb-aw-g:not([aria-expanded="true"]) { box-shadow: inset 0 0 0 1.5px var(--rb-fehlertext); }

@keyframes rb-aw-auf { from { opacity: 0; transform: translateY(-6px); } }
@keyframes rb-aw-plopp { from { opacity: 0; transform: scale(0.4); } }
@media (prefers-reduced-motion: reduce) { .rb-aw *, .rb-aw-rein { animation: none !important; transition: none !important; } }
html.still .rb-aw *, html.still .rb-aw-rein { animation: none !important; transition: none !important; }

/* Schmal: die Marken der Branchen füllen die Zeile zu zweit, nichts läuft über */
@media (max-width: 560px) {
  .rb-aw-gruppen { display: grid; grid-template-columns: 1fr 1fr; }
  .rb-aw-g { justify-content: space-between; min-width: 0; min-height: 48px; padding: 0 12px; }
  .rb-aw-g-t { min-width: 0; overflow-wrap: anywhere; }
  .rb-aw-g:last-of-type:nth-of-type(odd) { grid-column: 1 / -1; }
  .rb-aw-feld { padding: 10px 10px 12px; }
  .rb-aw-b { padding-right: 12px; max-width: 100%; }
}
