/*
 * BID Campus visual system v4
 * Derived from the BID HTML sales decks: black stage, warm paper, yellow marker,
 * red signal, crisp information surfaces. Product density stays operational.
 */
[hidden] {
  display: none !important;
}

/* Eine Zuständigkeit pro Praxisaufgabe, ohne zweiten Prüfstatus. */
.pruefzustand-panel {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 14px 0;
  padding: 13px 14px;
  border: 1px solid var(--stroke);
  border-left: 4px solid var(--yellow);
  border-radius: 7px;
  background: color-mix(in srgb, var(--yellow) 6%, var(--card));
}

.pruefzustand-panel[data-assigned="1"] {
  border-left-color: var(--green);
  background: color-mix(in srgb, var(--green) 5%, var(--card));
}

.pruefzustand-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--stroke);
}

.pruefzustand-icon .ui-icon {
  width: 19px;
  height: 19px;
}

.pruefzustand-copy {
  min-width: 0;
}

.pruefzustand-copy > span,
.pruefzustand-copy > strong,
.pruefzustand-copy > small {
  display: block;
}

.pruefzustand-copy > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.pruefzustand-copy > strong {
  margin-top: 2px;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.pruefzustand-copy > small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.pruefzustand-aktionen,
.pruefzustand-verwaltung {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.pruefzustand-verwaltung label {
  display: grid;
  gap: 3px;
  min-width: min(260px, 100%);
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.pruefzustand-verwaltung select {
  min-height: 40px;
  margin: 0;
}

.pruefzustand-kurz {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-weight: 700;
}

.pruefzustand-kurz.eigen {
  color: var(--green);
}

.pruefzustand-kurz.offen {
  color: var(--rot);
}

.pruefzustand-kurz .ui-icon {
  width: 13px;
  height: 13px;
}

.abgabe-feedbackfrist {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid var(--stroke);
  border-radius: 6px;
  background: var(--card);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
}

.abgabe-feedbackfrist .ui-icon {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.abgabe-feedbackfrist.heute {
  border-color: color-mix(in srgb, var(--yellow) 65%, var(--stroke));
  background: color-mix(in srgb, var(--yellow) 9%, var(--card));
  color: var(--text);
}

.abgabe-feedbackfrist.kritisch {
  border-color: color-mix(in srgb, var(--rot) 58%, var(--stroke));
  background: color-mix(in srgb, var(--rot) 7%, var(--card));
  color: var(--rot);
}

.abgabe-feedbackfrist.erledigt {
  border-color: color-mix(in srgb, var(--green) 55%, var(--stroke));
  background: color-mix(in srgb, var(--green) 7%, var(--card));
  color: var(--green);
}

.abgabe-arbeitsfilter {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 12px 0;
  padding-top: 10px;
  border-top: 1px solid var(--stroke);
}

.abgabe-arbeitsfilter button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 5px 9px;
  border: 1px solid var(--stroke);
  border-radius: 6px;
  background: var(--card);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.abgabe-arbeitsfilter button:hover,
.abgabe-arbeitsfilter button.aktiv {
  border-color: var(--yellow);
  color: var(--text);
}

.abgabe-arbeitsfilter button.aktiv {
  background: color-mix(in srgb, var(--yellow) 10%, var(--card));
}

.abgabe-arbeitsfilter button b {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  font-size: 10px;
}

@media (max-width: 720px) {
  .pruefzustand-panel {
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: start;
  }

  .pruefzustand-aktionen {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .pruefzustand-aktionen > .btn,
  .pruefzustand-verwaltung,
  .pruefzustand-verwaltung label,
  .pruefzustand-verwaltung .btn {
    width: 100%;
  }

  .abgabe-arbeitsfilter {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .abgabe-arbeitsfilter button {
    justify-content: space-between;
    width: 100%;
  }
}

/* Revisionsgebundene, menschlich bestätigte Praxisaufgaben-Bewertung. */
.abgabe-rubrik-editor {
  margin: 16px 0;
  padding: 15px 0;
  border-top: 1px solid var(--stroke);
  border-bottom: 1px solid var(--stroke);
}

.abgabe-rubrik-kopf,
.abgabe-bewertung-head,
.abgabe-bewertung-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.abgabe-rubrik-kopf p {
  max-width: 680px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.abgabe-rubrik-summary {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid var(--stroke);
  border-radius: 6px;
  background: var(--card);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.abgabe-rubrik-summary.vollstaendig {
  border-color: color-mix(in srgb, var(--green) 55%, var(--stroke));
  color: var(--green);
}

.abgabe-rubrik-zeilen {
  display: grid;
  margin-top: 12px;
  border-top: 1px solid var(--stroke);
}

.abgabe-rubrik-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 220px);
  gap: 14px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--stroke);
}

.abgabe-rubrik-row:last-child {
  border-bottom: 0;
}

.abgabe-rubrik-kriterium {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.abgabe-rubrik-select {
  width: 100%;
  min-height: 40px;
  margin: 0;
}

.abgabe-bewertung {
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid var(--stroke);
  border-left: 4px solid var(--yellow);
  border-radius: 7px;
  background: color-mix(in srgb, var(--yellow) 5%, var(--card));
}

.abgabe-bewertung-head > div:first-child {
  min-width: 0;
}

.abgabe-bewertung-head > div:first-child > span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.abgabe-bewertung-status {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
}

.abgabe-bewertung-score {
  min-width: 53px;
  color: var(--text);
  font-size: 18px;
  text-align: right;
}

.abgabe-bewertung-rubrik {
  display: grid;
  margin-top: 11px;
  border-top: 1px solid var(--stroke);
}

.abgabe-bewertung-row {
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--stroke);
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
}

.abgabe-bewertung-row > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.abgabe-rubrik-tag {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 25px;
  padding: 3px 7px;
  border: 1px solid var(--stroke);
  border-radius: 5px;
  background: var(--card);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.abgabe-rubrik-tag.erfuellt {
  border-color: color-mix(in srgb, var(--green) 52%, var(--stroke));
  color: var(--green);
}

.abgabe-rubrik-tag.teilweise {
  border-color: color-mix(in srgb, var(--yellow) 70%, var(--stroke));
  color: var(--text);
}

.abgabe-rubrik-tag.offen {
  border-color: color-mix(in srgb, var(--red) 55%, var(--stroke));
  color: var(--red);
}

.abgabe-bewertung-feedback {
  margin-top: 11px;
  color: var(--text);
}

.abgabe-bewertung-feedback p {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.abgabe-link {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--stroke);
  border-bottom: 1px solid var(--stroke);
}

.abgabe-link > .ui-icon {
  width: 20px;
  height: 20px;
  color: var(--red);
}

.abgabe-link > div {
  min-width: 0;
}

.abgabe-link > div span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.abgabe-video-aktion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  color: var(--muted);
  font-size: 11px;
}

.abgabe-video-aktion .btn {
  flex: 0 0 auto;
}

.abgabe-zeit-editor {
  margin: 14px 0 16px;
  padding: 14px 0;
  border-top: 1px solid var(--stroke);
  border-bottom: 1px solid var(--stroke);
}

.abgabe-zeit-kopf {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.abgabe-zeit-kopf p {
  max-width: 680px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.abgabe-zeit-kopf > strong {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid var(--stroke);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
}

.abgabe-zeit-liste {
  display: grid;
  gap: 8px;
  margin-top: 11px;
}

.abgabe-zeit-leer {
  margin: 0;
  padding: 9px 0;
  color: var(--muted);
  font-size: 12px;
}

.abgabe-zeit-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 36px;
  gap: 9px;
  align-items: start;
  padding: 9px 0;
  border-top: 1px solid var(--stroke);
}

.abgabe-zeit-row label {
  min-width: 0;
  margin: 0;
}

.abgabe-zeit-row label > span,
.abgabe-zeit-bewertung-row > div > span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.abgabe-zeit-row textarea {
  min-height: 70px;
  margin: 0;
}

.abgabe-zeitmarke {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 32px;
  padding: 5px 7px;
  border: 1px solid color-mix(in srgb, var(--red) 45%, var(--stroke));
  border-radius: 5px;
  background: var(--card);
  color: var(--red);
  font: 800 11px/1 var(--font);
  letter-spacing: 0;
}

button.abgabe-zeitmarke {
  cursor: pointer;
}

button.abgabe-zeitmarke:hover,
button.abgabe-zeitmarke:focus-visible {
  border-color: var(--red);
  background: color-mix(in srgb, var(--red) 7%, var(--card));
}

.abgabe-zeit-bewertung {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--stroke);
}

.abgabe-zeit-bewertung > div {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.abgabe-zeit-bewertung-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
}

.abgabe-zeit-bewertung-row p {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 620px) {
  .abgabe-rubrik-kopf,
  .abgabe-bewertung-head {
    display: grid;
  }

  .abgabe-rubrik-summary {
    width: fit-content;
    white-space: normal;
  }

  .abgabe-rubrik-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .abgabe-bewertung-status {
    justify-content: space-between;
  }

  .abgabe-link {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .abgabe-link .btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .abgabe-video-aktion,
  .abgabe-zeit-kopf {
    display: grid;
  }

  .abgabe-video-aktion .btn,
  .abgabe-zeit-kopf > strong {
    width: 100%;
  }

  .abgabe-zeit-row {
    grid-template-columns: 58px minmax(0, 1fr) 36px;
  }
}

:root,
[data-theme="light"] {
  --brand-dark: #1A1A1A;
  --brand-dark-2: #242422;
  --paper: #F6F7F8;
  --paper-2: #FFFFFF;
  --bg: #F3F5F7;
  --card: #FFFFFF;
  --glass: rgba(255, 255, 255, .96);
  --text: #1A1A1A;
  --muted: #62666D;
  --stroke: #DDE0E4;
  --stroke-strong: #C6CBD1;
  --schatten: 0 2px 3px rgba(22, 22, 20, .04), 0 14px 36px rgba(22, 22, 20, .065);
  --schatten-hover: 0 5px 12px rgba(22, 22, 20, .08), 0 20px 42px rgba(22, 22, 20, .09);
  --focus: #9D8F00;
  --chevron-blk: #1A1A1A;
  --green: #767871;
  --gruen: #767871;
  --career-soft-green: #FFFBE0;
  --career-ink-green: #5F5700;
}

[data-theme="dark"] {
  --brand-dark: #0C0D0D;
  --brand-dark-2: #1A1B1A;
  --paper: #111212;
  --paper-2: #181919;
  --bg: #0D0E0E;
  --card: #181919;
  --glass: rgba(24, 25, 25, .94);
  --text: #F7F5EF;
  --muted: #A7A69F;
  --stroke: #323330;
  --stroke-strong: #4D4E48;
  --schatten: 0 14px 42px rgba(0, 0, 0, .34);
  --schatten-hover: 0 18px 54px rgba(0, 0, 0, .48);
  --focus: #ECDC28;
  --chevron-blk: #FFFFFF;
  --green: #C2C3BC;
  --gruen: #C2C3BC;
  --career-soft-green: #2A291B;
  --career-ink-green: #ECDC28;
}

html {
  color-scheme: light;
  background: var(--bg);
}

html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme-switching] *,
html[data-theme-switching] *::before,
html[data-theme-switching] *::after {
  transition: none !important;
}

body {
  background-color: var(--bg);
  background-image:
    linear-gradient(145deg, rgba(236, 220, 40, .065), transparent 28rem),
    linear-gradient(325deg, rgba(230, 38, 0, .035), transparent 31rem);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  height: 3px;
  pointer-events: none;
  background: linear-gradient(90deg, var(--gelb), var(--rot));
}

[data-theme="dark"] body {
  background-image:
    linear-gradient(145deg, rgba(236, 220, 40, .055), transparent 30rem),
    linear-gradient(325deg, rgba(230, 38, 0, .05), transparent 34rem);
}

h1,
h2,
h3,
h4,
strong,
b {
  letter-spacing: 0;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

.workspace-page-title {
  margin: 16px 2px 12px;
  font-size: 22px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.kopf h1 {
  margin: 0;
  font-size: 20px;
}

p {
  text-wrap: pretty;
}

::selection {
  background: var(--gelb);
  color: var(--brand-dark);
}

:focus-visible {
  outline-color: var(--focus);
  outline-width: 3px;
}

/* Surfaces and controls */
.glass,
.tool,
.job-card,
.team-card,
.connection,
.endpoint,
.coursepanel {
  border-color: var(--stroke);
  background: var(--card);
  box-shadow: var(--schatten);
}

.glass {
  backdrop-filter: blur(18px) saturate(118%);
  -webkit-backdrop-filter: blur(18px) saturate(118%);
}

.glass.card,
.tool,
.job-card,
.team-card,
.connection,
.endpoint {
  border-radius: 8px;
}

.btn {
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid #C7B900;
  border-radius: 7px;
  background: var(--gelb);
  color: var(--brand-dark);
  font-weight: 800;
  box-shadow: 0 5px 16px rgba(188, 172, 0, .16);
  transition:
    transform .18s cubic-bezier(.16, 1, .3, 1),
    background .18s ease,
    border-color .18s ease,
    box-shadow .18s ease;
}

.btn:hover {
  border-color: var(--brand-dark);
  background: #F4E83C;
  box-shadow: 0 7px 22px rgba(188, 172, 0, .22);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn.sekundaer {
  border-color: var(--stroke-strong);
  background: var(--card);
  color: var(--text);
  box-shadow: none;
}

.btn.sekundaer:hover {
  border-color: var(--text);
  background: var(--paper);
}

.btn.gefahr {
  border-color: rgba(230, 38, 0, .48);
  background: transparent;
  color: var(--rot);
  box-shadow: none;
}

.icon-btn {
  border-color: var(--stroke);
  border-radius: 7px;
  background: var(--card);
  box-shadow: 0 2px 8px rgba(22, 22, 20, .035);
  transition:
    transform .18s cubic-bezier(.16, 1, .3, 1),
    background .18s ease,
    border-color .18s ease;
}

.icon-btn:hover {
  border-color: var(--text);
  background: var(--paper);
  transform: translateY(-1px);
}

.file-action {
  border-color: var(--stroke-strong);
  background: var(--paper);
  font-weight: 750;
}

.file-action > .ui-icon:first-child {
  padding: 4px;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--gelb);
  color: var(--brand-dark);
}

.pill,
.status,
.state,
.topic-chip,
.function-chip,
.scope,
.tag {
  border-radius: 6px;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  min-width: 0;
  max-width: 100%;
  border-color: var(--stroke-strong);
  border-radius: 7px;
  background: var(--card);
  color: var(--text);
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  border-color: #A89A00;
  outline: 0;
  box-shadow: 0 0 0 4px rgba(236, 220, 40, .17);
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--rot);
}

dialog,
.portal-dialog {
  border-color: var(--stroke-strong);
  background: var(--card);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .32);
}

dialog::backdrop,
.portal-dialog::backdrop {
  background: rgba(10, 10, 10, .62);
  backdrop-filter: blur(7px);
}

.portal-dialog-head,
.dialog-head,
.dialog-kopf {
  position: relative;
  background: var(--card);
}

.portal-dialog-head::after,
.dialog-head::after,
.dialog-kopf::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(90deg, var(--rot), var(--gelb), transparent 72%);
}

.portal-eyebrow,
.eyebrow,
.briefing-eyebrow {
  color: var(--rot);
  font-weight: 850;
  letter-spacing: .08em;
}

[data-theme="dark"] .portal-eyebrow,
[data-theme="dark"] .eyebrow,
[data-theme="dark"] .briefing-eyebrow {
  color: var(--gelb);
}

/* Shared top shell */
.role-header,
.wrap > header:not(.role-header),
.ob-top {
  position: relative;
  isolation: isolate;
  padding: 12px 14px;
  border: 1px solid #30312E;
  border-radius: 8px;
  background:
    linear-gradient(112deg, rgba(236, 220, 40, .055), transparent 34%),
    linear-gradient(290deg, rgba(230, 38, 0, .07), transparent 38%),
    var(--brand-dark);
  color: #FFFFFF;
  box-shadow: 0 12px 34px rgba(12, 12, 12, .18);
}

.role-header::after,
.wrap > header:not(.role-header)::after,
.ob-top::after {
  content: "";
  position: absolute;
  inset: auto 14px -1px;
  height: 2px;
  z-index: -1;
  background: linear-gradient(90deg, var(--gelb), var(--rot), transparent 70%);
}

.role-header,
.wrap > header:not(.role-header) {
  margin-top: 3px;
  margin-bottom: 20px;
  border-bottom-color: #30312E;
}

.role-header .brand,
.wrap > header:not(.role-header) .brand,
.ob-top .brand {
  --chevron-blk: #FFFFFF;
  color: #FFFFFF;
}

.role-header .brand .app b,
.wrap > header:not(.role-header) .brand .app b,
.ob-top .brand .app b {
  color: var(--gelb);
}

.role-header .brand .wm,
.wrap > header:not(.role-header) .brand .wm,
.ob-top .brand .wm,
.role-header .muted,
.role-header #who,
.role-header #wer,
.role-header #rolle {
  color: #BDBDB8 !important;
}

.role-nav button,
.role-nav a,
.role-nav summary {
  color: #C9C9C4;
}

.role-nav button:hover,
.role-nav a:hover,
.role-nav summary:hover {
  background: rgba(255, 255, 255, .09);
  color: #FFFFFF;
}

.role-nav button.aktiv,
.role-nav a.aktiv,
.role-nav [aria-current="page"],
.role-nav button[aria-selected="true"] {
  background: var(--gelb);
  color: var(--brand-dark);
  box-shadow: 0 5px 16px rgba(236, 220, 40, .16);
}

.role-header .icon-btn,
.wrap > header:not(.role-header) .icon-btn,
.ob-top .icon-btn {
  border-color: rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .07);
  color: #FFFFFF;
  box-shadow: none;
}

.role-header .icon-btn:hover,
.wrap > header:not(.role-header) .icon-btn:hover,
.ob-top .icon-btn:hover {
  border-color: var(--gelb);
  background: rgba(236, 220, 40, .12);
}

.role-header .btn.sekundaer,
.wrap > header:not(.role-header) .btn.sekundaer,
.ob-top .btn.sekundaer {
  border-color: rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .07);
  color: #FFFFFF;
}

.role-header input,
.role-header select {
  border-color: rgba(255, 255, 255, .18) !important;
  background: rgba(255, 255, 255, .08) !important;
  color: #FFFFFF !important;
}

.portal-launchers {
  gap: 7px;
}

.portal-nav-tools {
  display: none;
}

.portal-nav-tools-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.portal-nav-tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.portal-nav-tools-grid > button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  min-height: 46px;
  padding: 9px 11px;
  border: 1px solid var(--stroke);
  border-radius: 7px;
  background: var(--card);
  color: var(--text);
  font: 700 12px var(--font);
  text-align: left;
  cursor: pointer;
}

