/*
 * Aufnahmeoberflaeche, Stufe 1.
 * V2.4.1 Kap. 31.3 (Tabletbedienung), Festlegungen P1-4 und P1-12.
 *
 * Die Regeln, die hier alles bestimmen, kommen nicht aus dem Geschmack,
 * sondern aus dem Einsatzfall — stehend, mit dem Finger, oft im Halbdunkel:
 *   - Hauptziele 56 px hoch, Mindestmass 44 px;
 *   - keine Wirkung haengt an :hover, weil ein Finger nicht schwebt;
 *   - keine kleinen Kontrollkaestchen: geschaltet wird der ganze Streifen;
 *   - uebernommene Werte sehen anders aus als erfasste (Kap. 20.3).
 */

:root {
  --treffer-gross: 56px;
}

/* ---------------------------------------------------------- Kopfbereich */

.kopf-oben {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.kopf-oben h1 { flex: 1; margin: 0; }
.kopf-rechts { display: flex; align-items: center; gap: 10px; }

.speicherstand {
  font-size: 14px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ok) 14%, transparent);
  color: var(--ok);
  white-space: nowrap;
}
.speicherstand.fehler {
  background: color-mix(in srgb, var(--fehler) 16%, transparent);
  color: var(--fehler);
}

.pfad {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 8px 0 4px;
}
.pfad-teil {
  font: inherit;
  font-size: 15px;
  background: none;
  border: 0;
  padding: 6px 4px;
  min-height: var(--treffer);
  color: var(--akzent);
  text-decoration: underline;
  cursor: pointer;
}
.pfad-teil.aktuell {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}
.pfad-trenner { color: var(--ink-schwach); }

/* ------------------------------------------------------------- Listen */

.liste { display: flex; flex-direction: column; gap: 1px; background: var(--linie); border: 1px solid var(--linie); border-radius: var(--radius); overflow: hidden; }
.liste:empty { display: none; }

.zeile-knopf {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: var(--treffer-gross);
  padding: 12px 14px;
  background: var(--flaeche);
  border: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.zeile-knopf:active { background: color-mix(in srgb, var(--akzent) 10%, var(--flaeche)); }
.zeile-knopf:focus-visible { outline: 3px solid var(--akzent); outline-offset: -3px; }

.zeile-haupt { font-weight: 600; flex: 1; min-width: 0; }
.zeile-neben { color: var(--ink-schwach); font-size: 14px; }

.raumzeile { display: grid; grid-template-columns: 5.5rem 1fr auto auto; gap: 10px; align-items: center; }
.raum-nr { font-weight: 700; font-variant-numeric: tabular-nums; }
.raum-nr.gross { font-size: 26px; }

.leerhinweis {
  margin: 0;
  padding: 16px 14px;
  background: var(--flaeche);
  color: var(--ink-schwach);
}

/* --------------------------------------------------------- Werkzeuge */

.werkzeugleiste {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.suchfeld {
  flex: 1 1 240px;
  min-height: var(--treffer-gross);
  padding: 10px 14px;
  font: inherit;
  font-size: 17px;
  color: var(--ink);
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  min-height: var(--treffer);
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--linie);
  background: var(--flaeche);
  color: var(--ink-schwach);
  cursor: pointer;
}
.chip.an { background: var(--akzent); border-color: var(--akzent); color: var(--grund); }

.fortschritt {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 10px;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
}
.balken {
  flex: 1 1 160px;
  max-width: 320px;
  height: 8px;
  border-radius: 999px;
  background: var(--linie);
  overflow: hidden;
}
.balken i { display: block; height: 100%; background: var(--ok); }
.leise { color: var(--ink-schwach); font-size: 14px; }

/* ------------------------------------------------------------ Pillen */

.pille {
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  background: color-mix(in srgb, var(--ink-schwach) 14%, transparent);
  color: var(--ink-schwach);
}
.pille-ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.pille-warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }

/* ----------------------------------------------------------- Raumkopf */

.raumkopf {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: var(--abstand);
}
.raumkopf-titel {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.raum-name { font-size: 18px; font-weight: 600; }

.felder {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--linie);
  border: 1px solid var(--linie);
  border-radius: 6px;
  overflow: hidden;
}
.feld { background: var(--flaeche); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.feld-bez { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-schwach); }
.feld-wert { font-size: 17px; font-weight: 600; }
.feld-herkunft { font-size: 12px; color: var(--ink-schwach); font-style: italic; }

/*
 * Der wichtigste Unterschied auf dieser Seite: ein uebernommener Wert darf
 * nie aussehen wie ein gemessener (Kap. 20.3). Deshalb blasser gesetzt und
 * mit Herkunftszeile — nicht als Verzierung, sondern als Aussage.
 */
.feld.uebernommen .feld-wert { font-weight: 500; color: var(--ink-schwach); }

/* -------------------------------------------------------- Vollstaendigkeit */

