/* =====================================================================
   lab - werkzeuge/messplatz/app.css
   Messwerte-Labor: Freigabeleiste, Live-Kurve mit Kanalwahl und
   Auswertung der aufgezeichneten Messreihe.
   Konventionen (AGENTS.md §5):
     - Alle Klassen mit Prefix .lab_ (hier .lab_mp_ fuer Messplatz)
     - Keine harten Farben, nur Variablen aus css/colors.css
   ===================================================================== */

/* ---------- Freigabeleiste ---------- */
.lab_mp_leiste {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1rem;
  padding: 0.7rem 0.8rem;
  background: var(--ct-color);
  border: var(--lab-border);
  border-radius: 12px;
  box-shadow: var(--lab-shadow-1);
}

.lab_mp_meldung {
  margin: 0;
  flex: 1 1 12rem;
}

.lab_mp_meldung:empty {
  display: none;
}

/* ---------- Arbeitsfeld ---------- */
.lab_mp_layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
}

@media (min-width: 62rem) {
  .lab_mp_layout {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  }
}

.lab_mp_karte {
  background: var(--ct-color);
  border: var(--lab-border);
  border-radius: 14px;
  padding: 1rem 1.1rem 1.1rem;
  box-shadow: var(--lab-shadow-1);
  min-width: 0;
}

.lab_mp_kopfzeile {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}

.lab_mp_kopfzeile h2 {
  font-size: 1rem;
  margin: 0;
}

/* ---------- Kanalwahl ---------- */
.lab_mp_kanalwahl {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  margin: 0 0 0.7rem;
  padding: 0.4rem 0.6rem;
  border: var(--lab-border);
  border-radius: 9px;
  background: var(--alt-div-color);
}

.lab_mp_wahl {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.92rem;
  white-space: nowrap;
}

/* ---------- Buehne mit Kurve ---------- */
.lab_mp_buehne {
  position: relative;
  border: var(--lab-border);
  border-radius: 10px;
  background: var(--div-color);
  overflow: hidden;
}

#mp_kurve {
  display: block;
  width: 100%;
  height: 16rem;
}

.lab_mp_leerhinweis {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem 1.4rem;
  margin: 0;
  color: var(--grey600-color);
  background: var(--div-color);
}

/* ---------- Großer Wert ---------- */
.lab_mp_wert {
  margin: 0.7rem 0 0;
  font-size: 1rem;
}

.lab_mp_wert strong {
  font-family: var(--lab-mono);
  font-size: 1.7rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.lab_mp_wert_zusatz {
  margin: 0.1rem 0 0;
}

/* ---------- Messreihe: Eingaben und Knöpfe ---------- */
.lab_mp_reihe {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 0.7rem;
}

.lab_mp_feld {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.92rem;
  font-weight: 600;
  flex: 1 1 10rem;
  min-width: 0;
}

.lab_mp_feld input,
.lab_mp_feld select {
  font-weight: 400;
}

.lab_mp_knopfzeile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

/* ---------- Statistik ---------- */
.lab_mp_statistik {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0.9rem;
}

.lab_mp_statistik th,
.lab_mp_statistik td {
  text-align: left;
  padding: 0.35rem 0.5rem;
  border-bottom: var(--lab-border);
  font-size: 0.92rem;
}

.lab_mp_statistik th {
  font-weight: 600;
  color: var(--grey600-color);
  width: 55%;
}

.lab_mp_statistik td {
  font-family: var(--lab-mono);
  text-align: right;
  white-space: nowrap;
}

.lab_mp_statistik tr:last-child th,
.lab_mp_statistik tr:last-child td {
  border-bottom: 0;
}

/* ---------- Wertetabelle ---------- */
.lab_mp_tabelle {
  max-height: 18rem;
  overflow: auto;
  border: var(--lab-border);
  border-radius: 10px;
}

.lab_mp_werte {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.lab_mp_werte th,
.lab_mp_werte td {
  text-align: right;
  padding: 0.28rem 0.6rem;
  border-bottom: var(--lab-border);
  font-family: var(--lab-mono);
  white-space: nowrap;
}

.lab_mp_werte thead th {
  position: sticky;
  top: 0;
  background: var(--ct-color);
  font-weight: 700;
}

.lab_mp_werte tbody tr:last-child td {
  border-bottom: 0;
}

.lab_mp_leerzeile td {
  text-align: center;
  color: var(--grey600-color);
  font-family: var(--lab-font);
}

/* ---------- Hinweise ---------- */
.lab_mp_hilfe {
  margin-top: 1rem;
  background: var(--ct-color);
  border: var(--lab-border);
  border-radius: 12px;
  padding: 0.8rem 1.1rem;
  box-shadow: var(--lab-shadow-1);
}

.lab_mp_hilfe summary {
  cursor: pointer;
  font-weight: 600;
}

.lab_mp_hilfetext {
  margin: 0.7rem 0 0.2rem;
  padding-left: 1.2rem;
}

.lab_mp_hilfetext li {
  margin-bottom: 0.35rem;
}

/* ---------- Kleine Schirme ---------- */
@media (max-width: 30rem) {
  .lab_mp_karte {
    padding: 1rem 1rem 1.1rem;
  }
  #mp_kurve {
    height: 12rem;
  }
  .lab_mp_wert strong {
    font-size: 1.4rem;
  }
}

/* ---------- Drucken: Protokoll mit Kurve und Auswertung ---------- */
@media print {
  .lab_mp_leiste,
  .lab_mp_knopfzeile,
  .lab_mp_hilfe,
  .lab_mp_reihe {
    display: none !important;
  }
  .lab_mp_layout {
    display: block;
  }
  .lab_mp_karte {
    border: 0;
    box-shadow: none;
    padding: 0;
  }
  .lab_mp_tabelle {
    max-height: none;
    overflow: visible;
  }
}

/* ------------------------------------------------------------------
   Nachfrage-Dialog (statt Browser-Dialog)
   ------------------------------------------------------------------ */
.lab_mp_frage {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.lab_mp_frage[hidden] { display: none; }

.lab_mp_frage_kasten {
  width: 100%;
  max-width: 26rem;
  background: var(--ct-color);
  color: var(--blk-color);
  border: var(--lab-border);
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
  box-shadow: var(--lab-shadow-2);
}
.lab_mp_frage_kasten h2 { font-size: 1.1rem; margin: 0 0 0.4rem; }
.lab_mp_frage_kasten p { margin: 0 0 0.9rem; }
.lab_mp_frage_reihe {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}
