/* Website-Zentrale – hell, ruhig, klar. Keine Inline-Stile (CSP). Rot nur fuer echte Warnungen. */
:root {
  color-scheme: light;
  --grund: #f5f6f8;
  --flaeche: #ffffff;
  --linie: #e1e5ea;
  --linie-stark: #c9d0d8;
  --text: #1c2330;
  --leise: #5a6472;
  --akzent: #ff9900;          /* Cyberdox-Orange, nur mit dunkler Schrift */
  --akzent-hover: #f08c00;
  --dunkel: #171b25;
  --gruen: #2f9e44;
  --gelb: #f2a900;
  --gelb-text: #7a5300;
  --rot: #c92a2a;
  --grau: #9aa3ae;
  --info-grund: #eef3f8;
  --info-linie: #c8d6e5;
  --radius: 8px;
  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--grund); color: var(--text); font: 15px/1.5 var(--schrift); }
a { color: #1d5fa8; }
a:hover { color: #164a84; }
h1 { font-size: 1.55rem; line-height: 1.25; margin: 0 0 .6rem; }
h2 { font-size: 1.15rem; margin: 1.2rem 0 .5rem; }
h3 { font-size: 1rem; margin: 1.4rem 0 .5rem; padding-top: .9rem; border-top: 1px solid var(--linie); }
p { margin: .4rem 0 .8rem; }
.leise { color: var(--leise); font-size: .9rem; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid #1d5fa8; outline-offset: 2px; }

/* Kopf */
.kopf { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; padding: .7rem 1.25rem; background: var(--flaeche); border-bottom: 1px solid var(--linie); }
.marke { display: inline-flex; align-items: center; gap: .55rem; color: var(--text); text-decoration: none; font-weight: 650; font-size: 1.05rem; }
.marke-zeichen { width: 26px; height: 26px; fill: none; stroke: var(--dunkel); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.marke-zusatz { font-weight: 500; color: var(--leise); font-size: .85rem; padding: .05rem .45rem; border: 1px solid var(--linie-stark); border-radius: 99px; }
.menue { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; margin-left: auto; }
.menue a, .menue .link { color: var(--text); text-decoration: none; padding: .4rem .7rem; border-radius: 6px; font-size: .95rem; }
.menue a:hover, .menue .link:hover { background: var(--grund); }
.menue a[aria-current="page"] { background: var(--dunkel); color: #fff; }
.abmelden { display: inline; margin: 0; }

.inhalt { max-width: 1720px; margin: 0 auto; padding: 1.4rem 1.25rem 3rem; }
.schmal-seite .inhalt { max-width: 560px; padding-top: 3rem; }
.titelzeile { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .6rem; }
.titelzeile h1 { margin: 0; }

/* Karten */
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 1.25rem 1.4rem; }
.karte h2:first-child, .karte h1:first-child { margin-top: 0; }
.karten { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; align-items: start; }

/* Knoepfe */
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 40px; padding: .45rem 1rem; border: 1px solid transparent; border-radius: 6px;
  background: var(--akzent); color: var(--dunkel); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s; }
.knopf:hover { background: var(--akzent-hover); color: var(--dunkel); }
.knopf-hell { background: var(--flaeche); border-color: var(--linie-stark); color: var(--text); font-weight: 550; }
.knopf-hell:hover { background: var(--grund); border-color: #aeb7c2; }
.knopf-warnung { background: var(--rot); color: #fff; }
.knopf-warnung:hover { background: #a61e1e; color: #fff; }
.knopf[disabled] { opacity: .45; cursor: not-allowed; }
.knopf-klein { min-height: 32px; padding: .2rem .65rem; font-size: .85rem; }
.knopfreihe { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .4rem 0 .8rem; }
.knopfreihe form, form.inline { display: inline; margin: 0; }
.link { background: none; border: 0; padding: 0; color: #1d5fa8; font: inherit; cursor: pointer; text-decoration: underline; }

/* Formulare */
.formular { display: grid; gap: .45rem; margin: .6rem 0 1rem; }
.formular label { font-weight: 550; font-size: .92rem; }
.formular input, .formular select, .formular textarea { width: 100%; min-height: 42px; padding: .5rem .65rem; border: 1px solid var(--linie-stark); border-radius: 6px; background: #fff; color: var(--text); font: inherit; }
.formular textarea { min-height: 64px; }
.formular input:focus, .formular select:focus, .formular textarea:focus { border-color: #1d5fa8; outline: none; box-shadow: 0 0 0 3px rgba(29, 95, 168, .18); }
.formular .knopf { justify-self: start; margin-top: .3rem; }
.raster2 { grid-template-columns: 1fr 1fr; column-gap: 1rem; }
.raster2 .breit { grid-column: 1 / -1; }
.feld { display: grid; gap: .3rem; }
.haken { display: flex !important; align-items: center; gap: .5rem; font-weight: 500 !important; }
.haken input { width: auto; min-height: 0; }
input[readonly] { background: var(--grund); color: var(--leise); }

/* Meldungen */
.meldung { padding: .65rem .9rem; border-radius: 6px; margin: .5rem 0 .9rem; border: 1px solid; }
.meldung p { margin: .2rem 0; }
.meldung-ok { background: #ebf7ee; border-color: #b7e0c1; color: #1b5e2b; }
.meldung-info { background: var(--info-grund); border-color: var(--info-linie); }
.meldung-warnung { background: #fff6e0; border-color: #f1d18a; color: #5c4100; }
.meldung-fehler { background: #fdecec; border-color: #f2b8b8; color: #8a1c1c; }
.stand { color: var(--leise); font-size: .9rem; margin: .2rem 0 .8rem; }
.fortschritt { font-weight: 600; }

/* Ampel */
.ampel { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.ampel .punkt { width: 11px; height: 11px; border-radius: 50%; background: var(--grau); flex: none; }
.ampel-gruen .punkt { background: var(--gruen); }
.ampel-gelb .punkt { background: var(--gelb); }
.ampel-rot .punkt { background: var(--rot); }
.ampel-grau .punkt { background: var(--grau); }
.zusammenfassung { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; list-style: none; padding: 0; margin: .3rem 0 .2rem; }
.zusammenfassung strong { font-size: 1.15rem; }

/* Tabellen */
.tabelle-rahmen { position: relative; overflow-x: auto; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); }
.tabelle { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabelle th, .tabelle td { padding: .5rem .55rem; border-bottom: 1px solid var(--linie); text-align: left; vertical-align: top; }
.tabelle thead th { position: sticky; top: 0; background: #fafbfc; font-size: .82rem; color: var(--leise); font-weight: 600; vertical-align: bottom; z-index: 1; }
.sortieren .kurz { display: none; }
.tabelle tbody tr:last-child > * { border-bottom: 0; }
.tabelle tbody tr:hover { background: #fafbfd; }
.tabelle tbody th { font-weight: 600; }
.tabelle td { white-space: nowrap; }
.tabelle td.befund { white-space: normal; min-width: 170px; max-width: 360px; }
.tabelle td.umbruch { white-space: normal; min-width: 6.5rem; max-width: 9rem; }
.tabelle td.schlecht { color: var(--rot); font-weight: 600; }
.tabelle td.mau { color: var(--gelb-text); }
.tabelle td.leise { color: var(--leise); }
.tabelle tr.aus { opacity: .6; }
.tabelle.klein { font-size: .85rem; }
.tabelle td.aktionen { white-space: normal; }
.tabelle td.aktionen > * { margin: 0 .25rem .25rem 0; }
.sortieren { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: flex-end; gap: .3rem; text-align: left; }
.sortieren::after { content: "↕"; opacity: .35; font-size: .8em; }
th[aria-sort="ascending"] .sortieren::after { content: "↑"; opacity: 1; }
th[aria-sort="descending"] .sortieren::after { content: "↓"; opacity: 1; }
.seitenname { background: none; border: 0; padding: 0; font: inherit; font-weight: 650; color: #1d5fa8; cursor: pointer; text-align: left; text-decoration: underline; text-underline-offset: 2px; }
.unter { display: block; font-weight: 400; font-size: .8rem; color: var(--leise); white-space: normal; min-width: 160px; }
.zusatz { display: block; font-size: .8rem; color: var(--leise); }
td.schlecht .zusatz { color: var(--rot); }
.tabelle thead th:nth-child(6) { white-space: nowrap; }
.marke-offen { display: table; margin-top: .2rem; padding: 0 .45rem; border-radius: 99px; background: #fff3d6; color: var(--gelb-text); font-size: .75rem; font-weight: 600; }

/* Details */
.details-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .4rem; }
.befunde { list-style: none; padding: 0; margin: .3rem 0; display: grid; gap: .4rem; }
.befunde li { display: grid; grid-template-columns: 7.5rem 1fr; gap: .6rem; align-items: start; }
.werte { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: .3rem 1rem; margin: .3rem 0; }
.werte dt { color: var(--leise); }
.werte dd { margin: 0; overflow-wrap: anywhere; }
.dateiliste { margin: .2rem 0 .6rem; padding-left: 1.2rem; font-family: ui-monospace, Consolas, monospace; font-size: .82rem; }
.schluessel { font-family: ui-monospace, Consolas, monospace; overflow-wrap: anywhere; user-select: all; background: var(--grund); padding: .35rem .5rem; border-radius: 4px; }
.schritte { display: flex; gap: 1rem; list-style: none; padding: 0; margin: .3rem 0 1rem; counter-reset: s; }
.schritte li { counter-increment: s; color: var(--leise); }
.schritte li::before { content: counter(s) ". "; }
.schritte li[aria-current="step"] { color: var(--text); font-weight: 650; }
.totp { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: center; margin: .6rem 0; }
.qr { background: #fff; padding: 10px; border: 1px solid var(--linie); border-radius: 6px; width: max-content; }
.qr img, .qr canvas { display: block; }

/* Befunde in drei Gruppen */
.befund-gruppen { display: grid; gap: .8rem; margin: .6rem 0 1.4rem; }
.gruppe { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: .8rem 1rem; }
.gruppe > summary { cursor: pointer; list-style: none; }
.gruppe > summary::-webkit-details-marker { display: none; }
.gruppe > summary::before { content: "▸"; display: inline-block; width: 1.1rem; color: var(--leise); transition: transform .15s; }
.gruppe[open] > summary::before { transform: rotate(90deg); }
.gruppe-titel { font-size: 1.02rem; font-weight: 650; margin: 0; padding: 0; border: 0; }
h3.gruppe-titel { margin: 0 0 .5rem; }
.zahl { display: inline-block; min-width: 1.6rem; padding: 0 .45rem; margin-left: .3rem; border-radius: 99px; background: var(--grund); border: 1px solid var(--linie); font-size: .85rem; text-align: center; }
.gruppe-dich .zahl { background: #fff3d6; border-color: #f1d18a; }
.befund { border: 1px solid var(--linie); border-left: 4px solid var(--grau); border-radius: 6px; padding: .7rem .9rem; margin: .6rem 0 0; background: #fff; }
.befund-kritisch { border-left-color: var(--rot); }
.befund-warnung { border-left-color: var(--gelb); }
.befund-hinweis { border-left-color: var(--grau); }
.befund-erledigt { border-left-color: var(--gruen); }
.befund-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .7rem; }
.befund-kopf h4 { margin: 0; font-size: 1rem; }
.befund p { margin: .3rem 0; }
.befund-text { font-weight: 500; }
.befund .standard { color: var(--leise); font-size: .88rem; }
.befund .loesung ol { margin: .2rem 0 .3rem 1.2rem; padding: 0; }
.befund .knopfreihe { margin: .5rem 0 0; }
.ursache-loesung > summary { cursor: pointer; color: #1d5fa8; font-weight: 550; margin: .3rem 0; }
.status-wort { font-size: .85rem; color: #1b5e2b; background: #ebf7ee; border: 1px solid #b7e0c1; border-radius: 99px; padding: 0 .55rem; }
.seitenname.klein { font-size: .9rem; }
.behebungen { margin: .2rem 0 .8rem; padding-left: 1.2rem; }
.behebungen li { margin: .25rem 0; }
.autostatus { margin: .3rem 0 .6rem; }
.tabelle-werkzeug { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem 1rem; margin-top: 1rem; }
.tabelle-werkzeug h2 { margin: 0; }
.erklaerung { max-width: 70rem; }
.haken-zelle { text-align: center; white-space: normal; }
.haken-zelle .zusatz { white-space: nowrap; }
.schalter input { width: 1.15rem; height: 1.15rem; accent-color: var(--dunkel); cursor: pointer; }
.schalter input[disabled] { cursor: not-allowed; opacity: .45; }
.tabelle td.befund-spalte { white-space: normal; min-width: 170px; max-width: 320px; }

/* Eingebettetes Fenster */
.fenster { width: min(1000px, calc(100% - 24px)); max-height: calc(100vh - 40px); padding: 0; border: 1px solid var(--linie-stark); border-radius: 10px; color: var(--text); background: var(--flaeche); box-shadow: 0 20px 60px rgba(20, 30, 45, .25); }
.fenster::backdrop { background: rgba(20, 28, 40, .45); }
.fenster[open] { display: flex; flex-direction: column; animation: auf .18s ease-out; }
@keyframes auf { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fenster-kopf { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1.2rem; border-bottom: 1px solid var(--linie); position: sticky; top: 0; background: var(--flaeche); }
.fenster-kopf h2 { margin: 0; font-size: 1.1rem; }
.fenster-zu { background: none; border: 1px solid var(--linie-stark); border-radius: 6px; width: 40px; height: 40px; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--text); }
.fenster-zu:hover { background: var(--grund); }
.fenster > * { min-width: 0; }
.fenster-inhalt { padding: .4rem 1.2rem 1.2rem; overflow: auto; overflow-wrap: anywhere; }
.fenster-inhalt .tabelle td, .fenster-inhalt .tabelle th { overflow-wrap: normal; }
.fenster-inhalt h3:first-child { border-top: 0; }
.laedt { color: var(--leise); padding: 1rem 0; }

/* Handy */
@media (max-width: 760px) {
  body { font-size: 15px; }
  .kopf { padding: .6rem 1rem; }
  .menue { margin-left: 0; width: 100%; }
  .inhalt { padding: 1rem 1rem 2.5rem; }
  .raster2 { grid-template-columns: 1fr; }
  .tabelle .ampel-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  /* Uebersicht: Ampel (nur Punkt) und Seite bleiben beim seitlichen Wischen stehen */
  .tabelle .sortieren .lang { display: none; }
  .tabelle .sortieren .kurz { display: inline; }
  .tabelle[data-merken="uebersicht"] tbody tr > :first-child, .tabelle[data-merken="uebersicht"] thead th:first-child { position: sticky; left: 0; width: 2.4rem; min-width: 2.4rem; max-width: 2.4rem; background: var(--flaeche); z-index: 2; }
  .tabelle[data-merken="uebersicht"] tbody th, .tabelle[data-merken="uebersicht"] thead th:nth-child(2) { position: sticky; left: 2.4rem; background: var(--flaeche); z-index: 2; box-shadow: 1px 0 0 var(--linie); }
  .tabelle[data-merken="uebersicht"] thead th:first-child, .tabelle[data-merken="uebersicht"] thead th:nth-child(2) { background: #fafbfc; z-index: 3; }
  .tabelle .unter { min-width: 120px; }
  .befunde li { grid-template-columns: 1fr; gap: .1rem; }
  .werte { grid-template-columns: 1fr; }
  .werte dd { margin-bottom: .4rem; }
  .totp { grid-template-columns: 1fr; }
  .fenster { width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; margin: 0; }
  .fenster-inhalt { padding: .3rem 1rem 1.5rem; }
}