.befunde h3 { font-size: 15px; margin: 12px 0 6px; }
.befundliste { margin: 0 0 8px; padding-left: 20px; }
.befundliste li { margin-bottom: 3px; }
.befundliste.luecke li { color: var(--warn); }
.befundliste.hinweis li { color: var(--ink-schwach); }

.spaeter {
  padding: 14px;
  margin-bottom: var(--abstand);
  border: 1px dashed var(--linie);
  border-radius: var(--radius);
  color: var(--ink-schwach);
}
.spaeter h3 { margin: 0 0 6px; font-size: 15px; color: var(--ink); }

/* --------------------------------------------------------- Formulare */

.formular { display: flex; flex-direction: column; gap: 14px; }
.formzeile { display: flex; flex-direction: column; gap: 4px; }
.formzeile label { font-weight: 600; font-size: 15px; }
.formzeile input,
.formzeile select {
  min-height: var(--treffer-gross);
  padding: 10px 14px;
  font: inherit;
  font-size: 17px;
  color: var(--ink);
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
}
.formzeile input:focus-visible,
.formzeile select:focus-visible { outline: 3px solid var(--akzent); outline-offset: 1px; }
.feldhinweis { font-size: 13px; color: var(--ink-schwach); }

button.gross {
  min-height: var(--treffer-gross);
  font-size: 17px;
  padding: 0 20px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ------------------------------------------------- Zeilenmenue und Papierkorb */

/*
 * Das Loeschen eines Projekts liegt hinter dem `⋮`. Ein dauerhaft sichtbarer
 * Loeschknopf neben einer Zeile wird auf einem Tablet frueher oder spaeter
 * getroffen, ohne dass jemand es wollte — und ein Projekt ist die groesste
 * Einheit, die hier verloren gehen kann.
 */
.zeile-mit-menue {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  background: var(--flaeche);
}
.zeile-mit-menue .zeile-knopf { grid-column: 1; }

.menue-knopf {
  grid-column: 2;
  min-width: var(--treffer-gross);
  min-height: var(--treffer-gross);
  font-size: 22px;
  line-height: 1;
  background: none;
  border: 0;
  border-left: 1px solid var(--linie);
  color: var(--ink-schwach);
  cursor: pointer;
}
.menue-knopf:focus-visible { outline: 3px solid var(--akzent); outline-offset: -3px; }

.zeilenmenue {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--ink-schwach) 8%, var(--flaeche));
  border-top: 1px solid var(--linie);
}
.menue-eintrag,
.knopf-klein {
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  min-height: var(--treffer);
  padding: 8px 14px;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  background: var(--flaeche);
  color: var(--ink);
  cursor: pointer;
}
.warnend { color: var(--fehler); border-color: color-mix(in srgb, var(--fehler) 45%, var(--linie)); }
button.gross.warnend { background: var(--fehler); border-color: var(--fehler); color: var(--grund); }

.papierkorb-zeile {
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  padding: 12px 14px;
}
.zeile-text { display: flex; flex-direction: column; min-width: 0; }

/* --------------------------------------------------------- Sicherheitsabfrage */

dialog.abfrage {
  max-width: 34rem;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  background: var(--flaeche);
  color: var(--ink);
  padding: 20px;
}
dialog.abfrage::backdrop { background: rgba(0, 0, 0, .45); }
dialog.abfrage h2 { margin: 0 0 10px; font-size: 20px; }
.abfrage-knoepfe { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.abfrage-knoepfe button { flex: 1 1 auto; }

/* Das Fehlerbanner traegt jetzt auch Handlungen (z. B. "Wiederherstellen"). */
.banner button { margin-left: 10px; }

/* ------------------------------------------------------- Stufe 2: Raumkopf */

/*
 * Die drei Flaechenquellen nebeneinander. Sie sollen sichtbar drei sein und
 * nicht eine mit Zusatz: ein Planwert und ein Messwert widersprechen einander
 * manchmal, und dann ist der Widerspruch die Information.
 */
.quellen {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--linie);
  border: 1px solid var(--linie);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 16px;
}
.quelle {
  background: var(--flaeche);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.quelle.massgebend {
  background: color-mix(in srgb, var(--ok) 10%, var(--flaeche));
  box-shadow: inset 3px 0 0 var(--ok);
}

.bereichszeile {
  background: var(--flaeche);
  padding: 12px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.bereich-name { font-weight: 600; min-width: 7rem; }
.bereichszeile .zeichen { font-size: 17px; width: 1.5rem; text-align: center; }
.zeichen-vorhanden { color: var(--ok); }
.zeichen-keine { color: var(--ink-schwach); }
.zeichen-pruefen { color: var(--warn); }
.zeichen-unbearbeitet { color: var(--linie); }
.bereichszeile .chips { margin-left: auto; }
.frage { margin: 14px 0 6px; font-weight: 600; font-size: 15px; }