.portal-nav-tools-grid > button:hover {
  border-color: var(--stroke-strong);
  background: var(--paper);
}

.portal-nav-tools-grid > button .ui-icon {
  flex: 0 0 auto;
}

.portal-nav-tools-grid > button[hidden] {
  display: none;
}

.portal-nav-tools-grid > .portal-nav-logout {
  color: var(--rot);
}

.portal-help-dialog {
  width: min(720px, calc(100vw - 32px));
}

.portal-help-head .portal-dialog-actions {
  align-items: flex-start;
}

.portal-help-object {
  width: 58px;
  height: 58px;
  margin: -8px 2px -10px 0;
}

.portal-help-boundary {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin: 14px 20px 10px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--blau) 32%, var(--stroke));
  border-radius: 7px;
  background: color-mix(in srgb, var(--blau) 6%, var(--card));
}

.portal-help-boundary > .ui-icon {
  width: 22px;
  height: 22px;
  color: var(--blau);
}

.portal-help-boundary span,
.portal-help-boundary strong,
.portal-help-boundary small {
  display: block;
  min-width: 0;
}

.portal-help-boundary strong {
  font-size: 12px;
}

.portal-help-boundary small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.portal-help-suggestions {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 20px 12px;
  scrollbar-width: none;
}

.portal-help-suggestions::-webkit-scrollbar {
  display: none;
}

