/* Inlay-Scanner — Farb- und Formensprache bewusst identisch zum LED-Planer,
   AV-Rechner und Signalflow-Konfigurator, damit die eigenen Tools als eine
   Familie erkennbar bleiben. Schrift DM Sans, örtlich ausgeliefert
   (schrift/dm-sans.css). */
:root {
  --bg: #f4f5f7;
  --flaeche: #ffffff;
  --flaeche-2: #f8f9fb;
  --rand: #d6d9de;
  --rand-stark: #b3b8c0;
  --text: #1f2328;
  --leise: #6b727c;
  --primaer: #2f6fb5;
  --primaer-text: #ffffff;
  --gefahr: #c0392b;
  --ok-bg: #eef6ee;
  --ok-rand: #7fae7f;
  --warn-bg: #fdf3e3;
  --warn-rand: #e0b054;
  --fehler-bg: #fdecea;
  --fehler-rand: #d9534f;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1d21;
    --flaeche: #24272c;
    --flaeche-2: #1f2226;
    --rand: #3a3f46;
    --rand-stark: #50565e;
    --text: #e6e8ea;
    --leise: #9aa1aa;
    --primaer: #4b8fd6;
    --ok-bg: #21301f;
    --ok-rand: #4d7a4d;
    --warn-bg: #3a2f1c;
    --warn-rand: #8a6b2a;
    --fehler-bg: #3a2320;
    --fehler-rand: #a4453f;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 "DM Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

.versteckt, [hidden] { display: none !important; }
.luecke { flex: 1; }
.mini { font-size: 12px; color: var(--leise); }
.leise { color: var(--leise); }

/* ---------- Kopf ---------- */
.kopf {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--flaeche);
  border-bottom: 1px solid var(--rand);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
}
.kopf h1 { font-size: 17px; margin: 0; font-weight: 600; white-space: nowrap; }
.kopf nav { display: flex; gap: 10px; flex-wrap: wrap; }
.kopf nav a { color: var(--leise); text-decoration: none; padding: 2px 0;
  border-bottom: 2px solid transparent; }
.kopf nav a:hover { color: var(--text); }
.kopf nav a[aria-current="page"] { color: var(--text);
  border-bottom-color: var(--primaer); }

/* ---------- Bedienelemente ---------- */
input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--flaeche);
  border: 1px solid var(--rand-stark);
  border-radius: 6px;
  padding: 6px 8px;
  min-width: 0;
}
input:focus, select:focus { outline: 2px solid var(--primaer); outline-offset: -1px; }

