/* Mitarbeiter & Rechte (rechte.js, 13./14.10.2026). Handy zuerst; Farben und Schrift aus den Variablen der Seite (--ink, --line, --red …).
   Nur Klassen mit rt-… Tippflächen mindestens 44 px. PC: Tabelle Rechte × Personen (Namen oben fest, Rechte links fest); Handy: Schalterliste je Person. */
.rt { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; min-width: 0; padding-bottom: 8px; }
.rt > * { min-width: 0; }
.rt-nv { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rt .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.rt .btn.small { min-height: 36px; }
.rt .btn[disabled] { opacity: .5; cursor: default; }

/* Kopf */
.rt-kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.rt-kopf .page-title { margin: 4px 0 0; }
.rt-umschalter { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--g-hover, #f3efeb); }
.rt-umschalter button { border: 0; background: none; font: inherit; font-weight: 700; color: var(--muted); padding: 8px 16px; min-height: 40px; border-radius: 8px; cursor: pointer; }
.rt-umschalter button.an { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
.rt-intro { margin: 0; max-width: 1100px; }
.rt-leg { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; margin-left: 8px; }
.rt-leg-plus, .rt-leg-minus { display: inline-block; min-width: 20px; padding: 0 5px; border-radius: 5px; text-align: center; font-weight: 800; }
.rt-leg-plus { background: #e3f3e8; color: #17602f; }
.rt-leg-minus { background: #fdecec; color: #a32020; }
.rt-leg-neu { display: inline-block; width: 14px; height: 14px; border-radius: 4px; box-shadow: inset 0 0 0 2px var(--orange); background: #fff6e5; }
.rt-laedt { color: var(--muted); margin: 0; padding: 16px 2px; }
.rt-fehlerbox { background: #fdecec; color: var(--bad); border: 1px solid #f3c4c4; border-radius: 10px; padding: 12px 14px; margin: 0; }
.rt-mark { font-size: 12px; font-weight: 800; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.rt-mark-plus { background: #e3f3e8; color: #17602f; }
.rt-mark-minus { background: #fdecec; color: #a32020; }
.rt-mark-adm { background: var(--g-hover, #f3efeb); color: var(--muted); }
.rt-mark-neu { background: #fff1d6; color: #8a5a00; }
.rt-punkt { color: var(--orange); font-size: 12px; }
.rt-wie { color: var(--muted); font-size: 12.5px; }

/* ---------- Tabelle (PC) ---------- */
.rt-tab-leiste { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.rt-tab-leiste .rt-suche { flex: 0 1 340px; }
.rt-check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.rt-check input { width: 20px; height: 20px; accent-color: var(--red); }
.rt-tab-rahmen { overflow: auto; max-height: calc(100vh - 230px); min-height: 320px; border: 1px solid var(--line); border-radius: var(--r, 12px); background: #fff; overscroll-behavior: contain; }
.rt-matrix { border-collapse: separate; border-spacing: 0; font-size: 14px; overflow: visible !important; border-radius: 0; }   /* die Seite setzt table {overflow:hidden} – das hebelt „sticky“ aus */
.rt-matrix th, .rt-matrix td { border-bottom: 1px solid var(--line); }
.rt-matrix thead th { position: sticky; top: 0; z-index: 3; background: #faf8f5; vertical-align: bottom; border-bottom: 2px solid var(--line); }
.rt-ecke { position: sticky; left: 0; z-index: 4 !important; text-align: left; padding: 10px 12px; min-width: 260px; width: 300px; border-right: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.rt-ecke small { display: block; font-weight: 400; font-size: 12px; }
.rt-pk { padding: 8px 6px 8px; min-width: 116px; max-width: 150px; text-align: center; border-left: 1px solid var(--line); }
.rt-pk-name { display: block; width: 100%; border: 0; background: none; font: inherit; font-weight: 800; color: var(--ink); cursor: pointer; padding: 4px 2px; min-height: 32px; line-height: 1.2; overflow-wrap: anywhere; }
.rt-pk-name:hover, .rt-pk-name:focus-visible { color: var(--red); text-decoration: underline; }
.rt-pk .rt-vl-wahl { width: 100%; font: inherit; font-size: 12.5px; padding: 4px 4px; min-height: 32px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); margin-top: 2px; }
.rt-pk .rt-abw-z { display: flex; justify-content: center; gap: 4px; margin-top: 4px; font-size: 12.5px; min-height: 18px; }
.rt-pk .rt-alles { display: block; font-size: 12px; color: var(--muted); line-height: 1.25; margin-top: 2px; }
.rt-pk-admin { background: #f6f3ef !important; }
.rt-pk-neu { box-shadow: inset 0 -3px 0 var(--orange); }
.rt-gr-titel { position: sticky; left: 0; text-align: left; padding: 14px 12px 6px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 800; background: #fff; }
.rt-rk { position: sticky; left: 0; z-index: 2; background: #fff; text-align: left; padding: 8px 12px; border-right: 1px solid var(--line); width: 300px; min-width: 260px; max-width: 340px; font-weight: 400; }
.rt-rk-titel { display: block; font-weight: 700; }
.rt-rk small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; margin-top: 1px; }
.rt-matrix tbody tr:hover .rt-rk, .rt-matrix tbody tr:hover .rt-c { background-color: #fbf8f4; }
.rt-c { position: relative; text-align: center; padding: 0; border-left: 1px solid var(--line); min-width: 116px; height: 46px; }
.rt-haken { width: 22px; height: 22px; margin: 0; cursor: pointer; accent-color: var(--good); vertical-align: middle; }
.rt-haken:disabled { cursor: default; opacity: .55; }
.rt-c-plus { background: #eaf6ee !important; }
.rt-c-minus { background: #fdf0f0 !important; }
.rt-c-neu { box-shadow: inset 0 0 0 2px var(--orange); background-color: #fff6e5 !important; }
.rt-c-na { color: #c5bfb7; font-weight: 700; }
.rt-c-fest:not(.rt-c-na) { background: #faf8f5; }
.rt-zeichen { position: absolute; top: 3px; right: 6px; font-size: 13px; font-weight: 900; line-height: 1; }
.rt-c-plus .rt-zeichen { color: #17602f; }
.rt-c-minus .rt-zeichen { color: #a32020; }
.rt-leer { padding: 18px; color: var(--muted); }
.rt-fest-hinweis { margin: 0; }

/* ---------- Einzeln: Liste der Personen und Schalter ---------- */
.rt-raster { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.rt-raster .rt-editor { display: none; }
.rt-raster.rt-mit-editor .rt-liste { display: none; }
.rt-raster.rt-mit-editor .rt-editor { display: block; }
@media (min-width: 980px) {
  .rt-raster { grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); }
  .rt-raster .rt-liste, .rt-raster.rt-mit-editor .rt-liste { display: block; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
  .rt-raster .rt-editor, .rt-raster.rt-mit-editor .rt-editor { display: block; }
  .rt-zurueck { display: none !important; }
}
.rt-liste { background: var(--card, #fff); border: 1px solid var(--line); border-radius: var(--r, 12px); padding: 10px; }
.rt-suche { display: block; }
.rt-suche input { width: 100%; box-sizing: border-box; font: inherit; padding: 10px 12px; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.rt-grp { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 800; margin: 14px 8px 4px; }
.rt-pers { display: grid; gap: 1px; width: 100%; box-sizing: border-box; text-align: left; border: 1px solid transparent; background: none; font: inherit; color: var(--ink);
  padding: 9px 10px; border-radius: 10px; cursor: pointer; min-height: 52px; }
.rt-pers > * { min-width: 0; }
.rt-pers:hover { background: var(--g-hover, #f3efeb); }
.rt-pers.an { background: #fff; border-color: var(--red); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
.rt-pers-name { font-weight: 700; overflow-wrap: anywhere; }
.rt-pers small { color: var(--muted); font-size: 13px; }
.rt-pers .rt-std { color: #8a6d1a; font-size: 12px; }
.rt-pers-fest .rt-pers-name { color: var(--muted); }

.rt-editor { background: var(--card, #fff); border: 1px solid var(--line); border-radius: var(--r, 12px); padding: 16px; min-width: 0; }
.rt-zurueck { margin-bottom: 12px; }
.rt-ed-kopf h2 { margin: 0; font-size: 21px; overflow-wrap: anywhere; }
.rt-ed-kopf small { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.rt-vorlage { display: grid; gap: 6px; margin: 16px 0 4px; }
.rt-feld { display: grid; gap: 4px; }
.rt-feld > span:first-child { font-weight: 700; font-size: 14px; }
.rt-vl-zeile { display: flex; flex-wrap: wrap; gap: 8px; }
.rt-vl-zeile select { flex: 1 1 220px; max-width: 360px; font: inherit; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.rt-vorlage .hinweis { margin: 0; }
.rt-abw { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.rt-link { min-height: 32px; }
.rt-fest { background: var(--bg, #f5f2ee); border-radius: 10px; padding: 12px 14px; margin: 14px 0 0; }

.rt-gruppe { border: 0; margin: 18px 0 0; padding: 0; min-width: 0; }
.rt-gruppe legend { font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 800; padding: 0; margin: 0 0 4px; }
.rt-recht { position: relative; }
.rt-recht + .rt-recht { border-top: 1px solid var(--line); }
.rt-recht input { position: absolute; left: 8px; top: 12px; width: 44px; height: 26px; margin: 0; opacity: 0; }
.rt-schalter-flaeche { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; padding: 11px 8px; min-height: 44px; border-radius: 8px; cursor: pointer; }
.rt-schalter-flaeche:hover { background: var(--g-hover, #f3efeb); }
.rt-schalter { position: relative; width: 44px; height: 26px; border-radius: 13px; background: #cfc8bf; margin-top: 1px; transition: background .15s; }
.rt-schalter::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.rt-schalter-na { background: #e9e4de; }
.rt-schalter-na::after { background: #f6f3ef; box-shadow: none; }
.rt-recht input:checked + label .rt-schalter { background: var(--good); }
.rt-recht input:checked + label .rt-schalter::after { transform: translateX(18px); }
.rt-recht input:focus-visible + label { outline: 3px solid var(--orange); outline-offset: 1px; }
.rt-recht input:disabled + label { cursor: default; }
.rt-recht input:disabled + label:hover { background: none; }
.rt-recht input:disabled + label .rt-schalter { opacity: .55; }
.rt-gesperrt .rt-schalter-flaeche { cursor: default; }
.rt-gesperrt .rt-schalter-flaeche:hover { background: none; }
.rt-text { display: grid; gap: 2px; min-width: 0; }
.rt-titel { font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.rt-text small { color: var(--muted); font-size: 13.5px; line-height: 1.4; }
.rt-plus .rt-schalter-flaeche { background: #f3faf5; }
.rt-minus .rt-schalter-flaeche { background: #fdf5f5; }
.rt-neu .rt-schalter-flaeche { box-shadow: inset 3px 0 0 var(--orange); }

/* ---------- Speicherleiste (unten, fest) ---------- */
/* links ausgerichtet: unten rechts liegen oft Hinweisfenster der Seite (z. B. KI-Assistent) */
.rt-leiste { position: sticky; bottom: 0; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 8px;
  padding: 10px 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--r, 12px); box-shadow: 0 -6px 18px rgba(0, 0, 0, .06); }
.rt-leiste-an { background: #fff8e8; border-color: #f2d49b; }
.rt-status { margin-right: 10px; color: var(--muted); font-size: 14px; font-weight: 700; }
.rt-leiste-an .rt-status { color: #8a5a00; }
@media (max-width: 860px) {
  /* über der Handy-Leiste; unten Platz für die schwebenden Knöpfe der Seite (Zurück/Vor, „Ideen & Fehler“), „Speichern“ oben */
  body.gerust .rt-leiste { bottom: calc(66px + env(safe-area-inset-bottom)); padding-bottom: 60px; }
  .rt-leiste .btn { flex: 1 1 auto; }
  .rt-leiste [data-rt="speichern"] { order: -1; flex-basis: 100%; }
  .rt-status { flex-basis: 100%; order: -2; }
}

/* Protokoll */
.rt-protokoll { background: #fff; border: 1px solid var(--line); border-radius: var(--r, 12px); padding: 2px 14px; }
.rt-protokoll summary { cursor: pointer; font-weight: 700; padding: 11px 0; }
.rt-protokoll ul { list-style: none; margin: 0 0 10px; padding: 0; }
.rt-protokoll li { display: grid; gap: 2px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.rt-protokoll li small { color: var(--muted); }
.rt-protokoll .hinweis { margin: 0 0 12px; }

/* Meldung unten */
.rt-toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 70; max-width: min(92vw, 560px); background: var(--ink); color: #fff;
  padding: 12px 18px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); font-weight: 600; }
.rt-toast-fehler { background: var(--bad); }
@media (max-width: 860px) { body.gerust .rt-toast { bottom: calc(150px + env(safe-area-inset-bottom)); } }

/* Karte in den Einstellungen */
.rt-einst-karte { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin: 0 0 14px; }
.rt-einst-karte > div { display: grid; gap: 2px; }
.rt-einst-karte .hinweis { margin: 0; }
