:root {
    --bg: #f4f1ea;
    --fg: #1c1b18;
    --muted: #5c584f;
    --card: #fffdf8;
    --line: #d8d2c4;
    --accent: #1f4e79;
    --ok: #1b6b3a;
    --err: #8b1e1e;
    --font: "Segoe UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--fg);
    min-height: 100vh;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.7rem 1.2rem;
    background: var(--accent);
    color: #fff;
    position: relative;
}
.topbar-file {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 600;
    letter-spacing: 0.01em;
    max-width: 46%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}
.nav { display: flex; align-items: center; gap: 0.5rem; flex: 1; }
.nav[hidden] { display: none; }
.spacer { flex: 1; }
.topbar button {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,.4);
    padding: 0.3rem 0.7rem;
    cursor: pointer;
}

main { padding: 1.2rem; max-width: 1100px; margin: 0 auto; }
.view[hidden] { display: none; }
.card {
    background: var(--card);
    border: 1px solid var(--line);
    padding: 1rem 1.1rem 1.2rem;
    margin-bottom: 1rem;
}
.login { max-width: 22rem; margin: 3rem auto; }
h1, h2 { margin: 0 0 0.8rem; font-weight: 600; }
label { display: block; margin: 0.6rem 0; }
input, textarea, button, select {
    font: inherit;
    color: inherit;
}
input, textarea {
    width: 100%;
    border: 1px solid var(--line);
    padding: 0.4rem 0.5rem;
    background: #fff;
}
button {
    background: var(--accent);
    color: #fff;
    border: 0;
    padding: 0.45rem 0.8rem;
    cursor: pointer;
}
button:disabled { opacity: 0.45; cursor: not-allowed; }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: end; }
.row label { margin: 0; min-width: 7rem; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 800px) { .grid { grid-template-columns: 1fr; } }

.roh {
    min-height: 9rem;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.85rem;
    margin: 0.6rem 0;
    white-space: pre;
}
.status, .hint { color: var(--muted); font-size: 0.9rem; }
.fehler { color: var(--err); }
.ok { color: var(--ok); }

.werte { display: grid; grid-template-columns: 10rem 1fr; gap: 0.2rem 0.8rem; }
.werte dt { color: var(--muted); }
.werte dd { margin: 0; }

table { width: 100%; border-collapse: collapse; margin-top: 0.8rem; }
th, td { text-align: left; padding: 0.35rem 0.4rem; border-bottom: 1px solid var(--line); }

.print-only { display: none; }

@media print {
    body { background: #fff !important; margin: 0; }
    .topbar, .nav, .menubar, #view-login, #view-archiv, #view-messung,
    #dlg-save, #winlog-busy, button, .tbl-theme { display: none !important; }
    #print-root, .print-only { display: block !important; }
    #print-root[hidden] { display: block !important; }
    @page { size: A4 landscape; margin: 8mm; }
}
#print-root { background: #fff; }
.wl-sheet {
    width: 277mm;
    min-height: 190mm;
    margin: 0 auto;
    background: #fff;
    color: #111;
    font: 11px "Segoe UI", Arial, sans-serif;
}
.wl-sheet-head {
    font-size: 9px;
    color: #333;
    padding: 0 2px 3px;
}
.wl-frame {
    border: 1.2px solid #222;
}
.wl-sheet canvas {
    display: block;
    width: 100%;
    height: auto;
}
.wl-sheet-foot {
    display: grid;
    grid-template-columns: 1fr 52mm;
    border: 1.2px solid #222;
    border-top: 0;
    min-height: 22mm;
}
.wl-leg {
    padding: 4mm 5mm 3mm;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 8px;
    align-content: start;
    font-size: 10px;
}
.wl-leg i {
    display: inline-block;
    width: 16px;
    height: 0;
    border-top: 2px solid currentColor;
    margin-top: 6px;
}
.wl-brand {
    border-left: 1.2px solid #222;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    padding: 3mm 5mm;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.wl-brand strong { font-size: 16px; color: #1a4f8a; line-height: 1.05; }
.wl-brand em { font-style: normal; font-size: 16px; color: #1a4f8a; }
.wl-brand b {
    display: block;
    width: 36mm;
    height: 3px;
    margin-top: 4px;
    background: linear-gradient(90deg, #1a4f8a 0 70%, #f0c000 70% 100%);
}
.wl-rate {
    position: relative;
    text-align: right;
    font-size: 9px;
    padding: 2px 4px 0 0;
}


.kenn-tabelle {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-top: 0.6rem;
}
.kenn-tabelle th,
.kenn-tabelle td {
    text-align: left;
    padding: 0.2rem 0.4rem;
    border-bottom: 1px solid var(--line);
}
.kenn-tabelle th {
    color: var(--muted);
    font-weight: 600;
    width: 11rem;
}

/* Messgrafik + KKS-Tabelle */
.mess-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
}
.chart-wrap {
    position: relative;
    width: 100%;
    height: 380px;
    background: #fffdf8;
    border: 1px solid var(--line);
    border-radius: 4px;
}
.chart-wrap canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}
.chart-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.8rem;
    align-items: center;
    margin-bottom: 0.5rem;
}
.chart-toolbar label {
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.chart-toolbar button.active {
    background: var(--accent);
    color: #fff;
}
.kks-table-wrap {
    max-height: none;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 4px;
}
table.kks {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
table.kks thead th {
    position: sticky;
    top: 0;
    background: #e8eef5;
    z-index: 1;
    padding: 0.35rem 0.45rem;
    border-bottom: 2px solid var(--line);
    text-align: right;
}
table.kks thead th:first-child,
table.kks td:first-child {
    text-align: left;
}
table.kks tbody tr:nth-child(even) {
    background: #e8f0e4; /* KKS-typisch: grünlicher Wechsel */
}
table.kks tbody tr:nth-child(odd) {
    background: #fff;
}
table.kks tbody tr.cursor-row {
    outline: 2px solid var(--accent);
    background: #d6e4f5 !important;
}
table.kks td {
    padding: 0.25rem 0.45rem;
    text-align: right;
    border-bottom: 1px solid #e5e0d6;
    white-space: nowrap;
}
.ch-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    margin-right: 3px;
}

.menubar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    padding: 0.4rem 0.7rem;
    background: #e8eef5;
    border-bottom: 1px solid var(--line);
}
.menubar button { padding: 0.25rem 0.55rem; cursor: pointer; }
.menubar-sep {
    width: 1px;
    height: 1.4rem;
    background: var(--line);
    margin: 0 0.25rem;
}
.menubar-file {
    cursor: pointer;
    padding: 0.25rem 0.55rem;
    border: 1px solid var(--line);
    background: #fff;
    font-size: 0.9rem;
}
.hint-inline { font-size: 0.85rem; color: var(--muted); }
.kenn-band {
    padding: 0.35rem 0.7rem;
    border-bottom: 1px solid var(--line);
    background: #fffdf8;
    max-height: 7rem;
    overflow: auto;
}
.kenn-band-table { margin: 0; font-size: 0.8rem; }
.kenn-band-table th { width: auto; padding-right: 0.6rem; }
.mess-split {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 0.6rem;
    padding: 0.5rem 0.7rem;
    min-height: 420px;
}
@media (max-width: 900px) {
    .mess-split { grid-template-columns: 1fr; }
}
.mess-chart-pane, .mess-table-pane {
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.mess-table-pane .kks-table-wrap {
    flex: 1;
    max-height: none;
    min-height: 320px;
}


main { max-width: none; width: 100%; padding: 0; }
#view-messung { width: 100%; }
.progress-bar {
    position: relative;
    height: 1.4rem;
    background: #e5e0d6;
    border-bottom: 1px solid var(--line);
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.2s ease;
}
.progress-bar-text {
    position: absolute; left: 0; right: 0; top: 0; bottom: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; color: #fff; text-shadow: 0 0 2px #000;
    pointer-events: none;
}


.kenn-band {
    max-height: 8.5rem;
    overflow: auto;
    padding: 0.35rem 0.6rem 0.45rem;
}
.kenn-band-table { display: block; margin: 0; }
.kenn-grid {
    display: grid;
    grid-template-columns: repeat(var(--kenn-cols, 4), minmax(0, 1fr));
    gap: 0.15rem 1.2rem;
    font-size: 0.82rem;
    line-height: 1.25;
}
/* kenn-item: display contents via .kenn-gruppe grid */
.kenn-label {
    color: var(--muted);
    font-weight: 600;
    white-space: nowrap;
}
.kenn-wert {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
@media (max-width: 1100px) {
    .kenn-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .kenn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.kenn-band {
    max-height: 8.5rem;
    overflow: auto;
    padding: 0.35rem 0.75rem 0.4rem;
    background: #f7f5f0;
    border-bottom: 1px solid var(--line);
}
.kenn-band-table { display: block; margin: 0; }
.kenn-head {
    font-size: 0.95rem;
    margin-bottom: 0;
    color: #1a1a1a;
}
.kenn-head strong {
    font-weight: 700;
}
.kenn-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem 1.25rem;
    font-size: 0.82rem;
    line-height: 1.35;
}
.kenn-gruppe-title {
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #5a6a7a;
    margin-bottom: 0.55rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #d8d2c6;
}
.kenn-gruppe {
    min-width: 0;
}
.kenn-item {
    display: contents;
}
.kenn-label {
    color: var(--muted);
    font-weight: 600;
    white-space: nowrap;
}
.kenn-wert {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    color: #1a1a1a;
}
.kenn-led {
    display: inline-block;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    vertical-align: middle;
    margin-left: 0.2rem;
    box-shadow: 0 0 2px rgba(0,0,0,0.35);
}
.kenn-led-gruen { background: #2ecc40; }
.kenn-led-rot { background: #e74c3c; }
@media (max-width: 1100px) {
    .kenn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .kenn-grid { grid-template-columns: 1fr; }
}

.kenn-head-line { margin-bottom: 0.2rem; }
.kenn-head-meta {
    font-size: 0.85rem;
    font-weight: 500;
    color: #333;
    margin-top: 0.15rem;
    margin-bottom: 0.15rem;
}

.kenn-wert.kenn-wert-leer {
    color: #9a9a9a;
    font-weight: 500;
}

.kenn-head-meta div {
    line-height: 1.35;
}
.kenn-lp {
    color: #c0392b;
    font-weight: 700;
    margin-left: 0.25rem;
}

.kenn-head-title {
    font-size: 1rem;
    margin-bottom: 0.15rem;
}
.kenn-head-line {
    font-size: 0.9rem;
    margin-bottom: 0.15rem;
}
.kenn-head-lizenz {
    font-size: 0.88rem;
    margin-bottom: 0.35rem;
    color: #1a1a1a;
}
.kenn-wert-warn {
    color: #c0392b !important;
    font-weight: 700;
}
.kenn-wert br {
    display: block;
    content: "";
    margin-top: 0.1rem;
}

.kenn-gruppe-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.kenn-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
    padding: 0.2rem 0.35rem;
    border-radius: 3px;
    vertical-align: middle;
}
.kenn-badge-prog {
    background: #1a73e8;
    color: #fff;
}
.kenn-badge-nogps {
    position: relative;
    background: transparent;
    color: #666;
    border: 1px solid #999;
    padding: 0.15rem 0.35rem;
    overflow: hidden;
}
.kenn-badge-nogps::after {
    content: "";
    position: absolute;
    left: -10%;
    top: 50%;
    width: 120%;
    height: 0;
    border-top: 2px solid #c0392b;
    transform: rotate(-28deg);
    transform-origin: center;
    pointer-events: none;
}
.kenn-weck {
    margin-left: 0.15rem;
    font-size: 0.9em;
}

.kenn-grid {
    display: grid;
    grid-template-columns: 1.35fr 1.55fr 0.7fr 1.2fr;
    gap: 0.5rem 1rem;
    align-items: start;
}
.kenn-gruppe-schmal {
    min-width: 0;
}
.kenn-subcols {
    display: block;
}
.kenn-subcols-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 0.8rem;
    align-items: start;
}
.kenn-subcol {
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: 10px;
    row-gap: 0.12rem;
    align-items: baseline;
}
.kenn-subcol .kenn-item {
    display: contents;
}
@media (max-width: 1100px) {
    .kenn-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
    .kenn-grid { grid-template-columns: 1fr; }
    .kenn-subcols-2 { grid-template-columns: 1fr; }
}

.kenn-head-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 5px;
}
.kenn-head {
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: 0 !important;
}
.kenn-head-title {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 1.25rem;
    font-size: 0.95rem;
    margin-bottom: 0;
}
.kenn-head-fw, .kenn-head-lizenz {
    font-weight: 700;
}
.kenn-head-sn {
    font-weight: 700 !important;
}
.kenn-head-row .progress-bar {
    flex: 0 0 14rem;
    height: 1.15rem;
    border: 1px solid #d0cbc0;
    border-bottom: 1px solid #d0cbc0;
    border-radius: 3px;
    background: #e8e4db;
}
.kenn-head-row .progress-bar-text {
    font-size: 0.72rem;
    color: #333;
    text-shadow: none;
}

.kenn-wert-2z {
    min-height: 2.5em;
    line-height: 1.25;
}
.kenn-subcol {
    min-height: 4.8em;
}

.kenn-subcols-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    column-gap: 0.7rem;
    align-items: start;
}

.kenn-grid {
    display: grid !important;
    grid-template-columns: minmax(12rem, 1.1fr) minmax(22rem, 1.8fr) minmax(8rem, 0.7fr) minmax(12rem, 1.1fr) !important;
}
.kenn-gruppe-breit .kenn-subcols-3 {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
}
.kenn-subcols-2 {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
}
.kenn-subcols-3 {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
}

/* Kenndaten: fest begrenzen, scrollen statt wachsen. Rest für Grafik/Tabelle. */
html, body {
    height: 100%;
    overflow: hidden;
}
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}
main {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
#view-messung.view {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
}
#view-messung[hidden] { display: none !important; }
.menubar { flex: 0 0 auto; }
.kenn-band {
    flex: 0 0 auto;
    max-height: 8.5rem;
    overflow: auto;
}
.kenn-tabelle,
.kenn-band-table {
    min-width: 58rem;
}
.kenn-grid {
    display: grid !important;
    grid-template-columns: minmax(12rem, 1.1fr) minmax(20rem, 1.8fr) minmax(8rem, 0.7fr) minmax(12rem, 1.1fr) !important;
    min-width: 56rem;
}
.mess-split {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
.mess-chart-pane,
.mess-table-pane {
    min-height: 0;
    overflow: hidden;
}
@media (max-width: 1100px) {
    .kenn-grid {
        grid-template-columns: minmax(12rem, 1.1fr) minmax(20rem, 1.8fr) minmax(8rem, 0.7fr) minmax(12rem, 1.1fr) !important;
    }
    .kenn-subcols-2,
    .kenn-subcols-3 {
        grid-template-columns: inherit;
    }
}
@media (max-width: 700px) {
    .kenn-grid {
        grid-template-columns: minmax(12rem, 1.1fr) minmax(20rem, 1.8fr) minmax(8rem, 0.7fr) minmax(12rem, 1.1fr) !important;
    }
    .kenn-subcols-2 { grid-template-columns: 1fr 1fr !important; }
    .kenn-subcols-3 { grid-template-columns: 1fr 1fr 1fr !important; }
}

/* Nur Kenndaten scrollt; Grafik/Tabelle später eigene Scrollbereiche. */
.kks-table-wrap,
.mess-chart-pane,
.mess-table-pane,
.mess-split,
main,
body {
    scrollbar-gutter: auto;
}
#kenn-band {
    overflow: auto !important;
    max-height: 8.5rem !important;
}
#kenn-band .kenn-tabelle,
#kenn-band .kenn-grid {
    overflow: visible;
}