button, .knopf-link {
  font: inherit;
  background: var(--flaeche);
  color: var(--text);
  border: 1px solid var(--rand-stark);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
button:hover, .knopf-link:hover { border-color: var(--primaer); }
button:disabled { opacity: 0.5; cursor: default; }
button.klein, .knopf-link.klein { padding: 4px 9px; font-size: 13px; }
button.primaer { background: var(--primaer); color: var(--primaer-text);
  border-color: var(--primaer); }

/* ---------- Seitengerüst ---------- */
main { max-width: 1000px; margin: 0 auto; padding: 18px 16px 48px; }
main.schmal { max-width: 760px; }
h2 { font-size: 16px; margin: 22px 0 8px; font-weight: 600; }
h2:first-child { margin-top: 0; }
h3 { font-size: 14px; margin: 16px 0 6px; font-weight: 600; color: var(--leise); }
p { margin: 0 0 8px; }
p:last-child { margin-bottom: 0; }
code { font-family: ui-monospace, "Consolas", monospace; font-size: 0.93em;
  background: var(--flaeche-2); border: 1px solid var(--rand);
  border-radius: 4px; padding: 0 4px; }
a { color: var(--primaer); }

.tafel {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.tafel > h2 { margin-top: 0; }
.gitter { display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.hinweiskasten { border-radius: 6px; padding: 10px 12px; margin-bottom: 12px;
  border: 1px solid var(--rand); background: var(--flaeche-2); }
.hinweiskasten.ok { background: var(--ok-bg); border-color: var(--ok-rand); }
.hinweiskasten.warn { background: var(--warn-bg); border-color: var(--warn-rand); }
.hinweiskasten.fehler { background: var(--fehler-bg); border-color: var(--fehler-rand); }

.marke { display: inline-block; font-size: 12px; padding: 1px 7px;
  border-radius: 999px; border: 1px solid var(--rand-stark);
  background: var(--flaeche-2); white-space: nowrap; }
.marke.ok { background: var(--ok-bg); border-color: var(--ok-rand); }
.marke.warn { background: var(--warn-bg); border-color: var(--warn-rand); }
.marke.offen { color: var(--leise); }

/* ---------- Schrittfolge ---------- */
ol.schritte { margin: 10px 0 0; padding-left: 0; list-style: none;
  display: grid; gap: 10px; }
ol.schritte > li { display: grid; grid-template-columns: 22px 1fr; gap: 10px;
  align-items: start; }
ol.schritte .nr { font-size: 12px; line-height: 20px; text-align: center;
  color: var(--primaer-text); background: var(--primaer); border-radius: 4px; }
ol.schritte b { font-weight: 600; }
ol.schritte .warum { color: var(--leise); display: block; margin-top: 2px; }

/* ---------- Angabentabelle: Beschriftung links, Feld rechts ---------- */
table.angaben { width: 100%; }
table.angaben th { text-align: left; font-weight: 400; color: var(--leise);
  padding: 3px 10px 3px 0; white-space: nowrap; vertical-align: middle;
  width: 11rem; }
table.angaben td { padding: 3px 0; }
table.angaben input { width: 100%; }
@media (max-width: 30rem) {
  table.angaben th, table.angaben td { display: block; width: auto;
    padding: 0 0 2px; }
  table.angaben td { padding-bottom: 8px; }
}

/* ---------- Messleiste ---------- */
.messleiste {
  position: sticky; top: 49px; z-index: 9;
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: 8px;
  padding: 10px 14px; margin-bottom: 14px;
  display: flex; gap: 20px; align-items: baseline; flex-wrap: wrap;
}
.messleiste .feld { display: flex; flex-direction: column; min-width: 0; }
.messleiste .etikett { font-size: 12px; color: var(--leise); }
.messleiste .wert { font-size: 19px; font-weight: 600;
  font-variant-numeric: tabular-nums; }
.messleiste .wert.gross { color: var(--primaer); }
.messleiste .wert.klein { font-size: 13px; font-weight: 400;
  color: var(--leise); }
.balken { flex: 1 1 120px; min-width: 90px; height: 6px; border-radius: 3px;
  background: var(--flaeche-2); border: 1px solid var(--rand);
  overflow: hidden; align-self: center; }
.balken > i { display: block; height: 100%; width: 0; background: var(--primaer);
  transition: width 0.2s; }

/* ---------- Tabellen ---------- */
.tabellenfeld { overflow-x: auto; min-width: 0; }
table { width: 100%; border-collapse: collapse; }
thead th { text-align: left; font-weight: 600; font-size: 12px;
  color: var(--leise); padding: 4px 6px; border-bottom: 1px solid var(--rand);
  white-space: nowrap; }
tbody td { padding: 3px 6px; border-bottom: 1px solid var(--rand);
  vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
td.kennung { white-space: nowrap; font-variant-numeric: tabular-nums; }
td.zahl, th.zahl { text-align: right; font-variant-numeric: tabular-nums;
  white-space: nowrap; }
td.soll { color: var(--leise); }

/* Die Matrix bleibt eine Zeile je Kombination. Lieber scrollt sie im
   .tabellenfeld, als dass 'PE-Schaum 30 kg/m3' auf drei Zeilen umbricht und
   die Zeilen verschieden hoch werden. */
table.matrix { min-width: 38rem; }
table.matrix td { white-space: nowrap; }
table.matrix td.name { white-space: normal; }

table.mess { min-width: 24rem; }
table.mess col.c-kennung { width: 5.5rem; }
table.mess col.c-soll { width: 4.2rem; }
table.mess col.c-hinweis { width: 30%; }
table.mess input { width: 100%; padding: 4px 6px; }
input.anders { background: var(--warn-bg); border-color: var(--warn-rand); }
input.falsch { background: var(--fehler-bg); border-color: var(--fehler-rand); }
td.hinweis { font-size: 12px; color: var(--gefahr); line-height: 1.3; }

.blockkopf { display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.blockkopf h3 { margin: 0; }
.blockkopf .richtung { font-size: 12px; color: var(--leise); }

.knopfreihe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

pre.csv { font-family: ui-monospace, "Consolas", monospace; font-size: 12px;
  line-height: 1.4; background: var(--flaeche-2); border: 1px solid var(--rand);
  border-radius: 6px; padding: 10px; overflow-x: auto; max-height: 18rem;
  margin: 12px 0 0; }
.meldung { margin-top: 10px; }
.meldung.gut { color: var(--ok-rand); }
.meldung.schlecht { color: var(--gefahr); }

.fuss { max-width: 1000px; margin: 0 auto; padding: 0 16px 24px;
  color: var(--leise); font-size: 12px; }
.fuss a { color: var(--leise); }

@media (max-width: 34rem) {
  /* Die Hinweisspalte wegzunehmen heisst: auch die <col>. Nur die Zelle auf
     display:none zu setzen laesst die Spaltenbreite stehen - dann schiebt die
     Tabelle den Seitenkoerper auf. */
  table.mess col.c-hinweis, table.mess td.hinweis,
  table.mess thead th:nth-child(5) { display: none; }
  table.mess col.c-kennung { width: 4.6rem; }
  table.mess col.c-soll { width: 3.4rem; }
  table.mess { min-width: 19rem; }
  table.mess tr.hat-hinweis td.kennung { color: var(--gefahr); }
  .messleiste { top: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
