/* Pforte – Verwaltung (admin.nerdeley.de). Bewusst schlicht: Systemschrift, klare Flächen, gut am Handy.
   Gleiche Klassennamen wie pforte.css (Konto-Seite), nur ohne Pixel-Stil. */
:root {
  color-scheme: light dark;
  --grund: #f3f4f6;
  --flaeche: #ffffff;
  --flaeche-2: #f9fafb;
  --linie: #e5e7eb;
  --linie-stark: #d1d5db;
  --text: #111827;
  --leise: #6b7280;
  --akzent: #2563eb;
  --akzent-text: #ffffff;
  --akzent-hell: #dbeafe;
  --gut: #16a34a;
  --gut-hell: #dcfce7;
  --warn: #d97706;
  --warn-hell: #fef3c7;
  --rot: #dc2626;
  --rot-hell: #fee2e2;
  --radius: 12px;
  --schatten: 0 1px 2px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #0f1115;
    --flaeche: #1a1d23;
    --flaeche-2: #20242b;
    --linie: #2c313a;
    --linie-stark: #3a404b;
    --text: #f3f4f6;
    --leise: #9ca3af;
    --akzent: #3b82f6;
    --akzent-hell: #1e3a5f;
    --gut: #22c55e;
    --gut-hell: #143524;
    --warn: #f59e0b;
    --warn-hell: #3d2e0a;
    --rot: #ef4444;
    --rot-hell: #3f1717;
    --schatten: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--grund); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
main { max-width: 720px; margin: 0 auto; padding: 8px 16px 96px; }
a { color: var(--akzent); }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.nur-vorlesen { position: absolute; left: -9999px; }

/* ---- Kopf ---- */
.kopf { display: flex; align-items: center; gap: 12px; padding: 10px 0 14px; position: sticky; top: 0; z-index: 5;
  background: var(--grund); }
.kopf img { width: 36px; height: 36px; border-radius: 9px; flex: none; }
.kopf h1 { font-size: 20px; line-height: 1.2; margin: 0; font-weight: 650; }
.kopf .unter { font-size: 13px; color: var(--leise); }
.kopf .rechts { margin-left: auto; display: flex; gap: 8px; }

/* ---- Karten ---- */
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten);
  padding: 16px; margin: 0 0 14px; }
.karte h2 { font-size: 18px; margin: 0 0 10px; font-weight: 650; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--leise); margin: 18px 0 6px; font-weight: 600; }
.leise { color: var(--leise); }
.klein { font-size: 14px; }
p { margin: 6px 0 10px; }

/* ---- Formulare ---- */
label.feld { display: block; margin: 0 0 12px; }
label.feld > span { display: block; font-size: 14px; font-weight: 550; margin-bottom: 4px; }
label.feld > span em { font-style: normal; font-weight: 400; color: var(--leise); }
input[type=text], input[type=password], input[type=email], input[type=search], textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; font-size: 16px;
  background: var(--flaeche); border: 1px solid var(--linie-stark); border-radius: 10px; outline: none;
}
textarea { min-height: 64px; resize: vertical; }
input:focus, textarea:focus { border-color: var(--akzent); box-shadow: 0 0 0 3px var(--akzent-hell); }
.mit-auge { position: relative; }
.mit-auge input { padding-right: 84px; }
.mit-auge button { position: absolute; right: 4px; top: 4px; bottom: 4px; padding: 0 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--akzent); font-size: 14px; cursor: pointer; }
.feld-fehler input, .feld-fehler textarea { border-color: var(--rot); }
.meldung { margin: 8px 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--rot-hell); border: 1px solid var(--rot); font-size: 15px; }
.meldung.gut { background: var(--gut-hell); border-color: var(--gut); }
.meldung.info { background: var(--warn-hell); border-color: var(--warn); }
.honig { position: absolute; left: -9999px; }

.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 16px;
  border: 1px solid var(--linie-stark); border-radius: 10px; background: var(--flaeche); color: var(--text);
  font-size: 15px; font-weight: 550; text-decoration: none; cursor: pointer; }
.knopf.gold { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); }
.knopf.rot { background: transparent; border-color: var(--rot); color: var(--rot); }
.knopf.breit { width: 100%; }
.knopf.klein { min-height: 38px; padding: 6px 12px; font-size: 14px; }
.knopf:active { transform: translateY(1px); }
.knopf[disabled] { opacity: .5; cursor: default; }
.knopf:focus-visible, .link-knopf:focus-visible, .schalter input:focus-visible + span, .wahl button:focus-visible,
.reiter button:focus-visible, .konto > button.zeile:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
.link-knopf { background: none; border: 0; padding: 6px 0; color: var(--akzent); cursor: pointer; min-height: 36px; font-size: 14px; }
.knopfreihe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Schalter (wie am Handy gewohnt) */
.schalter { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 4px 0;
  cursor: pointer; border-bottom: 1px solid var(--linie); }
.schalter:last-child { border-bottom: 0; }
.schalter input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.schalter > span:first-of-type { order: 2; flex: none; width: 50px; height: 30px; border-radius: 15px; background: var(--linie-stark);
  position: relative; transition: background .15s; }
