/* Layout der Anwendung. Nur Rollen-Farben aus drk.css, nie --drk-* direkt (docs/design.md).
 * Mobil nutzbar (N-01), hell und dunkel (N-14). */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--schrift);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}
a { color: var(--link); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Überschriften: groß in Softrot (≥ 24 px), kleine Zwischenüberschriften eigene Rolle */
h1 { font-size: 1.75rem; font-weight: 700; color: var(--heading); margin: 0.5rem 0; }
h2 { font-size: 1.5rem; font-weight: 700; color: var(--heading); margin-top: 0; }
h3 { font-size: 1.05rem; font-weight: 600; color: var(--heading-small); margin: 1.25rem 0 0.5rem; }
h4 { font-size: 0.95rem; font-weight: 600; color: var(--heading-small); margin: 0.75rem 0 0.25rem; }

/* Kopfzeile. Das Logo sitzt in jedem Modus auf einer weißen Fläche mit Schutzzone. */
.site-header {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.75rem 1rem; background: var(--header-bg);
}
.logo-plate { display: inline-block; background: var(--logo-plate); padding: 6px; line-height: 0; }
.logo { display: block; height: 60px; width: auto; }   /* mindestens 60 px */
/* Wortmarke (N-18): neben dem Gliederungslogo, feine Trennlinie, mindestens 20 px hoch */
.wordmark { display: flex; align-items: center; padding-left: 1rem; border-left: 1px solid var(--line); min-height: 36px; }
.wordmark img { display: block; height: 36px; width: auto; }
.brand-dark { display: none !important; }
:root[data-theme="dark"] .brand-light { display: none !important; }
:root[data-theme="dark"] .brand-dark { display: block !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .brand-light { display: none !important; }
  :root:not([data-theme]) .brand-dark { display: block !important; }
}
/* Farbschema-Menü (N-14) */
.theme-menu { margin-left: auto; position: relative; }
.theme-menu > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; color: var(--heading-small); border: 1px solid var(--input-border);
}
.theme-menu > summary::-webkit-details-marker { display: none; }
.theme-menu[open] > summary { box-shadow: inset 0 -3px 0 var(--nav-hover); }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 0.25rem); z-index: 10; min-width: 10rem;
  display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--input-border);
}
.menu-item {
  display: flex; align-items: center; gap: 0.5rem; width: 100%; text-align: left;
  background: var(--bg); color: var(--text); border: none; font-weight: normal; padding: 0.5rem 0.75rem;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-alt); color: var(--text); border: none; }
.menu-item[aria-pressed="true"] { font-weight: 600; }
.menu-check { display: inline-block; width: 1rem; color: var(--heading-small); }

/* Hauptmenü (N-01): eine Zeile, nie umbrechen. Was nicht passt, verschiebt js/app.js unter „Mehr“.
   Auf dem Handy (bis 700 px) nur der Menüknopf, das Menü klappt untereinander auf. */
.nav-toggle { display: none; }
.nav {
  display: flex; flex-wrap: nowrap; align-items: center; gap: 0 0.25rem;
  background: var(--nav-bg); padding: 0 1rem;
}
.nav-links { display: flex; flex-wrap: nowrap; align-items: center; gap: 0 0.25rem; flex: 1 1 auto; min-width: 0; overflow: hidden; }
.nav a, .nav button.link, .nav-more > summary {
  color: var(--nav-text); text-decoration: none; padding: 0.6rem 0.75rem; display: inline-block;
  border-bottom: 3px solid transparent; white-space: nowrap;
}
.nav-links > a { flex: none; }
.nav a:hover, .nav button.link:hover, .nav-more > summary:hover { border-bottom-color: var(--nav-hover); background: none; }
.nav-more { position: relative; flex: none; }
.nav-more > summary { display: block; list-style: none; cursor: pointer; font-weight: normal; margin: 0; }
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary::after { content: " ▾"; }
.nav-more[open] > summary { border-bottom-color: var(--nav-hover); }
.nav-more-panel { min-width: 13rem; }
.nav .nav-more-panel a { display: block; color: var(--text); padding: 0.5rem 0.75rem; border-bottom: none; }
.nav .nav-more-panel a:hover, .nav .nav-more-panel a:focus-visible { background: var(--surface-alt); }
.nav-account { display: flex; align-items: center; flex: 0 1 auto; min-width: 0; margin-left: auto; }
.nav .nav-user {
  color: var(--nav-text); font-size: 0.875rem; padding: 0.6rem 0.5rem;
  overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 22rem;
}
/* Einmal-Code für Helferkonten (F-67): groß, gut abzulesen */
.one-time-code { font-size: 2rem; font-weight: 700; letter-spacing: 0.1em; color: var(--heading-small); margin: 0.25rem 0; font-variant-numeric: tabular-nums; }
.nav .inline { display: flex; flex: none; }
@media (max-width: 700px) {
  .nav-toggle { display: inline-block; margin-left: auto; }
  .site-header .nav-toggle + .theme-menu { margin-left: 0; }   /* neben „Menü“; ohne Menüknopf (Anmeldung) bleibt es rechts */
  .nav { display: none; flex-direction: column; align-items: stretch; padding: 0.25rem 1rem 0.5rem; }
  .nav.open { display: flex; }
  .nav-links, .nav-account { flex-direction: column; align-items: stretch; overflow: visible; margin-left: 0; }
  .nav-more { display: none; }
  .nav .nav-user { max-width: none; white-space: normal; }
}

