/* Vernier: Messen mit Go Direct-Sensoren. Dunkelmodus hier, Hellmodus-Grundtokens aus lib/thema/thema.css. */
:root {
  color-scheme: dark;
  --bg: #080d16;
  --bg-hi: #142030;
  --text: #e8edf4;
  --muted: #9aaabd;
  --faint: #6f7f93;
  --line: rgba(160, 190, 215, .16);
  --accent: #5ad7cb;
  --accent-ink: #062320;
  --teal: var(--accent);
  --glass: rgba(18, 27, 40, .72);
  --glass-strong: rgba(14, 21, 32, .94);
  --glass-edge: rgba(190, 220, 240, .12);
  --btn: rgba(255, 255, 255, .04);
  --btn-hover: rgba(255, 255, 255, .09);
  --btn-on: rgba(90, 215, 203, .16);
  --btn-on-edge: rgba(90, 215, 203, .55);
  --btn-on-text: #a6f1e8;
  --shadow: 0 24px 60px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3);
  --ok: #7fd99a;
  --warn: #ffb454;
  --err: #ff9a8b;
  --rec: #ff5a5f;
  --raw: #7e8ea3;
  --gitter: rgba(160, 190, 215, .08);
  --auswahl: rgba(90, 215, 203, .13);
  --panel-b: 330px;
  --radius: 12px;
}
html[data-theme="light"] {
  --ok: #2f8a4a;
  --warn: #b0620c;
  --err: #c8473a;
  --rec: #d62f3a;
  --raw: #8a919c;
  --gitter: rgba(25, 30, 45, .06);
  --auswahl: rgba(52, 70, 184, .10);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { font-family: var(--schrift-text); font-size: var(--gr-text); overflow: hidden; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.app { display: grid; grid-template-rows: auto 1fr; height: 100dvh; }

/* ---------- Kopfzeile ---------- */
.leiste {
  display: flex; align-items: center; gap: 14px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line); min-width: 0; flex-wrap: wrap;
}
.marke { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.marke h1 { font-family: var(--schrift-titel); font-weight: 600; font-size: 26px; margin: 0; }
.untertitel { color: var(--muted); font-size: var(--gr-klein); }
.sitzungstitel {
  flex: 1 1 120px; min-width: 80px; max-width: 420px; font-size: var(--gr-text); background: transparent; border-color: transparent;
  font-family: var(--schrift-text) !important;
}
.sitzungstitel:hover, .sitzungstitel:focus { border-color: var(--line); background: var(--btn); }
.aufnahme { display: flex; align-items: center; gap: 8px; }
.start {
  display: inline-flex; align-items: center; gap: 9px; font-weight: 600; padding: 9px 16px; min-height: 40px;
  border-color: color-mix(in srgb, var(--rec) 55%, transparent); background: color-mix(in srgb, var(--rec) 12%, transparent);
}
.start:hover:not(:disabled) { background: color-mix(in srgb, var(--rec) 22%, transparent); }
.start-punkt { width: 11px; height: 11px; border-radius: 50%; background: var(--rec); }
.nimmt-auf .start { background: var(--rec); color: #fff; border-color: var(--rec); }
.nimmt-auf .start-punkt { background: #fff; border-radius: 2px; }
.laufzeit { font-family: var(--schrift-mono); font-variant-numeric: tabular-nums; font-size: var(--gr-text); color: var(--rec); display: inline-flex; align-items: center; gap: 6px; }
.laufzeit::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--rec); animation: puls 1.2s ease-in-out infinite; }
.laufzeit.warn { color: var(--warn); }
@keyframes puls { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .laufzeit::before { animation: none; } }
.kopf-knoepfe { margin-left: auto; display: flex; gap: 4px; align-items: center; }

/* ---------- Grundelemente ---------- */
button, select, input, summary {
  font: inherit; font-size: var(--gr-panel); color: var(--text);
  background: var(--btn); border: 1px solid var(--line); border-radius: 9px; padding: 7px 11px; min-height: 34px;
}
button, summary { cursor: pointer; }
button:hover:not(:disabled), summary:hover { background: var(--btn-hover); }
button:disabled { opacity: .45; cursor: default; }
button.haupt { background: var(--btn-on); border-color: var(--btn-on-edge); color: var(--btn-on-text); font-weight: 600; }
button.gefahr { color: var(--err); border-color: color-mix(in srgb, var(--err) 45%, transparent); }
select { padding: 6px 8px; }
input[type="text"], input:not([type]) { font-family: var(--schrift-mono); min-width: 0; }
input.ungueltig { border-color: var(--err); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.icon { width: 36px; height: 36px; min-height: 0; display: inline-grid; place-items: center; padding: 0; border-color: transparent; background: transparent; }
.icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon.klein { width: 30px; height: 30px; font-size: 16px; line-height: 1; }
.icon.klein svg { width: 16px; height: 16px; }
.chip { border-radius: 999px; padding: 5px 12px; min-height: 30px; font-size: var(--gr-klein); }
.chip[aria-pressed="true"] { background: var(--btn-on); border-color: var(--btn-on-edge); color: var(--btn-on-text); }
.label { font-family: var(--schrift-mono); font-weight: 500; font-size: var(--gr-label); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.hinweis { color: var(--muted); font-size: var(--gr-panel); line-height: 1.45; margin: 0 0 10px; }
.hinweis.warn { color: var(--warn); }
.klein, .hinweis.klein { font-size: var(--gr-klein); }
kbd { font-family: var(--schrift-mono); font-size: var(--gr-label); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; background: var(--btn); }

.segment { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; padding: 2px; gap: 2px; background: var(--btn); }
.segment button { border: 0; background: transparent; padding: 5px 10px; min-height: 30px; border-radius: 8px; }
.segment button[aria-checked="true"] { background: var(--btn-on); color: var(--btn-on-text); box-shadow: inset 0 0 0 1px var(--btn-on-edge); }
#secAnsicht .segment { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); width: 100%; margin-bottom: 8px; }
.segment.klein button { font-size: var(--gr-klein); padding: 4px 9px; min-height: 28px; }
.schalter { display: flex; align-items: center; gap: 8px; font-size: var(--gr-panel); cursor: pointer; padding: 4px 0; }
.zeile { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.zeile.zwei > label { flex: 1; display: flex; gap: 6px; align-items: center; font-size: var(--gr-panel); color: var(--muted); }
.zeile.zwei input { width: 100%; }

/* ---------- Arbeitsfläche ---------- */
.arbeit { display: grid; grid-template-columns: var(--panel-b) minmax(0, 1fr); min-height: 0; }
.panel { border-right: 1px solid var(--line); min-height: 0; display: flex; flex-direction: column; background: color-mix(in srgb, var(--bg) 80%, var(--bg-hi)); }
.panel-griff { display: none; }
.panel-inhalt { overflow-y: auto; padding: 14px 14px 24px; overscroll-behavior: contain; }
.abschnitt { padding: 4px 2px 16px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.abschnitt:last-of-type { border-bottom: 0; }
.verbinden button { flex: 1; min-height: 40px; }
.sim select { flex: 1; min-width: 0; }
.speicherhinweis { padding: 0 2px; }

.feld { display: grid; grid-template-columns: 56px 1fr; gap: 8px; align-items: center; margin: 6px 0; }
.feld > label { color: var(--muted); font-size: var(--gr-panel); }
.feld .eingabe { display: flex; gap: 6px; min-width: 0; }
.feld .eingabe input { width: 76px; flex: 0 0 auto; }
.feld .eingabe select { flex: 1; min-width: 0; }

/* Geräte */
.geraeteliste { display: grid; gap: 10px; margin-top: 10px; }
.geraet { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 10px 6px; background: var(--btn); }
.g-kopf { display: flex; align-items: center; gap: 8px; }
.g-kopf .punkt { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); flex: none; }
.geraet[data-status="verbinden"] .punkt, .geraet[data-status="wiederverbinden"] .punkt { background: var(--warn); animation: puls 1s infinite; }
.geraet[data-status="getrennt"] .punkt { background: var(--err); }
.g-name { font-size: var(--gr-panel); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.akku { font-family: var(--schrift-mono); font-size: var(--gr-label); color: var(--muted); }
.akku.schwach { color: var(--err); }
.g-info { font-size: var(--gr-label); color: var(--muted); margin: 3px 0 6px 17px; font-family: var(--schrift-mono); }
.g-hinweis { font-size: var(--gr-klein); color: var(--warn); margin: 0 0 6px 17px; }
.kanaele { list-style: none; margin: 0; padding: 0; }
.kanaele label { display: flex; align-items: center; gap: 9px; padding: 6px 6px; border-radius: 8px; cursor: pointer; min-height: 36px; font-size: var(--gr-panel); }
.kanaele label:hover { background: var(--btn-hover); }
.k-name { flex: 1; }
.kanaele .live { font-family: var(--schrift-mono); font-variant-numeric: tabular-nums; font-size: var(--gr-panel); color: var(--text); }

/* Durchgänge */
.durchgaenge { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.durchgang { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-radius: 9px; border: 1px solid transparent; }
.durchgang.aktiv { border-color: var(--line); background: var(--btn); }
.farbfeld { width: 22px; height: 22px; min-height: 0; padding: 0; border-radius: 6px; border: 0; flex: none; }
.d-name { flex: 1; width: 0; min-width: 0; font-family: var(--schrift-text) !important; background: transparent; border-color: transparent; padding: 5px 6px; }
.d-name:hover, .d-name:focus { border-color: var(--line); }
.d-info { font-family: var(--schrift-mono); font-size: var(--gr-label); color: var(--muted); white-space: nowrap; }
.auge[aria-pressed="false"] { color: var(--faint); }
.d-mehr { position: relative; }
.d-mehr summary { list-style: none; border: 0; background: transparent; display: grid; place-items: center; }
.d-mehr summary::-webkit-details-marker { display: none; }
.d-menu { position: absolute; right: 0; top: 100%; z-index: 5; display: grid; gap: 4px; padding: 6px; border: 1px solid var(--glass-edge); border-radius: 10px; background: var(--glass-strong); box-shadow: var(--shadow); min-width: 140px; }
.d-menu button { text-align: left; }

/* ---------- Ansichten ---------- */
.huelle { min-width: 0; min-height: 0; container-type: size; display: grid; }
.ansichten { min-width: 0; min-height: 0; display: grid; gap: 1px; background: var(--line); }
.bereich { background: var(--bg); min-width: 0; min-height: 0; position: relative; }
.ansichten[data-layout="graph"] { grid-template: "g" 1fr / 1fr; }
.ansichten[data-layout="graph-tabelle"] { grid-template: "g t" 1fr / minmax(0, 1.9fr) minmax(260px, 1fr); }
.ansichten[data-layout="alle"] { grid-template: "a a" auto "g t" 1fr / minmax(0, 1.9fr) minmax(260px, 1fr); }
.ansichten[data-layout="zwei-graphen"] { grid-template: "g" 1fr "g2" 1fr / 1fr; }
.ansichten[data-layout="anzeige"] { grid-template: "a" 1fr / 1fr; }
.b-graph { grid-area: g; display: flex; flex-direction: column; }
.b-graph2 { grid-area: g2; }
.b-tabelle { grid-area: t; display: flex; flex-direction: column; }
.tabelle-werkzeuge { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 10px 6px; }
.tabelle-werkzeuge:empty { display: none; }
.tabelle-box { flex: 1; min-height: 0; }
.werkzeug-slot { display: contents; }
.menu-gruppe { display: contents; }
.b-anzeige { grid-area: a; }
.ansichten:not([data-layout="zwei-graphen"]) .b-graph2 { display: none; }
.ansichten[data-layout="graph"] .b-tabelle, .ansichten[data-layout="zwei-graphen"] .b-tabelle, .ansichten[data-layout="anzeige"] .b-tabelle { display: none; }
.ansichten:not([data-layout="alle"]):not([data-layout="anzeige"]) .b-anzeige { display: none; }
.ansichten[data-layout="anzeige"] .b-graph { display: none; }
@container (max-width: 900px) {
  .ansichten[data-layout="graph-tabelle"] { grid-template: "g" minmax(0, 1.6fr) "t" minmax(150px, 1fr) / 1fr; }
  .ansichten[data-layout="alle"] { grid-template: "a" auto "g" minmax(0, 1.6fr) "t" minmax(150px, 1fr) / 1fr; }
}

.graph-werkzeuge { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 8px 10px 0; }
.graph-box { position: relative; flex: 1; min-height: 160px; touch-action: none; }
.graph-canvas { position: absolute; inset: 0; display: block; cursor: crosshair; outline-offset: -2px; }
.achsen-titel {
  position: absolute; z-index: 2; opacity: 0; padding: 0; min-height: 0; border: 0; border-radius: 6px; cursor: pointer; font-size: 0;
}
.achsen-titel:hover, .achsen-titel:focus-visible { opacity: 1; background: color-mix(in srgb, var(--accent) 12%, transparent); outline: 1px dashed var(--accent); }
.zoom-rahmen { position: absolute; pointer-events: none; border: 1px dashed var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 2px; }
.graph-tip {
  position: absolute; z-index: 3; pointer-events: none; background: var(--glass-strong); border: 1px solid var(--glass-edge);
  border-radius: 10px; padding: 8px 11px 7px; box-shadow: 0 8px 24px rgba(0, 0, 0, .28), 0 1px 3px rgba(0, 0, 0, .18);
  font-size: var(--gr-klein); min-width: 160px; max-width: min(340px, 80%);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
html[data-theme="light"] .graph-tip { box-shadow: 0 8px 24px rgba(20, 25, 40, .12), 0 1px 3px rgba(20, 25, 40, .08); }
.tip-kopf {
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px; color: var(--muted);
  padding-bottom: 5px; margin-bottom: 4px; border-bottom: 1px solid var(--line); font-size: var(--gr-label);
}
.tip-kopf span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tip-kopf b { font-family: var(--schrift-mono); font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; font-size: var(--gr-klein); }
.tip-zeile { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 8px; align-items: center; line-height: 1.7; }
.tip-zeile i { width: 8px; height: 8px; border-radius: 50%; }
.tip-zeile span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tip-zeile b { font-family: var(--schrift-mono); font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.tip-zeile b small { font-family: var(--schrift-text); font-weight: 400; font-size: var(--gr-label); color: var(--muted); margin-left: 4px; }
.tip-zeile.anders { opacity: .6; }
.tip-zeile.zusatz { border-top: 1px dashed var(--line); margin-top: 2px; padding-top: 2px; }
.tip-zeile.zusatz ~ .tip-zeile.zusatz { border-top: 0; margin-top: 0; padding-top: 0; }

/* Tabelle */
.tabelle { height: 100%; display: flex; flex-direction: column; font-family: var(--schrift-mono); font-size: var(--gr-klein); font-variant-numeric: tabular-nums; }
.t-kopf { overflow: hidden; flex: none; border-bottom: 1px solid var(--line); }
.t-scroll { flex: 1; overflow: auto; position: relative; overscroll-behavior: contain; }
.t-innen { position: relative; }
.t-zeilen { position: absolute; inset: 0 auto auto 0; }
.t-reihe { display: grid; height: 26px; align-items: center; }
.t-zeilen .t-reihe { position: absolute; top: 0; left: 0; }
.t-zeilen .t-reihe:nth-child(even) { background: color-mix(in srgb, var(--text) 3%, transparent); }
.t-gruppen { height: 26px; font-family: var(--schrift-text); font-size: var(--gr-klein); font-weight: 600; }
.t-gruppe { display: flex; align-items: center; gap: 6px; padding: 0 8px; border-left: 1px solid var(--line); overflow: hidden; white-space: nowrap; }
.t-gruppe i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.t-namen { height: 38px; }
.t-name { display: flex; flex-direction: column; align-items: flex-end; padding: 0 8px; line-height: 1.2; overflow: hidden; }
.t-name span { font-family: var(--schrift-text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.t-name small { color: var(--muted); font-size: var(--gr-label); }
.t-nr { color: var(--faint); text-align: right; padding-right: 8px; }
.t-zelle { text-align: right; padding: 0 8px; white-space: nowrap; overflow: hidden; }
.t-zelle.erste, .t-name.erste { border-left: 1px solid var(--line); }
.t-zelle.mark { background: var(--auswahl); }

/* Messanzeige */
.b-anzeige { display: flex; flex-wrap: wrap; gap: 10px; padding: 10px; align-content: flex-start; }
.meter {
  --mf: var(--meter-farbe, var(--accent));
  position: relative; overflow: hidden; flex: 1 1 210px; min-width: 0;
  display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 2px;
  padding: 11px 16px 11px 19px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--btn);
}
.meter::before {
  content: ''; position: absolute; left: 7px; top: 12px; bottom: 12px; width: 3px; border-radius: 2px;
  background: var(--mf); opacity: .85;
}
html[data-theme="light"] .meter { background: #fff; box-shadow: 0 1px 2px rgba(20, 25, 40, .05); }
.meter.alt { opacity: .5; }
.m-name {
  color: var(--muted); font-size: var(--gr-klein); font-weight: 500; letter-spacing: .01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.m-wert {
  font-family: var(--schrift-mono); font-size: clamp(28px, 3.6vw, 42px); font-weight: 500; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; line-height: 1.1; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.m-wert small {
  font-family: var(--schrift-text); font-size: var(--gr-text); font-weight: 500; letter-spacing: 0; color: var(--muted); margin-left: .45em;
}
.m-geraet { color: var(--faint); font-size: var(--gr-label); font-family: var(--schrift-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leer { color: var(--muted); padding: 20px; }
.ansichten[data-layout="anzeige"] .b-anzeige { align-content: center; justify-content: center; padding: 4vh 4vw; gap: 3vh 3vw; }
.ansichten[data-layout="anzeige"] .meter { flex: 1 1 380px; padding: 3vh 3vw 3vh calc(3vw + 10px); row-gap: 1vh; }
.ansichten[data-layout="anzeige"] .meter::before { left: 1.4vw; top: 3vh; bottom: 3vh; width: 4px; }
.ansichten[data-layout="anzeige"] .m-name { font-size: clamp(16px, 2.2vw, 28px); }
.ansichten[data-layout="anzeige"] .m-wert { font-size: clamp(56px, 11vw, 180px); }
.ansichten[data-layout="anzeige"] .m-wert small { font-size: clamp(18px, 2.6vw, 40px); }
.ansichten[data-layout="anzeige"] .m-geraet { font-size: clamp(11px, 1.2vw, 16px); }

/* ---------- Menü, Dialoge, Meldung ---------- */
.menu { margin: 0; inset: auto; position: fixed; top: 56px; right: 12px; left: auto; padding: 6px; border: 1px solid var(--glass-edge); border-radius: 12px; background: var(--glass-strong); color: var(--text); box-shadow: var(--shadow); min-width: 230px; }
.menu:popover-open { display: grid; gap: 2px; }
.menu button { text-align: left; border: 0; background: transparent; padding: 9px 12px; }
.menu button:hover { background: var(--btn-hover); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }

.dialog { border: 1px solid var(--glass-edge); border-radius: 16px; background: var(--glass-strong); color: var(--text); box-shadow: var(--shadow); padding: 18px 20px; width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
.dialog.breit { width: min(860px, calc(100vw - 24px)); }
.dialog::backdrop { background: rgba(0, 0, 0, .35); }
.dialog h2 { font-family: var(--schrift-titel); font-weight: 600; font-size: var(--gr-titel); margin: 0 0 12px; }
.dialog h3 { font-family: var(--schrift-titel); font-weight: 600; font-size: var(--gr-text); margin: 16px 0 6px; }
.dialog p { line-height: 1.5; }
.dialog-knoepfe { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.dialog-knoepfe .gefahr { margin-right: auto; }
.achsen-dialog { position: fixed; width: min(340px, calc(100vw - 24px)); }
.feld-gruppe { border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px 10px; margin: 10px 0; }
.feld-gruppe legend { font-size: var(--gr-label); font-family: var(--schrift-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; padding: 0 4px; }
.spaltenwahl { max-height: 200px; overflow: auto; }
.achsen-dialog .feld { grid-template-columns: 44px 1fr; }
.achsen-dialog .feld input { width: 100%; font-family: var(--schrift-text); }
.sitzungsliste { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; max-height: 50vh; overflow: auto; }
.sitzung { display: flex; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
.sitzung.offen { border-color: var(--btn-on-edge); }
.s-text { flex: 1; display: grid; gap: 2px; min-width: 0; }
.s-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-text .hinweis { margin: 0; }
.log { margin: 10px 0 0; height: 50vh; overflow: auto; font-family: var(--schrift-mono); font-size: var(--gr-klein); line-height: 1.5; white-space: pre-wrap; word-break: break-word; background: var(--btn); border-radius: 10px; padding: 10px 12px; }
.log .ok { color: var(--ok); } .log .warn { color: var(--warn); } .log .err { color: var(--err); } .log .raw { color: var(--raw); } .log .t { color: var(--muted); }
.hilfe-spalten { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 8px 28px; }
.kuerzel { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: var(--gr-panel); margin: 0; }
.kuerzel dd { margin: 0; color: var(--muted); }
.liste { padding-left: 18px; margin: 0; font-size: var(--gr-panel); line-height: 1.5; color: var(--muted); }
.matrix { border-collapse: collapse; font-size: var(--gr-panel); width: 100%; }
.matrix th, .matrix td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); }
.matrix th { font-weight: 600; }
.lizenz { white-space: pre-wrap; font-size: var(--gr-label); color: var(--muted); max-height: 200px; overflow: auto; }

.meldung {
  position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50;
  background: var(--glass-strong); border: 1px solid var(--glass-edge); border-radius: 12px; padding: 10px 16px; box-shadow: var(--shadow);
  max-width: min(560px, calc(100vw - 24px)); font-size: var(--gr-panel); line-height: 1.45;
}
.meldung.ok { border-left: 4px solid var(--ok); }
.meldung.warn { border-left: 4px solid var(--warn); }
.meldung.err { border-left: 4px solid var(--err); }

/* ---------- Tablet hoch, Handy: Bedienfeld unten als ausziehbares Blatt ---------- */
@media (max-width: 900px), (orientation: portrait) and (max-width: 1100px) {
  .arbeit { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .panel { order: 2; border-right: 0; border-top: 1px solid var(--line); max-height: 46dvh; transition: max-height .25s ease; }
  .panel-griff { display: flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 0; background: transparent; min-height: 36px; width: 100%; color: var(--muted); font-size: var(--gr-klein); }
  .griff-strich { width: 36px; height: 4px; border-radius: 2px; background: var(--line); box-shadow: inset 0 0 0 2px var(--muted); opacity: .5; }
  .panel-zu .panel { max-height: 36px; }
  .panel-zu .panel-inhalt { display: none; }
  .panel-inhalt { padding-bottom: max(20px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 20px; align-items: start; }
  .abschnitt { border-bottom: 0; }
  .huelle { grid-row: 1; }
}
@media (max-width: 1000px) { .untertitel { display: none; } }
@media (max-width: 640px) {
  .leiste { gap: 8px; padding: 8px 10px; }
  .marke h1 { font-size: 22px; }
  .untertitel { display: none; }
  .sitzungstitel { order: 5; flex: 1 1 100px; max-width: none; }
  .aufnahme { margin-left: auto; }
  .kopf-knoepfe { order: 6; margin-left: 0; }
  .icon { width: 38px; }
  .panel { max-height: 40dvh; }
  .start { padding: 8px 12px; }
}
@media (pointer: coarse) {
  button, select, input, summary { min-height: 44px; }
  .segment button, .chip { min-height: 40px; }
  .icon, .icon.klein { width: 44px; height: 44px; }
  .farbfeld { width: 30px; height: 30px; }
}

.ueber { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 28px; }
.ueber p { font-size: var(--gr-panel); color: var(--text); }
.dialog a { color: var(--accent); }
