:root {
  --hintergrund: #f5f6f8;
  --flaeche: #ffffff;
  --text: #1f2933;
  --gedaempft: #52606d;
  --linie: #d5dae1;
  --akzent: #1d4f91;
  --akzent-dunkel: #153c70;
  --fehler: #a12622;
  --fehler-grund: #fdeceb;
}
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; }
body {
  margin: 0; background: var(--hintergrund); color: var(--text); line-height: 1.55;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--akzent); text-underline-offset: 0.15em; }
a:hover { color: var(--akzent-dunkel); }
:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; border-radius: 2px; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 1rem; font-weight: 650; }

.sprung { position: absolute; left: -999px; top: 0; background: var(--flaeche); padding: 0.5rem 1rem; z-index: 10; }
.sprung:focus { left: 0.5rem; top: 0.5rem; }

.kopf {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem;
  padding: 0.9rem 1.5rem; background: var(--flaeche); border-bottom: 1px solid var(--linie);
}
.marke { font-weight: 650; color: var(--text); text-decoration: none; }
.kopf-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; }
.benutzer { color: var(--gedaempft); font-size: 0.9rem; overflow-wrap: anywhere; }
.inline { display: inline; margin: 0; }

.inhalt { max-width: 62rem; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.seitenkopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; margin-bottom: 1.5rem; }
.seitenkopf h1 { margin: 0; }

.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 0.5rem; padding: 1.75rem; }
.karte.schmal { max-width: 28rem; margin: 2rem auto 0; }
.karte.leer { text-align: center; padding: 3rem 1.5rem; }

.feld { margin-bottom: 1.25rem; }
label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
input[type=text], input[type=email], input[type=password], input[type=url] {
  width: 100%; font: inherit; padding: 0.6rem 0.75rem; color: var(--text);
  background: var(--flaeche); border: 1px solid #8a94a0; border-radius: 0.375rem;
}
.hilfe { margin: 0.35rem 0 0; font-size: 0.9rem; color: var(--gedaempft); }
.tagesgrenze { color: var(--fehler); font-size: 0.875rem; font-weight: 650; margin-left: 0.5rem; }
.zustand-warn { color: var(--fehler); font-size: 0.875rem; font-weight: 650; }
.meldung { background: var(--fehler-grund); color: var(--fehler); border: 1px solid var(--fehler); border-radius: 0.375rem; padding: 0.75rem 1rem; margin: 0 0 1.25rem; }

.knopf {
  display: inline-block; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  padding: 0.6rem 1.25rem; min-height: 2.75rem; color: #fff; background: var(--akzent);
  border: 1px solid var(--akzent); border-radius: 0.375rem;
}
.knopf:hover { background: var(--akzent-dunkel); color: #fff; }
.knopf-leise { background: transparent; color: var(--akzent); border-color: var(--linie); }
.knopf-leise:hover { background: var(--hintergrund); color: var(--akzent-dunkel); }
.aktionen { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }

.tabelle-rahmen { overflow-x: auto; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 0.5rem; }
.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th, .tabelle td { text-align: left; padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--linie); }
.tabelle thead th { font-size: 0.85rem; color: var(--gedaempft); font-weight: 600; }
.tabelle tbody tr:last-child > * { border-bottom: 0; }
.tabelle tbody th { font-weight: 600; }

