/* Anmeldung, „Meine Boards“, Verwaltung und „Passwort festlegen“. Immer Auftritt seiler.
   Vorbild: entwurf/board-entwurf-2.html (Ansichten „Meine Boards“ und „Verwaltung“). Unter 700 px werden die
   Tabellen zu Kartenlisten (Spaltenname aus data-titel). */

html, body { min-height: 100%; }
body { display: flex; flex-direction: column; min-height: 100vh; }

.unsichtbar {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.gedaempft { color: var(--muted); }
.hinweis { margin-top: 6px; font-size: 13.5px; color: var(--muted); }

/* Knopf ohne Rahmen, wie ein Link */
.textknopf {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0;
  font: inherit; color: var(--akzent); background: none; border: 0; cursor: pointer; text-decoration: none;
}
.textknopf:hover { text-decoration: underline; }
.textknopf:disabled { opacity: .5; cursor: default; }

/* Kopf */
.kopf {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  min-height: 64px; padding: 0 36px; background: #fff; border-bottom: 1px solid var(--linie);
}
.kopf-marke { display: flex; align-items: center; gap: 14px; flex: 1 1 0; min-width: 0; }
.kopf .logo { height: 26px; }
#kopf-titel {
  font: 500 12px var(--schrift-text); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  border-left: 1px solid var(--linie); padding-left: 14px; white-space: nowrap;
}
#reiter { display: flex; gap: 26px; font-size: 14.5px; }
#reiter a {
  display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: none;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
#reiter a:hover { color: var(--akzent); }
#reiter a.an { border-bottom-color: var(--akzent); }
#wer { flex: 1 1 0; text-align: right; font-size: 14px; color: var(--muted); white-space: nowrap; }
#wer .textknopf { color: var(--muted); min-height: 44px; vertical-align: middle; }
#wer .textknopf:hover { color: var(--akzent); }