/* Kompakte Kenndaten-Hauptspalten, 15px Abstand */
.kenn-grid {
    display: grid !important;
    grid-template-columns: max-content max-content max-content max-content !important;
    column-gap: 15px !important;
    row-gap: 0.35rem;
    min-width: 0 !important;
}
.kenn-tabelle,
.kenn-band-table {
    min-width: 0 !important;
}
.kenn-gruppe-breit .kenn-subcols-3 {
    grid-template-columns: max-content max-content max-content !important;
    column-gap: 12px !important;
}
.kenn-subcols-2 {
    column-gap: 12px !important;
}
.kenn-subcol {
    column-gap: 8px !important;
}

/* Kein vertikaler Scroll; Kategorien mit Abstand; seitlich blättern */
#kenn-band {
    overflow: hidden !important;
    max-height: none !important;
}
.kenn-carousel {
    display: flex;
    align-items: stretch;
    gap: 0.25rem;
}
.kenn-scroll {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    scrollbar-width: none;
}
.kenn-scroll::-webkit-scrollbar { display: none; }
.kenn-nav {
    flex: 0 0 1.6rem;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--accent);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 3px;
    padding: 0;
}
.kenn-nav:hover { background: #eef3f8; }
.kenn-grid {
    column-gap: 28px !important;
}
.kenn-gruppe + .kenn-gruppe {
    margin-left: 0;
}

.menubar-drop {
    position: relative;
    display: inline-block;
}
.menubar-drop-list {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 20;
    min-width: 12rem;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
    padding: 0.2rem 0;
}
.menubar-drop-list button {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 0.35rem 0.7rem;
    cursor: pointer;
}
.menubar-drop-list button:hover:not(:disabled) {
    background: #eef3f8;
}
.kenn-head-sn { font-weight: 400 !important; }

.menubar {
    overflow: visible;
    flex-wrap: nowrap;
    position: relative;
    z-index: 30;
}
.menubar-drop {
    position: relative;
    display: inline-block;
}
.menubar-drop-list {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    z-index: 80;
    min-width: 13rem;
    display: none;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 6px 16px rgba(0,0,0,.16);
    padding: 0.15rem 0;
}
.menubar-drop.open .menubar-drop-list,
.menubar-drop-list.open {
    display: flex !important;
}
.menubar-drop-list[hidden] {
    display: none !important;
}
.menubar-drop-list button {
    display: block;
    width: 100%;
    text-align: left;
    white-space: nowrap;
    border: 0;
    background: #fff;
    padding: 0.4rem 0.8rem;
}

.menubar-drop-list {
    background: #f7f4ee !important;
    border: 1px solid #b8b2a6 !important;
}
.menubar-drop-list button {
    color: #1c1b18 !important;
    background: #f7f4ee !important;
}
.menubar-drop-list button:hover:not(:disabled) {
    background: #dce6f0 !important;
    color: #1c1b18 !important;
}
.menubar-drop-list button:disabled {
    color: #6a665e !important;
}

.progress-bar {
    background: #e8e4db;
}
.progress-bar-fill {
    background: #8fb4d4;
}
.progress-bar-text,
.kenn-head-row .progress-bar-text {
    color: #1a1a1a !important;
    font-weight: 700;
    text-shadow:
        0 0 3px #fff,
        0 0 3px #fff,
        1px 0 0 #fff,
        -1px 0 0 #fff,
        0 1px 0 #fff,
        0 -1px 0 #fff;
}

.kenn-head-row {
    min-height: 1.4rem;
    flex-wrap: nowrap;
}
.kenn-head-title {
    flex-wrap: nowrap !important;
    min-height: 1.2rem;
    overflow: hidden;
}
.kenn-head-sn {
    flex: 0 0 9.5rem;
}
.kenn-head-fw {
    flex: 0 0 4.5rem;
}
.kenn-head-lizenz {
    flex: 1 1 auto;
    min-width: 8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.kenn-head-row .progress-bar {
    flex: 0 0 14rem !important;
    visibility: visible;
}
.kenn-head-row .progress-bar.progress-idle {
    visibility: hidden;
}
.menubar-drop-list button:hover,
.menubar-drop-list button:focus {
    background: #dce6f0;
}
.menubar-drop:not(.open) .menubar-drop-list button:hover {
    background: #f7f4ee;
}

.kenn-head-title {
    font-weight: 400 !important;
}
.kenn-head-ml {
    font-weight: 700;
    flex: 0 0 5.6rem;
}
.kenn-head-sn-lab {
    font-weight: 400 !important;
    flex: 0 0 5.2rem;
    color: #333;
}
.kenn-head-sn {
    font-weight: 400 !important;
    flex: 0 0 4.6rem;
}
.kenn-head-fw {
    font-weight: 700;
    flex: 0 0 4.4rem;
}
.kenn-head-lizenz {
    font-weight: 700;
    min-width: 0;
    max-width: 18rem;
}
.kenn-wert-2z {
    height: 2.5em;
    max-height: 2.5em;
    overflow: hidden;
}

.kenn-subcol .kenn-item .kenn-label {
    /* Lizenz sits above Kommentar */
}
.kenn-wert-2z {
    height: 3.2em;
    max-height: 3.2em;
    margin-top: 0.15rem;
}

.kenn-head-sn-lab {
    flex: 0 0 auto !important;
    margin-right: 0.35rem;
}
.kenn-head-sn {
    flex: 0 0 auto !important;
    margin-right: 1.25rem;
}
.kenn-head-fw {
    margin-left: 0;
}

.kenn-head-sn-lab { font-weight: 400 !important; }
.kenn-head-sn { font-weight: 700 !important; }

.mess-split {
    display: flex !important;
    flex-direction: row;
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding: 0.35rem 0.5rem 0.4rem;
    gap: 0;
}
.mess-chart-pane {
    flex: 1 1 var(--split-chart, 58%);
    width: var(--split-chart, 58%);
    min-width: 12rem;
    max-width: calc(100% - 10rem);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
.mess-table-pane {
    flex: 1 1 auto;
    min-width: 10rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
.mess-split-handle {
    flex: 0 0 8px;
    cursor: col-resize;
    background: linear-gradient(#d0cbc0, #d0cbc0) center/2px 100% no-repeat;
    background-color: transparent;
}
.mess-split-handle:hover,
.mess-split.dragging .mess-split-handle {
    background-color: #c5d4e4;
}
.mess-chart-pane .chart-wrap {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
}
.mess-chart-pane .hint {
    flex: 0 0 auto;
    margin: 0.2rem 0 0;
}
.mess-table-pane .row {
    flex: 0 0 auto;
}
.kks-table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto !important;
    max-height: none !important;
}
body.mess-dragging {
    cursor: col-resize;
    user-select: none;
}
@media (max-width: 900px) {
    .mess-split {
        flex-direction: column;
    }
    .mess-split-handle {
        flex: 0 0 8px;
        cursor: row-resize;
        background: linear-gradient(#d0cbc0, #d0cbc0) 50%/100% 2px no-repeat;
    }
    .mess-chart-pane {
        width: auto;
        max-width: none;
        flex: 1 1 var(--split-chart, 50%);
        min-height: 10rem;
    }
}

/* Immer Grafik | Slider | Tabelle nebeneinander */
.mess-split,
.mess-split#mess-ansicht {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
}
@media (max-width: 900px) {
    .mess-split,
    .mess-split#mess-ansicht {
        flex-direction: row !important;
        grid-template-columns: unset !important;
    }
}
.mess-split-handle {
    flex: 0 0 10px !important;
    width: 10px !important;
    min-width: 10px !important;
    align-self: stretch;
    cursor: col-resize !important;
    background: #c5bfb3 !important;
    border-left: 1px solid #b0aaa0;
    border-right: 1px solid #b0aaa0;
    border-radius: 2px;
    margin: 0 2px;
}
.mess-split-handle:hover,
.mess-split.dragging .mess-split-handle {
    background: #1f4e79 !important;
}
.mess-chart-pane {
    flex: 1 1 58% !important;
    max-width: none;
}
.mess-table-pane {
    flex: 1 1 42% !important;
}

table.kks th.col-zeit,
table.kks td.col-zeit {
    width: 1%;
    white-space: nowrap;
    padding-left: 0.45rem;
    padding-right: 0.55rem;
}
table.kks th.col-k,
table.kks td.col-k {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
table.kks td.col-k1, table.kks th.col-k1 { color: #1f4e79; }
table.kks td.col-k2, table.kks th.col-k2 { color: #c0392b; }
table.kks td.col-k3, table.kks th.col-k3 { color: #1b7a3a; }
table.kks td.col-k4, table.kks th.col-k4 { color: #e67e22; }

table.kks {
    width: auto !important;
    max-width: 100%;
    table-layout: auto !important;
}
table.kks thead th {
    color: inherit;
}
table.kks thead th.col-k1,
table.kks thead th.col-k2,
table.kks thead th.col-k3,
table.kks thead th.col-k4 {
    color: inherit !important;
}
table.kks th.col-zeit,
table.kks td.col-zeit {
    width: 1% !important;
    max-width: 6.2rem !important;
    padding: 0.2rem 0.4rem !important;
    white-space: nowrap !important;
}
table.kks th.col-k,
table.kks td.col-k {
    width: 1% !important;
    padding: 0.15rem 0.28rem !important;
    white-space: nowrap !important;
}
table.kks td.col-k1 { color: #1f4e79 !important; }
table.kks td.col-k2 { color: #c0392b !important; }
table.kks td.col-k3 { color: #1b7a3a !important; }
table.kks td.col-k4 { color: #e67e22 !important; }

.mess-chart-pane {
    flex: 0 0 var(--split-chart, 62%) !important;
    width: var(--split-chart, 62%) !important;
    max-width: none !important;
}
.mess-table-pane {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
}
.mess-split-handle {
    flex: 0 0 12px !important;
    width: 12px !important;
    z-index: 5;
    position: relative;
}
table.kks {
    width: max-content !important;
    min-width: 0 !important;
}
.kks-table-wrap {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    width: auto;
    max-width: 100%;
}
table.kks th.col-zeit,
table.kks td.col-zeit {
    width: auto !important;
    max-width: none !important;
}

.mess-datum {
    flex: 0 0 auto;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.15rem 0.35rem 0.25rem;
    color: var(--fg);
}
table.kks thead th {
    text-align: center !important;
}
table.kks th.col-zeit,
table.kks td.col-zeit {
    text-align: right !important;
    padding-left: 0.45rem !important;
    padding-right: 3px !important;
}
table.kks th.col-k,
table.kks td.col-k {
    padding-left: 10px !important;
    padding-right: 3px !important;
}
#series-nav { display: none !important; }

.mess-datum {
    text-align: center;
    font-weight: 700;
    font-size: 0.92rem;
    padding: 0.25rem 0.4rem;
    background: #e8e8e8;
    border: 1px solid #c8c8c8;
    border-bottom: 0;
}
table.kks thead th {
    text-align: center !important;
    background: #f3f3f3 !important;
    font-weight: 600;
    border: 1px solid #c8c8c8;
    color: #111 !important;
}
table.kks tbody tr:nth-child(odd) td {
    background: #fff;
}
table.kks tbody tr:nth-child(even) td {
    background: #8ec8f0 !important;
}
table.kks td.col-zeit {
    text-align: right !important;
    padding-right: 3px !important;
    padding-left: 8px !important;
}
table.kks td.col-k {
    padding-left: 10px !important;
    padding-right: 3px !important;
}
table.kks td.col-kom {
    min-width: 4rem;
    text-align: left !important;
    color: #111 !important;
    padding-left: 6px !important;
}
table.kks tbody tr.cursor-row td {
    outline: none;
    background: #5eaee6 !important;
}

table.kks td.col-kom {
    min-width: 6rem;
    padding: 0 2px !important;
    background: inherit;
}
.kom-input {
    width: 100%;
    min-width: 5rem;
    border: 0;
    background: transparent;
    font: inherit;
    padding: 0.1rem 4px;
    color: inherit;
}
.kom-input:focus {
    background: #fff;
    outline: 1px solid var(--accent);
}

.mess-datum {
    text-align: center !important;
    font-weight: 700 !important;
    font-size: 0.95rem;
    padding: 0.2rem 0.3rem 0.15rem !important;
    background: transparent !important;
    border: 0 !important;
}
table.kks {
    font-size: 0.8rem;
    line-height: 1.15;
}
table.kks thead th {
    padding: 0.12rem 0.25rem !important;
    line-height: 1.2;
}
table.kks thead th.col-kom {
    text-align: center !important;
}
table.kks td {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 1.2;
    height: 1.25rem;
}
table.kks td.col-kom {
    padding: 0 !important;
    min-width: 5rem;
}
.kom-input {
    display: block;
    width: 100%;
    height: 1.25rem;
    border: 0 !important;
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
    font: inherit;
    line-height: 1.25rem;
    padding: 0 4px !important;
    color: inherit;
}
.kom-input:focus {
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
}

table.kks td.col-zeit {
    padding-left: 10px !important;
    padding-right: 8px !important;
}
table.kks td.col-k {
    padding-left: 12px !important;
    padding-right: 8px !important;
}
table.kks td.col-kom,
table.kks th.col-kom {
    min-width: 7rem;
    padding-left: 8px !important;
    padding-right: 8px !important;
}
table.kks thead th {
    padding: 0.2rem 0.4rem !important;
}
.kks-table-wrap {
    overflow-x: auto !important;
    overflow-y: auto !important;
}
.mess-table-pane {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: 70%;
}

.kks-table-wrap {
    overflow-x: auto !important;
    overflow-y: auto !important;
}
table.kks {
    width: max-content !important;
}

.mess-table-pane {
    overflow: hidden !important;
    flex: 0 0 auto !important;
}
.kks-table-wrap {
    overflow-x: auto !important;
    overflow-y: auto !important;
    scrollbar-gutter: stable;
}
table.kks {
    width: max-content !important;
}
table.kks th.col-zeit,
table.kks td.col-zeit {
    min-width: 6.6rem !important;
    padding-left: 12px !important;
    padding-right: 10px !important;
}

.mess-datum {
    margin: 0 !important;
    padding: 0 0 2px 0 !important;
    line-height: 1.2;
    background: transparent !important;
    border: 0 !important;
}
.mess-table-pane {
    padding: 0 !important;
    gap: 0 !important;
}
.kks-table-wrap {
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0;
}
.mess-split-handle {
    flex: 0 0 6px !important;
    width: 6px !important;
    min-width: 6px !important;
    margin: 0 !important;
}
table.kks th.col-zeit,
table.kks td.col-zeit {
    min-width: 7.2rem !important;
}

.mess-table-pane {
    flex: 0 0 auto !important;
    width: fit-content !important;
    max-width: none !important;
    min-width: 0 !important;
}
.kks-table-wrap {
    width: fit-content !important;
    max-width: none !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
}
table.kks {
    width: max-content !important;
    max-width: none !important;
}

.mess-table-pane {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto !important;
    overflow: hidden !important;
    min-width: 0 !important;
}
.mess-datum {
    flex: 0 0 auto;
    margin: 0 !important;
    padding: 0 0 2px !important;
}
.kks-head {
    flex: 0 0 auto;
    overflow: hidden;
}
.kks-head table.kks thead th {
    position: static !important;
}
.kks-table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    width: auto !important;
    max-width: none !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
}
table.kks {
    width: max-content !important;
    border-collapse: collapse;
}

.kks-head {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}
.kks-head::-webkit-scrollbar { height: 0; display: none; }

#mess-table-pane.mess-table-pane {
    flex: 0 0 auto !important;
    width: auto !important;
}
#kks-head,
#kks-table-wrap {
    width: auto !important;
    max-width: none !important;
}
#mess-table-head-tbl,
#mess-table {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    table-layout: fixed !important;
}
#mess-table td,
#mess-table-head-tbl th {
    box-sizing: border-box;
}
.mess-datum {
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1.25;
}
.kks-head { margin: 0; padding: 0; }

#mess-table,
#mess-table-head-tbl,
.kks-head table,
.kks-table-wrap table {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}
.kks-head,
.kks-table-wrap {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

#mess-table-head-tbl th.col-zeit,
#mess-table td.col-zeit {
    width: 91px !important;
    min-width: 91px !important;
    max-width: 91px !important;
    box-sizing: border-box !important;
}

#mess-table-head-tbl th.col-kom,
#mess-table td.col-kom {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
}
#mess-table-head-tbl th.col-k,
#mess-table td.col-k {
    width: 78px !important;
    min-width: 78px !important;
    max-width: 78px !important;
}
#mess-table-pane {
    flex: 0 0 auto !important;
}

.mess-split {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch;
}
.mess-chart-pane {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
}
.mess-split-handle {
    flex: 0 0 6px !important;
    width: 6px !important;
}
#mess-table-pane {
    flex: 0 0 auto !important;
    width: max-content !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    overflow: hidden !important;
}
#kks-head,
#kks-table-wrap {
    width: auto !important;
    max-width: none !important;
    margin-left: auto;
}
#mess-table-head-tbl,
#mess-table {
    width: max-content !important;
    margin-left: auto !important;
    margin-right: 0 !important;
    table-layout: auto !important;
}
#mess-table-head-tbl th.col-k,
#mess-table td.col-k,
#mess-table-head-tbl th.col-kom,
#mess-table td.col-kom {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
}
#mess-table-head-tbl th.col-zeit,
#mess-table td.col-zeit {
    width: auto !important;
    max-width: 91px !important;
}