.portal-help-suggestion {
  display: grid;
  grid-template-columns: 28px minmax(112px, 1fr) auto;
  gap: 7px;
  align-items: center;
  flex: 0 0 auto;
  min-height: 42px;
  max-width: 230px;
  padding: 6px 9px;
  border: 1px solid var(--stroke);
  border-radius: 7px;
  background: var(--card);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.portal-help-suggestion:hover {
  border-color: var(--stroke-strong);
  background: var(--paper);
  transform: translateY(-1px);
}

.portal-help-suggestion > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--gelb) 22%, var(--card));
  color: color-mix(in srgb, var(--text) 78%, var(--gelb));
}

.portal-help-suggestion > b {
  min-width: 0;
  font-size: 11px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.portal-help-suggestion > .ui-icon {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.portal-help-form {
  padding: 0 20px 14px;
}

.portal-help-form > label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.portal-help-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 38px;
  gap: 9px;
  align-items: center;
  min-height: 46px;
  padding: 3px 4px 3px 12px;
  border: 1px solid var(--stroke-strong);
  border-radius: 7px;
  background: var(--bg);
}

.portal-help-field:focus-within {
  border-color: var(--blau);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, .12);
}

.portal-help-field > .ui-icon {
  color: var(--muted);
}

.portal-help-field input {
  width: 100%;
  height: 38px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: 500 14px var(--font);
  box-shadow: none;
}

.portal-help-field button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 6px;
  background: var(--gelb);
  color: #1B1B19;
  cursor: pointer;
}

.portal-help-field button:hover {
  filter: brightness(.97);
  transform: translateX(1px);
}

.portal-help-field button:disabled {
  cursor: wait;
  opacity: .56;
}

.portal-help-results {
  min-height: 210px;
  overflow-y: auto;
  border-top: 1px solid var(--stroke);
}

.portal-help-empty span {
  max-width: 430px;
  color: var(--muted);
  font-size: 11px;
}

.portal-help-answer {
  padding: 17px 20px 21px;
}

.portal-help-answer > header {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
}

.portal-help-answer-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--gelb) 24%, var(--card));
  color: var(--text);
}

.portal-help-answer[data-help-state="sicherheitsgrenze"] .portal-help-answer-icon {
  background: color-mix(in srgb, var(--rot) 10%, var(--card));
  color: var(--rot);
}

.portal-help-answer > header div > span {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.portal-help-answer h3 {
  font-size: 17px;
  line-height: 1.25;
}

.portal-help-answer > p {
  margin: 11px 0 13px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.portal-help-answer ol {
  display: grid;
  gap: 8px;
  margin: 0 0 15px;
  padding: 0;
  list-style: none;
  counter-reset: portal-help-step;
}

.portal-help-answer li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  counter-increment: portal-help-step;
}

.portal-help-answer li::before {
  content: counter(portal-help-step);
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--stroke);
  border-radius: 50%;
  background: var(--paper);
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
}

.portal-help-action {
  width: fit-content;
}

.portal-help-related {
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid var(--stroke);
}

.portal-help-related > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.portal-help-related > div {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.portal-help-related .portal-help-suggestion {
  flex: 1 1 180px;
}

.portal-delivery:has(#portal-push-device:checked) {
  border-color: color-mix(in srgb, var(--gelb) 72%, var(--stroke));
  box-shadow: inset 3px 0 var(--gelb);
}

.portal-delivery-copy em[data-status="aktiv"] {
  color: var(--text);
  font-weight: 700;
}

.portal-delivery-copy em[data-status="fehler"] {
  color: var(--rot);
}

.portal-session-settings {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--stroke);
}

.portal-session-settings > header {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.portal-session-settings > header > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.portal-session-settings > header strong {
  font-size: 12px;
}

.portal-session-settings > header small {
  color: var(--muted);
  font-size: 10px;
}

.portal-session-list {
  margin-top: 9px;
  border-block: 1px solid var(--stroke);
}

.portal-session-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  gap: 9px;
  align-items: center;
  min-height: 58px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--stroke);
}

.portal-session-row:last-child {
  border-bottom: 0;
}

.portal-session-row.aktuell {
  box-shadow: inset 3px 0 var(--gelb);
}

.portal-session-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--text);
}

.portal-session-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.portal-session-copy strong {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.portal-session-copy strong b {
  flex: 0 0 auto;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--gelb);
  color: var(--brand-dark);
  font-size: 9px;
}

.portal-session-copy small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.portal-session-revoke {
  width: 32px;
  height: 32px;
}

.portal-session-empty,
.portal-session-message {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 46px;
  margin: 0;
  padding: 8px 2px;
  color: var(--muted);
  font-size: 10px;
}

.portal-session-empty .ui-icon {
  width: 16px;
  height: 16px;
}

.portal-session-message {
  min-height: auto;
  color: var(--text);
}

[data-pwa-install] .ui-icon {
  color: var(--gelb);
}

[data-theme="light"] [data-pwa-install] .ui-icon {
  color: var(--rot);
}

.portal-side-tools {
  border-bottom-color: rgba(255, 255, 255, .12);
}

.portal-theme-toggle .theme-label-light,
[data-theme="dark"] .portal-theme-toggle .theme-label-dark {
  display: inline;
}

.portal-theme-toggle .theme-label-dark,
[data-theme="dark"] .portal-theme-toggle .theme-label-light {
  display: none;
}

/* Staff sidebar: one calm, role-specific control plane */
.seite {
  border-right: 1px solid #30312E;
  background:
    linear-gradient(165deg, rgba(236, 220, 40, .045), transparent 30%),
    var(--brand-dark);
  color: #FFFFFF;
}

.seite .brand {
  --chevron-blk: #FFFFFF;
  color: #FFFFFF;
}

.seite .brand .app b {
  color: var(--gelb);
}

.seite .brand .wm {
  color: #AAA9A4 !important;
}

.seite .block {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #888983;
  letter-spacing: .08em;
}

.seite .block::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  background: var(--rot);
}

.seite a {
  color: #CDCDC8;
}

.seite a:hover {
  background: rgba(255, 255, 255, .08);
  color: #FFFFFF;
}

.seite a.aktiv {
  background: var(--gelb);
  color: var(--brand-dark);
  box-shadow: 0 6px 18px rgba(236, 220, 40, .14);
}

.seite .portal-side-button {
  border-color: rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .055);
  color: #E7E7E1;
}

.seite .portal-side-button:hover {
  border-color: var(--gelb);
  background: rgba(236, 220, 40, .11);
}

/* Navigation, tables and data density */
.tabs,
.career-tabs {
  border-color: var(--stroke);
  background: color-mix(in srgb, var(--card) 93%, transparent);
  box-shadow: var(--schatten);
  backdrop-filter: blur(18px);
}

.tabs button.aktiv,
.career-tabs button.aktiv {
  background: var(--brand-dark);
  color: #FFFFFF;
}

.tabs button.aktiv .ui-icon,
.career-tabs button.aktiv .ui-icon {
  color: var(--gelb);
}

.admin-tabs {
  top: 3px;
  padding: 6px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: color-mix(in srgb, var(--card) 94%, transparent);
  box-shadow: var(--schatten);
  backdrop-filter: blur(18px);
}

.admin-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
}

.admin-tabs button[aria-selected="true"] {
  border: 0;
  background: var(--brand-dark);
  color: #FFFFFF;
}

.admin-area-picker {
  display: none;
}

.glass table thead th,
.card table thead th {
  border-color: #353632;
  background: var(--brand-dark);
  color: #F4F3ED;
  font-size: 11px;
  font-weight: 800;
}

.glass table tbody tr,
.card table tbody tr {
  transition: background .14s ease;
}

.glass table tbody tr:hover,
.card table tbody tr:hover {
  background: rgba(236, 220, 40, .075);
}

.kpi .kachel,
.metric-band .metric,
.metric-grid .metric,
.summary-grid > *,
.audit-kpi > *,
.betrieb-zahl,
.sf-zahl,
.briefing-metric {
  position: relative;
  overflow: hidden;
  background: var(--card);
}

.kpi .kachel::after,
.metric-band .metric::after,
.metric-grid .metric::after,
.summary-grid > *::after,
.audit-kpi > *::after,
.briefing-metric::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: var(--gelb);
}

.kpi .kachel:first-child,
.metric-band .metric:first-child,
.metric-grid .metric:first-child,
.summary-grid > *:first-child,
.audit-kpi > *:first-child {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
  color: #FFFFFF;
}

.kpi .kachel:first-child span,
.metric-band .metric:first-child span,
.metric-band .metric:first-child small,
.metric-grid .metric:first-child span,
.summary-grid > *:first-child span,
.audit-kpi > *:first-child span {
  color: #BDBDB8;
}

.kpi .kachel:first-child::after,
.metric-band .metric:first-child::after,
.metric-grid .metric:first-child::after,
.summary-grid > *:first-child::after,
.audit-kpi > *:first-child::after {
  background: linear-gradient(90deg, var(--gelb), var(--rot));
}

.balken {
  background: color-mix(in srgb, var(--stroke) 82%, transparent);
}

.balken > div,
.progress > span,
.briefing-progress span,
.sf-fortschritt span {
  background: linear-gradient(90deg, var(--gradR), var(--rot) 34%, var(--gradY));
}

.chart .saeule,
.mini-chart span:nth-child(n) {
  background: linear-gradient(180deg, var(--gelb), var(--rot) 130%);
}