/* Hauptbereich */
#haupt { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 34px 36px 40px; }
#haupt h1 { font-size: 28px; }
.unter { color: var(--muted); margin: 4px 0 24px; }
.oben { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.oben .unter { margin-bottom: 0; }
.ansicht > .meldung { margin-bottom: 16px; }
.leer { color: var(--muted); padding: 30px 0; }

/* Anmeldung und Passwort festlegen */
.mitte { display: flex; justify-content: center; padding: 30px 0 10px; }
.karte-a {
  width: 430px; max-width: 100%; padding: 32px 34px 26px;
  background: #fff; border: 1px solid var(--linie); border-radius: 16px; box-shadow: var(--schatten-karte);
}
.karte-a h1 { margin-bottom: 6px; }
.karte-a p { color: var(--muted); font-size: 15px; line-height: 1.55; }
.karte-a .meldung { margin-top: 14px; }
.karte-a .knopf.breit { margin-top: 18px; }
.vergessen-link { display: flex; margin: 12px auto 0; justify-content: center; min-height: 44px; font-size: 14px; }

/* Meine Boards: Kacheln */
.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.kachel { background: #fff; border: 1px solid var(--linie); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.vorschau {
  height: 150px; background-color: var(--flaeche);
  background-image: radial-gradient(circle, #cfd2cb 1px, transparent 1.2px); background-size: 14px 14px;
  border-bottom: 1px solid var(--linie);
}
.vorschau svg { display: block; width: 100%; height: 100%; }
.kachel .inhalt { padding: 16px 18px 18px; display: flex; flex-direction: column; align-items: flex-start; flex: 1; }
.kachel h3 { font-size: 17px; overflow-wrap: anywhere; }
.kachel .meta { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.kachel .knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 14px; }
.kachel .knopf { padding: 10px 18px; font-size: 14.5px; }
.zustand {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; padding: 4px 10px; border-radius: 20px; margin-top: 12px;
}
.zustand::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.zustand.offen { background: var(--akzent-hell); color: var(--akzent-dunkel); }
.zustand.zu { background: #eef0ec; color: #5d6b5e; }
.zustand.frost { background: #fff6dc; color: #7a5900; }

/* Tabellen der Verwaltung */
table.liste {
  width: 100%; border-collapse: separate; border-spacing: 0; background: #fff;
  border: 1px solid var(--linie); border-radius: 14px; overflow: hidden;
}
.liste th {
  font: 500 11.5px var(--schrift-text); letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  text-align: left; padding: 13px 16px; background: var(--flaeche); border-bottom: 1px solid var(--linie);
}
.liste td { padding: 12px 16px; border-bottom: 1px solid var(--linie); vertical-align: middle; font-size: 14.5px; }
.liste tr:last-child td { border-bottom: 0; }
.liste td b { font-weight: 600; font-family: var(--schrift-kopf); color: var(--head); overflow-wrap: anywhere; }
.liste td small { display: block; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.liste td.aktion { text-align: right; width: 1%; white-space: nowrap; }
.liste .knopf.zweit { padding: 9px 16px; font-size: 14px; }
.liste .mail { overflow-wrap: anywhere; }
.board-titel { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.etikett { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: #fff6dc; color: #7a5900; }
.leer-zeile td { color: var(--muted); }

.kreise { display: flex; }
.kreis {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  color: #fff; font: 600 11px var(--schrift-kopf); margin-right: -6px; border: 2px solid #fff;
}

/* Dreistufiger Umschalter Auftritt */
.umschalter { display: inline-flex; border: 1px solid var(--rand-feld); border-radius: 8px; overflow: hidden; }
.umschalter button {
  min-height: 34px; padding: 6px 11px; font: 400 13px var(--schrift-text); color: var(--ink);
  background: #fff; border: 0; border-left: 1px solid var(--linie); cursor: pointer; white-space: nowrap;
}
.umschalter button:first-child { border-left: 0; }
.umschalter button:hover { background: #f3f5f1; }
.umschalter button.an { background: var(--akzent); color: #fff; }

.tag { font-size: 12.5px; padding: 3px 9px; border-radius: 6px; background: #eef0ec; color: var(--muted); }
.tag.bhk { background: #f4e7e4; color: #7d211b; }
.stand.offen { color: #7a5900; }
.stand.gesperrt { color: var(--warn); }

/* Dialoge der Verwaltung */
.dialog .beschriftung { display: block; margin: 14px 0 6px; font-size: 14px; color: var(--muted); }
.dialog .hinweis { margin-top: 6px; }
.dialog .meldung { margin-top: 14px; }
.dialog .feld + .feld { margin-top: 10px; }
.rueckfrage .feld { margin-top: 14px; }
.board-dialog .dialog { width: 600px; }
.dialog .knoepfe .knopf.warn { margin-right: auto; }
.ankreuz { display: flex; flex-direction: column; gap: 2px; }
.ankreuz.waagrecht { flex-direction: row; flex-wrap: wrap; gap: 4px 18px; }
.wahl { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; font-size: 15px; }
.wahl input { width: 18px; height: 18px; accent-color: var(--akzent); margin: 0; }
.wahl.sperren { margin-top: 16px; color: var(--warn); }
.wahl.gesperrt { color: var(--muted); cursor: default; }
.dialog p.mail { margin-top: 2px; }
.abschnitt { font-size: 16px; margin: 22px 0 8px; }
.netz { list-style: none; border: 1px solid var(--linie); border-radius: 10px; max-height: 220px; overflow: auto; }
.netz li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--linie); font-size: 14px;
}
.netz li:last-child { border-bottom: 0; }
.netz li.gedaempft { padding: 12px 14px; }
.netz .knopf { padding: 8px 14px; font-size: 13.5px; }

/* Kurze Bestätigung unten in der Mitte, über dem Fuß: oben deckte sie Kopf und Reiter zu */
.toast {
  position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%); z-index: 40;
  box-shadow: var(--schatten-pille); max-width: calc(100% - 32px); width: max-content; text-align: center;
}

/* Fuß: Impressum, Datenschutz, Glühbirne */
.fuss {
  display: flex; align-items: center; justify-content: flex-end; min-height: 44px; padding: 0 12px 0 20px;
  border-top: 1px solid var(--linie); background: #fff; font-size: 13px;
}
.fuss nav { display: flex; align-items: center; gap: 18px; }
.fuss a { color: var(--muted); text-decoration: none; }
.fuss a:hover { color: var(--akzent); }
.gluehbirne {
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
}
.gluehbirne:hover { color: var(--akzent); background: var(--akzent-hell); }

/* Glühbirnen-Dialog (wie im Board) */
.vorschlag .dialog p + p { margin-top: 4px; }
.vorschlag-wahl { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 12px; }
.vorschlag-wahl label { position: relative; cursor: pointer; }
.vorschlag-wahl input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.vorschlag-wahl span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  border: 1.5px solid var(--rand-feld); border-radius: 22px; background: #fff; color: var(--ink); font-size: 15px;
}
.vorschlag-wahl input:checked + span { border-color: var(--akzent); background: var(--akzent-hell); color: var(--akzent); font-weight: 500; }
.vorschlag-wahl input:focus-visible + span { outline: 2.5px solid var(--akzent); outline-offset: 2px; }
.vorschlag .meldung { margin-top: 12px; }

/* Tablet: etwas enger */
@media (max-width: 1000px) {
  .kopf { padding: 0 20px; }
  #haupt { padding: 28px 20px 36px; }
  #reiter { gap: 18px; }
}

/* Handy: Kopf zweizeilig, Tabellen als Kartenlisten */
@media (max-width: 699px) {
  .kopf { flex-wrap: wrap; gap: 0 12px; padding: 8px 16px 0; }
  .kopf-marke { flex: 1 1 auto; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; min-height: 52px; }
  .kopf .logo { height: 22px; }
  #kopf-titel { border-left: 0; padding-left: 0; font-size: 10.5px; letter-spacing: .1em; }
  #wer { flex: 0 1 auto; min-width: 0; font-size: 13px; }
  #wer-name { display: inline-block; max-width: 110px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
  #reiter { order: 3; flex: 1 0 100%; gap: 20px; overflow-x: auto; }
  #haupt { padding: 22px 16px 30px; }
  #haupt h1 { font-size: 24px; }
  .oben { flex-direction: column; align-items: stretch; }
  .raster { grid-template-columns: 1fr; }
  .karte-a { padding: 26px 22px 20px; }

  table.liste, .liste tbody, .liste tr, .liste td { display: block; width: 100%; }
  .liste thead { display: none; }
  table.liste { background: transparent; border: 0; border-radius: 0; overflow: visible; }
  .liste tr { background: #fff; border: 1px solid var(--linie); border-radius: 14px; padding: 8px 0; margin-bottom: 12px; }
  .liste td { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; border: 0; text-align: right; }
  .liste td::before {
    content: attr(data-titel); flex: 0 0 auto; text-align: left;
    font: 500 11px var(--schrift-text); letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  }
  .liste td:first-child { display: block; text-align: left; padding-bottom: 6px; }
  .liste td:first-child::before { display: none; }
  .liste td.aktion { width: 100%; text-align: left; }
  .liste td.aktion::before { display: none; }
  .liste td.aktion .knopf { width: 100%; }
  .liste .mail { min-width: 0; }
  .umschalter button { min-height: 44px; padding: 6px 10px; }
  .dialog { padding: 22px 18px; }
  .dialog .knoepfe .knopf { flex: 1 1 auto; }
  .fuss { justify-content: center; padding: 0 8px; }
}

/* Ansicht umschalten (nur Admin): Pille im Kopf links neben „Name · Abmelden“ (Markup aus js/ansicht.js) */
#wer #ansicht { margin-right: 16px; vertical-align: middle; }
/* Hinweis in der Gastansicht, Auswahl „Ansehen als“ in der Ansicht Moderation */
.gast-hinweis { margin-bottom: 22px; }
.ansehen-als { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 22px; }
.ansehen-als[hidden] { display: none; }
.ansehen-lab { color: var(--muted); font-size: 14px; }
.ansehen-liste { display: flex; flex-wrap: wrap; gap: 8px; }
.ansehen-knopf {
  min-height: 44px; padding: 0 16px; border: 1.5px solid var(--rand-feld); border-radius: 22px; background: #fff;
  font: 400 14.5px var(--schrift-text); color: var(--ink); cursor: pointer;
}
.ansehen-knopf:hover { background: #f3f5f1; }
.ansehen-knopf.an { border-color: var(--akzent); background: var(--akzent-hell); color: var(--akzent-dunkel); font-weight: 500; }

@media (max-width: 999px) {
  #wer .ansicht-lab { display: none; }
  #wer .ansicht-segmente { padding-left: 3px; }
}
@media (max-width: 699px) {
  #wer #ansicht { margin-right: 8px; }
  #wer .ansicht-knopf { padding: 0 8px; }
}

/* Öffnen und Bearbeiten nebeneinander in der Boards-Tabelle */
td.aktion .aktionen { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: nowrap; white-space: nowrap; }
@media (max-width: 699px) { td.aktion .aktionen { flex-wrap: wrap; } }