#mess-table-pane {
    flex: 0 0 auto !important;
    width: max-content !important;
}
#kks-table-wrap {
    overflow: auto !important;
    width: auto !important;
}
#mess-table {
    width: max-content !important;
    margin: 0 !important;
    table-layout: auto !important;
}
#mess-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}
.mess-chart-pane {
    flex: 1 1 auto !important;
    width: auto !important;
}
.mess-split-handle {
    flex: 0 0 6px !important;
    cursor: col-resize !important;
    z-index: 8;
}

.chart-ctx-menu {
    position: fixed;
    z-index: 4000;
    background: #fff;
    border: 1px solid #c8c2b6;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    padding: 0.2rem 0;
    min-width: 10rem;
}
.chart-ctx-menu button {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 0.35rem 0.8rem;
    cursor: pointer;
    font: inherit;
}
.chart-ctx-menu button:hover {
    background: #e8eef5;
}

.chart-ctx-menu {
    background: #f7f4ee !important;
    border: 1px solid #5c584f !important;
}
.chart-ctx-menu button {
    color: #1c1b18 !important;
    background: #f7f4ee !important;
}
.chart-ctx-menu button:hover {
    background: #d6e4f5 !important;
    color: #1c1b18 !important;
}

.mess-chart-pane .chart-wrap {
    position: relative;
    flex: 1 1 auto !important;
    min-height: 120px !important;
    height: auto !important;
}
.mess-chart-pane .chart-wrap canvas,
#mess-chart {
    position: absolute;
    left: 0;
    top: 0;
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.mess-split-handle {
    background: transparent !important;
    background-image: none !important;
}
.mess-split-handle:hover,
.mess-split.dragging .mess-split-handle {
    background-color: rgba(0, 0, 0, 0.06) !important;
}