.chart .saeule:nth-child(3n+2),
.mini-chart span:nth-child(3n+2) {
  background: #7B7B75;
}

.chart .saeule.leer {
  background: var(--stroke);
}

/* Participant home */
.tn-page .wrap {
  max-width: 1180px;
}

.tn-section-head {
  position: relative;
  padding-left: 18px;
  margin: 8px 0 18px;
}

.tn-section-head::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--rot);
}

.tn-section-head h1,
.tn-section-head h2 {
  font-size: 28px;
  font-weight: 900;
}

.bidi-card {
  isolation: isolate;
  border-color: #343530;
  background:
    linear-gradient(115deg, rgba(236, 220, 40, .10), transparent 42%),
    linear-gradient(295deg, rgba(230, 38, 0, .12), transparent 44%),
    var(--brand-dark);
  color: #FFFFFF;
  box-shadow: 0 22px 56px rgba(15, 15, 14, .18);
}

.bidi-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .16;
  pointer-events: none;
  background: repeating-linear-gradient(
    135deg,
    transparent 0 20px,
    rgba(255, 255, 255, .08) 20px 21px
  );
}

.bidi-card .portal-eyebrow {
  color: var(--gelb);
}

.bidi-card h3 {
  color: #FFFFFF;
  font-size: 21px;
}

.bidi-card p {
  color: #C9C9C4;
}

.bidi-card-main {
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 18px;
}

.bidi-card-main > .bidi-avatar {
  width: 96px;
  height: 96px;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .45));
}

.bidi-prompt {
  border-color: rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .065);
  color: #F5F4EE;
}

.bidi-prompt:hover {
  border-color: var(--gelb);
  background: rgba(236, 220, 40, .12);
}

.plan-date,
.date-tile {
  border-color: #33342F;
  background: var(--brand-dark);
  color: #B7B7B2;
  box-shadow: inset 0 3px var(--gelb);
}

.plan-date b,
.date-tile b {
  color: #FFFFFF;
}

.team-avatar,
.avatar,
.briefing-avatar {
  border: 1px solid color-mix(in srgb, var(--gelb) 54%, var(--stroke));
  background: #FFF7A6;
  color: var(--brand-dark);
}

.ampel .punkt,
.status-dot {
  background: var(--gelb) !important;
  box-shadow: 0 0 0 4px rgba(236, 220, 40, .18);
}

/* Learning */
.course-summary {
  position: relative;
  padding: 27px 28px;
  border: 1px solid #343530;
  border-radius: 8px;
  background:
    linear-gradient(110deg, rgba(236, 220, 40, .08), transparent 42%),
    var(--brand-dark);
  color: #FFFFFF;
  box-shadow: 0 20px 50px rgba(15, 15, 14, .16);
}

.course-summary::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gelb), var(--rot), transparent 78%);
}

.course-summary .eyebrow,
.course-summary .next-label {
  color: var(--gelb);
}

.course-summary .progress-copy span,
.course-summary .next-lesson p {
  color: #BDBDB8;
}

.course-summary .ring {
  background: conic-gradient(var(--gelb) calc(var(--p) * 1%), #3B3C38 0);
}

.course-summary .ring > div {
  background: var(--brand-dark);
}

.course-summary .map-step {
  background: #40413D;
}

.course-summary .map-step.begonnen {
  background: linear-gradient(90deg, var(--yellow) var(--step), #40413D 0);
}

.course-summary .map-step.fertig {
  background: var(--yellow);
}

.kap-card {
  border-color: var(--stroke);
  box-shadow: var(--schatten);
  transition:
    transform .24s cubic-bezier(.16, 1, .3, 1),
    border-color .18s ease,
    box-shadow .24s ease;
}

.kap-card:hover {
  border-color: #A89A00;
  box-shadow: var(--schatten-hover);
  transform: translateY(-2px);
}

.kap-mark,
.kap-card.fertig .kap-mark {
  background: var(--brand-dark);
  color: var(--gelb);
}

/* Career and onboarding */
.career-head,
.welcome {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border: 1px solid #343530;
  border-radius: 8px;
  background:
    linear-gradient(110deg, rgba(236, 220, 40, .08), transparent 44%),
    linear-gradient(300deg, rgba(230, 38, 0, .09), transparent 40%),
    var(--brand-dark);
  color: #FFFFFF;
  box-shadow: 0 20px 50px rgba(15, 15, 14, .16);
}

.career-head::after,
.welcome::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gelb), var(--rot), transparent 78%);
}

.career-head p,
.career-head .head-status span,
.welcome p {
  color: #C3C3BE;
}

.career-head .eyebrow,
.welcome .eyebrow {
  color: var(--gelb);
}

.career-head h1,
.welcome h1 {
  color: #FFFFFF;
  font-weight: 900;
}

.metric-icon,
.next-icon,
.step-icon,
.timeline-row.done .step-icon,
.step.done .step-icon {
  border-color: rgba(236, 220, 40, .55);
  background: rgba(236, 220, 40, .18);
  color: var(--text);
}

.timeline-row.done .step-icon,
.step.done .step-icon {
  background: var(--gelb);
  color: var(--brand-dark);
}

.timeline-row.done .state,
.state.done {
  border-color: #B5A900;
  background: rgba(236, 220, 40, .16);
  color: var(--text);
}

.step.done {
  border-left-color: var(--gelb);
}

.profile-hero {
  border: 1px solid #343530;
  border-left: 5px solid var(--rot);
  border-radius: 8px;
  background: var(--brand-dark);
  color: #FFFFFF;
  box-shadow: var(--schatten);
}

.profile-hero p {
  color: #C3C3BE;
}

.profile-score {
  border-left-color: #3A3B37;
}

.profile-score b {
  color: var(--gelb);
}

.score-button {
  border-color: #343530;
  background: var(--brand-dark);
  color: #FFFFFF;
  box-shadow: inset 0 -3px var(--gelb);
}

.step,
.context {
  box-shadow: var(--schatten);
}

/* Communication */
.community-header {
  margin-bottom: 14px;
}

.staff-contextbar {
  padding: 6px 2px 15px;
}

.staff-context-copy span {
  color: var(--rot);
}

.workspace {
  border-color: var(--stroke);
  box-shadow: var(--schatten);
}

.community-header + .staff-contextbar + .mode-tabs + .workspace,
.mode-tabs + .workspace {
  box-shadow: 0 20px 54px rgba(19, 19, 18, .10);
}

.community-header ~ .mode-tabs button.aktiv {
  border-bottom-color: var(--gelb);
}

.community-header ~ .workspace .left-rail {
  border-right-color: #30312E;
  background:
    linear-gradient(165deg, rgba(236, 220, 40, .05), transparent 35%),
    var(--brand-dark);
  color: #FFFFFF;
}

.community-header ~ .workspace .left-rail .rail-head h2,
.community-header ~ .workspace .left-rail .rail-title {
  color: #FFFFFF;
}

.community-header ~ .workspace .left-rail .rail-sub {
  color: #9F9F9A;
}

.community-header ~ .workspace .left-rail .rail-search input {
  border-color: rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .07);
  color: #FFFFFF;
}

.community-header ~ .workspace .left-rail .rail-button {
  color: #D4D4CE;
}

.community-header ~ .workspace .left-rail .rail-button:hover {
  background: rgba(255, 255, 255, .08);
}

.community-header ~ .workspace .left-rail .rail-button.aktiv {
  background: var(--gelb);
  color: var(--brand-dark);
}

.community-header ~ .workspace .left-rail .rail-button.aktiv .rail-title,
.community-header ~ .workspace .left-rail .rail-button.aktiv .rail-sub {
  color: var(--brand-dark);
}

.community-header ~ .workspace .left-rail .icon-btn {
  border-color: rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .07);
  color: #FFFFFF;
}

.space-mark,
.space-mark.kohorte,
.space-mark.gruppe {
  background: var(--gelb);
  color: var(--brand-dark);
}

.post {
  box-shadow: 0 8px 24px rgba(22, 22, 20, .045);
}

.post.angeheftet {
  border-top-color: var(--gelb);
}

.message.eigen .bubble {
  border-color: #B7AA16;
  background: var(--gelb);
  color: var(--brand-dark);
}

[data-theme="light"] .feedback-workspace,
[data-theme="light"] .feedback-grid,
[data-theme="light"] .feedback-panel,
[data-theme="light"] .pulse-card,
[data-theme="light"] .idea-card {
  color: var(--text);
}

[data-theme="dark"] .feedback-grid {
  border-color: var(--stroke);
  background: var(--card);
}

[data-theme="dark"] .feedback-panel + .feedback-panel {
  border-left-color: var(--stroke);
}

[data-theme="dark"] .pulse-card,
[data-theme="dark"] .idea-card {
  background: #121215;
}

[data-theme="dark"] .pulse-privacy,
[data-theme="dark"] .pulse-metric,
[data-theme="dark"] .pulse-result-note,
[data-theme="dark"] .idea-vote,
[data-theme="dark"] .idea-decision {
  background: var(--card);
}

[data-theme="dark"] .status-chip.offen,
[data-theme="dark"] .status-chip.in_pruefung {
  color: #F1B95F;
}

[data-theme="dark"] .status-chip.geplant {
  color: #80B7D2;
}

[data-theme="dark"] .status-chip.umgesetzt,
[data-theme="dark"] .status-chip.wirksam {
  color: #7BC4A4;
}

[data-theme="dark"] .status-chip.nicht_umgesetzt,
[data-theme="dark"] .status-chip.unwirksam,
[data-theme="dark"] .status-chip.kritisch {
  color: #FF8E78;
}

/* Teaching, planning, editorial and QMS */
.briefing-hero,
.hero-line,
.workspace-head {
  position: relative;
  padding: 22px 24px;
  border: 1px solid #343530;
  border-radius: 8px;
  background:
    linear-gradient(110deg, rgba(236, 220, 40, .075), transparent 44%),
    var(--brand-dark);
  color: #FFFFFF;
  box-shadow: var(--schatten);
}

