:root {
  --teal: #1D9D9E; --teal-tief: #157F80; --gelb: #FFD41F; --rot: #c0392b;
  --bg: #eef2f2; --panel: #ffffff; --fg: #1f2a2a; --muted: #5b6566; --line: #d3dcdc; --chip: #eef3f3;
  --font: Verdana, Geneva, "DejaVu Sans", sans-serif;
  --kopf: 52px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 14px/1.45 var(--font); }
[hidden] { display: none !important; }
h1 { font-size: 1.25rem; margin: 0 0 .6rem; }
h2 { font-size: 1.05rem; margin: 1.6rem 0 .4rem; }
h3 { font-size: .95rem; margin: 0 0 .5rem; }
p { margin: .4rem 0; }
.klein { font-size: .85rem; color: var(--muted); }
a { color: var(--teal-tief); }

/* Kopf */
.kopf { position: sticky; top: 0; z-index: 50; min-height: var(--kopf); background: var(--teal); color: #fff; display: flex; align-items: center; gap: .7rem; padding: .35rem 14px; flex-wrap: wrap; }
.marke { font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.marke::after { content: ""; display: inline-block; width: .45rem; height: .45rem; border-radius: 50%; background: var(--gelb); margin-left: .3rem; vertical-align: .1rem; }
.fassung-wahl { max-width: 20rem; min-width: 0; flex: 0 1 auto; }
.status { font-size: .8rem; background: rgba(255,255,255,.2); border-radius: 999px; padding: .15rem .6rem; white-space: nowrap; }
.status.archiv { background: var(--gelb); color: #1f2a2a; }
.reiter { display: flex; gap: .25rem; margin-left: auto; }
.reiter button { font: inherit; color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.45); border-radius: 6px; padding: .3rem .7rem; cursor: pointer; }
.reiter button.aktiv { background: #fff; color: var(--teal-tief); border-color: #fff; font-weight: 700; }
.ich { font-size: .85rem; white-space: nowrap; }
.hilfe { font: inherit; font-weight: 700; color: #1f2a2a; background: var(--gelb); border: 0; width: 1.8rem; height: 1.8rem; border-radius: 50%; cursor: pointer; flex: none; }

select, input[type=text], textarea { font: inherit; color: var(--fg); background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: .35rem .5rem; }
textarea { width: 100%; resize: vertical; min-height: 4.2rem; }
select:focus-visible, input:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid var(--teal-tief); outline-offset: 1px; }
.knopf { font: inherit; color: #fff; background: var(--teal-tief); border: 1px solid var(--teal-tief); border-radius: 6px; padding: .4rem .8rem; cursor: pointer; }
.knopf:hover { background: var(--teal); }
.knopf.klein { padding: .2rem .55rem; }
.knopf.hell { color: var(--teal-tief); background: #fff; border-color: var(--line); }
.knopf.hell:hover { background: var(--chip); }
.knopf.rot { color: var(--rot); background: #fff; border-color: var(--line); }
.knopf:disabled { opacity: .5; cursor: default; }
.zeile { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.zeile input[type=text] { flex: 1 1 12rem; min-width: 0; }
.schalter { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; cursor: pointer; }

.meldung { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 200; max-width: min(92vw, 34rem); background: #1f2a2a; color: #fff; border-radius: 8px; padding: .6rem 1rem; box-shadow: 0 6px 24px rgba(0,0,0,.3); }
.meldung.fehler { background: var(--rot); }

.karte { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; margin: 16px auto; padding: 18px 20px; max-width: 1080px; }
.karte.schmal { max-width: 620px; }
.kasten { border: 1px solid var(--line); border-radius: 8px; padding: .8rem 1rem; margin: .8rem 0; background: #fafcfc; }

/* Seitenansicht */
.seiten { display: grid; grid-template-columns: 132px minmax(0, 1fr) 330px; height: calc(100vh - var(--kopf)); height: calc(100dvh - var(--kopf)); }
.leiste { overflow-y: auto; padding: 8px; background: #e2e8e8; border-right: 1px solid var(--line); }
.daumen { display: block; width: 100%; background: transparent; border: 2px solid transparent; border-radius: 6px; padding: 4px; margin-bottom: 4px; cursor: pointer; text-align: center; font: inherit; color: var(--fg); position: relative; }
.daumen img { display: block; max-width: 100%; max-height: 92px; margin: 0 auto 2px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); min-height: 40px; }
.daumen.aktiv { border-color: var(--teal-tief); background: #fff; }
.daumen .nr { font-size: .78rem; color: var(--muted); }
.daumen .zahl { position: absolute; top: 0; right: 0; min-width: 1.35rem; height: 1.35rem; border-radius: 999px; background: var(--teal-tief); color: #fff; font-size: .75rem; line-height: 1.35rem; padding: 0 .3rem; }
.daumen .zahl.fertig { background: #9aa8a8; }
.daumen .neu { position: absolute; top: 0; left: 0; width: .7rem; height: .7rem; border-radius: 50%; background: var(--rot); border: 2px solid #e2e8e8; }

.buehne { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.werkzeug { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .4rem .7rem; background: var(--panel); border-bottom: 1px solid var(--line); }
.seiten-titel { font-weight: 700; min-width: 9.5rem; text-align: center; }
.zoom-wert { min-width: 3.4rem; text-align: center; font-size: .85rem; color: var(--muted); }
.trenner { width: 1px; height: 1.3rem; background: var(--line); margin: 0 .2rem; }
.hinweis { font-size: .82rem; color: var(--muted); margin-left: auto; }
.rahmen { flex: 1; overflow: auto; background: #6f7b7b; cursor: crosshair; min-height: 0; }
.rahmen.zieht { cursor: grabbing; }
.rahmen.nur-lesen { cursor: default; }
.blatt { position: relative; margin: 12px auto; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.4); user-select: none; -webkit-user-select: none; }
.blatt img { display: block; width: 100%; height: 100%; }
.blatt.laedt::after { content: "Seite wird geladen …"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); background: #fff; }

/* Zettel-Marke auf der Seite */
.pin { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border: 1px solid rgba(0,0,0,.35); border-radius: 3px 3px 8px 3px; box-shadow: 1px 2px 4px rgba(0,0,0,.45); font: 700 10px/24px var(--font); color: #1f2a2a; text-align: center; cursor: pointer; padding: 0; }
.pin:hover { transform: scale(1.12); z-index: 3; }
.pin.gewaehlt { outline: 3px solid var(--teal-tief); outline-offset: 2px; z-index: 4; }
.pin.erledigt { opacity: .55; filter: grayscale(.7); }
.pin.eigen { touch-action: none; }
.pin.entwurf { outline: 3px dashed var(--teal-tief); outline-offset: 2px; z-index: 4; }
.pin .neu, .eintrag .neu { position: absolute; top: -5px; right: -5px; width: 11px; height: 11px; border-radius: 50%; background: var(--rot); border: 2px solid #fff; }

/* Liste rechts */
.panel { overflow-y: auto; background: var(--panel); border-left: 1px solid var(--line); padding: 10px 12px; }
.panel h2 { margin: .2rem 0 .6rem; font-size: .95rem; }
.eintrag { position: relative; display: block; width: 100%; text-align: left; font: inherit; color: var(--fg); background: #fff; border: 1px solid var(--line); border-left-width: 6px; border-radius: 6px; padding: .45rem .6rem; margin-bottom: .5rem; cursor: pointer; }
.eintrag:hover, .eintrag.gewaehlt { background: var(--chip); }
.eintrag.gewaehlt { box-shadow: 0 0 0 2px var(--teal-tief); }
.eintrag.erledigt { opacity: .65; }
.eintrag .wer { font-size: .8rem; color: var(--muted); display: flex; gap: .4rem; justify-content: space-between; }
.eintrag .text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; }
.eintrag .fuss { font-size: .8rem; color: var(--muted); margin-top: .15rem; }
.leer-text { color: var(--muted); font-size: .88rem; }

/* schwebender Zettel */
.zettel { position: fixed; z-index: 100; width: 330px; max-width: calc(100vw - 16px); max-height: min(78vh, 640px); overflow-y: auto; background: #fffdf2; border: 1px solid rgba(0,0,0,.25); border-top: 10px solid #FFE066; border-radius: 4px 4px 14px 4px; box-shadow: 3px 6px 22px rgba(0,0,0,.4); padding: .6rem .8rem .8rem; }
.zettel .kopfzeile { display: flex; align-items: flex-start; gap: .5rem; margin-bottom: .35rem; }
.zettel .wer { flex: 1; min-width: 0; }
.zettel .wer b { display: block; overflow-wrap: anywhere; }
.zettel .wer span { font-size: .8rem; color: var(--muted); }
.zettel .zu { font: inherit; font-size: 1.2rem; line-height: 1; background: transparent; border: 0; cursor: pointer; color: var(--muted); padding: .1rem .3rem; }
.zettel .text { white-space: pre-wrap; overflow-wrap: anywhere; margin: .2rem 0 .5rem; }
.zettel .erledigt-zeile { font-size: .85rem; background: #e6f4ea; border-radius: 6px; padding: .3rem .5rem; margin: .4rem 0; }
.zettel .antwort { border-top: 1px dashed rgba(0,0,0,.2); padding: .4rem 0 .2rem; }
.zettel .antwort .wer { font-size: .8rem; color: var(--muted); display: flex; gap: .4rem; align-items: center; }
.zettel .antwort .wer b { display: inline; color: var(--fg); }
.zettel .knoepfe { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.zettel .mini { font: inherit; font-size: .8rem; color: var(--teal-tief); background: transparent; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.punkt { display: inline-block; width: 1.5rem; height: 1.5rem; border-radius: 3px 3px 7px 3px; border: 1px solid rgba(0,0,0,.3); font: 700 10px/1.4rem var(--font); text-align: center; color: #1f2a2a; flex: none; }

/* Liste aller Zettel */
.listen-kopf { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: baseline; justify-content: space-between; margin-bottom: .6rem; }
.liste-seite { margin: 1.1rem 0 .4rem; padding-bottom: .2rem; border-bottom: 2px solid var(--teal); font-weight: 700; }
.liste-zeile { display: grid; grid-template-columns: 1.7rem minmax(0, 1fr) auto; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid var(--line); break-inside: avoid; }
.liste-zeile .wer { font-size: .82rem; color: var(--muted); }
.liste-zeile .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.liste-zeile .antw { margin: .25rem 0 0 .8rem; padding-left: .6rem; border-left: 2px solid var(--line); font-size: .92rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.liste-zeile.erledigt .text { color: var(--muted); }
.marke-erledigt { font-size: .8rem; background: #e6f4ea; border-radius: 999px; padding: .1rem .5rem; white-space: nowrap; }

/* Tabellen der Organisation */
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .82rem; color: var(--muted); font-weight: 400; }
td input[type=text] { width: 100%; min-width: 6rem; }
td.aktionen { white-space: nowrap; }
td.aktionen .knopf { margin: 1px 0; }
.gesperrt td { color: var(--muted); }
.tab-rahmen { overflow-x: auto; }

.hilfe-dialog { max-width: 36rem; border: 1px solid var(--line); border-radius: 10px; padding: 1.1rem 1.3rem; font: inherit; color: var(--fg); }
.hilfe-dialog::backdrop { background: rgba(0,0,0,.4); }
.hilfe-dialog h2 { margin-top: 0; }
.hilfe-dialog li { margin: .35rem 0; }

@media (max-width: 900px) {
  .seiten { display: block; height: auto; }
  .leiste { display: flex; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--line); padding: 6px; gap: 4px; }
  .daumen { width: 84px; flex: none; margin: 0; }
  .daumen img { max-height: 60px; }
  .rahmen { height: 62vh; flex: none; }
  .panel { border-left: 0; border-top: 1px solid var(--line); }
  .hinweis { display: none; }
  .karte { margin: 10px 8px; padding: 14px; }
  .reiter { margin-left: 0; }
}
@media (max-width: 700px) {
  .zettel { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: auto; max-width: none; max-height: 70vh; border-radius: 12px 12px 0 0; }
}
@media print {
  .kopf, .nicht-drucken, .zettel, .meldung { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .karte { border: 0; margin: 0; padding: 0; max-width: none; }
}