.content { max-width: 72rem; margin: 0 auto; padding: 1rem; }
.title-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.hint { font-size: 0.875rem; color: var(--text-muted); }
/* Begriffe des Aufbaus (N-27): Abschnitt, Posten, Position mit kurzer Erklärung darunter */
.terms { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.5rem 1rem; margin: 0.5rem 0 1rem; font-size: 0.875rem; }
.terms dt { font-weight: 600; color: var(--heading-small); }
.terms dd { margin: 0; color: var(--text-muted); }
.inline { display: inline; }

/* Meldungen der App: Fläche statt Rahmen, Status immer auch als Text */
.messages { list-style: none; padding: 0; }
.messages li { padding: 0.5rem 0.75rem; margin-bottom: 0.5rem; background: var(--surface-alt); border-left: 4px solid var(--line); }
.messages .msg-success { border-left-color: var(--status-ok-border); }
.messages .msg-warning { border-left-color: var(--heading); }
.messages .msg-error { border-left-color: var(--danger); color: var(--danger); }
.errors, .errorlist { color: var(--danger); }
.errorlist { margin: 0.25rem 0; padding-left: 1rem; }

/* Knöpfe: Hauptknopf DRK-Rot mit weißer Schrift, Zweitknopf Dunkelblau mit weißer Schrift */
button, .button {
  display: inline-block; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  padding: 0.5rem 1rem; border: 2px solid var(--btn-primary-bg); border-radius: 0;
  background: var(--btn-primary-bg); color: var(--btn-primary-text);
}
button:hover, .button:hover { background: var(--btn-primary-hover); border-color: var(--btn-primary-hover); }
button.secondary, .button.secondary {
  background: var(--btn-secondary-bg); color: var(--btn-secondary-text); border-color: var(--btn-secondary-border);
}
button.secondary:hover, .button.secondary:hover { background: var(--btn-secondary-bg); box-shadow: inset 0 -3px 0 var(--nav-hover); }
button.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
button.danger:hover { background: var(--status-bad-bg); color: var(--status-bad-text); border-color: var(--status-bad-bg); }
button.small, .button.small { padding: 0.15rem 0.6rem; font-size: 0.85rem; }
button.active { box-shadow: inset 0 -3px 0 var(--btn-primary-bg); }
button.link { background: none; border: none; padding: 0; font-weight: normal; color: var(--link); text-decoration: underline; }

/* Formulare auf eigener Fläche, Fehler in --danger */
.form { max-width: 48rem; }
form.form, .filters { background: var(--surface); }
form.form { padding: 1rem; }
form.form a, .filters a { color: var(--link-on-surface); }
fieldset { border: none; border-top: 1px solid var(--line); margin: 0 0 1rem; padding: 0.75rem 0; }
legend { font-weight: 600; color: var(--heading-small); padding: 0; }
.field { margin-bottom: 0.75rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.2rem; color: var(--heading-small); }
label.check { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: normal; margin-right: 0.75rem; color: var(--text); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=tel],
input[type=number], select, textarea {
  font: inherit; color: var(--text); padding: 0.45rem 0.55rem;
  border: 1px solid var(--input-border); border-radius: 0; width: 100%; max-width: 32rem; background: var(--input-bg);
}
input[type=checkbox], input[type=radio] { width: 1.1rem; height: 1.1rem; accent-color: var(--btn-secondary-bg); }
.inline input, .inline select, .filters select { width: auto; }
fieldset > div > div, .field > div > div { display: inline-block; margin-right: 1rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 0; }
.row { display: flex; flex-wrap: wrap; gap: 0 1rem; }
/* Textfelder über die ganze Breite des Formulars, z. B. Name und Beschreibung einer Stufe */
.form-wide input[type=text], .form-wide textarea { max-width: none; }
.row .field { flex: 1 1 12rem; }
.oneoff { border-top: 1px solid var(--line); padding-top: 0.75rem; margin-top: 0.75rem; }
.oneoff:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }
details summary { cursor: pointer; margin: 0.25rem 0; color: var(--heading-small); font-weight: 600; }
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: end; margin: 0.75rem 0; padding: 0.75rem; }
.status-switch { display: block; margin: 0.5rem 0 1rem; }