.briefing-hero p,
.hero-line p,
.workspace-head p {
  color: #C3C3BE;
}

.briefing-hero .briefing-eyebrow {
  color: var(--gelb);
}

.briefing-metrics {
  border-color: var(--stroke);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--schatten);
}

.briefing-metric:first-child {
  padding-left: 16px;
  background: var(--brand-dark);
  color: #FFFFFF;
}

.briefing-metric:first-child span {
  color: #BDBDB8;
}

.briefing-metric.ok b {
  color: var(--text);
}

.briefing-person {
  box-shadow: 0 6px 20px rgba(22, 22, 20, .04);
}

.planung-shell,
.red-header + .workspace {
  border-color: var(--stroke);
  box-shadow: var(--schatten);
}

.kohorten-rail,
.module-nav {
  border-color: #30312E;
  background:
    linear-gradient(165deg, rgba(236, 220, 40, .045), transparent 32%),
    var(--brand-dark);
  color: #FFFFFF;
}

.kohorten-rail h2,
.module-nav h2 {
  color: #A7A7A2;
}

.cohort-button,
.module-list button {
  color: #D3D3CE;
}

.cohort-button:hover,
.module-list button:hover {
  border-color: rgba(255, 255, 255, .15);
  background: rgba(255, 255, 255, .07);
}

.cohort-button.aktiv,
.module-list button.aktiv {
  border-color: var(--gelb);
  background: var(--gelb);
  color: var(--brand-dark);
}

.cohort-button.aktiv span,
.module-list button.aktiv small {
  color: #514B0B;
}

.lesson-type {
  border-color: var(--stroke);
  box-shadow: 0 6px 18px rgba(22, 22, 20, .035);
  transition:
    transform .24s cubic-bezier(.16, 1, .3, 1),
    border-color .18s ease,
    background .18s ease;
}

.lesson-type:hover {
  border-color: #AA9B00;
  background: rgba(236, 220, 40, .08);
  transform: translateY(-2px);
}

.lesson-type .ui-icon {
  color: var(--rot);
}

.dashboard-grid {
  border-color: var(--stroke);
  box-shadow: var(--schatten);
}

.dashboard-grid .dash-panel:first-child {
  border-right-color: #383935;
  background: var(--brand-dark);
  color: #FFFFFF;
}

.dashboard-grid .dash-panel:first-child .dash-panel-head span,
.dashboard-grid .dash-panel:first-child .metric-link span {
  color: #ACACA7;
}

.dashboard-grid .dash-panel:first-child .metric-link {
  border-bottom-color: #363733;
  color: #FFFFFF;
}

.dashboard-grid .dash-panel:first-child .health-ring > div {
  background: var(--brand-dark);
}