/* Slider nur bei Hover/Ziehen sichtbar */
.mess-split-handle,
.mess-split .mess-split-handle {
    background: transparent !important;
    background-image: none !important;
    border: none !important;
    border-left: none !important;
    border-right: none !important;
    box-shadow: none !important;
}
.mess-split-handle:hover,
.mess-split.dragging .mess-split-handle {
    background: rgba(31, 78, 121, 0.18) !important;
    background-image: none !important;
}

.chart-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    position: relative;
}
.chart-toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}
.chart-info-wrap {
    position: relative;
    flex: 0 0 auto;
    margin-left: auto;
}
.chart-info-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid #8a8680;
    background: #f4f1ea;
    color: #3a3834;
    font: italic 700 13px "Times New Roman", serif;
    line-height: 20px;
    padding: 0;
    cursor: pointer;
}
.chart-info-btn:hover,
.chart-info-btn.open {
    background: #1f4e79;
    color: #fff;
    border-color: #1f4e79;
}
.chart-info-pop {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 30;
    min-width: 16rem;
    padding: 0.55rem 0.7rem;
    background: #fffef9;
    border: 1px solid #c8c2b6;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    color: #3a3834;
    font-size: 0.82rem;
    line-height: 1.45;
    white-space: nowrap;
}
.mess-chart-pane > .hint { display: none; }

#kenn-band {
    box-sizing: border-box;
}
.chart-stats {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0 0.6rem;
    font-size: 0.78rem;
    color: #3a3834;
}
.chart-stats-scope {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    white-space: nowrap;
    color: #5c584f;
    cursor: pointer;
}
.chart-stats-scope input { margin: 0; }
.chart-stats-body {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.85rem;
    min-width: 0;
    flex: 1 1 auto;
}
.chart-stat-ch {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    white-space: nowrap;
}
.chart-stat-ch b {
    font-weight: 700;
}
.chart-stat-ch span { color: #4a4741; }

.stat-scope-row {
    display: flex;
    gap: 0.7rem;
    padding: 0 0.35rem 0.15rem;
    font-size: 0.78rem;
    color: #5c584f;
}
.stat-table {
    width: max-content;
    margin: 0;
    border-bottom: 1px solid #c8c2b6;
}
.stat-table th,
.stat-table td {
    padding: 1px 10px 1px 3px;
    font-size: 0.78rem;
    line-height: 1.25;
}
.stat-table th.col-zeit,
.stat-table td.col-zeit {
    text-align: right;
    padding-right: 3px;
    font-weight: 600;
}
.stat-table td.col-k { text-align: right; }

.kenn-stat-row {
    display: flex;
    align-items: stretch;
    width: 100%;
    min-width: 0;
}
.kenn-stat-row #kenn-band {
    flex: 0 0 auto;
}
.stat-side {
    flex: 1 1 auto;
    min-width: 0;
    overflow: auto;
    padding: 0 0.35rem 0.15rem;
    box-sizing: border-box;
}

.stat-side {
    padding: 0 !important;
    margin: 0;
}
.stat-scope-row {
    padding: 0 0 2px 0 !important;
}
.stat-table {
    width: max-content !important;
    margin: 0 !important;
    table-layout: fixed;
}
.stat-table th.col-zeit,
.stat-table td.col-zeit {
    width: 91px !important;
    min-width: 91px !important;
    max-width: 91px !important;
    box-sizing: border-box !important;
    text-align: right !important;
    padding-left: 12px !important;
    padding-right: 10px !important;
}
.stat-table th.col-k,
.stat-table td.col-k {
    padding-left: 10px !important;
    padding-right: 3px !important;
    text-align: right !important;
}
.mess-table-pane .mess-datum {
    text-align: center;
    font-weight: 700;
    padding: 2px 0 !important;
}

#view-messung {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.mess-work {
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
    display: flex;
    flex-direction: column;
}
.mess-work .mess-split {
    flex: 1 1 auto;
    min-height: 0;
}
#mess-table {
    width: 100% !important;
    min-width: 100% !important;
}
#mess-table th.col-kom,
#mess-table td.col-kom {
    width: auto !important;
    min-width: 7rem !important;
    max-width: none !important;
}
#kks-table-wrap,
.kks-table-wrap {
    background: #d4edfc;
}


#kks-table-wrap,
.kks-table-wrap {
    background: #d4edfc;
}

#mess-table thead th.col-k,
#stat-table thead th.col-k,
table.kks thead th.col-k {
    text-align: center !important;
}
#stat-table th.col-k {
    text-align: center !important;
}

#mess-table th.col-zeit,
#mess-table td.col-zeit,
#stat-table th.col-zeit,
#stat-table td.col-zeit {
    width: calc(4.6rem + 20px) !important;
    min-width: calc(4.6rem + 20px) !important;
    max-width: calc(4.6rem + 20px) !important;
    box-sizing: border-box !important;
}

.stat-side { display: flex; }
.mess-table-pane {
    min-width: 34rem !important;
}
#kks-table-wrap {
    overflow: auto !important;
}
#stat-table,
#mess-table {
    min-width: 34rem;
}
#stat-table {
    width: max-content;
    border-bottom: 1px solid #c8c2b6;
}
.stat-scope-row {
    flex: 0 0 auto;
}

.stat-side {
    display: flex !important;
    flex-direction: column;
    overflow: hidden !important;
    min-width: 34rem;
}
.stat-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}
.stat-scroll::-webkit-scrollbar { display: none; }
#stat-table {
    margin: 0;
}

.panel-tabs {
    display: flex;
    gap: 0;
    flex: 0 0 auto;
    padding: 0 0.35rem;
    background: #e8e4da;
    border-bottom: 1px solid #c8c2b6;
}
.panel-tab {
    border: 0;
    border-right: 1px solid #c8c2b6;
    background: transparent;
    color: #3a3834;
    font: 600 0.8rem Segoe UI, Tahoma, sans-serif;
    padding: 0.28rem 0.75rem;
    cursor: pointer;
}
.panel-tab:hover { background: #f3efe6; }
.panel-tab.active {
    background: #f4f1ea;
    color: #1f4e79;
    box-shadow: inset 0 -2px 0 #1f4e79;
}
.kenn-stat-row {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.2s ease, opacity 0.15s ease;
}
.kenn-stat-row.open {
    max-height: 12rem;
    opacity: 1;
    pointer-events: auto;
    overflow: hidden;
}
.kenn-stat-row .kenn-band { display: none; }
.kenn-stat-row .stat-side { display: none !important; }
.kenn-stat-row.show-kenn .kenn-band { display: block; }
.kenn-stat-row.show-stat .stat-side { display: flex !important; }

.kenn-stat-row {
    display: flex !important;
    align-items: stretch !important;
    flex: 0 0 auto !important;
    height: auto !important;
}
.kenn-stat-row:not(.open) {
    max-height: 0 !important;
    min-height: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    border: 0 !important;
}
.kenn-stat-row.open {
    max-height: none !important;
    min-height: 7.5rem !important;
    height: auto !important;
    overflow: visible !important;
    opacity: 1 !important;
}
.kenn-stat-row.open.show-kenn #kenn-band,
.kenn-stat-row.show-kenn #kenn-band {
    display: block !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
}
.kenn-stat-row.open.show-stat #stat-side,
.kenn-stat-row.show-stat .stat-side {
    display: flex !important;
    height: auto !important;
    min-height: 6rem !important;
}

.panel-tabs {
    align-items: stretch;
}
.panel-tabs .progress-bar {
    flex: 1 1 auto;
    min-width: 8rem;
    height: auto;
    margin: 3px 8px 3px 12px;
    border: 1px solid #c8c2b6;
    border-radius: 3px;
    align-self: center;
}
.panel-tabs .progress-bar.progress-idle {
    opacity: 0.35;
}
.panel-tabs .progress-bar-text {
    color: #222;
    text-shadow: none;
}

.panel-tabs {
    min-height: 2rem;
    align-items: center !important;
}
.panel-tabs #progress-wrap,
.panel-tabs .progress-bar {
    display: block !important;
    position: relative !important;
    flex: 1 1 auto !important;
    height: 1.35rem !important;
    min-height: 1.35rem !important;
    max-height: 1.35rem !important;
    margin: 0 0.6rem 0 0.8rem !important;
    background: #e5e0d6 !important;
    border: 1px solid #b0aaa0 !important;
    border-radius: 3px !important;
    overflow: hidden !important;
    visibility: visible !important;
    opacity: 1 !important;
}
.panel-tabs .progress-bar-fill {
    display: block !important;
    height: 100% !important;
    background: #8fb4d4 !important;
}
.panel-tabs .progress-bar-text {
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: #1a1a1a !important;
    font-weight: 700;
    font-size: 0.78rem;
    text-shadow: none;
}

.panel-tabs #progress-wrap,
.panel-tabs .progress-bar {
    flex: 0 0 14rem !important;
    width: 14rem !important;
    max-width: 14rem !important;
    min-width: 14rem !important;
    margin-left: auto !important;
    margin-right: 0.5rem !important;
}

.panel-tabs .progress-bar.progress-idle,
.panel-tabs #progress-wrap.progress-idle {
    visibility: hidden !important;
    opacity: 0 !important;
}