.plakette { background: #e6edf6; color: var(--akzent-dunkel); padding: 0.2rem 0.7rem; border-radius: 999px; font-size: 0.9rem; font-weight: 600; }
.reiter { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--linie); }
.reiter a { padding: 0.6rem 0.85rem; color: var(--gedaempft); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.reiter a:hover { color: var(--text); }
.reiter a[aria-current=page] { color: var(--akzent-dunkel); border-bottom-color: var(--akzent); font-weight: 600; }

.angaben { display: grid; grid-template-columns: max-content 1fr; gap: 0.6rem 1.5rem; margin: 0; }
.angaben dt { color: var(--gedaempft); }
.angaben dd { margin: 0; overflow-wrap: anywhere; }

@media (max-width: 30rem) {
  .kopf, .inhalt { padding-left: 1rem; padding-right: 1rem; }
  .karte { padding: 1.25rem; }
  .angaben { grid-template-columns: 1fr; gap: 0.1rem; }
  .angaben dd { margin-bottom: 0.6rem; }
}

/* Wissen, Stammdaten, Regeln */
textarea { width: 100%; font: inherit; padding: 0.6rem 0.75rem; color: var(--text); background: var(--flaeche);
  border: 1px solid #8a94a0; border-radius: 0.375rem; resize: vertical; }
input[type=date], input[type=text] { min-height: 2.5rem; }
fieldset { border: 1px solid var(--linie); border-radius: 0.375rem; padding: 0.75rem 1rem; margin: 0 0 1.25rem; }
legend { font-weight: 600; padding: 0 0.4rem; }
.auswahl { display: inline-block; font-weight: 400; margin-right: 1.5rem; }
.leise { font-weight: 400; color: var(--gedaempft); font-size: 0.9rem; }
.karte + .karte, .meldung + .karte, .karte + form.karte { margin-top: 1.25rem; }
.thema-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin-bottom: 0.75rem; }
.thema-kopf h2 { margin: 0 auto 0 0; font-size: 1.2rem; }
.zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin-top: 0.75rem; }
.zeile label { margin: 0; }
.zeile input[type=text] { flex: 1 1 14rem; width: auto; }
.abschnitte { list-style: none; margin: 0.5rem 0; padding: 0; }
.abschnitte li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; padding: 0.5rem 0; border-top: 1px solid var(--linie); }
.aktionen-klein { margin-left: auto; display: flex; gap: 0.5rem; }
.knopf-klein { min-height: 2.25rem; padding: 0.3rem 0.7rem; }
.knopf-gefahr { background: var(--fehler); border-color: var(--fehler); }
.knopf-gefahr:hover { background: #7e1d1a; }
.plakette-warn { background: var(--fehler-grund); color: var(--fehler); }
progress { width: 100%; height: 0.9rem; }
.groesse .meldung { margin: 0.75rem 0 0; }
.fassungen { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; }
.fassung { border: 1px solid var(--linie); border-radius: 0.375rem; padding: 0.75rem 1rem; }
.fassung h3 { margin: 0 0 0.5rem; font-size: 1rem; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; margin: 0.5rem 0; }
.saison input { width: 100%; }
.meldung ul { margin: 0.25rem 0 0; padding-left: 1.25rem; }

/* Aussehen, Zimmer, Buchung, Testchat */
select { font: inherit; padding: 0.55rem 0.75rem; color: var(--text); background: var(--flaeche);
  border: 1px solid #8a94a0; border-radius: 0.375rem; max-width: 100%; }
input[type=file] { font: inherit; max-width: 100%; }
.erfolg { background: #e8f3ec; color: #1b5e34; border: 1px solid #1b5e34; border-radius: 0.375rem; padding: 0.75rem 1rem; margin: 0 0 1.25rem; }
.hinweis { background: #fff6e0; color: #5c4200; border: 1px solid #8a6500; border-radius: 0.375rem; padding: 0.75rem 1rem; margin: 0 0 1.25rem; }
.hinweis p { margin: 0; }
.hinweis ul { margin: 0.25rem 0 0; padding-left: 1.25rem; }
.standardknopf { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.farbe { margin-bottom: 0.9rem; }
.farbfeld { display: flex; gap: 0.5rem; align-items: center; }
.farbfeld input[type=color] { width: 3rem; min-width: 3rem; height: 2.5rem; padding: 0.1rem; border: 1px solid #8a94a0; border-radius: 0.375rem; background: var(--flaeche); }
.farbfeld input[type=text] { max-width: 12rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.sprachgruppe { background: #fafbfc; }
.sprachgruppe input[type=text] + input[type=text] { margin-top: 0.4rem; }
.gruppentitel { font-weight: 600; margin: 0; }
.vorschaubild { object-fit: cover; border-radius: 0.25rem; border: 1px solid var(--linie); background: var(--hintergrund); }
.vorschaubild.gross { max-width: 16rem; max-height: 10rem; width: auto; height: auto; object-fit: contain; }
.zimmerliste td { vertical-align: middle; }
details.selten { margin-top: 1.25rem; }
details.selten summary { cursor: pointer; font-weight: 600; color: var(--gedaempft); }
details.selten[open] summary { margin-bottom: 0.75rem; }
details.karte.selten { padding: 1rem 1.75rem; }
.thema-kopf + details.selten, .karte details.selten { margin-top: 0.75rem; }
.testchat { display: block; width: 460px; max-width: 100%; height: 760px; border: 1px solid var(--linie); border-radius: 0.5rem; background: var(--flaeche); }
button:disabled { opacity: 0.45; cursor: default; }
@media (max-width: 40rem) {
  .testchat { width: 100%; height: 80vh; }
  .farbfeld input[type=text] { max-width: none; }
}

/* Angleichung der Seiten (Rundgang): Titel, Reiter, Abstände, Tabellen, Speichern-Leiste */
h2 { font-size: 1.2rem; line-height: 1.3; margin: 0 0 0.75rem; }
.karte > h2:first-child, form.karte > h2:first-child { margin-top: 0; }
.seitenort { font-weight: 400; color: var(--gedaempft); }
.kopf .knopf { min-height: 2.25rem; padding: 0.3rem 0.9rem; }
progress { accent-color: var(--akzent); }
fieldset > .hilfe { margin: 0 0 0.9rem; }
fieldset > label ~ label { margin-top: 0.75rem; }
.knopf-loeschen { background: transparent; color: var(--fehler); border-color: var(--linie); }
.knopf.knopf-loeschen:hover { background: var(--fehler-grund); color: #7e1d1a; border-color: var(--fehler); }
.tabelle-rahmen + form.karte, .tabelle-rahmen + section.karte { margin-top: 1.25rem; }
.hochladen label { flex: 1 1 100%; }
.hochladen { margin-top: 0.5rem; }
.speichern-leiste {
  position: sticky; bottom: 0; z-index: 2; margin: 1.25rem -1.75rem -1.75rem; padding: 0.9rem 1.75rem;
  background: var(--flaeche); border-top: 1px solid var(--linie); border-radius: 0 0 0.5rem 0.5rem;
}
details.selten + .speichern-leiste { margin-top: 1.25rem; }

/* Reiter: eine Zeile, auf schmalen Schirmen seitlich verschiebbar */
.reiter { flex-wrap: nowrap; overflow-x: auto; gap: 0; scrollbar-width: thin; border-bottom: 0; box-shadow: inset 0 -1px 0 var(--linie); }
.reiter a { white-space: nowrap; padding: 0.6rem 0.7rem; margin-bottom: 0; }

@media (max-width: 40rem) {
  .stapel thead { position: absolute; left: -9999px; }
  .stapel, .stapel tbody, .stapel tr, .stapel th, .stapel td { display: block; }
  .stapel tr { padding: 0.75rem 1rem; border-bottom: 1px solid var(--linie); }
  .stapel tbody tr:last-child { border-bottom: 0; }
  .tabelle.stapel th, .tabelle.stapel td { border: 0; padding: 0.15rem 0; }
  .stapel td[data-label]::before { content: attr(data-label) ": "; color: var(--gedaempft); font-size: 0.9rem; }
  .stapel td[data-label="Bild"]::before { content: ""; }
  .stapel th[data-label]::before { content: attr(data-label) " "; color: var(--gedaempft); font-size: 0.9rem; font-weight: 400; }
  .zeile { flex-direction: column; align-items: stretch; }
  .zeile input[type=text] { flex: 0 0 auto; width: 100%; }
  .zeile .knopf { align-self: flex-start; }
  .saison thead { display: none; }
  .saison tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.25rem 0.5rem; }
  .saison td:nth-child(3) { grid-column: 1 / -1; }
  .tabelle.saison td { border: 0; padding: 0; }
  .saison tr { padding: 0.6rem 0; border-bottom: 1px solid var(--linie); }
  .saison td[data-label]::before { content: attr(data-label); display: block; font-size: 0.85rem; color: var(--gedaempft); margin-bottom: 0.15rem; }
}
@media (max-width: 30rem) {
  .speichern-leiste { margin: 1.25rem -1.25rem -1.25rem; padding: 0.75rem 1.25rem; }
  .reiter { margin-left: -1rem; margin-right: -1rem; padding: 0 0.5rem; }
}

/* Testchat: Rahmen füllt die Karte; die Höhe setzt verwaltung.js auf den Rest des Fensters */
.testchat-karte { padding-bottom: 1rem; }
.testchat-karte > p { margin-top: 0; }
.testchat { max-width: 460px; }
.saison td { min-width: 0; }

/* Speichern-Leiste: Eingabefelder und Knöpfe bleiben beim Tabulieren über der Leiste */
html { scroll-padding-bottom: 6rem; }
.speichern-leiste { box-shadow: 0 -4px 10px rgba(31, 41, 51, 0.08); }

/* Felder mit Fehler */
.feld-fehler input, .feld-fehler textarea, .feld-fehler select, input[aria-invalid=true], textarea[aria-invalid=true] {
  border-color: var(--fehler); border-width: 2px; background: var(--fehler-grund);
}
.feldfehler { margin: 0.35rem 0 0; font-size: 0.9rem; color: var(--fehler); font-weight: 600; }

/* Konflikt: abweichende Zeilen */
.fassung .abweichung { background: #fff6e0; border-left: 3px solid #8a6500; padding-left: 0.5rem; margin-left: -0.5rem; }
.angaben dt.abweichung, .angaben dd.abweichung { padding-top: 0.15rem; padding-bottom: 0.15rem; }
.abweichung-marke { font-size: 0.8rem; font-weight: 650; color: #5c4200; }

/* Kopf einer Karte mit Zustandsplaketten: Titel links, Plaketten zusammen rechts */
.karte > .seitenkopf { justify-content: flex-start; margin-bottom: 1rem; }
.karte > .seitenkopf h2 { margin-right: auto; }
form.karte > h2 + .feld { margin-top: 0.75rem; }

/* Übersicht: Schrittliste „Bis live“ und der Einbinde-Schnipsel */
.schritte { margin: 0.5rem 0; padding-left: 1.5rem; }
.schritte li { margin: 0.45rem 0; line-height: 1.6; }
.schritte .hilfe { display: inline; margin: 0 0 0 0.3rem; }
.plakette-leise { background: var(--hintergrund); color: var(--gedaempft); border: 1px solid var(--linie); }
pre.schnipsel { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.9rem; background: var(--hintergrund); padding: 0.6rem 0.8rem; border-radius: 6px; }