.health-ring {
  background: conic-gradient(var(--rot) calc(var(--risk) * 1%), #3D3E39 0);
}

.queue-track {
  background: var(--stroke);
}

.queue-track i,
.queue-row.warn .queue-track i {
  background: linear-gradient(90deg, var(--gelb), var(--rot));
}

/* True light mode: navigation and workspaces stay light across every role. */
[data-theme="light"] .login-top,
[data-theme="light"] .role-header,
[data-theme="light"] .wrap > header:not(.role-header),
[data-theme="light"] .ob-top {
  border-color: var(--stroke);
  background: var(--paper-2);
  color: var(--text);
  box-shadow: var(--schatten);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

[data-theme="light"] .login-top .brand,
[data-theme="light"] .role-header .brand,
[data-theme="light"] .wrap > header:not(.role-header) .brand,
[data-theme="light"] .ob-top .brand {
  --chevron-blk: var(--text);
  color: var(--text);
}

[data-theme="light"] .login-top .brand .app b,
[data-theme="light"] .role-header .brand .app b,
[data-theme="light"] .wrap > header:not(.role-header) .brand .app b,
[data-theme="light"] .ob-top .brand .app b {
  color: var(--text);
}

[data-theme="light"] .login-top .brand .wm,
[data-theme="light"] .role-header .brand .wm,
[data-theme="light"] .wrap > header:not(.role-header) .brand .wm,
[data-theme="light"] .ob-top .brand .wm,
[data-theme="light"] .role-header .muted,
[data-theme="light"] .role-header #who,
[data-theme="light"] .role-header #wer,
[data-theme="light"] .role-header #rolle {
  color: var(--muted) !important;
}

[data-theme="light"] .role-nav button,
[data-theme="light"] .role-nav a,
[data-theme="light"] .role-nav summary {
  color: #55544F;
}

[data-theme="light"] .role-nav button:hover,
[data-theme="light"] .role-nav a:hover,
[data-theme="light"] .role-nav summary:hover {
  background: var(--paper);
  color: var(--text);
}

[data-theme="light"] .role-nav button.aktiv,
[data-theme="light"] .role-nav a.aktiv,
[data-theme="light"] .role-nav [aria-current="page"],
[data-theme="light"] .role-nav button[aria-selected="true"] {
  color: var(--brand-dark);
}

[data-theme="light"] .login-top .icon-btn,
[data-theme="light"] .role-header .icon-btn,
[data-theme="light"] .wrap > header:not(.role-header) .icon-btn,
[data-theme="light"] .ob-top .icon-btn,
[data-theme="light"] .role-header .btn.sekundaer,
[data-theme="light"] .wrap > header:not(.role-header) .btn.sekundaer,
[data-theme="light"] .ob-top .btn.sekundaer {
  border-color: var(--stroke);
  background: var(--paper-2);
  color: var(--text);
}

[data-theme="light"] .login-top .icon-btn:hover,
[data-theme="light"] .role-header .icon-btn:hover,
[data-theme="light"] .wrap > header:not(.role-header) .icon-btn:hover,
[data-theme="light"] .ob-top .icon-btn:hover {
  border-color: #A89A00;
  background: #FFFBE2;
}

[data-theme="light"] .role-header input,
[data-theme="light"] .role-header select {
  border-color: var(--stroke-strong) !important;
  background: var(--paper-2) !important;
  color: var(--text) !important;
}

[data-theme="light"] .portal-side-tools {
  border-bottom-color: var(--stroke);
}

[data-theme="light"] .mode-tabs,
[data-theme="light"] .lehre-more-menu,
[data-theme="light"] .post-menu .menu,
[data-theme="light"] .mention-menu,
[data-theme="light"] .bidi-settings {
  border-color: var(--stroke);
  background: var(--paper-2);
  color: var(--text);
}

[data-theme="light"] .seite,
[data-theme="light"] .community-header ~ .workspace .left-rail,
[data-theme="light"] .kohorten-rail,
[data-theme="light"] .module-nav {
  border-color: var(--stroke);
  background: var(--paper-2);
  color: var(--text);
  box-shadow: 1px 0 0 rgba(22, 25, 29, .025);
}

[data-theme="light"] .seite .brand,
[data-theme="light"] .seite .marke .brand {
  --chevron-blk: var(--text);
  color: var(--text);
}

[data-theme="light"] .seite .brand .app b {
  color: var(--text);
}

[data-theme="light"] .seite .brand .wm {
  color: var(--muted) !important;
}

[data-theme="light"] .seite .block {
  color: var(--muted);
}

[data-theme="light"] .seite a,
[data-theme="light"] .community-header ~ .workspace .left-rail .rail-button,
[data-theme="light"] .cohort-button,
[data-theme="light"] .module-list button {
  color: #55544F;
}

[data-theme="light"] .seite a:hover,
[data-theme="light"] .community-header ~ .workspace .left-rail .rail-button:hover,
[data-theme="light"] .cohort-button:hover,
[data-theme="light"] .module-list button:hover {
  border-color: var(--stroke);
  background: var(--paper);
  color: var(--text);
}

[data-theme="light"] .seite a.aktiv,
[data-theme="light"] .community-header ~ .workspace .left-rail .rail-button.aktiv,
[data-theme="light"] .cohort-button.aktiv,
[data-theme="light"] .module-list button.aktiv {
  color: var(--brand-dark);
}

[data-theme="light"] .seite .portal-side-button,
[data-theme="light"] .community-header ~ .workspace .left-rail .icon-btn {
  border-color: var(--stroke);
  background: var(--paper);
  color: var(--text);
}

[data-theme="light"] .community-header ~ .workspace .left-rail .rail-head h2,
[data-theme="light"] .community-header ~ .workspace .left-rail .rail-title,
[data-theme="light"] .kohorten-rail h2,
[data-theme="light"] .module-nav h2 {
  color: var(--text);
}

[data-theme="light"] .community-header ~ .workspace .left-rail .rail-sub,
[data-theme="light"] .cohort-button span,
[data-theme="light"] .module-list button small {
  color: var(--muted);
}

[data-theme="light"] .community-header ~ .workspace .left-rail .rail-search input {
  border-color: var(--stroke-strong);
  background: var(--paper-2);
  color: var(--text);
}

[data-theme="light"] .tabs button.aktiv,
[data-theme="light"] .career-tabs button.aktiv,
[data-theme="light"] .admin-tabs button[aria-selected="true"] {
  background: var(--gelb);
  color: var(--brand-dark);
}

[data-theme="light"] .admin-tabs {
  background: var(--paper-2);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

[data-theme="light"] .glass table thead th,
[data-theme="light"] .card table thead th {
  border-color: var(--stroke);
  background: var(--paper);
  color: var(--text);
}

[data-theme="light"] .kpi .kachel:first-child,
[data-theme="light"] .metric-band .metric:first-child,
[data-theme="light"] .metric-grid .metric:first-child,
[data-theme="light"] .summary-grid > *:first-child,
[data-theme="light"] .audit-kpi > *:first-child,
[data-theme="light"] .briefing-metric:first-child {
  border-color: var(--stroke);
  background: var(--card);
  color: var(--text);
}

[data-theme="light"] .kpi .kachel:first-child span,
[data-theme="light"] .metric-band .metric:first-child span,
[data-theme="light"] .metric-band .metric:first-child small,
[data-theme="light"] .metric-grid .metric:first-child span,
[data-theme="light"] .summary-grid > *:first-child span,
[data-theme="light"] .audit-kpi > *:first-child span,
[data-theme="light"] .briefing-metric:first-child span {
  color: var(--muted);
}

[data-theme="light"] .bidi-card,
[data-theme="light"] .course-summary,
[data-theme="light"] .career-head,
[data-theme="light"] .welcome,
[data-theme="light"] .profile-hero,
[data-theme="light"] .briefing-hero,
[data-theme="light"] .hero-line,
[data-theme="light"] .workspace-head,
[data-theme="light"] .dashboard-grid .dash-panel:first-child {
  border-color: var(--stroke);
  background:
    linear-gradient(112deg, rgba(236, 220, 40, .11), transparent 42%),
    linear-gradient(300deg, rgba(230, 38, 0, .04), transparent 43%),
    var(--card);
  color: var(--text);
  box-shadow: var(--schatten);
}

[data-theme="light"] .bidi-card h3,
[data-theme="light"] .course-summary h1,
[data-theme="light"] .career-head h1,
[data-theme="light"] .welcome h1,
[data-theme="light"] .briefing-hero h1,
[data-theme="light"] .hero-line h1,
[data-theme="light"] .workspace-head h1,
[data-theme="light"] .community-header ~ .workspace .left-rail .rail-head h2 {
  color: var(--text);
}

[data-theme="light"] .bidi-card p,
[data-theme="light"] .course-summary .progress-copy span,
[data-theme="light"] .course-summary .next-lesson p,
[data-theme="light"] .career-head p,
[data-theme="light"] .career-head .head-status span,
[data-theme="light"] .welcome p,
[data-theme="light"] .profile-hero p,
[data-theme="light"] .briefing-hero p,
[data-theme="light"] .hero-line p,
[data-theme="light"] .workspace-head p,
[data-theme="light"] .dashboard-grid .dash-panel:first-child .dash-panel-head span,
[data-theme="light"] .dashboard-grid .dash-panel:first-child .metric-link span {
  color: var(--muted);
}

[data-theme="light"] .bidi-card .portal-eyebrow,
[data-theme="light"] .course-summary .eyebrow,
[data-theme="light"] .course-summary .next-label,
[data-theme="light"] .career-head .eyebrow,
[data-theme="light"] .welcome .eyebrow,
[data-theme="light"] .briefing-hero .briefing-eyebrow {
  color: #7B7000;
}

[data-theme="light"] .bidi-prompt {
  border-color: var(--stroke);
  background: rgba(255, 255, 255, .78);
  color: var(--text);
}

[data-theme="light"] .plan-date,
[data-theme="light"] .date-tile {
  border-color: var(--stroke);
  background: var(--paper);
  color: var(--muted);
}

[data-theme="light"] .plan-date b,
[data-theme="light"] .date-tile b {
  color: var(--text);
}

[data-theme="light"] .course-summary .ring {
  background: conic-gradient(var(--gelb) calc(var(--p) * 1%), var(--stroke) 0);
}

[data-theme="light"] .course-summary .ring > div {
  background: var(--card);
}

[data-theme="light"] .profile-score {
  border-left-color: var(--stroke);
}

[data-theme="light"] .score-button {
  border-color: #C7B900;
  background: var(--gelb);
  color: var(--brand-dark);
}

[data-theme="light"] .gelb,
[data-theme="light"] .ampelleiste .p.teils {
  border-color: #8A7D00;
  color: #6F6500;
}

[data-theme="light"] .dashboard-grid .dash-panel:first-child .metric-link {
  border-bottom-color: var(--stroke);
  color: var(--text);
}

[data-theme="light"] .dashboard-grid .dash-panel:first-child .health-ring > div {
  background: var(--card);
}

/* Dark mode corrections for page-local hard-coded light surfaces */
[data-theme="dark"] .rail,
[data-theme="dark"] .center,
[data-theme="dark"] .conversation,
[data-theme="dark"] .moderation,
[data-theme="dark"] .selected-file,
[data-theme="dark"] .comment-bubble,
[data-theme="dark"] .dialog-foot,
[data-theme="dark"] .booking-selection,
[data-theme="dark"] .career-tabs,
[data-theme="dark"] .admin-tabs {
  background: var(--bg);
  color: var(--text);
}

[data-theme="dark"] .rail-button:hover,
[data-theme="dark"] .post-menu summary:hover,
[data-theme="dark"] .post-menu[open] summary,
[data-theme="dark"] .post-menu .menu button:hover,
[data-theme="dark"] .post-actions button:hover,
[data-theme="dark"] .post-actions button.aktiv,
[data-theme="dark"] .mention-menu label:hover,
[data-theme="dark"] .contact:hover,
[data-theme="dark"] .lesson:hover {
  background: rgba(255, 255, 255, .075);
}

[data-theme="dark"] .rail-button.aktiv,
[data-theme="dark"] .compose-types button.aktiv {
  background: rgba(236, 220, 40, .18);
  color: var(--text);
}

[data-theme="dark"] .poll button .fill {
  background: rgba(236, 220, 40, .20);
}

[data-theme="dark"] .cta-action {
  border-color: transparent;
  background: var(--gelb);
  color: #1A1A18;
}

[data-theme="dark"] .cta-action small {
  color: #4D4A18;
}

[data-theme="dark"] .cta-action .cta-arrow {
  background: #171817;
  color: var(--gelb);
}

[data-theme="dark"] .message.eigen .bubble {
  color: var(--brand-dark);
}

[data-theme="dark"] .event-date,
[data-theme="dark"] .topic-list span {
  background: rgba(255, 255, 255, .07);
  color: var(--text);
}

[data-theme="dark"] .comment.akzeptiert {
  border-color: rgba(236, 220, 40, .55);
  background: rgba(236, 220, 40, .09);
}

[data-theme="dark"] .answer-badge {
  color: var(--gelb);
}

[data-theme="dark"] .briefing-metric.ok b,
[data-theme="dark"] .complete-state,
[data-theme="dark"] .ampel-gruen {
  color: var(--gelb);
}

[data-theme="dark"] .kpi-box {
  background: var(--card);
  color: var(--text);
}

/* Mobile: app-like black bottom bar, stable controls, no hidden content */
@media (max-width: 820px) {
  body::before {
    position: absolute;
  }

  .role-header,
  .wrap > header:not(.role-header),
  .ob-top {
    border-radius: 0 0 8px 8px;
    margin-top: 0;
  }

  .seite {
    border-bottom: 1px solid #30312E;
  }

  .seite .qm-nav-toggle {
    border-color: rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .07);
    color: #FFFFFF;
  }

  .seite .qm-nav-links {
    background: var(--brand-dark);
  }

  [data-theme="light"] .seite {
    border-bottom-color: var(--stroke);
  }

  [data-theme="light"] .seite .qm-nav-toggle {
    border-color: var(--stroke-strong);
    background: var(--paper);
    color: var(--text);
  }

  [data-theme="light"] .seite .qm-nav-toggle:hover {
    border-color: #A89A00;
    background: #FFFBE2;
  }

  [data-theme="light"] .seite .qm-nav-links {
    background: var(--paper-2);
    color: var(--text);
  }

  .course-summary,
  .career-head,
  .welcome,
  .briefing-hero,
  .hero-line,
  .workspace-head {
    padding: 21px 18px;
  }

  .bidi-card-main {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .bidi-card-main > .bidi-avatar {
    width: 74px;
    height: 74px;
  }

  .dashboard-grid .dash-panel:first-child {
    border-right: 0;
    border-bottom-color: #383935;
  }

  .kohorten-rail,
  .module-nav {
    border-right: 0;
    border-bottom-color: #30312E;
  }

  [data-theme="light"] .kohorten-rail,
  [data-theme="light"] .module-nav {
    border-bottom-color: var(--stroke);
  }
}

@media (max-width: 1100px) and (min-width: 961px) {
  .tn-header .role-nav,
  .learning-header .role-nav,
  .career-header .role-nav {
    gap: 1px;
  }

  .tn-header .role-nav button,
  .tn-header .role-nav a,
  .learning-header .role-nav button,
  .learning-header .role-nav a,
  .career-header .role-nav button,
  .career-header .role-nav a {
    gap: 4px;
    padding-inline: 5px;
    font-size: 12px;
  }
}

@media (max-width: 960px) and (min-width: 721px) {
  .tn-header,
  .learning-header,
  .career-header {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .tn-header .role-nav-toggle,
  .learning-header .role-nav-toggle,
  .career-header .role-nav-toggle {
    display: inline-grid;
    grid-column: 2;
    grid-row: 1;
  }

  .tn-header .role-actions,
  .learning-header .role-actions,
  .career-header .role-actions {
    grid-column: 3;
    grid-row: 1;
  }

  .tn-header .role-nav,
  .learning-header .role-nav,
  .career-header .role-nav {
    display: none;
    position: static;
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    overflow: visible;
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 7px;
    background: rgba(255, 255, 255, .045);
  }

  [data-theme="light"] .tn-header .role-nav,
  [data-theme="light"] .learning-header .role-nav,
  [data-theme="light"] .career-header .role-nav {
    border-color: var(--stroke);
    background: var(--paper-2);
    box-shadow: 0 12px 30px rgba(22, 22, 20, .10);
  }

  .tn-header.nav-offen .role-nav,
  .learning-header.nav-offen .role-nav,
  .career-header.nav-offen .role-nav {
    display: grid;
  }

  .tn-header .role-nav button,
  .tn-header .role-nav a,
  .learning-header .role-nav button,
  .learning-header .role-nav a,
  .career-header .role-nav button,
  .career-header .role-nav a {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .zeile > div,
  .zeile > label,
  .zeile > fieldset {
    flex: 1 1 180px;
    min-width: 0;
    max-width: 100%;
  }

  .zeile > div > input:not([type="checkbox"]):not([type="radio"]),
  .zeile > div > select,
  .zeile > div > textarea,
  .zeile > label > input:not([type="checkbox"]):not([type="radio"]),
  .zeile > label > select,
  .zeile > label > textarea {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .portal-session-settings > header {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .portal-session-settings > header .portal-command {
    grid-column: 1 / -1;
    justify-self: stretch;
    justify-content: center;
  }

  .learning-page,
  .career-page {
    padding-bottom: 82px;
  }

  .learning-header,
  .career-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .tn-header,
  .learning-header,
  .career-header {
    z-index: 70;
    animation: none !important;
    transform: none !important;
  }

  [data-theme="light"] .tn-header,
  [data-theme="light"] .learning-header,
  [data-theme="light"] .career-header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .tn-header .role-nav-toggle,
  .learning-header .role-nav-toggle,
  .career-header .role-nav-toggle {
    display: none;
  }

  .learning-header .role-actions,
  .career-header .role-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .tn-header .role-nav,
  .learning-header .role-nav,
  .career-header .role-nav {
    display: grid !important;
    position: fixed;
    inset: auto 0 0;
    z-index: 60;
    grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
    gap: 3px;
    padding: 8px 5px calc(7px + env(safe-area-inset-bottom));
    border-top: 2px solid var(--gelb) !important;
    background: rgba(18, 19, 19, .96) !important;
    box-shadow: 0 -12px 32px rgba(0, 0, 0, .24) !important;
    backdrop-filter: blur(18px);
  }

  .tn-header .role-nav button,
  .tn-header .role-nav a,
  .learning-header .role-nav button,
  .learning-header .role-nav a,
  .career-header .role-nav button,
  .career-header .role-nav a {
    display: flex;
    min-width: 0;
    min-height: 48px;
    padding: 5px 2px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    color: #BEBEB8;
    font-size: 9px;
    white-space: nowrap;
  }

  .tn-header .role-nav button.aktiv,
  .tn-header .role-nav a.aktiv,
  .learning-header .role-nav button.aktiv,
  .learning-header .role-nav a.aktiv,
  .career-header .role-nav button.aktiv,
  .career-header .role-nav a.aktiv {
    background: var(--gelb);
    color: var(--brand-dark);
  }

  [data-theme="light"] .tn-header .role-nav,
  [data-theme="light"] .learning-header .role-nav,
  [data-theme="light"] .career-header .role-nav {
    border-top-color: var(--gelb) !important;
    background: var(--paper-2) !important;
    box-shadow: 0 -12px 30px rgba(22, 22, 20, .12) !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  [data-theme="light"] .tn-header .role-nav button,
  [data-theme="light"] .tn-header .role-nav a,
  [data-theme="light"] .learning-header .role-nav button,
  [data-theme="light"] .learning-header .role-nav a,
  [data-theme="light"] .career-header .role-nav button,
  [data-theme="light"] .career-header .role-nav a {
    color: var(--muted);
  }

  [data-theme="light"] .tn-header .role-nav button.aktiv,
  [data-theme="light"] .tn-header .role-nav a.aktiv,
  [data-theme="light"] .learning-header .role-nav button.aktiv,
  [data-theme="light"] .learning-header .role-nav a.aktiv,
  [data-theme="light"] .career-header .role-nav button.aktiv,
  [data-theme="light"] .career-header .role-nav a.aktiv {
    color: var(--brand-dark);
  }

  .community-header ~ .workspace .left-rail {
    border-right: 0;
    border-bottom: 1px solid #30312E;
  }

  [data-theme="light"] .community-header ~ .workspace .left-rail {
    border-bottom-color: var(--stroke);
  }
}

@media (max-width: 560px) {
  #lehre-header .role-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    width: 100%;
  }

  #lehre-header .role-actions #datum {
    grid-column: 1;
    grid-row: 1;
    width: 100% !important;
    min-width: 0;
  }

  #lehre-header .role-actions .logout {
    grid-column: 2;
    grid-row: 1;
  }

  #lehre-header .role-actions .portal-launchers {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
}

@media (max-width: 520px) {
  .admin-tabs {
    display: none;
  }

  .admin-area-picker {
    position: sticky;
    top: 3px;
    z-index: 8;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin: 12px 0 16px;
    padding: 8px 9px 8px 12px;
    border: 1px solid var(--stroke);
    border-radius: 8px;
    background: color-mix(in srgb, var(--card) 96%, transparent);
    box-shadow: var(--schatten);
    backdrop-filter: blur(18px);
  }

  .admin-area-picker > span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
  }

  .admin-area-picker select {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 0 10px;
    border: 1px solid var(--stroke-strong);
    border-radius: 6px;
    background: var(--card);
    color: var(--text);
    font: 700 13px var(--font);
  }

  .tn-section-head h1,
  .tn-section-head h2 {
    font-size: 24px;
  }

  .bidi-card h3 {
    font-size: 18px;
  }

  .role-header {
    padding: 10px 11px;
  }

  .portal-dialog-head,
  .dialog-head,
  .dialog-kopf {
    padding-left: 15px;
    padding-right: 15px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .role-header,
  .wrap > header:not(.role-header),
  .ob-top {
    animation: bid-shell-in .42s cubic-bezier(.16, 1, .3, 1) both;
  }

  .tn-view:not([hidden]),
  .view:not([hidden]),
  [data-audit-view]:not([hidden]),
  .course-summary,
  .community-page .mode-tabs,
  .briefing-hero,
  .dashboard-grid {
    animation: bid-view-in .34s cubic-bezier(.16, 1, .3, 1) both;
  }

  .role-nav .aktiv .ui-icon,
  .role-nav [aria-current="page"] .ui-icon,
  .tabs .aktiv .ui-icon,
  .career-tabs .aktiv .ui-icon {
    animation: bid-icon-pop .32s cubic-bezier(.16, 1, .3, 1) both;
  }

  .portal-badge:not([hidden]) {
    animation: bid-badge-in .38s cubic-bezier(.16, 1, .3, 1) both;
  }
}

@keyframes bid-shell-in {
  from {
    opacity: 0;
    transform: translateY(-7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bid-view-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bid-icon-pop {
  0% {
    transform: scale(.82);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes bid-badge-in {
  0% {
    opacity: 0;
    transform: scale(.55);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn:hover,
  .icon-btn:hover,
  .kap-card:hover,
  .lesson-type:hover {
    transform: none;
  }
}

/* Gemeinsame Teilnehmerakte fuer Lehre, QMS und Audit */
.tn-record-dialog {
  width: min(1120px, calc(100vw - 32px));
  max-width: none;
  height: min(860px, calc(100dvh - 32px));
  max-height: none;
  padding: 0;
  border: 1px solid var(--stroke-strong);
  border-radius: 8px;
  overflow: hidden;
  background: var(--card);
  color: var(--text);
}

.tn-record-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-width: 0;
  background: var(--card);
}

.tn-record-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 19px 22px 17px;
  border-bottom: 1px solid var(--stroke);
  background: var(--card);
}

.tn-record-head::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(90deg, var(--rot), var(--gelb), transparent 70%);
}

.tn-record-person {
  min-width: 0;
}

.tn-record-eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--rot);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

[data-theme="dark"] .tn-record-eyebrow {
  color: var(--gelb);
}

.tn-record-person h2 {
  margin: 0;
  font-size: 25px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.tn-record-person p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.tn-record-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.tn-record-status {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 4px 9px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.tn-record-status.positiv {
  border-color: rgba(52, 199, 89, .38);
  background: rgba(52, 199, 89, .1);
  color: #187636;
}

[data-theme="dark"] .tn-record-status.positiv {
  color: #70DC8A;
}

.tn-record-status.kritisch {
  border-color: rgba(230, 38, 0, .32);
  background: rgba(230, 38, 0, .08);
  color: var(--rot);
}

.tn-record-tabs {
  display: flex;
  flex: 0 0 auto;
  gap: 3px;
  min-width: 0;
  padding: 8px 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--stroke);
  background: var(--card);
  scrollbar-width: none;
}

.tn-record-tabs::-webkit-scrollbar {
  display: none;
}

.tn-record-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 11px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: 700 12px var(--font);
  cursor: pointer;
}

.tn-record-tabs button:hover {
  background: rgba(100, 104, 112, .08);
  color: var(--text);
}

.tn-record-tabs button.aktiv {
  background: var(--gelb);
  color: #1A1A1A;
}

.tn-record-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg);
}

.tn-record-panel[hidden] {
  display: none;
}

.tn-record-band {
  padding: 20px 22px;
  border-bottom: 1px solid var(--stroke);
  background: var(--card);
}

.tn-record-band:last-child {
  border-bottom: 0;
}

.tn-record-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.tn-record-section-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}

.tn-record-section-head > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 7px;
  background: rgba(236, 220, 40, .2);
  color: #736900;
}

[data-theme="dark"] .tn-record-section-head > span {
  color: var(--gelb);
}

.tn-record-section-head h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
}

.tn-record-section-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.tn-record-gates {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.tn-record-gate {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--stroke);
  border-radius: 7px;
  background: var(--bg);
}

.tn-record-gate-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--card);
  color: var(--muted);
}