.chart-body {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
}
.kanal-panel {
    flex: 0 0 11.6rem;
    width: 11.6rem;
    overflow: auto;
    padding: 0.25rem 0.3rem 0.4rem 0.25rem;
    border-right: 1px solid #d0cbc0;
    background: #f7f4ee;
}
.kanal-card {
    border: 1px solid #d0cbc0;
    border-radius: 4px;
    padding: 0.28rem 0.32rem 0.35rem;
    margin-bottom: 0.3rem;
    background: #fffef9;
    font-size: 0.72rem;
}
.kanal-card-head {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.2rem;
}
.kanal-card-head input[type="color"] {
    width: 1.3rem;
    height: 1.15rem;
    padding: 0;
    border: 1px solid #bbb;
    background: #fff;
}
.kanal-card-head input[type="text"] {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.72rem;
    padding: 1px 3px;
}
.kanal-card-row {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.15rem;
}
.kanal-card-row label { color: #5c584f; }
.kanal-card-row input[type="number"] {
    width: 3.2rem;
    font-size: 0.72rem;
    padding: 1px 2px;
}
.kanal-card select {
    font-size: 0.72rem;
    padding: 1px 2px;
}
.kanal-aktiv {
    margin-left: auto;
    white-space: nowrap;
}

.kanal-panel {
    flex: 0 0 13rem !important;
    width: 13rem !important;
    background: #eef1f4 !important;
    border-right: 1px solid #d5dbe2 !important;
    padding: 0.45rem 0.4rem 0.6rem !important;
}
.kanal-card {
    background: #fff !important;
    border: 0 !important;
    border-radius: 10px !important;
    box-shadow: 0 1px 2px rgba(20, 40, 70, 0.06), 0 0 0 1px rgba(20, 40, 70, 0.06);
    padding: 0.55rem 0.55rem 0.5rem !important;
    margin-bottom: 0.45rem !important;
    font-size: 0.75rem;
    position: relative;
    overflow: hidden;
}
.kanal-card::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--ch, #1f4e79);
}
.kanal-card.is-off { opacity: 0.55; }
.kanal-card-head {
    gap: 0.4rem !important;
    margin-bottom: 0.4rem !important;
}
.kanal-color {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #c5ccd4;
    flex: 0 0 auto;
}
.kanal-color input {
    transform: scale(1.8);
    transform-origin: center;
    cursor: pointer;
    border: 0 !important;
    width: 1.35rem !important;
    height: 1.35rem !important;
    padding: 0 !important;
}
.kanal-titel {
    flex: 1 1 auto;
    min-width: 0;
    border: 0 !important;
    border-bottom: 1px solid #e2e6ea !important;
    background: transparent !important;
    font: 600 0.82rem/1.3 Segoe UI, system-ui, sans-serif !important;
    padding: 2px 0 !important;
    color: #1c2330;
}
.kanal-titel:focus {
    outline: none;
    border-bottom-color: var(--ch, #1f4e79) !important;
}
.kanal-switch {
    position: relative;
    width: 2rem;
    height: 1.15rem;
    flex: 0 0 auto;
    margin-left: auto;
}
.kanal-switch input { display: none; }
.kanal-switch span {
    position: absolute;
    inset: 0;
    background: #cfd5dc;
    border-radius: 99px;
    transition: background 0.15s;
}
.kanal-switch span::after {
    content: "";
    position: absolute;
    top: 2px; left: 2px;
    width: 0.85rem;
    height: 0.85rem;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    transition: transform 0.15s;
}
.kanal-switch input:checked + span { background: var(--ch, #1f4e79); }
.kanal-switch input:checked + span::after { transform: translateX(0.82rem); }
.kanal-seg {
    display: flex;
    background: #eef1f4;
    border-radius: 8px;
    padding: 2px;
    margin-bottom: 0.4rem;
}
.kanal-seg button {
    flex: 1;
    border: 0;
    background: transparent;
    border-radius: 6px;
    padding: 0.18rem 0;
    font: 600 0.75rem Segoe UI, system-ui, sans-serif;
    color: #5b6570;
    cursor: pointer;
}
.kanal-seg button.on {
    background: #fff;
    color: #1c2330;
    box-shadow: 0 1px 2px rgba(20,40,70,0.12);
}
.kanal-card-row {
    gap: 0.4rem !important;
}
.kanal-card-row label {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.65rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #7a838c !important;
}
.kanal-card-row input[type="number"] {
    width: 100% !important;
    border: 1px solid #e2e6ea;
    border-radius: 6px;
    background: #f7f9fb;
    padding: 0.22rem 0.3rem !important;
    font: 0.78rem Segoe UI, system-ui, sans-serif !important;
    color: #1c2330;
}
.kanal-card-row input[type="number"]:focus {
    outline: none;
    border-color: var(--ch, #1f4e79);
    background: #fff;
}

.kanal-panel {
    display: none;
}
.kanal-panel.open {
    display: block;
}
.kanal-panel {
    scrollbar-width: thin;
    scrollbar-color: #b7c0c9 transparent;
}
.kanal-panel::-webkit-scrollbar {
    width: 8px;
}
.kanal-panel::-webkit-scrollbar-track {
    background: transparent;
    margin: 6px 0;
}
.kanal-panel::-webkit-scrollbar-thumb {
    background: #c5ced6;
    border-radius: 99px;
    border: 2px solid #eef1f4;
}
.kanal-panel::-webkit-scrollbar-thumb:hover {
    background: #9aa6b2;
}
.kanal-einheit {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 0.4rem;
}
.kanal-feld-lab {
    font-size: 0.65rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #7a838c;
}
.kanal-einheit .kanal-seg { margin-bottom: 0; }

.chart-body {
    display: flex !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    min-width: 0 !important;
}
.chart-body .chart-wrap {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
}
.kanal-panel:not(.open) {
    display: none !important;
    width: 0 !important;
    flex: 0 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
}

.chart-toolbar { display: none !important; height: 0 !important; }
.mess-chart-pane,
.mess-table-pane {
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    height: 100% !important;
}
.chart-body {
    flex: 1 1 auto !important;
    height: 100% !important;
}
.chart-wrap {
    position: relative !important;
}
.chart-wrap .chart-info-wrap {
    position: absolute;
    top: 6px;
    right: 8px;
    z-index: 8;
    margin: 0;
}
.chart-info-pop {
    right: 0;
    left: auto;
}

.panel-tabs {
    display: flex !important;
    align-items: center !important;
    gap: 0.45rem !important;
    padding: 0.35rem 0.55rem !important;
    background: #eef1f4 !important;
    border-bottom: 1px solid #d5dbe2 !important;
    min-height: 2.4rem;
}
.panel-tabs .panel-tab {
    border: 0 !important;
    border-right: 0 !important;
    background: transparent !important;
    color: #5b6570 !important;
    font: 600 0.78rem Segoe UI, system-ui, sans-serif !important;
    padding: 0.28rem 0.85rem !important;
    border-radius: 999px !important;
    box-shadow: none !important;
    letter-spacing: 0.01em;
}
.panel-tabs .panel-tab:hover {
    background: #e3e8ed !important;
    color: #1c2330 !important;
}
.panel-tabs .panel-tab.active {
    background: #fff !important;
    color: #1c2330 !important;
    box-shadow: 0 1px 2px rgba(20, 40, 70, 0.12) !important;
}
.panel-tabs #progress-wrap {
    margin-left: auto !important;
}

.stat-side {
    padding: 0.2rem 0.2rem 0.15rem !important;
    min-height: 0 !important;
}
.stat-scope-row {
    display: flex !important;
    justify-content: flex-end;
    padding: 0 0 0.15rem !important;
    margin: 0 !important;
}
.stat-seg {
    width: auto;
    min-width: 9rem;
    margin: 0 !important;
}
.stat-seg button {
    padding: 0.12rem 0.55rem !important;
    font-size: 0.72rem !important;
}
.stat-table th,
.stat-table td {
    padding-top: 1px !important;
    padding-bottom: 1px !important;
    line-height: 1.15 !important;
    font-size: 0.75rem !important;
}
.kenn-stat-row.open {
    min-height: 0 !important;
}
.kenn-stat-row.open.show-stat #stat-side,
.kenn-stat-row.show-stat .stat-side {
    min-height: 0 !important;
}

#mess-table th.col-k,
#mess-table td.col-k,
#stat-table th.col-k,
#stat-table td.col-k {
    min-width: 5.6rem !important;
    width: 5.6rem;
    box-sizing: border-box !important;
}

.mess-table-pane {
    min-width: 0 !important;
    overflow: hidden !important;
}
#kks-table-wrap {
    overflow-x: auto !important;
    overflow-y: auto !important;
}
#mess-table {
    width: max-content !important;
}
#stat-table {
    min-width: 0 !important;
}
.stat-side {
    min-width: 0 !important;
}

.chart-ctx-menu {
    position: fixed;
    z-index: 80;
    min-width: 12rem;
    background: #fff;
    color: #1c2330;
    border: 1px solid #c5ccd4;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(20, 40, 70, 0.16);
    padding: 0.25rem;
    font: 600 0.8rem Segoe UI, system-ui, sans-serif;
}
.chart-ctx-menu button {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: #1c2330;
    padding: 0.38rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
}
.chart-ctx-menu button:hover,
.chart-ctx-menu button.on {
    background: #eef1f4;
}

.chart-ctx-menu .chart-ctx-seg {
    display: flex;
    gap: 2px;
    background: #eef1f4;
    border-radius: 8px;
    padding: 2px;
    margin-bottom: 0.3rem;
}
.chart-ctx-menu .chart-ctx-seg button {
    flex: 1;
    text-align: center;
    border-radius: 6px;
    padding: 0.4rem 0.35rem;
    font-weight: 600;
    color: #5b6570;
}
.chart-ctx-menu .chart-ctx-seg button.on {
    background: #fff;
    color: #1c2330;
    box-shadow: 0 1px 2px rgba(20, 40, 70, 0.12);
}
.chart-ctx-menu .chart-ctx-action {
    width: 100%;
    text-align: left;
    margin-top: 0.1rem;
    padding: 0.4rem 0.55rem;
    border-radius: 6px;
    font-weight: 600;
    color: #1c2330;
}
.chart-ctx-menu .chart-ctx-action:hover {
    background: #eef1f4;
}

.chart-ctx-menu .chart-ctx-seg button.on {
    background: #1f4e79 !important;
    color: #fff !important;
    box-shadow: none !important;
}
.chart-ctx-menu .chart-ctx-seg button.on:hover {
    background: #16385a !important;
    color: #fff !important;
}