/* Tabellen: Kopf Dunkelblau, Zeilen abwechselnd, Linien */
/* position: relative hält absolut gesetzte Elemente (z. B. .visually-hidden) im scrollbaren Bereich,
   sonst verbreitern sie die ganze Seite auf dem Handy (Runde 6, Teil 4) */
.table-wrap { overflow-x: auto; position: relative; }
table { border-collapse: collapse; width: 100%; margin: 0.5rem 0; }
th, td { text-align: left; padding: 0.45rem 0.55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--table-head-bg); color: var(--table-head-text); font-weight: 600; white-space: nowrap; }
tbody tr:nth-child(even) td { background: var(--surface-alt); }
tr.inactive td, li.inactive { text-decoration: line-through; color: var(--text-muted); }
tr.short td:first-of-type:not([rowspan]), tr.short td:nth-last-child(1) { color: var(--danger); font-weight: 600; }
.row-actions { white-space: nowrap; }

/* Reiter je Schicht wie Tabellenblätter (F-62) */
.tabs { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin: 1rem 0 0; border-bottom: 2px solid var(--table-head-bg); padding-bottom: 0.5rem; }
.tab-day { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }
.tab-date { font-size: 0.8rem; font-weight: 600; color: var(--heading-small); margin-right: 0.25rem; }
.tab { padding: 0.3rem 0.7rem; text-decoration: none; color: var(--text); background: var(--surface-alt); }
.tab:hover { box-shadow: inset 0 -3px 0 var(--nav-hover); }
.tab.active { background: var(--table-head-bg); color: var(--table-head-text); }
.tab.marked:not(.active)::after { content: " ●"; color: var(--heading-small); }
.panel { border-top: 1px solid var(--line); padding: 1rem 0; margin: 1rem 0; }
details.panel > summary { margin-bottom: 0.5rem; }

/* Kennzahlen der Belegung (F-36) */
.summary { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0.75rem 0; }
.summary > div { background: var(--surface-alt); padding: 0.5rem 1rem; min-width: 6.5rem; }
.summary .num { display: block; font-size: 1.6rem; font-weight: 700; color: var(--heading-small); }
.summary .short .num { color: var(--shortage); }

/* Status: Farbe aus der Palette, immer mit Text (docs/design.md) */
.badge, .chip {
  display: inline-block; font-size: 0.8rem; padding: 0.05rem 0.5rem; margin: 0 0.15rem 0.15rem 0; white-space: nowrap;
  background: var(--status-neutral-bg); color: var(--status-neutral-text); border: 1px solid transparent;
}
.chip.warn { background: transparent; color: var(--danger); border-color: var(--danger); }
.badge.status-gemeldet, .badge.status-entwurf { background: var(--status-open-bg); color: var(--status-open-text); border-color: var(--line); }
.badge.status-bestaetigt, .badge.status-offen { background: var(--status-ok-bg); color: var(--status-ok-text); border-color: var(--status-ok-border); }
/* F-124: Reserve, gestrichelter Rahmen, immer mit dem Wort „Reserve“ */
.badge.status-reserve { background: var(--status-open-bg); color: var(--status-open-text); border: 1px dashed var(--status-ok-border); }
.badge.status-teilweise_bestaetigt { background: var(--status-open-bg); color: var(--status-open-text); border-color: var(--status-ok-border); }
.badge.status-abgelehnt, .badge.status-krank { background: var(--status-bad-bg); color: var(--status-bad-text); }
.badge.status-abgemeldet, .badge.status-zurueckgezogen, .badge.status-geschlossen, .badge.status-archiviert {
  background: var(--status-neutral-bg); color: var(--status-neutral-text);
}
/* Qualifikationen im Meldungseingang (F-77): Kürzel je Liste, höchste medizinische
 * Ausbildung gefüllt und fett, dazu „(höchste)“ für Screenreader. Bricht um, schneidet nichts ab. */