.tn-record-gate.erledigt {
  border-color: rgba(52, 199, 89, .3);
}

.tn-record-gate.erledigt .tn-record-gate-icon {
  background: rgba(52, 199, 89, .12);
  color: var(--gruen);
}

.tn-record-gate.offen .tn-record-gate-icon {
  background: rgba(230, 38, 0, .08);
  color: var(--rot);
}

.tn-record-gate strong,
.tn-record-gate small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.tn-record-gate strong {
  font-size: 12px;
}

.tn-record-gate small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.tn-record-fields {
  display: grid;
  grid-template-columns: minmax(105px, .7fr) minmax(0, 1.3fr);
  gap: 0;
}

.tn-record-fields-wide {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 18px;
}

.tn-record-field {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: span 2;
  gap: 10px;
  min-width: 0;
  padding: 7px 0;
  border-bottom: 1px solid var(--stroke);
}

.tn-record-fields-wide .tn-record-field {
  display: block;
  grid-column: auto;
}

.tn-record-field dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.tn-record-field dd {
  min-width: 0;
  margin: 0;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.tn-record-fields-wide .tn-record-field dd {
  margin-top: 3px;
  font-weight: 650;
}

.tn-record-verdict {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.tn-record-verdict strong {
  font-size: 12px;
}

.tn-record-progress {
  margin-top: 12px;
}

.tn-record-progress > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
}

.tn-record-progress b {
  color: var(--text);
}

.tn-record-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--stroke);
}