table.kks th.col-k1, table.kks td.col-k1 { color: var(--k1, #1f4e79) !important; }
table.kks th.col-k2, table.kks td.col-k2 { color: var(--k2, #c0392b) !important; }
table.kks th.col-k3, table.kks td.col-k3 { color: var(--k3, #1b7a3a) !important; }
table.kks th.col-k4, table.kks td.col-k4 { color: var(--k4, #e67e22) !important; }
table.kks th.col-k5, table.kks td.col-k5 { color: var(--k5, #8e44ad) !important; }
table.kks th.col-k6, table.kks td.col-k6 { color: var(--k6, #16a085) !important; }
table.kks th.col-k7, table.kks td.col-k7 { color: var(--k7, #2c3e50) !important; }
table.kks th.col-k8, table.kks td.col-k8 { color: var(--k8, #d68910) !important; }

.chart-info-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.chart-mode-seg {
    display: flex;
    background: #eef1f4;
    border-radius: 8px;
    padding: 2px;
    box-shadow: 0 1px 2px rgba(20,40,70,0.08);
}
.chart-mode-seg button {
    border: 0;
    background: transparent;
    color: #5b6570;
    font: 600 0.72rem Segoe UI, system-ui, sans-serif;
    padding: 0.22rem 0.55rem;
    border-radius: 6px;
    cursor: pointer;
}
.chart-mode-seg button.on {
    background: #1f4e79;
    color: #fff;
}

.chart-mode-seg button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 1.55rem;
    padding: 0.1rem !important;
}
.chart-mode-seg button svg { display: block; }

.chart-wrap .chart-info-wrap {
    top: 4px;
    right: 8px;
}

.chart-body.stack-sync {
    overflow-x: hidden;
    overflow-y: hidden !important;
    align-items: stretch;
}
.chart-body.stack-sync.stack-scroll {
    overflow-y: auto !important;
}
.chart-body.stack-sync .kanal-panel.open {
    display: block !important;
    position: relative;
    overflow: visible !important;
    height: auto !important;
    flex: 0 0 13rem !important;
}
.chart-body.stack-sync .chart-wrap {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
}
.chart-body.stack-sync .kanal-card {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    margin: 0 0 6px 0 !important;
    box-sizing: border-box;
}
.chart-body:not(.stack-sync) .kanal-card {
    position: relative;
    top: auto;
    height: auto;
}

.chart-body.stack-sync .kanal-panel.open {
    padding-top: 42px !important;
    padding-right: 0.4rem !important;
    padding-bottom: 0 !important;
    padding-left: 0.4rem !important;
    box-sizing: border-box;
}
.chart-body.stack-sync .kanal-card {
    margin: 0 0 6px 0 !important;
}

.chart-body.stack-sync .kanal-panel.open {
    padding: 0 0.4rem 0 !important;
    position: relative !important;
}
.chart-body.stack-sync .kanal-card {
    position: absolute !important;
    left: 0.4rem !important;
    right: 0.4rem !important;
    margin: 0 !important;
    height: auto !important;
}

.chart-body.stack-sync .kanal-panel.open {
    flex: 0 0 11.2rem !important;
    width: 11.2rem !important;
    max-width: 11.2rem !important;
    overflow: hidden !important;
    z-index: 2;
}
.chart-body.stack-sync .chart-wrap {
    z-index: 3;
    min-width: 0 !important;
}
.chart-body.stack-sync .kanal-card {
    left: 0.3rem !important;
    right: 0.3rem !important;
    width: auto !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.chart-body.stack-sync .kanal-panel.open {
    overflow-x: hidden !important;
    overflow-y: visible !important;
    height: auto !important;
    min-height: 100%;
}
.chart-body.stack-sync .kanal-card {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.kanal-panel,
.kanal-panel.open,
.chart-body.stack-sync .kanal-panel.open {
    flex: 0 0 11.2rem !important;
    width: 11.2rem !important;
    max-width: 11.2rem !important;
}

.chart-body:not(.stack-sync) .chart-wrap {
    padding-top: 34px;
    box-sizing: border-box;
}
.chart-body:not(.stack-sync) .chart-wrap canvas,
.chart-body:not(.stack-sync) #mess-chart {
    top: 34px !important;
    height: calc(100% - 34px) !important;
}

.mess-split#mess-ansicht,
.mess-split {
    align-items: stretch !important;
}
.mess-chart-pane,
.mess-table-pane {
    height: 100% !important;
    max-height: 100% !important;
    align-self: stretch !important;
}
.mess-chart-pane {
    overflow: hidden !important;
    border-bottom: 1px solid #c5ccd4;
    box-sizing: border-box;
}
.mess-table-pane {
    border-bottom: 1px solid #c5ccd4;
    box-sizing: border-box;
}
.chart-body {
    min-height: 0 !important;
}

.chart-body:not(.stack-sync) .kanal-panel.open {
    padding: 0.45rem 0.4rem 0.6rem !important;
}
.chart-body:not(.stack-sync) .kanal-card {
    position: relative !important;
    top: auto !important;
    margin: 0 0 0.45rem 0 !important;
    height: auto !important;
}

.chart-stat-btn {
    font-family: "Times New Roman", Times, serif;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1;
}
.chart-stat-btn.on {
    background: #1f4e79 !important;
    color: #fff !important;
}

.stack-tools {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 6;
}
.stack-head {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    pointer-events: auto;
    box-sizing: border-box;
    padding: 0 2px 0 0;
    overflow: hidden;
}
.stack-head .kanal-switch { margin: 0; }
.stack-more {
    border: 1px solid #c5ccd4;
    background: #fff;
    border-radius: 6px;
    width: 1.55rem;
    height: 1.4rem;
    line-height: 1;
    cursor: pointer;
    color: #3a4450;
    padding: 0;
}
.stack-more.on {
    background: #1f4e79;
    color: #fff;
    border-color: #1f4e79;
}
.stack-more-row {
    display: none;
    align-items: center;
    gap: 0.4rem;
    flex: 1 1 auto;
    min-width: 0;
}
.stack-head.open .stack-more-row { display: flex; }
.stack-more-row .kanal-titel { width: 7rem; min-width: 4rem; }
.stack-more-row .kanal-color { flex: 0 0 auto; }
.stack-more-row input[type="number"] { width: 3.2rem; }
.chart-body.stack-sync .kanal-panel.open {
    display: none !important;
    width: 0 !important;
    flex: 0 0 0 !important;
}

.chart-wrap .chart-set-btn {
    position: absolute;
    top: 4px;
    left: 8px;
    z-index: 9;
}
.chart-set-btn.on {
    background: #1f4e79 !important;
    color: #fff !important;
}
.kanal-switch span {
    background: var(--ch, #cfd5dc);
    opacity: 0.38;
}
.kanal-switch input:checked + span {
    background: var(--ch, #1f4e79);
    opacity: 1;
}
.stack-head .kanal-switch { margin-left: 0; }
.chart-body.show-chan-set.stack-sync .stack-more-row { display: flex; }
.chart-body.show-chan-set:not(.stack-sync) .kanal-panel {
    display: block !important;
}

.chart-set-btn svg {
    display: block;
    width: 16px;
    height: 16px;
}
.stack-more-row .kanal-titel {
    width: auto;
    flex: 1 1 6rem;
    min-width: 4rem;
    max-width: 8rem;
    font-size: 0.75rem;
    padding: 1px 3px;
}
.stack-more-row .kanal-feld-lab,
.stack-more-row label {
    font-size: 0.72rem;
}
.stack-more-row input[type="number"] {
    width: 3.2rem;
    font-size: 0.72rem;
    padding: 1px 2px;
}
.stack-more-row .kanal-seg button {
    font-size: 0.72rem;
    padding: 1px 6px;
}
.chart-body.stack-sync.show-chan-set .kanal-panel {
    display: block !important;
    flex: 0 0 11.2rem !important;
    width: 11.2rem !important;
    max-width: 11.2rem !important;
}

.chart-body.stack-sync .kanal-panel,
.chart-body.stack-sync.show-chan-set .kanal-panel,
.chart-body.stack-sync .kanal-panel.open {
    display: none !important;
    width: 0 !important;
    flex: 0 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
}
.chart-set-btn.chart-info-btn {
    width: 22px;
    height: 22px;
    font-size: 0 !important;
    line-height: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center;
}
.chart-set-btn.chart-info-btn svg {
    width: 13px;
    height: 13px;
    margin: 0 auto;
    display: block;
}

.stack-more-row {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(20, 40, 70, 0.06), 0 0 0 1px rgba(20, 40, 70, 0.06);
    padding: 2px 8px 2px 6px;
    margin-left: 0.15rem;
}
.stack-more-row .kanal-titel {
    flex: 0 1 6.5rem;
    max-width: 7.5rem;
    font: 600 0.78rem/1.2 Segoe UI, system-ui, sans-serif !important;
    padding: 1px 0 !important;
}
.stack-more-row .kanal-einheit {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin: 0;
}
.stack-more-row .kanal-feld-lab {
    font-size: 0.62rem;
    color: #6a7380;
    line-height: 1;
}
.stack-more-row .kanal-seg {
    margin: 0;
    min-width: 4.4rem;
}
.stack-more-row .kanal-seg button {
    flex: 1;
    min-width: 1.8rem;
    font-size: 0.72rem;
    padding: 2px 10px;
}
.stack-more-row .kanal-color {
    width: 1.2rem;
    height: 1.2rem;
}
.stack-num {
    display: flex;
    flex-direction: column;
    gap: 1px;
    font-size: 0.62rem;
    color: #6a7380;
}
.stack-num input {
    width: 3.4rem;
    border: 0;
    border-bottom: 1px solid #e2e6ea;
    background: transparent;
    font: 600 0.75rem Segoe UI, system-ui, sans-serif;
    color: #1c2330;
    padding: 1px 0;
}
.stack-num input:focus {
    outline: none;
    border-bottom-color: var(--ch, #1f4e79);
}

.stack-head {
    align-items: flex-end;
}
.stack-head-titel {
    flex: 0 1 7rem;
    max-width: 8rem;
    margin: 0 0.2rem 1px 0.15rem;
}
.stack-head.is-off .stack-head-titel {
    opacity: 0.45;
    color: #6a7380 !important;
    font-weight: 500 !important;
}
.stack-more-row {
    align-items: flex-end !important;
}
.stack-more-row .kanal-titel { display: none; }

.stack-head {
    align-items: center !important;
}
.stack-head-titel {
    margin: 0 0.35rem 0 0.2rem !important;
    align-self: center;
}
.stack-more-row {
    align-items: center !important;
    display: flex !important;
    flex-wrap: nowrap;
    gap: 0.35rem 0.45rem;
    padding: 2px 8px !important;
}
.stack-more-row .kanal-feld-lab {
    font-size: 0.68rem;
    color: #6a7380;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1;
    margin: 0;
}
.stack-more-row .kanal-seg {
    margin: 0 !important;
    padding: 2px;
}
.stack-more-row .kanal-einheit { display: contents; }
.stack-inp {
    width: 3.4rem;
    border: 0;
    border-bottom: 1px solid #e2e6ea;
    background: transparent;
    font: 600 0.75rem Segoe UI, system-ui, sans-serif;
    color: #1c2330;
    padding: 1px 0;
    align-self: center;
}
.stack-inp:focus {
    outline: none;
    border-bottom-color: var(--ch, #1f4e79);
}
.stack-num { display: none; }

.stack-more-row {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none;
    align-self: center;
    padding: 3px 8px !important;
    margin: 0 0 0 0.25rem !important;
    box-sizing: border-box;
}
.stack-head .stack-more-row {
    height: auto;
    min-height: 0;
}

.stack-more-row {
    background: transparent !important;
    box-shadow: none !important;
    border: 1px solid #c5ccd4 !important;
    border-radius: 8px !important;
}

.stack-more-row {
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

.chart-wrap .chart-set-btn {
    position: static !important;
    top: auto !important;
    left: auto !important;
}
.stack-more-row {
    display: none !important;
}
.chart-body.show-chan-set .stack-more-row {
    display: flex !important;
}
.chart-info-wrap {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.stack-vsplit {
    position: absolute;
    height: 7px;
    margin-top: -3px;
    cursor: ns-resize;
    pointer-events: auto;
    z-index: 7;
    background: transparent;
}
.stack-vsplit::after {
    content: "";
    position: absolute;
    left: 12%;
    right: 12%;
    top: 2px;
    height: 3px;
    border-radius: 2px;
    background: #c5ccd4;
}
.stack-vsplit:hover::after,
.stack-split-drag .stack-vsplit::after {
    background: #1f4e79;
}
body.stack-split-drag {
    cursor: ns-resize !important;
    user-select: none !important;
}

.stack-vsplit {
    height: 10px !important;
    margin-top: 0 !important;
    cursor: row-resize !important;
    background: #c5bfb3 !important;
    border-top: 1px solid #b0aaa0;
    border-bottom: 1px solid #b0aaa0;
    border-radius: 2px;
}
.stack-vsplit::after { display: none !important; }
.stack-vsplit:hover,
body.stack-split-drag .stack-vsplit {
    background: #1f4e79 !important;
}
body.stack-split-drag {
    cursor: row-resize !important;
}

.stack-vsplit {
    height: 10px !important;
    margin: 0 !important;
    background: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 2px;
    cursor: row-resize !important;
}
.stack-vsplit::after { display: none !important; content: none !important; }
.stack-vsplit:hover,
body.stack-split-drag .stack-vsplit {
    background: rgba(31, 78, 121, 0.18) !important;
}

#mess-chart { pointer-events: none; z-index: 1; }
#mess-chart-hover.chart-hover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
    pointer-events: auto;
    background: transparent !important;
}

.stack-tools { z-index: 8 !important; }
.stack-vsplit { z-index: 10 !important; }
.chart-wrap .chart-info-wrap { z-index: 12 !important; }

#winlog-busy {
    position: fixed;
    inset: 0;
    z-index: 20000;
    background: rgba(255,255,255,0.35);
    cursor: wait;
}
body.winlog-busy, body.winlog-busy * {
    cursor: wait !important;
}
#winlog-busy span {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #1f4e79;
    color: #fff;
    padding: 0.45rem 0.9rem;
    border-radius: 6px;
    font: 600 0.85rem Segoe UI, sans-serif;
}

.kenn-head-file {
    margin-left: 0.8rem;
    font-weight: 600;
    color: #1f4e79;
    white-space: nowrap;
}

.chart-perf {
    position: absolute;
    left: 8px;
    top: 36px;
    z-index: 15;
    font: 11px/1.3 Consolas, "Segoe UI", monospace;
    color: #3a4338;
    background: rgba(255,253,248,0.88);
    border: 1px solid #c5bfb3;
    padding: 2px 6px;
    pointer-events: none;
    max-width: calc(100% - 16px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mb-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 30px;
    padding: 0;
    border: 1px solid #c5bfb3;
    border-radius: 6px;
    background: #fff;
    color: #1f4e79;
    cursor: pointer;
}
.mb-ico svg { display: block; }
.mb-ico:hover:not(:disabled) { background: #e8eef5; }
.mb-ico:disabled { opacity: 0.4; cursor: default; }
label.mb-ico { margin: 0; }
.menubar { flex-wrap: nowrap; }
.menubar .mb-ico { flex: 0 0 auto; }
.dlg {
    position: fixed;
    inset: 0;
    background: rgba(20,24,28,0.35);
    z-index: 30050;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}
.dlg[hidden] { display: none; }
.dlg-card {
    background: #fffdf8;
    border: 1px solid #c5bfb3;
    border-radius: 8px;
    min-width: 280px;
    padding: 1rem 1.1rem 0.9rem;
    box-shadow: 0 8px 28px rgba(0,0,0,.18);
}
.dlg-card h2 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.dlg-opt { display: flex; gap: 0.5rem; align-items: center; padding: 0.28rem 0; font-size: 0.92rem; }
.dlg-opt-off { color: #8a867c; }
.dlg-act { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 0.8rem; }
.btn-ghost { background: transparent; }

.dlg-field { display: block; font-size: 0.78rem; color: #5c584f; margin: 0.7rem 0 0.85rem; }
.dlg-name {
    display: flex;
    align-items: center;
    margin-top: 0.28rem;
    border: 1px solid #c5bfb3;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}
.dlg-name input {
    flex: 1;
    border: 0;
    padding: 0.5rem 0.7rem;
    font: 0.95rem inherit;
    background: transparent;
}
.dlg-name input:focus { outline: none; }
.dlg-name #save-ext {
    padding: 0.5rem 0.7rem;
    background: #eef2f6;
    color: #1f4e79;
    font-weight: 600;
    font-size: 0.85rem;
}
.dlg-fmts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
}
.dlg-fmt {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid #c5bfb3;
    border-radius: 8px;
    background: #fff;
    color: #1f4e79;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
}
.dlg-fmt span { font-weight: 500; font-size: 0.75rem; color: #5c584f; }
.dlg-fmt.on { border-color: #1f4e79; background: #e8eef5; box-shadow: inset 0 0 0 1px #1f4e79; }
.dlg-fmt:disabled { opacity: 0.4; cursor: default; }
.dlg-act { display: flex; justify-content: flex-end; gap: 0.45rem; margin-top: 1rem; }
.dlg-act .btn-prim {
    background: #1f4e79;
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 0.4rem 0.9rem;
    cursor: pointer;
}
.dlg-act .btn-ghost {
    border: 1px solid #c5bfb3;
    background: #fff;
    border-radius: 6px;
    padding: 0.4rem 0.9rem;
    cursor: pointer;
}
.dlg-card { min-width: 22rem; }

#dlg-save .dlg-fmt {
    background: #fff !important;
    color: #1f4e79 !important;
    border: 1px solid #c5bfb3 !important;
}
#dlg-save .dlg-fmt.on {
    background: #e8eef5 !important;
    border-color: #1f4e79 !important;
}
#dlg-save .dlg-act button {
    min-width: 7.5rem;
    color: #1f4e79 !important;
}
#dlg-save #dlg-save-ok {
    background: #1f4e79 !important;
    color: #fff !important;
}
#dlg-save #dlg-save-cancel {
    background: #fff !important;
    color: #1f4e79 !important;
    border: 1px solid #c5bfb3 !important;
}

.tbl-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 1.4rem;
}
.tbl-bar .mess-datum { flex: 1; }
.tbl-theme {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    border: 1px solid #c5bfb3;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}
.tbl-theme button {
    width: 26px;
    height: 22px;
    padding: 0;
    border: 0;
    background: #fff;
    color: #5c584f;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
}
.tbl-theme button.on {
    background: #1f4e79;
    color: #fff;
}

/* Moderne Tabelle – klassische Regeln bleiben unangetastet */
#mess-table-pane.tbl-modern #kks-table-wrap,
#mess-table-pane.tbl-modern .kks-table-wrap {
    background: #f7f4ee !important;
    border: 1px solid #e4dfd4;
    border-radius: 10px;
}
#mess-table-pane.tbl-modern #mess-table,
#mess-table-pane.tbl-modern #stat-table {
    border-collapse: separate;
    border-spacing: 0;
    font-variant-numeric: tabular-nums;
    font-size: 0.82rem;
}
#mess-table-pane.tbl-modern #mess-table thead th,
#mess-table-pane.tbl-modern #stat-table thead th,
#mess-table-pane.tbl-modern #mess-table-head-tbl th,
#mess-table-pane.tbl-modern table.kks thead th {
    background: #f7f4ee !important;
    color: #6a655c !important;
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 0 !important;
    border-bottom: 1px solid #ddd6c8 !important;
    box-shadow: none !important;
}
#mess-table-pane.tbl-modern table.kks tbody tr:nth-child(odd),
#mess-table-pane.tbl-modern table.kks tbody tr:nth-child(even) {
    background: transparent;
}
#mess-table-pane.tbl-modern table.kks tbody tr:nth-child(odd) td {
    background: #fff !important;
}
#mess-table-pane.tbl-modern table.kks tbody tr:nth-child(even) td {
    background: #f3f0ea !important;
}
#mess-table-pane.tbl-modern table.kks td {
    border-bottom: 1px solid #ece7dc !important;
    padding-top: 0.32rem;
    padding-bottom: 0.32rem;
}
#mess-table-pane.tbl-modern table.kks tbody tr:hover td {
    background: #e7eef6 !important;
}
#mess-table-pane.tbl-modern table.kks tbody tr.cursor-row td {
    background: #d9e6f4 !important;
    outline: none;
    box-shadow: inset 3px 0 0 #1f4e79;
}
#mess-table-pane.tbl-modern td.col-zeit {
    color: #4a463e;
    font-variant-numeric: tabular-nums;
}
#mess-table-pane.tbl-modern td.col-kom input,
#mess-table-pane.tbl-modern td.col-kom {
    background: transparent !important;
    color: #6a655c;
}
#mess-table-pane.tbl-modern .stat-table {
    background: transparent;
}

/* Classic: extra markup stays inline */
.mw-pip { display: none; }
.mw-t, .mw-v { display: inline; }
.mw-u { display: inline; margin-left: 0.25rem; }
.mw-ms { display: inline; margin: 0; padding: 0; }
.mw-ms3 { display: none; }
.mw-ms::before { content: ","; }

#mess-table-pane.tbl-modern .mw-pip {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}
#mess-table-pane.tbl-modern .mw-hn { vertical-align: middle; }
#mess-table-pane.tbl-modern td.col-zeit {
    line-height: 1.15;
    text-align: right !important;
}
#mess-table-pane.tbl-modern .mw-t {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    letter-spacing: 0.01em;
}
#mess-table-pane.tbl-modern .mw-ms { display: none; }
#mess-table-pane.tbl-modern .mw-ms3 {
    display: inline;
    margin: 0 0 0 0.28rem;
    font-size: 0.68rem;
    color: #8a867c;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    vertical-align: baseline;
}
#mess-table-pane.tbl-modern .mw-ms3::after { content: " ms"; }
#mess-table-pane.tbl-modern th.col-zeit,
#mess-table-pane.tbl-modern td.col-zeit {
    width: 7.6rem !important;
    min-width: 7.6rem !important;
    max-width: 8.4rem !important;
    white-space: nowrap !important;
}
#mess-table-pane.tbl-modern td.col-k {
    font-variant-numeric: tabular-nums;
}
#mess-table-pane.tbl-modern .mw-v {
    font-weight: 650;
    font-size: 0.86rem;
}
#mess-table-pane.tbl-modern .mw-u {
    margin-left: 0.35rem;
    font-size: 0.68rem;
    font-weight: 500;
    color: #8a867c;
    opacity: 0.95;
}
#mess-table-pane.tbl-modern .kom-input {
    border: 0;
    background: transparent;
    width: 100%;
    padding: 0.1rem 0.2rem;
    color: #5c584f;
}
#mess-table-pane.tbl-modern .kom-input::placeholder { color: #c0bbb0; }
#mess-table-pane.tbl-modern table.kks tbody tr td:first-child {
    box-shadow: inset 2px 0 0 transparent;
}