.schalter > span:first-of-type::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: left .15s; }
.schalter input:checked + span { background: var(--gut); }
.schalter input:checked + span::after { left: 23px; }
.schalter .beschr { order: 1; font-size: 16px; }
.schalter .beschr small { display: block; font-size: 13px; color: var(--leise); }
.schalter.angefragt .beschr::after { content: "gewünscht"; margin-left: 8px; font-size: 12px; padding: 2px 8px; border-radius: 999px;
  background: var(--warn-hell); color: var(--warn); font-weight: 600; }

/* Zweierwahl (Rolle) */
.wahl { display: flex; padding: 3px; gap: 3px; background: var(--flaeche-2); border: 1px solid var(--linie); border-radius: 10px; }
.wahl button { flex: 1; min-height: 40px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-size: 15px; }
.wahl button[aria-pressed=true] { background: var(--flaeche); box-shadow: var(--schatten); font-weight: 600; outline: 1px solid var(--linie); }
.wahl button[disabled] { opacity: .45; cursor: default; }

/* ---- Liste ---- */
.reiter { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; margin: 0 0 8px; scrollbar-width: none; }
.reiter button { flex: none; min-height: 38px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--linie-stark);
  background: var(--flaeche); cursor: pointer; font-size: 14px; font-weight: 550; }
.reiter button[aria-pressed=true] { background: var(--text); color: var(--grund); border-color: var(--text); }
.reiter .zahl { margin-left: 6px; }
.reiter .leise { margin-left: 4px; }
.suche { margin-bottom: 12px; }
.zahl { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--rot); color: #fff;
  font-size: 12px; line-height: 20px; font-weight: 700; text-align: center; }

.konto { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten);
  margin: 0 0 10px; overflow: hidden; }
.konto.wartet { border-color: var(--warn); }
.konto.gesperrt { opacity: .75; }
.konto > button.zeile { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 0;
  background: none; text-align: left; cursor: pointer; min-height: 60px; }
.konto .name { font-size: 16px; font-weight: 600; }
.konto .bn { font-size: 13px; color: var(--leise); }
.marken { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.marke { font-size: 12px; line-height: 20px; padding: 0 8px; border-radius: 999px; background: var(--akzent-hell); color: var(--akzent);
  font-weight: 600; white-space: nowrap; }
.marke.admin { background: var(--text); color: var(--grund); }
.marke.gesperrt { background: var(--rot-hell); color: var(--rot); }
.marke.wunsch { background: var(--warn-hell); color: var(--warn); }
.marke.taverne { background: var(--gut-hell); color: var(--gut); }
.marke.wartet { background: var(--warn); color: #fff; }
.konto .innen { padding: 4px 14px 14px; border-top: 1px solid var(--linie); }
.zitat { margin: 8px 0; padding: 8px 12px; border-radius: 8px; background: var(--flaeche-2); border-left: 3px solid var(--warn); }
.geraete { margin: 4px 0; padding: 0; list-style: none; font-size: 14px; }
.geraete li { padding: 3px 0; }
.linkfeld { margin: 12px 0; padding: 12px; border-radius: 10px; background: var(--gut-hell); border: 1px solid var(--gut); }
.linkfeld code { display: block; word-break: break-all; font: 13px/1.35 ui-monospace, SFMono-Regular, Consolas, monospace;
  background: var(--flaeche); padding: 8px; border-radius: 6px; margin: 6px 0; }
.leer { text-align: center; padding: 28px 10px; color: var(--leise); }

.versprechen { border-radius: 10px; background: var(--gut-hell); padding: 10px 14px; margin: 6px 0 14px; font-size: 15px; }
.versprechen h3 { margin-top: 2px; }
.versprechen ul { margin: 4px 0; padding-left: 20px; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); max-width: calc(100% - 32px); z-index: 20;
  padding: 10px 16px; border-radius: 10px; background: var(--text); color: var(--grund); font-size: 15px; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.toast.fehler { background: var(--rot); color: #fff; }

dialog { border: 0; padding: 0; background: transparent; width: min(560px, calc(100% - 24px)); max-height: calc(100% - 24px); }
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog .karte { margin: 0; max-height: calc(100vh - 40px); overflow-y: auto; }

.fuss { text-align: center; color: var(--leise); font-size: 14px; margin-top: 20px; }
.fuss a, .fuss .link-knopf { color: var(--leise); }
.bereiche { display: grid; gap: 8px; }

/* Akte: Steckbrief und Verlauf */
.steckbrief { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 15px; }
.steckbrief dt { color: var(--leise); }
.steckbrief dd { margin: 0; word-break: break-word; }
.verlauf { list-style: none; margin: 0; padding: 0; }
.verlauf li { padding: 8px 0; border-bottom: 1px solid var(--linie); font-size: 15px; }
.verlauf li:last-child { border-bottom: 0; }
/* Einträge ohne Aufklappen (Reiter „Ohne Konto“) */
.konto > div.zeile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 60px; }
@media (max-width: 420px) { .steckbrief { grid-template-columns: 1fr; gap: 0 0; } .steckbrief dd { margin-bottom: 8px; } }

/* Reiter „Post“: Roundcube eingebettet */
.post { display: block; width: 100%; height: calc(100vh - 170px); min-height: 420px; border: 1px solid var(--linie); border-radius: var(--radius); background: #fff; }