.tn-record-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rot), var(--gelb));
}

.tn-record-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.tn-record-kpis > div {
  min-width: 0;
  padding: 12px;
  border-left: 2px solid var(--gelb);
  background: var(--bg);
}

.tn-record-kpis b,
.tn-record-kpis span {
  display: block;
}

.tn-record-kpis b {
  font-size: 22px;
  line-height: 1.1;
}

.tn-record-kpis span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.tn-record-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.tn-record-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 12px;
}

.tn-record-table th,
.tn-record-table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--stroke);
  text-align: left;
  vertical-align: top;
}

.tn-record-table th {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.tn-record-list {
  border-top: 1px solid var(--stroke);
}

.tn-record-list > div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--stroke);
  font-size: 12px;
}

.tn-record-list span,
.tn-record-list small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.tn-record-list small,
.tn-record-list em {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.tn-record-callout {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding: 11px 12px;
  border-left: 3px solid var(--gelb);
  background: var(--bg);
  font-size: 12px;
}

.tn-record-callout span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
}

.tn-record-files {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tn-record-files .file-action {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  width: 100%;
}

.tn-record-files .file-action small {
  color: var(--muted);
  font-size: 9px;
}

.tn-record-empty,
.tn-record-loading,
.tn-record-error {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 92px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.tn-record-loading {
  flex: 1;
  flex-direction: column;
}

.tn-record-loading .ui-icon {
  animation: tn-record-spin 1s linear infinite;
}

.tn-record-error {
  flex: 1;
  flex-direction: column;
  padding: 32px;
}

.tn-record-error h2 {
  color: var(--text);
  font-size: 20px;
}

@keyframes tn-record-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 760px) {
  .tn-record-dialog {
    width: calc(100vw - 12px);
    height: calc(100dvh - 12px);
  }

  .tn-record-head {
    padding: 15px 14px 13px;
  }

  .tn-record-person h2 {
    font-size: 21px;
  }

  .tn-record-head-actions > .tn-record-status {
    display: none;
  }

  .tn-record-tabs {
    padding: 7px 9px;
  }

  .tn-record-tabs button {
    min-width: 40px;
    padding: 8px 10px;
  }

  .tn-record-tabs button span {
    display: none;
  }

  .tn-record-band {
    padding: 16px 14px;
  }

  .tn-record-two,
  .tn-record-gates,
  .tn-record-kpis,
  .tn-record-fields-wide,
  .tn-record-files {
    grid-template-columns: minmax(0, 1fr);
  }

  .tn-record-two {
    gap: 24px;
  }

  .tn-record-gates {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tn-record-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tn-record-callout {
    display: block;
  }

  .tn-record-callout span {
    margin-top: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tn-record-loading .ui-icon {
    animation: none;
  }
}

/* One role-aware Campus shell. Workspace navigation is global; local tabs stay local. */
.campus-shell-header .campus-role-nav {
  min-width: 0;
}

.campus-shell-header .campus-role-nav[aria-busy="true"] {
  visibility: hidden;
  pointer-events: none;
}

.campus-shell-header .campus-role-nav a {
  position: relative;
}

.campus-shell-header .campus-role-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 3px;
  left: 10px;
  height: 2px;
  border-radius: 2px;
  background: var(--gelb);
}

[data-theme="light"] .campus-shell-header .campus-role-nav a[aria-current="page"] {
  background: #FFFBE2;
  color: var(--brand-dark);
}

.area-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  width: 100%;
  min-width: 0;
  margin: -4px 0 16px;
  padding: 5px;
  overflow: visible;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--schatten);
}

.area-nav > button,
.area-nav > a,
.area-nav > details > summary,
.area-nav .lehre-more-menu button,
.area-nav .lehre-more-menu a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  font: 650 12px var(--font);
  cursor: pointer;
}

.area-nav > button:hover,
.area-nav > a:hover,
.area-nav > details > summary:hover,
.area-nav > button.aktiv,
.area-nav > a.aktiv,
.area-nav > details > summary.aktiv {
  background: var(--paper);
  color: var(--text);
}

.area-nav > button.aktiv,
.area-nav > a.aktiv,
.area-nav > details > summary.aktiv {
  box-shadow: inset 0 -2px var(--gelb);
}

.qm-local-title {
  display: block;
  padding: 0 9px 7px;
  color: #A7A7A2;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

[data-theme="light"] .qm-local-title {
  color: var(--muted);
}

@media (min-width: 1101px) {
  .campus-shell-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center;
    row-gap: 9px;
  }

  .campus-shell-header > :first-child {
    grid-column: 1;
    grid-row: 1;
  }

  .campus-shell-header .role-nav-toggle {
    display: none !important;
  }

  .campus-shell-header .role-actions {
    grid-column: 2 !important;
    grid-row: 1 !important;
    justify-content: flex-end;
  }

  .campus-shell-header .campus-role-nav {
    display: flex !important;
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    flex-wrap: wrap;
    justify-content: flex-start !important;
    width: 100%;
    max-width: 100%;
    padding-top: 8px;
    overflow: visible !important;
    border-top: 1px solid rgba(255, 255, 255, .13);
  }

  [data-theme="light"] .campus-shell-header .campus-role-nav {
    border-top-color: var(--stroke);
  }
}

@media (max-width: 1100px) {
  .campus-shell-header {
    grid-template-columns: minmax(0, 1fr) auto auto !important;
  }

  .campus-shell-header .role-nav-toggle {
    display: inline-grid !important;
    grid-column: 2;
    grid-row: 1;
  }

  .campus-shell-header .role-actions {
    grid-column: 3 !important;
    grid-row: 1;
    justify-content: flex-end;
  }

  .campus-shell-header .campus-role-nav {
    display: none !important;
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    padding: 7px;
    overflow: visible !important;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 7px;
    background: rgba(255, 255, 255, .045);
  }

  [data-theme="light"] .campus-shell-header .campus-role-nav {
    border-color: var(--stroke);
    background: var(--paper-2);
    box-shadow: 0 12px 30px rgba(22, 22, 20, .10);
  }

  .campus-shell-header.nav-offen .campus-role-nav {
    display: grid !important;
  }

  .campus-shell-header .campus-role-nav a,
  .campus-shell-header .campus-role-nav button {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    white-space: normal;
  }
}

@media (max-width: 620px) {
  .campus-shell-header {
    grid-template-columns: minmax(0, 1fr) auto !important;
  }

  .role-header .brand {
    min-height: 44px;
  }

  .role-header .role-actions .icon-btn,
  .role-header .role-nav-toggle {
    min-width: 44px;
    min-height: 44px;
  }

  .campus-shell-header .role-nav-toggle {
    grid-column: 2;
  }

  .campus-shell-header .role-actions {
    grid-column: 1 / -1 !important;
    grid-row: 2;
    justify-content: flex-end;
  }

  .campus-shell-header .campus-role-nav {
    grid-row: 3 !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .campus-shell-header .campus-role-nav a,
  .campus-shell-header .campus-role-nav button {
    align-items: flex-start;
    min-height: 47px;
    line-height: 1.2;
  }

  .campus-shell-header .campus-role-nav a span,
  .campus-shell-header .campus-role-nav button span {
    min-width: 0;
    overflow-wrap: anywhere;
    hyphens: auto;
  }

  body[data-portal-mobile-tools="more"] .role-header .role-actions > #theme-toggle,
  body[data-portal-mobile-tools="more"] .role-header .role-actions > .logout,
  body[data-portal-mobile-tools="more"] .role-header .role-actions > [data-icon="logout"],
  body[data-portal-mobile-tools="more"] .role-header .role-actions
    .portal-launchers > #portal-search-open,
  body[data-portal-mobile-tools="more"] .role-header .role-actions
    .portal-launchers > #portal-help-open,
  body[data-portal-mobile-tools="more"] .role-header .role-actions
    .portal-launchers > .portal-theme-toggle,
  body[data-portal-mobile-tools="more"] .role-header .role-actions
    .portal-launchers > [data-pwa-install] {
    display: none !important;
  }

  .portal-nav-tools {
    display: block;
    flex: 0 0 auto;
    padding: 13px 14px 15px;
    border-top: 1px solid var(--stroke);
    background: var(--paper-2);
  }

  .portal-nav-tools-grid > button {
    min-height: 48px;
  }

  .portal-help-object {
    width: 48px;
    height: 48px;
  }

  .portal-help-boundary {
    margin: 11px 14px 9px;
  }

  .portal-help-suggestions {
    padding: 0 14px 10px;
  }

  .portal-help-form {
    padding: 0 14px 12px;
  }

  .portal-help-answer {
    padding: 15px 14px 19px;
  }

  .portal-help-related > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .portal-help-related .portal-help-suggestion {
    width: 100%;
    max-width: none;
  }

  .btn {
    min-height: 44px;
  }

  .area-nav {
    margin-bottom: 13px;
  }

  .area-nav > button,
  .area-nav > a,
  .area-nav > details > summary,
  .area-nav .lehre-more-menu button,
  .area-nav .lehre-more-menu a {
    min-height: 44px;
  }
}