#mess-table th.col-gps,
#mess-table td.col-gps {
    width: 32px;
    min-width: 32px;
    max-width: 32px;
    text-align: center;
    padding-left: 2px !important;
    padding-right: 2px !important;
    white-space: nowrap;
}
#mess-table th.col-gps {
    cursor: pointer;
    user-select: none;
}
#mess-table th.col-gps.open,
#mess-table td.col-gps.open {
    width: 168px;
    min-width: 168px;
    max-width: 168px;
    text-align: left;
    padding-left: 6px !important;
}
.gps-pin {
    display: inline-block;
    vertical-align: middle;
}
.gps-txt {
    margin-left: 6px;
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    color: #4a463e;
    font-weight: 500;
}
#mess-table-pane.tbl-modern td.col-gps {
    background: inherit;
}

#mess-table td.col-gps.gps-fix,
#mess-table td.col-gps.gps-carry { cursor: pointer; }
#gps-hint {
    position: fixed;
    left: 50%;
    bottom: 1.4rem;
    transform: translateX(-50%);
    background: #3a3834;
    color: #fff;
    padding: 0.45rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    z-index: 40000;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
#gps-hint[hidden] { display: none !important; }

#wl-tip {
    position: fixed;
    z-index: 50000;
    max-width: 16.5rem;
    padding: 0.45rem 0.6rem 0.5rem;
    background: rgba(28, 32, 36, 0.94);
    color: #f4f1ea;
    border-radius: 8px;
    font: 500 0.78rem/1.35 "Segoe UI", Tahoma, sans-serif;
    box-shadow: 0 8px 24px rgba(0,0,0,.22);
    pointer-events: none;
    backdrop-filter: blur(6px);
}
#wl-tip[hidden] { display: none !important; }
#wl-tip .tip-gps strong {
    display: block;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
    margin-bottom: 0.15rem;
}
#wl-tip .tip-sub { color: #c8c3b8; font-size: 0.72rem; }
#wl-tip .tip-art { margin-top: 0.35rem; }
#wl-tip .tip-leg {
    display: flex;
    gap: 0.7rem;
    margin-top: 0.35rem;
    color: #c8c3b8;
    font-size: 0.7rem;
}
#wl-tip .tip-pin {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    margin-right: 5px;
    vertical-align: 1px;
}
#wl-tip .tip-pin.rot { background: #e74c3c; }
#wl-tip .tip-pin.grau { background: #b0aaa0; }

