:root {
  --tinte: #1d2433; --grau: #6b7280; --linie: #d9dde3; --flaeche: #f5f6f8; --weiss: #fff;
  --akzent: #1e5aa8; --akzent-hell: #e8f0fb; --warn: #b4232c; --warn-hell: #fbe9ea; --ok: #1f7a3a; --ok-hell: #e6f4ea;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; color: var(--tinte); background: var(--flaeche); }
a { color: var(--akzent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 .6rem; }
h1 small { font-size: .95rem; font-weight: normal; }
h2 { font-size: 1.1rem; margin: 1.6rem 0 .6rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
.grau { color: var(--grau); }
.mono { font-variant-numeric: tabular-nums; }
.mitte { text-align: center; }
.hinweis { color: var(--grau); font-size: .9rem; }
.warn { color: var(--warn); }

header.top { display: flex; align-items: center; justify-content: space-between; padding: .5rem 1.2rem; background: var(--weiss); border-bottom: 1px solid var(--linie); position: sticky; top: 0; z-index: 5; }
header .logo { font-weight: 600; color: var(--tinte); display: flex; align-items: center; gap: .6rem; }
header .logo img { height: 28px; }
header nav { display: flex; gap: 1.2rem; align-items: center; }
header nav .wer { color: var(--grau); }
main { max-width: 1100px; margin: 0 auto; padding: 1.2rem; }

.flash { padding: .6rem .9rem; border-radius: 6px; margin-bottom: 1rem; background: var(--ok-hell); color: var(--ok); }
.flash.fehler { background: var(--warn-hell); color: var(--warn); }

.kopfzeile { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.kopfzeile .rechts { margin-left: auto; position: relative; }
.aktionen { display: flex; gap: .5rem; align-items: center; }
.aktionen form { display: inline; }
.zurueck { color: var(--grau); font-weight: normal; }

.karte { background: var(--weiss); border: 1px solid var(--linie); border-radius: 8px; padding: 1rem 1.2rem; margin-bottom: 1rem; }
.karte.schmal { max-width: 420px; margin: 3rem auto; }
.karte.schwebend { position: absolute; right: 0; top: 2.4rem; width: min(520px, 90vw); z-index: 4; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.spalten { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.spalten.breit-links { grid-template-columns: 2fr 1fr; align-items: start; }
@media (max-width: 800px) { .spalten, .spalten.breit-links { grid-template-columns: 1fr; } }

label { display: block; margin: .5rem 0; font-size: .9rem; color: var(--grau); }
label.inline { display: inline-flex; align-items: center; gap: .35rem; margin-right: 1rem; color: var(--tinte); }
input, select, textarea { font: inherit; color: var(--tinte); width: 100%; padding: .45rem .55rem; border: 1px solid var(--linie); border-radius: 6px; background: var(--weiss); margin-top: .15rem; }
input[type=checkbox], input[type=radio] { width: auto; margin: 0; }
textarea { resize: vertical; }
.zeile { display: flex; gap: .8rem; flex-wrap: wrap; }
.zeile > label { flex: 1 1 180px; }
.zeile.klein { align-items: center; margin-top: .4rem; }
.zeile.klein label.inline { margin-right: .4rem; font-size: .85rem; color: var(--grau); }
.zeile.klein select, .zeile.klein input[type=date] { width: auto; padding: .25rem .4rem; margin: 0; font-size: .85rem; max-width: 170px; }
fieldset { border: 0; padding: 0; margin: 0; }
fieldset:disabled input, fieldset:disabled textarea, fieldset:disabled select { background: var(--flaeche); color: var(--tinte); }

button, .knopf { font: inherit; cursor: pointer; padding: .45rem .9rem; border-radius: 6px; border: 1px solid var(--linie); background: var(--weiss); color: var(--tinte); display: inline-block; }
button:hover, .knopf:hover { border-color: var(--akzent); text-decoration: none; }
.primaer { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.primaer:hover { background: #174a8c; }
.klein { padding: .25rem .6rem; font-size: .85rem; }
.leise { border-color: transparent; color: var(--grau); background: transparent; }
.leise:hover { color: var(--warn); border-color: var(--linie); }
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary.knopf { display: inline-block; }

.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--linie); margin: .6rem 0 1rem; }
.tabs a { padding: .5rem .9rem; color: var(--grau); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.aktiv { color: var(--tinte); border-color: var(--akzent); font-weight: 600; }

.pille { display: inline-block; padding: .1rem .55rem; border-radius: 999px; background: var(--akzent-hell); color: var(--akzent); font-size: .8rem; font-weight: 500; vertical-align: middle; }
.pille.ok { background: var(--ok-hell); color: var(--ok); }
.pille.warn { background: var(--warn-hell); color: var(--warn); }
.pille.extern { background: #fff4e0; color: #8a5a00; }
.pille.klein { font-size: .74rem; }

table.liste { width: 100%; border-collapse: collapse; background: var(--weiss); border: 1px solid var(--linie); border-radius: 8px; overflow: hidden; }
table.liste th { text-align: left; font-weight: 600; font-size: .82rem; color: var(--grau); padding: .5rem .7rem; background: var(--flaeche); }
table.liste td { padding: .45rem .7rem; border-top: 1px solid var(--linie); vertical-align: middle; }
table.liste td input, table.liste td select { margin: 0; padding: .3rem .45rem; }
table.liste tr.erledigt td { color: var(--grau); }
table.liste tr.erledigt a { color: var(--grau); }
table.liste tr.ueberfaellig td:nth-child(5) { color: var(--warn); font-weight: 600; }
table.liste .aktionen form { display: inline; }
table.teilnehmer td { padding: .25rem .5rem; }
.scrollbar { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 1rem; }
table.beteiligte td { font-size: .9rem; white-space: nowrap; }
table.beteiligte td:nth-child(3) { white-space: normal; min-width: 160px; }
table.beteiligte td.ordnen { white-space: nowrap; width: 1%; padding-right: 0; }
table.beteiligte td.ordnen form { display: inline; }
table.beteiligte td.aktionen { position: relative; width: 1%; }
details.bearbeiten summary { white-space: nowrap; }
details.bearbeiten .karte.schwebend { position: fixed; left: 50%; top: 15vh; transform: translateX(-50%); right: auto; width: min(640px, 92vw); text-align: left; white-space: normal; z-index: 20; }
details.bearbeiten .karte.schwebend .aktionen { margin-top: .6rem; }

.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.kachel { display: block; background: var(--weiss); border: 1px solid var(--linie); border-radius: 8px; padding: 1rem; color: var(--tinte); }
.kachel:hover { border-color: var(--akzent); text-decoration: none; }
.kachel.inaktiv { opacity: .6; }
.kachel .titel { font-weight: 600; font-size: 1.05rem; }
.kachel .zahlen { display: flex; gap: 1rem; margin-top: .6rem; font-size: .9rem; }
.plan-vorschau { width: 100%; height: 140px; object-fit: contain; background: var(--flaeche); border-radius: 4px; }
.plan-pdf { height: 140px; display: grid; place-items: center; background: var(--flaeche); color: var(--grau); border-radius: 4px; }
.logo-vorschau { display: flex; align-items: center; gap: 1rem; margin: .4rem 0; }
.logo-vorschau img { max-height: 48px; }

/* Punkte einer Ausgabe: Nr | Text | Verantwortlich, wie im Protokoll */
.punkt { display: grid; grid-template-columns: 72px 1fr 120px; gap: .8rem; background: var(--weiss); border: 1px solid var(--linie); border-top: 0; padding: .8rem; }
.punkt:first-of-type { border-top: 1px solid var(--linie); border-radius: 8px 8px 0 0; }
.punkt:last-of-type { border-radius: 0 0 8px 8px; margin-bottom: 1rem; }
.punkt.offen { background: #fcfcfd; }
.punkt.erledigt .titelzeile b { color: var(--grau); text-decoration: line-through; }
.punkt .nr b { font-size: 1.05rem; }
.punkt .kette { display: block; font-size: .72rem; color: var(--grau); line-height: 1.3; margin-top: .2rem; }
.punkt .titelzeile { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .3rem; }
.punkt .wer { font-size: .9rem; text-align: right; }
.punkt .ordnen { display: flex; gap: .1rem; justify-content: flex-end; margin-top: .5rem; }
.punkt .ordnen form { display: inline; }
.punkt .stand, .stand { white-space: pre-wrap; }
.eintrag-form textarea { margin: 0; }
.alt { color: var(--grau); font-style: italic; white-space: pre-wrap; font-size: .9rem; margin: .4rem 0; padding-left: .6rem; border-left: 2px solid var(--linie); }
.alt .kennung { font-style: normal; font-weight: 600; margin-right: .3rem; }
.historie { margin-top: .6rem; }
.verweis { color: var(--grau); font-size: .82rem; }
@media (max-width: 700px) { .punkt { grid-template-columns: 56px 1fr; } .punkt .wer { grid-column: 2; text-align: left; } }

.fotos { display: flex; flex-wrap: wrap; gap: .6rem; margin: .6rem 0; align-items: flex-start; }
.fotos figure { margin: 0; width: 160px; font-size: .78rem; color: var(--grau); }
.fotos img { width: 160px; height: 120px; object-fit: cover; border-radius: 4px; border: 1px solid var(--linie); display: block; }
.fotos .anlage { display: grid; place-items: center; width: 160px; height: 120px; background: var(--flaeche); border-radius: 4px; padding: .4rem; text-align: center; word-break: break-all; }
.pins { display: flex; flex-wrap: wrap; gap: .2rem; margin: .2rem 0; }
.pins form, .pille form { display: inline; }
.pille .x, .pille button.x { border: 0; background: transparent; padding: 0 0 0 .3rem; color: inherit; cursor: pointer; font-size: .8rem; }
.pille.leise { background: var(--flaeche); color: var(--grau); }
.versionen { display: flex; flex-wrap: wrap; gap: .2rem .4rem; align-items: center; margin-top: .4rem; }
.versionen form { display: inline; }
.mitnummer { position: relative; display: block; }
.fotonr { position: absolute; left: 4px; top: 4px; background: var(--akzent); color: #fff; font-weight: 700; font-size: .8rem; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.fotos.skizzen { border-top: 1px dashed var(--linie); padding-top: .5rem; }
.fotos figure.skizze { width: 240px; }
.fotos figure.skizze img { width: 240px; height: auto; max-height: 240px; object-fit: contain; background: #fff; }
.planwahl { display: flex; gap: .4rem; align-items: center; }
.foto-form { display: flex; flex-direction: column; gap: .2rem; margin-top: .2rem; }
.foto-form input, .foto-form select { padding: .2rem .35rem; font-size: .78rem; margin: 0; }
.fotos figure form:last-child { text-align: right; }
.upload { align-self: center; }

.stand-karte { background: var(--weiss); border: 1px solid var(--linie); border-radius: 8px; padding: .8rem 1rem; margin-bottom: .8rem; }
.stand-karte.extern { border-left: 4px solid #e0a030; }
.stand-karte .kopf { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: .4rem; }

.funktionen { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .15rem .6rem; margin: .2rem 0 .6rem; }
.funktionen label.inline { margin: 0; font-size: .88rem; }

/* gesperrte Aktionen: sichtbar, aber ausgegraut; Klick zeigt den Grund */
.knopf.gesperrt, button.gesperrt { opacity: .45; cursor: not-allowed; background: var(--flaeche); color: var(--grau); border-color: var(--linie); }
.hinweisbox { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); background: var(--tinte); color: #fff; padding: .7rem 1rem; border-radius: 8px; max-width: min(520px, 92vw); box-shadow: 0 6px 20px rgba(0,0,0,.25); z-index: 50; font-size: .95rem; }

table.beteiligte td.zugang { white-space: normal; min-width: 170px; position: relative; }
table.beteiligte td.zugang details { display: inline-block; margin-left: .3rem; }
table.beteiligte td.zugang .karte.schwebend { text-align: left; white-space: normal; }

tr.bt-zeile { cursor: pointer; }
tr.bt-zeile:hover td { background: #fafbfd; }
tr.bt-zeile.aktiv td { background: var(--akzent-hell); }

pre.plankopf { max-height: 220px; overflow: auto; background: var(--flaeche); padding: .5rem; font-size: .75rem; white-space: pre-wrap; }

/* Startseite (nicht angemeldet) */
.start { margin: -1.2rem calc(50% - 50vw) 0; }
.start-held { position: relative; background: #1e5aa8; color: #fff; overflow: hidden; }
.start-bild { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; }
.start-held::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20,42,78,.78) 0%, rgba(20,42,78,.55) 50%, rgba(20,42,78,.12) 100%), linear-gradient(180deg, rgba(20,42,78,.35) 0%, rgba(20,42,78,0) 60%); }
.start-held-innen { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 3rem 1.2rem 5rem; display: grid; grid-template-columns: 1.4fr 1fr; gap: 2.4rem; align-items: start; }
.start-ueber { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; opacity: .85; margin: 0 0 .6rem; }
.start-text h1 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); line-height: 1.15; margin: 0 0 1rem; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.start-satz { font-size: 1.05rem; line-height: 1.5; max-width: 42rem; margin: 0 0 1.2rem; }
.start-merkmale { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; max-width: 42rem; }
.start-merkmale li { padding-left: 1.4rem; position: relative; font-size: .95rem; line-height: 1.4; }
.start-merkmale li::before { content: ""; position: absolute; left: 0; top: .45em; width: .7rem; height: .7rem; border-radius: 50%; background: #e8762b; box-shadow: 0 0 0 3px rgba(232,118,43,.3); }
.start-login { color: var(--tinte); margin: 0; box-shadow: 0 16px 40px rgba(0,0,0,.28); padding: 1.3rem 1.4rem 1.1rem; }
.start-login h2 { margin: 0 0 .4rem; }
.start-login .breit { width: 100%; margin-top: .6rem; padding: .6rem; }
.start-login .hinweis { margin: .9rem 0 0; }
.start-ablauf { max-width: 1100px; margin: 0 auto; padding: 2.4rem 1.2rem 1rem; }
.start-ablauf h2 { margin-top: 0; }
.start-ablauf ol { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.start-ablauf li { background: var(--weiss); border: 1px solid var(--linie); border-radius: 8px; padding: 1rem; display: flex; gap: .8rem; align-items: flex-start; font-size: .93rem; line-height: 1.4; }
.start-ablauf li span { flex: none; width: 2rem; height: 2rem; border-radius: 50%; background: var(--akzent); color: #fff; display: grid; place-items: center; font-weight: 600; }
.start-fuss { max-width: 1100px; margin: 1.5rem auto 0; padding: 1rem 1.2rem 2rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; color: var(--grau); font-size: .85rem; border-top: 1px solid var(--linie); }
@media (max-width: 900px) {
  .start-held-innen { grid-template-columns: 1fr; padding: 2rem 1.2rem 2.4rem; }
  .start-login { order: -1; }  /* auf iPad hochkant und Handy: Anmeldung zuerst, Beschreibung darunter */
  .start-ablauf ol { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) { .start-ablauf ol { grid-template-columns: 1fr; } }