.persons-cell { min-width: 16rem; }
.qual-summary { margin: 0 0 0.35rem; font-weight: 600; color: var(--heading-small); }
.person-quals { list-style: none; padding: 0; margin: 0; }
.person-quals li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.15rem 0.5rem; padding: 0.2rem 0; }
.person-quals li + li { border-top: 1px solid var(--line); }
.person-name { font-weight: 600; margin-right: 0.25rem; }
.qual-group { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0.15rem; }
.qual-label { font-size: 0.75rem; color: var(--text-muted); text-decoration: none; cursor: help; margin-right: 0.1rem; }
.badge.qual { margin: 0; border-color: var(--line); }
.badge.qual-top { background: var(--status-ok-bg); color: var(--status-ok-text); border-color: var(--status-ok-border); font-weight: 700; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* Zähler offener Meldungen (F-81): rote Zahl wie beim iPhone, Text für Screenreader */
.count-badge {
  display: inline-block; min-width: 1.35rem; padding: 0 0.35rem; margin-left: 0.35rem; border-radius: 999px;
  background: var(--btn-primary-bg); color: var(--btn-primary-text); font-size: 0.75rem; font-weight: 700;
  line-height: 1.35rem; text-align: center; vertical-align: middle;
}
/* Anmeldeseite (N-17): zentrierte Karte */
.content.entrance { max-width: 30rem; }
.entrance-card { background: var(--surface); padding: 1.5rem; margin-top: 1rem; }
.entrance-brand { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.entrance-brand .logo { height: 60px; }
.entrance-step { margin: 0 0 0.5rem; padding: 0.4rem 0.6rem; background: var(--surface-alt); }
.entrance-card input[type=email], .entrance-card input[type=password], .entrance-card input[type=text] { max-width: none; }
/* Verwaltungsmenü (N-16) */
.menu-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; }
.menu-group { background: var(--surface-alt); padding: 0.75rem 1rem; }
.menu-group h2 { display: flex; align-items: center; gap: 0.5rem; font-size: 1.15rem; color: var(--heading-small); }
.menu-group ul { list-style: none; padding: 0; margin: 0; }
.menu-group li { padding: 0.35rem 0; border-top: 1px solid var(--line); }
.group-icon { flex: none; }
/* Segmented Control (z. B. Status eines Dienstes): eine aktive Auswahl, nicht rot */
.status-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.5rem 0 1rem; }
.segmented { display: inline-flex; border: 1px solid var(--input-border); }
.segmented button { background: var(--bg); color: var(--text); border: none; border-right: 1px solid var(--input-border); font-weight: 600; padding: 0.3rem 0.8rem; font-size: 0.9rem; }
.segmented button:last-child { border-right: none; }
.segmented button:hover { background: var(--surface-alt); }
.segmented button[aria-pressed="true"] { background: var(--btn-secondary-bg); color: var(--btn-secondary-text); }
/* Symbolknöpfe: Mülleimer (N-20) und Reihenfolge (N-19) */
/* Symbol-Knöpfe (N-22): Trefferfläche mindestens 44 × 44 px, Name über aria-label und title */
.icon-button { display: inline-flex; align-items: center; justify-content: center; min-width: 2.75rem; min-height: 2.75rem; background: transparent; border: 1px solid transparent; color: var(--text); padding: 0.2rem 0.35rem; line-height: 1; font-weight: 600; cursor: pointer; text-decoration: none; }
a.icon-button:hover { color: var(--text); }
.row-icons { display: flex; justify-content: flex-end; align-items: center; gap: 0; flex-wrap: nowrap; }
.row-icons form, .row-icons details { display: inline-flex; margin: 0; }
td.row-icons-cell { width: 1%; white-space: nowrap; padding-top: 0; padding-bottom: 0; }
summary.icon-button { list-style: none; }
summary.icon-button::-webkit-details-marker { display: none; }
.icon-button:hover { background: var(--surface-alt); border-color: var(--line); }
.icon-button.danger-icon { color: var(--danger); }
.icon-button.danger-icon:hover { background: var(--status-bad-bg); color: var(--status-bad-text); }
.reorder { display: inline-flex; gap: 0.1rem; }
/* Reihenfolge (N-19, geändert): Griff zum Ziehen, Pfeile, „+ hier einfügen“ zwischen den Zeilen */
.grip { cursor: grab; color: var(--text-muted); user-select: none; padding: 0 0.25rem; }
.record-list li.insert-row, .insert-row {
  list-style: none; display: flex; justify-content: center; align-items: center;
  min-height: 0.75rem; padding: 0; border: none; margin: 0;
}
.insert-here { font-size: 0.8rem; text-decoration: none; padding: 0 0.5rem; opacity: 0; }
.insert-row:hover .insert-here, .insert-here:focus, .insert-here:focus-visible { opacity: 1; }
@media (hover: none) { .insert-here { opacity: 0.7; } }   /* Touch: kein Darüberfahren */
dialog.form-sheet .sheet-close { margin-top: 0.5rem; }
[data-reorder-url][draggable="true"] { cursor: grab; }
.record-list { list-style: none; padding: 0; margin: 0; }
.record-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--line); }
.record-list .record-name { flex: 1 1 12rem; }
/* Aufbau: Einsatzbereiche, Stufen, Vorlagen (F-101 bis F-103) */
.area-card { border: 1px solid var(--line); padding: 0.5rem 0.75rem; margin: 0.75rem 0; }
.area-card h3, .area-card h4 { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.25rem 0; }
.count-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.25rem 0; border-bottom: 1px solid var(--line); }
.count-row input { width: 5rem; }
.extra-field-editor { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .extra-field-editor { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
.extra-preview { margin: 0; padding: 0.75rem; border: 1px dashed var(--line); }
.extra-preview figcaption { font-weight: 600; margin-bottom: 0.5rem; }
/* Dienstanlage in einer Maske (F-92) */
.setup-day { border: 1px solid var(--line); padding: 0.5rem 0.75rem; margin: 0.75rem 0; }
.setup-day legend { font-weight: 600; padding: 0 0.25rem; }
.shift-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.5rem 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
/* Felder teilen sich die Zeile, der Mülleimer steht immer am Ende (rechts) */
.shift-row .field { display: flex; flex-direction: column; flex: 1 1 7.5rem; min-width: 0; margin-bottom: 0; }
.shift-row .field input, .shift-row .field select { max-width: none; }
.shift-row .field-time { flex: 0 0 8rem; }
.shift-row .field input[type="time"] { min-width: 0; }
.shift-row > .shift-row-remove { flex: 0 0 auto; margin-left: auto; align-self: flex-start; margin-top: 1.9rem; }
.shift-row-errors { flex-basis: 100%; }
.next-day { font-weight: 600; color: var(--text); min-height: 1.2em; }
.setup-outside { border-left: 4px solid var(--warn, var(--line)); padding-left: 0.75rem; }
/* Wiki (F-95) */
.wiki-tree { padding-left: 1.25rem; }
.wiki-tree li { margin: 0.25rem 0; }
.wiki-body img { max-width: 100%; height: auto; }
.wiki-body table { border-collapse: collapse; }
.wiki-thumb { max-height: 3rem; vertical-align: middle; }
.wiki-editor-grid { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .wiki-editor-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.breadcrumbs { margin-bottom: 0.5rem; }
.rate-default { display: block; }
/* Freigabe eines Dienstes (F-83): Pfeil mit Text */
.release { display: inline-flex; align-items: center; gap: 0.25rem; font-weight: 600; color: var(--heading-small); white-space: nowrap; }
.release-icon { flex: none; }
/* Schichtplan (F-84): Posten als Karten, Positionen als Zeilen */
.area-card { border-top: 1px solid var(--line); padding: 0.5rem 0; }
.positions { list-style: none; padding: 0; margin: 0 0 0.5rem; }
.position { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--line); }
.position.free { background: var(--surface-alt); }
.position-name { font-weight: 600; min-width: 10rem; }
.free-label { font-weight: 600; color: var(--danger); }
.assigned[draggable="true"] { cursor: grab; }
.row-menu, .actions-menu { position: relative; display: inline-block; }
.actions-menu > summary { list-style: none; cursor: pointer; }
.actions-menu > summary::-webkit-details-marker { display: none; }
.row-menu > summary { cursor: pointer; color: var(--link); text-decoration: underline; list-style: none; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu .menu-panel, .actions-menu .menu-panel { left: 0; right: auto; max-height: 20rem; overflow-y: auto; min-width: 16rem; }
.actions-menu { margin: 0.5rem 0; }
.actions-menu > summary.button { text-decoration: none; color: var(--btn-secondary-text); }
a.menu-item { text-decoration: none; }
dialog.sheet { border: 1px solid var(--input-border); background: var(--bg); color: var(--text); max-width: 40rem; width: calc(100% - 2rem); padding: 1rem; }
dialog.sheet::backdrop { background: var(--backdrop); }
.candidates { list-style: none; padding: 0; }
.candidates li { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; align-items: center; padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
.check-item { font-size: 0.85rem; padding: 0 0.35rem; }
.check-item.ok { color: var(--status-ok-text); background: var(--status-ok-bg); }
.check-item.bad { color: var(--status-bad-text); background: var(--status-bad-bg); }
.open-positions { background: var(--surface-alt); padding: 0.5rem 0.75rem; margin: 0.5rem 0; }
.comment { background: var(--surface-alt); padding: 0.5rem 0.75rem; }
ul.people { list-style: none; padding: 0; margin: 0; }
ul.people li { padding: 0.2rem 0; border-bottom: 1px solid var(--line); }

/* Kalender (FullCalendar) in den Rollen-Farben */
#calendar { margin-top: 1rem; }
.fc {
  --fc-page-bg-color: var(--bg); --fc-neutral-bg-color: var(--surface-alt); --fc-list-event-hover-bg-color: var(--surface);
  --fc-button-bg-color: var(--btn-secondary-bg); --fc-button-border-color: var(--btn-secondary-border);
  --fc-button-text-color: var(--btn-secondary-text);
  --fc-button-hover-bg-color: var(--btn-secondary-bg); --fc-button-hover-border-color: var(--nav-hover);
  --fc-button-active-bg-color: var(--btn-secondary-bg); --fc-button-active-border-color: var(--nav-hover);
  --fc-event-bg-color: var(--status-ok-bg); --fc-event-border-color: var(--status-ok-border); --fc-event-text-color: var(--status-ok-text);
  --fc-today-bg-color: var(--surface); --fc-border-color: var(--line);
}
.fc .fc-toolbar-title { color: var(--heading); font-weight: 700; }
.fc a { color: var(--text); }
.fc .fc-event.status-geschlossen { opacity: 0.65; }
.fc .fc-event.status-entwurf { background: var(--status-open-bg); border-color: var(--line); }
.fc .fc-event.status-entwurf .fc-event-title { color: var(--status-open-text); }

@media (max-width: 600px) {
  h1 { font-size: 1.5rem; }   /* bleibt ≥ 24 px für Softrot */
  .menu-panel { right: auto; left: 0; }
  /* Das Farbschema-Symbol steht immer am rechten Rand, seine Liste klappt nach links auf */
  .theme-menu .menu-panel { left: auto; right: 0; }
  .persons-cell { min-width: 13rem; }
  /* Anmeldung: Logo und Wortmarke passen bei 390 px nicht nebeneinander, Wortmarke darunter */
  .entrance-brand { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .entrance-brand .wordmark { border-left: none; padding-left: 0; }
  /* Chips mit Freitext (z. B. Beginnzeit mit Bemerkung) brechen um statt quer zu scrollen */
  .chip { white-space: normal; max-width: 100%; }
  /* Kalender: Werkzeugleiste darf umbrechen */
  .fc .fc-toolbar { flex-wrap: wrap; gap: 0.5rem; }
  .fc .fc-toolbar-title { font-size: 1.5rem; }   /* Softrot, bleibt ≥ 24 px */
}

/* Einteilung als Tabelle (F-105) */
.assign-table { font-size: 0.9rem; }
.assign-table td, .assign-table th { vertical-align: middle; padding: 0.35rem 0.4rem; }
.assign-table th { white-space: normal; }
.assign-table td:first-child { min-width: 7rem; }
.assign-table .free-label { color: var(--danger); font-weight: 600; }
.sort-button { background: none; border: none; padding: 0; color: inherit; font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.sort-button::after { content: " ↕"; opacity: 0.5; }
th[aria-sort="ascending"] .sort-button::after { content: " ▲"; opacity: 1; }
th[aria-sort="descending"] .sort-button::after { content: " ▼"; opacity: 1; }
/* Auf dem Handy wird jede Zeile eine Karte, nichts wird abgeschnitten */
@media (max-width: 700px) {
  .table-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { border: 1px solid var(--line); margin: 0 0 0.75rem; padding: 0.25rem 0.5rem; }
  .table-cards td { display: flex; justify-content: space-between; gap: 1rem; border: none; padding: 0.25rem 0; text-align: right; }
  .table-cards td::before { content: attr(data-label); font-weight: 600; color: var(--heading-small); text-align: left; }
  .table-cards td.row-icons-cell { width: 100%; white-space: normal; }
  .table-cards .cell-content { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 0.25rem 0.5rem; }
}

/* Gemeldete Personen (F-109): abgelehnt und krank rot, durchgestrichen und mit Wort */
.person-rejected, .person-sick { color: var(--danger); text-decoration: line-through; }
.status-word { color: var(--danger); font-weight: 600; font-size: 0.85rem; }
.person-remark { font-style: italic; color: var(--text-muted); margin-left: 0.25rem; }
.remark-form { display: flex; gap: 0.25rem; align-items: center; }
.remark-form input { min-width: 10rem; }

/* Melden über Dropdowns (F-106) */
.person-rows { list-style: none; padding: 0; margin: 0.75rem 0; }
.person-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
.person-row .person-name { font-weight: 600; min-width: 12rem; }
.person-row input[type=text] { flex: 1 1 14rem; width: auto; }
.person-row .icon-button { margin-left: auto; }
.oneoff .row { align-items: flex-end; }
/* Tom Select in den App-Farben; „form“ davor, weil dessen CSS nach app.css lädt */
form .person-picker .ts-control .person-picker-item { display: none; }
form .ts-wrapper .ts-control, form .ts-dropdown { background: var(--input-bg); color: var(--text); border-color: var(--input-border); border-radius: 0; font: inherit; font-size: 1rem; }
form .ts-wrapper .ts-control input { color: var(--text); font: inherit; }
form .ts-dropdown .option, form .ts-dropdown .optgroup-header { color: var(--text); background: var(--input-bg); }
form .ts-dropdown .active { background: var(--surface-alt); color: var(--text); }
form .ts-dropdown .option.disabled, form .ts-dropdown .is-registered { color: var(--text-muted); }
form .ts-wrapper.multi .ts-control > .item { background: var(--surface-alt); color: var(--text); border: 1px solid var(--line); }
form .ts-wrapper.plugin-remove_button .item .remove { border-left-color: var(--line); }
form .ts-dropdown .ts-dropdown-content { background: var(--input-bg); }

/* Checklisten (F-112) und Beginnzeiten (F-111) */
.checklist-count { display: inline-block; margin-left: 0.35rem; padding: 0 0.4rem; font-size: 0.75rem; font-weight: 600; border: 1px solid var(--line); color: var(--text); vertical-align: middle; }
.checklist-count.overdue { color: var(--danger); border-color: var(--danger); }
.checklist { margin: 0.5rem 0 1rem; }
.checklist-items { list-style: none; padding: 0; margin: 0.25rem 0; }
.checklist-item { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.6rem; padding: 0.25rem 0; border-bottom: 1px solid var(--line); }
.checklist-item form { display: inline-flex; margin: 0; }
.checklist-item.done .checklist-text { text-decoration: line-through; color: var(--text-muted); }
.checklist-item.overdue .checklist-text { color: var(--danger); font-weight: 600; }
.checklist-item .row-icons { margin-left: auto; }
.check-button { min-width: 2.75rem; min-height: 2.75rem; background: transparent; border: 1px solid transparent; color: var(--text); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.check-button:hover { border-color: var(--line); }
.hand-sign { font-size: 0.85rem; color: var(--text-muted); font-style: italic; }
.due-fields { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.due-fields input, .due-fields select { width: auto; }
.start-time-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.start-time-form input { width: auto; }

/* Mehr Angaben je Person beim Melden (F-114) */
[data-phone-to-list][hidden] { display: none; }
.person-row .phone-field { display: inline-flex; align-items: center; gap: 0.35rem; }
.person-row .phone-field input { width: 12rem; }
.person-more { flex-basis: 100%; }
.person-more summary { font-weight: 600; }
.person-more label { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0.25rem 0.75rem 0.25rem 0; }
.person-more input, .person-more select { width: auto; max-width: 18rem; }

/* Interne Kommentare (F-116) */
.icon-count { font-size: 0.75rem; font-weight: 700; margin-left: 0.1rem; }
.comments { list-style: none; padding: 0; }
.comments .comment { padding: 0.5rem 0.75rem; margin: 0.5rem 0; border-left: 3px solid var(--line); background: var(--surface); }

/* F-119: Banner für wichtige Mitteilungen, im Fluss über dem Inhalt (verdeckt nichts) */
.news-banner { border: 2px solid var(--status-bad-bg); border-left-width: 6px; background: var(--surface); padding: 0.75rem 1rem; margin: 0 0 1rem; }
.news-banner p { margin: 0.25rem 0; }
.news-banner .actions { margin-top: 0.5rem; }
.badge.status-wichtig { background: var(--status-bad-bg); color: var(--status-bad-text); }
.news-summary { font-size: 1.15rem; border-left: 4px solid var(--line); padding: 0.5rem 1rem; background: var(--surface-alt); }
.news-meta { color: var(--text-muted); font-size: 0.9rem; }
.char-counter { font-size: 0.85rem; }
@media print {
  .site-header, .nav, .news-banner, .no-print, .messages { display: none !important; }
  .news-print-summary { font-size: 1.6rem; font-weight: 700; border: 3px solid var(--text); padding: 1rem; }
}

/* Stufe als Tabelle (Runde 7, F-102): Anzahl mit Minus und Plus, nicht besetzte Zeilen blasser */
.stepper { display: inline-flex; align-items: center; gap: 0.25rem; }
.stepper-count { min-width: 1.5rem; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.level-table tr.not-used td:not(.row-icons-cell) { color: var(--text-muted); }
.insert-block select { max-width: 12rem; }

/* „+ neu“ neben Auswahlfeldern (N-26) */
.quick-create { display: inline-block; margin-left: 0.5rem; font-size: 0.875rem; white-space: nowrap; }

/* Dienst als Arbeitsfläche (F-123): Brotkrumen und Aufbau-Baum mit Aktionen am Element */
.breadcrumbs { font-size: 0.875rem; margin: 0.25rem 0 0.5rem; color: var(--text-muted); }
.tree { list-style: none; margin: 0; padding-left: 0; }
.tree .tree { padding-left: 1.25rem; border-left: 2px solid var(--line); }
.tree > li > details > summary { cursor: pointer; padding: 0.35rem 0; font-weight: 600; }
.tree-kind { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-right: 0.25rem; }
.tree-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; margin: 0 0 0.5rem; }
.tree-toolbar { margin: 0.5rem 0; }
.tree-positions li .record-name { font-weight: normal; }

/* Lizenz (N-28): Banner, Fußzeile, Seite „Lizenz“ */
.license-banner { padding: 0.5rem 1rem; margin: 0 0 1rem; border: 1px solid var(--line); background: var(--surface-alt); font-weight: 600; }
.license-banner.read-only { border-color: var(--danger); color: var(--danger); background: transparent; }
.site-footer { max-width: 72rem; margin: 2rem auto 1rem; padding: 0.5rem 1rem; font-size: 0.8rem; color: var(--text-muted); border-top: 1px solid var(--line); }
.entrance-legal { margin-top: 1rem; }
.license-facts { display: grid; gap: 0.25rem 1rem; }
.license-facts div { display: grid; grid-template-columns: minmax(10rem, 14rem) 1fr; gap: 1rem; }
.license-facts dt { font-weight: 600; color: var(--heading-small); }
.license-facts dd { margin: 0; }

/* F-124: frei gewordene Positionen und Reserve */
.notice-card { border-left: 4px solid var(--danger); padding-left: 0.75rem; }
.reserve-offer details { margin: 0.25rem 0 0.5rem; }
.promote-form { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.25rem 0.5rem; min-width: 0; }
.promote-ask { flex: 1 1 100%; min-width: 0; text-align: left; border: 1px solid var(--line); padding: 0.25rem 0.5rem; margin: 0.25rem 0; }
.promote-ask label { display: block; }
.promote-ask select { max-width: 100%; }
.promote-ask legend { font-weight: 600; padding: 0 0.25rem; }

/* F-126: Lage am Diensttag, gut lesbar auf Tablet und Handy */
.situation-stand { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.situation-lines { list-style: none; margin: 0; padding: 0; }
.situation-line { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: baseline; padding: 0.5rem 0; border-top: 1px solid var(--line); }
.situation-line:first-child { border-top: none; }
.situation-position { flex: 0 0 12rem; font-weight: 600; min-width: 0; }
.situation-person { flex: 1 1 12rem; min-width: 0; }
.situation-status { flex: 1 1 14rem; min-width: 0; }
.situation-reserve { flex: 1 1 100%; min-width: 0; }
@media (max-width: 600px) {
  .situation-position, .situation-person, .situation-status { flex-basis: 100%; }
}

/* N-29: Installations-ID auf der Seite „Lizenz“ */
.instance-id { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; border: 1px solid var(--line); margin: 0.5rem 0 1rem; }
.instance-id span { font-weight: 600; }
.instance-id code { font-size: 1.05rem; overflow-wrap: anywhere; min-width: 0; }