.stack-vsplit {
    height: 8px !important;
    margin: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    cursor: row-resize !important;
}
.stack-vsplit::after {
    content: "" !important;
    display: block !important;
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    width: 4px !important;
    height: 4px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: #8a867c !important;
    box-shadow: -8px 0 #8a867c, 8px 0 #8a867c !important;
    transform: translate(-50%, -50%) !important;
}
.stack-vsplit:hover,
body.stack-split-drag .stack-vsplit {
    background: transparent !important;
}
.stack-vsplit:hover::after,
body.stack-split-drag .stack-vsplit::after {
    background: #1f4e79 !important;
    box-shadow: -8px 0 #1f4e79, 8px 0 #1f4e79 !important;
}

.stack-pane {
    position: relative;
    pointer-events: none;
    box-sizing: border-box;
}
.stack-pane .stack-head {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 28px;
    overflow: visible !important;
    pointer-events: auto;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    box-sizing: border-box;
    padding: 0 6px;
    z-index: 22;
}
.stack-pane .stack-vsplit {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    top: auto !important;
    width: auto !important;
    pointer-events: auto;
}
.stack-pane.is-collapsed .stack-vsplit { display: none; }

.chart-wrap > .chart-perf { display: none !important; }
.chart-info-wrap { position: relative; }
#chart-perf.chart-perf {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 12;
    max-width: min(42rem, 70vw);
    padding: 0.35rem 0.45rem 0.35rem 0.6rem;
    background: rgba(28, 32, 36, 0.92);
    color: #f3efe6;
    border-radius: 8px;
    font: 500 0.72rem/1.35 "Segoe UI", Tahoma, sans-serif;
    box-shadow: 0 8px 22px rgba(0,0,0,.2);
    pointer-events: auto;
}
#chart-perf.chart-perf[hidden] { display: none !important; }
.chart-perf-body { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-perf-reset {
    flex: 0 0 auto;
    border: 0;
    background: #4a463e;
    color: #fff;
    border-radius: 5px;
    padding: 0.15rem 0.45rem;
    font: 600 0.7rem/1 "Segoe UI", sans-serif;
    cursor: pointer;
}
.chart-perf-reset:hover { background: #1f4e79; }
#chart-diag-btn.open { background: #1f4e79; color: #fff; }

.stack-tools {
    z-index: 20 !important;
    pointer-events: none;
}
.stack-offbar {
    position: absolute;
    top: 8px;
    left: 72px;
    right: 86px;
    height: 28px;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    pointer-events: auto;
    z-index: 21;
}
.stack-offchip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0 0.35rem 0 0.15rem;
    height: 26px;
    pointer-events: auto;
    background: transparent;
}
.stack-offname {
    font-size: 0.78rem;
    color: #6a655c;
    font-weight: 600;
    opacity: 0.75;
}
.stack-pane { z-index: 21; }

.stack-tools.stack-board {
    display: flex !important;
    flex-direction: column;
    inset: 0;
    pointer-events: none;
    z-index: 20 !important;
}
.stack-board .stack-offbar {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    flex: 0 0 30px;
    margin: 4px 86px 0 72px;
    width: auto;
    height: 30px !important;
    pointer-events: auto;
}
.stack-board .stack-pane {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: auto !important;
    height: auto !important;
    display: flex;
    flex-direction: column;
    min-height: 0;
    pointer-events: none;
}
.stack-board .stack-head {
    flex: 0 0 auto;
    height: auto !important;
    margin-left: 72px;
    margin-right: 86px;
    width: auto !important;
    overflow: visible !important;
    pointer-events: auto;
    background: transparent !important;
    border: 0 !important;
}
.stack-board .stack-plot {
    flex: 1 1 auto;
    min-height: 24px;
    margin-left: 72px;
    margin-right: 86px;
    pointer-events: none;
}
.stack-board .stack-xaxis {
    flex: 0 0 36px;
    margin-left: 72px;
    margin-right: 86px;
    pointer-events: none;
}
.stack-board .stack-vsplit {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    width: auto !important;
    flex: 0 0 8px;
    margin-left: 72px;
    margin-right: 86px;
    pointer-events: auto;
}

.stack-tools .stack-pane {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
}
.stack-tools .stack-offbar {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    align-items: center;
}
.stack-tools .stack-vsplit {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
}
.stack-tools.stack-board {
    padding-top: 38px;
    box-sizing: border-box;
}

#stack-tools.stack-board {
    padding-top: 0 !important;
}
#stack-tools .stack-offbar {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.6rem !important;
    flex: 0 0 auto !important;
    min-height: 34px;
    height: auto !important;
    margin: 4px 11.5rem 2px 12px !important;
    width: auto !important;
    z-index: 30 !important;
    pointer-events: auto !important;
}
#stack-tools .stack-offchip {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    display: inline-flex !important;
    flex: 0 0 auto !important;
    align-items: center;
    gap: 0.3rem;
    z-index: 31 !important;
}
#stack-tools .stack-pane {
    position: relative !important;
    top: auto !important;
    left: auto !important;
}

.chart-info-wrap {
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 0.35rem;
    pointer-events: none;
}
.chart-info-wrap > * { pointer-events: auto; }
#stack-offbar.stack-offbar {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    margin: 0 auto 0 0 !important;
    height: auto !important;
    min-height: 0;
    flex: 1 1 auto;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    pointer-events: auto;
    z-index: 40;
}
#stack-offbar[hidden] { display: none !important; }
#stack-offbar .stack-offchip {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    display: inline-flex !important;
    align-items: center;
    gap: 0.28rem;
    margin: 0;
    padding: 0.1rem 0.4rem 0.1rem 0.2rem;
    background: rgba(255,252,246,0.92);
    border-radius: 6px;
    cursor: pointer;
}
#stack-offbar .stack-offchip input { display: none; }
#stack-offbar .stack-offsw {
    width: 1.55rem;
    height: 0.9rem;
    border-radius: 1rem;
    background: #c5bfb3;
    position: relative;
    flex: 0 0 auto;
}
#stack-offbar .stack-offsw::after {
    content: "";
    position: absolute;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: #fff;
    top: 0.1rem;
    left: 0.1rem;
}

#stack-tools.stack-board {
    padding-top: 40px !important;
    box-sizing: border-box;
}
#stack-tools .stack-pane.is-off {
    position: relative !important;
    flex: 0 0 auto !important;
    flex-grow: 0 !important;
    height: auto !important;
    min-height: 28px;
    margin: 0 86px 10px 72px !important;
    z-index: 24;
}
#stack-tools .stack-pane.is-off .stack-head {
    margin-left: 0 !important;
    margin-right: 0 !important;
    position: relative !important;
    z-index: 24;
}
#stack-tools .stack-pane.is-off .stack-plot,
#stack-tools .stack-pane.is-off .stack-xaxis,
#stack-tools .stack-pane.is-off .stack-vsplit {
    display: none !important;
}

#stack-tools.stack-board .stack-pane.is-off {
    margin-bottom: 18px !important;
    padding-bottom: 6px !important;
}
#stack-tools.stack-board .stack-pane.is-off .stack-vsplit,
#stack-tools .stack-pane.is-off .stack-vsplit,
.stack-pane.is-off > .stack-vsplit {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

.chart-body.show-chan-set #stack-tools .stack-more-row,
#stack-tools .stack-pane:not(.is-off) .stack-more-row {
    display: flex !important;
    visibility: visible !important;
}
#stack-tools .stack-head {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    height: auto !important;
    min-height: 28px !important;
    overflow: visible !important;
}
#stack-tools.stack-board {
    display: flex !important;
    flex-direction: column !important;
}
#stack-tools .stack-pane {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    top: auto !important;
    left: auto !important;
}
#stack-tools .stack-pane.is-off {
    flex: 0 0 auto !important;
    min-height: 32px !important;
    margin-bottom: 14px !important;
}
.chart-body:not(.show-chan-set) #stack-tools .stack-more-row {
    display: none !important;
}

.menubar .mb-ico {
    width: 2.35rem;
    height: 2.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.menubar .mb-ico svg {
    width: 22px;
    height: 22px;
}
.menubar #chart-perf.chart-perf {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    max-width: min(46rem, 58vw);
    margin: 0 0.35rem 0 0;
    padding: 0.2rem 0.45rem;
    background: rgba(28, 32, 36, 0.9);
    color: #f3efe6;
    border-radius: 6px;
    font: 500 0.72rem/1.3 "Segoe UI", Tahoma, sans-serif;
    box-shadow: none;
}
.menubar #chart-perf.chart-perf[hidden] { display: none !important; }
.menubar #chart-diag-btn.on,
.menubar #chart-diag-btn.open {
    background: #1f4e79;
    color: #fff;
}

.menubar .mb-ico-diag {
    width: 2.6rem !important;
    height: 2.35rem !important;
}
.menubar .mb-ico-diag svg {
    width: 26px !important;
    height: 26px !important;
}

#btn-port { display: none !important; }
#kenn-band,
.kenn-band {
    width: 100% !important;
    max-width: none !important;
    flex: 1 1 auto !important;
}
#kenn-stat-row.open,
#kenn-stat-row.show-kenn {
    width: 100%;
}

.topbar-file {
    font-size: 1.02rem;
    font-weight: 600;
}
.topbar-file strong {
    font-weight: 800;
    margin-right: 0.35rem;
}

.nav [data-view="messung"],
.nav [data-view="archiv"],
.tbl-theme { display: none !important; }
.mess-table-pane { /* immer modern */ }

#view-login,
#user-label,
#btn-logout { display: none !important; }
#nav-app { visibility: hidden; }

.mb-ico.is-locked,
.mb-ico[aria-disabled="true"] {
    opacity: 0.35;
    pointer-events: none;
}
