/* VSEW measurement — layout per reference mockup */

.vsew-measurement {
  margin: 0;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  background: #ececec;
  color: #1a1a1a;
  font-family: var(--vsew-font, "Inter", "IBM Plex Sans", system-ui, sans-serif);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  --vsew-chart-plot-height: 268px;
  --vsew-charts-split-height: 335px;
}

.vsew-measurement-shell {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

/* —— Sidebar —— */
.vsew-sidebar {
  position: relative;
  z-index: 20;
  background: #f7f7f7;
  border-right: 1px solid #dcdcdc;
  padding: 20px 14px 16px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  box-sizing: border-box;
}

.vsew-brand-block {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  min-width: 0;
}

.vsew-brand-mark {
  display: block;
  height: 57px;
  width: auto;
  max-width: 78px;
  flex-shrink: 0;
  object-fit: contain;
  object-position: left center;
}

.vsew-brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  line-height: 1.1;
  min-width: 0;
}

.vsew-brand-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #111;
}

.vsew-brand-sub {
  font-size: 13px;
  font-weight: 500;
  color: #607d8b;
  margin: 0;
}

.vsew-nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

.vsew-nav-group {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.vsew-nav-group--monitoring {
  flex: 1 1 0;
  overflow: hidden;
}

.vsew-nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #9a9a9a;
  margin: 0 0 6px 4px;
  flex: 0 0 auto;
}

.vsew-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 4px;
  border-left: 3px solid transparent;
  color: #444;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}

.vsew-nav a:hover {
  background: #efefef;
  text-decoration: none;
}

.vsew-nav a.is-active {
  background: #ebebeb;
  border-left-color: #2563eb;
  color: #111;
  font-weight: 600;
}

.vsew-nav a svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}

.vsew-nav-sensors {
  margin: 2px 0 8px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
}

.vsew-nav-sensors-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin: 0 0 4px 10px;
  padding: 5px 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #666;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  text-align: left;
}

.vsew-nav-sensors-toggle:hover {
  background: #efefef;
  color: #333;
}

.vsew-nav-sensors-toggle__label {
  flex: 1 1 auto;
}

.vsew-nav-sensors-toggle__meta {
  font-size: 10px;
  font-weight: 600;
  color: #888;
  font-variant-numeric: tabular-nums;
}

.vsew-nav-sensors-toggle::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.5px solid #888;
  border-bottom: 1.5px solid #888;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
  margin-right: 2px;
}

.vsew-nav-sensors-toggle[aria-expanded="false"]::after {
  transform: rotate(-45deg);
  margin-top: 3px;
}

.vsew-nav-children {
  display: none;
  flex-direction: column;
  gap: 1px;
  margin: 0 0 0 10px;
  padding-left: 8px;
  border-left: 1px solid #e0e0e0;
  min-height: 0;
  overflow-y: auto;
  flex: 1 1 0;
  max-height: min(46vh, 360px);
}

.vsew-nav-children--open {
  display: flex;
}

.vsew-nav-sensor {
  display: block;
  padding: 5px 10px 5px 8px;
  border-radius: 4px;
  border-left: 3px solid transparent;
  color: #555;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vsew-nav-sensor:hover {
  background: #efefef;
  text-decoration: none;
  color: #222;
}

.vsew-nav-sensor.is-active {
  background: #ebebeb;
  border-left-color: #2563eb;
  color: #111;
  font-weight: 600;
}

.vsew-systemzeit {
  margin-top: auto;
  border: 1px solid #dcdcdc;
  border-radius: 6px;
  background: #fff;
  padding: 10px 12px;
}

.vsew-systemzeit .vsew-nav-label {
  margin-bottom: 4px;
}

.vsew-systemzeit strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: #111;
}

.vsew-systemzeit div {
  font-size: 12px;
  color: #666;
  margin-top: 2px;
}

/* —— Main column —— */
.vsew-main {
  min-width: 0;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #ececec;
}

.vsew-topbar {
  background: #f7f7f7;
  border-bottom: 1px solid #dcdcdc;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.vsew-sensor-title {
  font-size: 13px;
  font-weight: 600;
  color: #222;
  margin: 0;
  flex: 1;
  min-width: 200px;
}

.vsew-topbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.vsew-vital-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  min-height: 16px;
}

.vsew-vital-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 500;
  line-height: 12px;
  color: #444;
}

.vsew-vital-item + .vsew-vital-item {
  margin-left: 18px;
}

.vsew-vital-item.online {
  color: #1a7f4e;
  font-weight: 600;
  font-size: 12px;
  line-height: 12px;
}

.vsew-vital-item .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
}

.vsew-vital-item svg {
  width: 14px;
  height: 14px;
  stroke: #666;
  fill: none;
  stroke-width: 1.5;
}

.vsew-vital-battery,
.vsew-vital-signal {
  gap: 3px;
}

.vsew-vital-temp {
  font-size: 12px;
  font-weight: 500;
  line-height: 12px;
  font-variant-numeric: tabular-nums;
}

.vsew-vital-num {
  font-size: 12px;
  font-weight: 500;
  line-height: 12px;
  font-variant-numeric: tabular-nums;
}

.vsew-battery-icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
  height: 13px;
}

.vsew-battery-icon svg {
  display: block;
  height: 13px;
  width: auto;
}

.vsew-battery-icon .battery-outline {
  fill: #fff;
  stroke: #777;
  stroke-width: 1.2;
}

.vsew-battery-icon .battery-fill {
  fill: var(--battery-color, #22c55e);
  stroke: none;
}

.vsew-battery-icon .battery-tip {
  fill: #777;
  stroke: none;
}

.vsew-battery-icon.is-unknown .battery-outline {
  fill: #f3f3f3;
}

.vsew-wifi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
  width: 20px;
  height: 12px;
  overflow: visible;
}

.vsew-wifi-icon svg {
  display: block;
  width: 20px;
  height: 20px;
  transform: scale(1.2);
  transform-origin: 50% 72%;
}

.vsew-daterange {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  font-size: 12px;
  color: #333;
  white-space: nowrap;
}

.vsew-daterange svg {
  width: 14px;
  height: 14px;
  stroke: #666;
  fill: none;
}

.vsew-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid #bbb;
  background: #fff;
  color: #222;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.vsew-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}

.vsew-btn-dark {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: #fff;
}

.vsew-btn-icon {
  padding: 6px 8px;
}

.vsew-content {
  padding: 8px 12px 10px;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* —— Collapsible blocks (details/summary) —— */
.vsew-collapsible {
  border: 1px solid #dcdcdc;
  background: #f7f7f7;
}

.vsew-collapsible__summary {
  cursor: pointer;
  list-style: none;
  padding: 8px 10px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.vsew-collapsible__summary::-webkit-details-marker {
  display: none;
}

.vsew-collapsible__summary::after {
  content: "";
  margin-left: auto;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid #888;
  border-bottom: 1.5px solid #888;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  flex: 0 0 auto;
}

.vsew-collapsible[open] > .vsew-collapsible__summary::after {
  transform: rotate(45deg);
  margin-top: -3px;
}

.vsew-collapsible__title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #666;
}

.vsew-collapsible__hint {
  font-size: 12px;
  color: #777;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.vsew-collapsible__body {
  padding: 0 0 8px;
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.18s ease;
}

.vsew-collapsible[open] > .vsew-collapsible__body {
  grid-template-rows: 1fr;
}

.vsew-collapsible__body-inner {
  overflow: hidden;
}

.vsew-collapsible--filter[open] > .vsew-collapsible__body {
  transition-timing-function: cubic-bezier(0.2, 0.75, 0.2, 1);
}

.vsew-collapsible--chart-controls > .vsew-collapsible__body {
  transition-duration: 0.14s;
}

.vsew-collapsible--filter {
  margin-bottom: 8px;
}

.vsew-collapsible--filter .vsew-filter-bar {
  margin: 0;
  border: 0;
}

.vsew-collapsible--chart-controls {
  margin-left: auto;
}

.vsew-collapsible__summary--compact {
  padding: 4px 8px;
  border: 1px solid #cfcfcf;
  background: #fff;
  border-radius: 4px;
  gap: 6px;
}

.vsew-collapsible__summary--compact::after {
  width: 6px;
  height: 6px;
}

.vsew-collapsible--chart-controls .vsew-collapsible__body {
  padding: 6px 0 0;
}

/* —— Global filter strip —— */
.vsew-filter-bar {
  background: #f7f7f7;
  border: 1px solid #dcdcdc;
  border-radius: 0;
  padding: 8px 10px;
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 12px;
  flex: 0 0 auto;
}

.vsew-filter-bar .fld {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.vsew-filter-bar .fld > span {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #888;
}

.vsew-filter-bar input,
.vsew-filter-bar select {
  border: 1px solid #c8c8c8;
  border-radius: 3px;
  padding: 5px 7px;
  font-family: var(--vsew-font, "Inter", "IBM Plex Sans", system-ui, sans-serif);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  background: #fff;
  color: #222;
  height: 28px;
  box-sizing: border-box;
}

.vsew-filter-bar .fld-pair {
  display: flex;
  gap: 4px;
}

.vsew-filter-bar .fld-pair input {
  width: 52px;
}

/* Audit table: phone portrait when global filter is collapsed */
@media (max-width: 900px) and (orientation: portrait) {
  body.vsew-filter-collapsed #audit-table th,
  body.vsew-filter-collapsed #audit-table td {
    display: none;
  }

  /* Keep: Dom.Achse (3), Vmax (8), Freq X/Y/Z (9/10/11), Ausnutzung (12), Details (16) */
  body.vsew-filter-collapsed #audit-table th:nth-child(3),
  body.vsew-filter-collapsed #audit-table td:nth-child(3),
  body.vsew-filter-collapsed #audit-table th:nth-child(8),
  body.vsew-filter-collapsed #audit-table td:nth-child(8),
  body.vsew-filter-collapsed #audit-table th:nth-child(9),
  body.vsew-filter-collapsed #audit-table td:nth-child(9),
  body.vsew-filter-collapsed #audit-table th:nth-child(10),
  body.vsew-filter-collapsed #audit-table td:nth-child(10),
  body.vsew-filter-collapsed #audit-table th:nth-child(11),
  body.vsew-filter-collapsed #audit-table td:nth-child(11),
  body.vsew-filter-collapsed #audit-table th:nth-child(12),
  body.vsew-filter-collapsed #audit-table td:nth-child(12),
  body.vsew-filter-collapsed #audit-table th:nth-child(16),
  body.vsew-filter-collapsed #audit-table td:nth-child(16) {
    display: table-cell;
  }

  body.vsew-filter-collapsed #audit-table th:nth-child(9),
  body.vsew-filter-collapsed #audit-table th:nth-child(10),
  body.vsew-filter-collapsed #audit-table th:nth-child(11) {
    white-space: nowrap;
  }
}

/* datetime-local: only calendar icon until focus or value is set */
.vsew-measurement input[type="datetime-local"] {
  width: 32px;
  min-width: 32px;
  max-width: 32px;
  padding: 0 2px;
  cursor: pointer;
  box-sizing: border-box;
  font-family: var(--vsew-font, "Inter", "IBM Plex Sans", system-ui, sans-serif);
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  line-height: 1.4;
}

.vsew-measurement input[type="datetime-local"]::-webkit-datetime-edit,
.vsew-measurement input[type="datetime-local"]::-webkit-datetime-edit-fields-wrapper,
.vsew-measurement input[type="datetime-local"]::-webkit-datetime-edit-text,
.vsew-measurement input[type="datetime-local"]::-webkit-datetime-edit-month-field,
.vsew-measurement input[type="datetime-local"]::-webkit-datetime-edit-day-field,
.vsew-measurement input[type="datetime-local"]::-webkit-datetime-edit-year-field,
.vsew-measurement input[type="datetime-local"]::-webkit-datetime-edit-hour-field,
.vsew-measurement input[type="datetime-local"]::-webkit-datetime-edit-minute-field {
  font-family: inherit;
  font-variant-numeric: inherit;
  font-size: inherit;
  line-height: inherit;
}

.vsew-measurement input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  opacity: 1;
  cursor: pointer;
  margin: 0;
}

.vsew-measurement input[type="datetime-local"]:not(:focus):not(.has-value)::-webkit-datetime-edit,
.vsew-measurement input[type="datetime-local"]:not(:focus):not(.has-value)::-webkit-datetime-edit-fields-wrapper,
.vsew-measurement input[type="datetime-local"]:not(:focus):not(.has-value)::-webkit-datetime-edit-text,
.vsew-measurement input[type="datetime-local"]:not(:focus):not(.has-value)::-webkit-datetime-edit-month-field,
.vsew-measurement input[type="datetime-local"]:not(:focus):not(.has-value)::-webkit-datetime-edit-day-field,
.vsew-measurement input[type="datetime-local"]:not(:focus):not(.has-value)::-webkit-datetime-edit-year-field,
.vsew-measurement input[type="datetime-local"]:not(:focus):not(.has-value)::-webkit-datetime-edit-hour-field,
.vsew-measurement input[type="datetime-local"]:not(:focus):not(.has-value)::-webkit-datetime-edit-minute-field,
.vsew-measurement input[type="datetime-local"]:not(:focus):not(.has-value)::-webkit-datetime-edit-second-field,
.vsew-measurement input[type="datetime-local"]:not(:focus):not(.has-value)::-webkit-datetime-edit-ampm-field {
  display: none;
  width: 0;
  min-width: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.vsew-measurement input[type="datetime-local"]:focus,
.vsew-measurement input[type="datetime-local"].has-value {
  width: 128px;
  min-width: 128px;
  max-width: none;
  padding-right: 2px;
  color: #222;
}

.vsew-measurement input[type="datetime-local"].is-auto-default:not(:focus) {
  color: rgb(170, 170, 170);
}

.vsew-measurement input[type="datetime-local"].is-auto-default:not(:focus)::-webkit-datetime-edit,
.vsew-measurement input[type="datetime-local"].is-auto-default:not(:focus)::-webkit-datetime-edit-fields-wrapper,
.vsew-measurement input[type="datetime-local"].is-auto-default:not(:focus)::-webkit-datetime-edit-text,
.vsew-measurement input[type="datetime-local"].is-auto-default:not(:focus)::-webkit-datetime-edit-month-field,
.vsew-measurement input[type="datetime-local"].is-auto-default:not(:focus)::-webkit-datetime-edit-day-field,
.vsew-measurement input[type="datetime-local"].is-auto-default:not(:focus)::-webkit-datetime-edit-year-field,
.vsew-measurement input[type="datetime-local"].is-auto-default:not(:focus)::-webkit-datetime-edit-hour-field,
.vsew-measurement input[type="datetime-local"].is-auto-default:not(:focus)::-webkit-datetime-edit-minute-field {
  color: rgb(170, 170, 170);
}

.vsew-filter-bar .fld-zeit .fld-pair input[type="datetime-local"]:not(:focus):not(.has-value) {
  width: 32px;
  min-width: 32px;
  max-width: 32px;
}

.vsew-filter-bar .fld-zeit .fld-pair input[type="datetime-local"]:focus,
.vsew-filter-bar .fld-zeit .fld-pair input[type="datetime-local"].has-value {
  width: 140px;
  min-width: 140px;
  max-width: none;
  padding-right: 2px;
}

.vsew-filter-bar .fld-achse input[type="checkbox"] {
  accent-color: rgb(140, 140, 140);
  width: 14px;
  height: 14px;
}

.vsew-filter-bar .fld-suche input {
  width: 140px;
}

.vsew-filter-bar .fld-achse .achse-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
}

.vsew-filter-bar .fld-achse label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 500;
  color: #444;
  text-transform: none;
  letter-spacing: 0;
}

.vsew-filter-bar .fld-achse input {
  width: auto;
  height: auto;
}

.vsew-filter-refresh {
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #c8c8c8;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  margin-bottom: 0;
}

.vsew-filter-refresh svg {
  width: 15px;
  height: 15px;
  stroke: #555;
  fill: none;
}

.vsew-filter-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid #c8c8c8;
  border-radius: 3px;
  background: #fff;
  color: #666;
  text-decoration: none;
  font-size: 18px;
  line-height: 1;
}

.vsew-filter-reset:hover {
  background: #f3f3f3;
  text-decoration: none;
}

/* —— Dashboard —— */
.vsew-topbar-dashboard {
  align-items: flex-end;
}

.vsew-topbar-left {
  min-width: 0;
  flex: 1;
}

.vsew-page-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #111;
}

.vsew-page-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: #666;
}

.vsew-content-dashboard {
  overflow: auto;
  flex: 1 1 0;
  min-height: 0;
}

.vsew-dashboard-panel {
  background: #fff;
  border: 1px solid #dcdcdc;
  margin-bottom: 8px;
}

.vsew-dashboard-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #ebebeb;
}

.vsew-dashboard-panel-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #111;
}

.vsew-filter-bar-compact {
  margin-bottom: 0;
  border: none;
  border-bottom: 1px solid #ebebeb;
}

.vsew-dashboard-map {
  height: 360px;
  width: 100%;
  background: #e8e8e8;
}

.vsew-device-view-toggle {
  display: inline-flex;
  border: 1px solid #c8c8c8;
  border-radius: 3px;
  overflow: hidden;
}

.vsew-device-view-toggle button {
  border: 0;
  background: #fff;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #555;
  cursor: pointer;
  font-family: inherit;
}

.vsew-device-view-toggle button.is-active {
  background: #ebebeb;
  color: #111;
  font-weight: 600;
}

.vsew-device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 8px;
  padding: 8px 10px 10px;
}

.vsew-device-card {
  display: block;
  padding: 10px 12px 10px 14px;
  border: 1px solid #dcdcdc;
  border-radius: 0;
  background: #fff;
  text-decoration: none;
  color: inherit;
  border-left: 3px solid #c8c8c8;
  box-sizing: border-box;
}

.vsew-device-card:hover {
  background: #fafafa;
  text-decoration: none;
  border-color: #c0c0c0;
}

.vsew-device-card.status-CRITICAL,
.vsew-device-card.status-RED {
  border-left-color: #c95a5a;
}

.vsew-device-card.status-YELLOW {
  border-left-color: #b8860b;
}

.vsew-device-card.status-EVENT,
.vsew-device-card.status-GREEN {
  border-left-color: #3d6b7a;
}

.vsew-device-card-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: #222;
  line-height: 1.35;
}

.vsew-device-card .vsew-vital-chips {
  margin-bottom: 8px;
}

.vsew-device-card-event {
  margin: 0;
  font-size: 11px;
  color: #666;
  line-height: 1.4;
}

.vsew-device-card-event-label {
  font-weight: 600;
  color: #888;
}

.vsew-device-table-wrap {
  padding: 0 10px 10px;
  overflow: auto;
}

.vsew-device-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
}

/* Default column split (Geräte-Tabelle): tuned to manual layout from dashboard table view */
.vsew-device-table:not(.vsew-device-table-cols-px) col.vsew-col-sensor {
  width: 48%;
}

.vsew-device-table:not(.vsew-device-table-cols-px) col.vsew-col-vitals {
  width: 22%;
}

.vsew-device-table:not(.vsew-device-table-cols-px) col.vsew-col-last-vital {
  width: 17%;
}

.vsew-device-table:not(.vsew-device-table-cols-px) col.vsew-col-last-event {
  width: 13%;
}

.vsew-device-table th,
.vsew-device-table td {
  border-bottom: 1px solid #ebebeb;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  overflow: hidden;
}

.vsew-device-table-sensor {
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  text-align: left;
}

.vsew-device-table-last-vital {
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  text-align: center;
}

.vsew-device-table-last-event {
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  text-align: right;
}

.vsew-device-table th:nth-child(1) {
  text-align: left;
}

.vsew-device-table th:nth-child(4) {
  text-align: right;
}

.vsew-device-table th {
  position: relative;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  background: #f7f7f7;
  padding-right: 14px;
}

.vsew-device-table-title {
  font-size: 13px;
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
}

.vsew-device-table-title:hover {
  text-decoration: underline;
}

.vsew-device-table-sub {
  font-size: 11px;
  color: #888;
  margin-top: 2px;
}

.vsew-device-table th:nth-child(2),
.vsew-device-table th:nth-child(3),
.vsew-device-table-vitals,
.vsew-device-table-last-vital {
  text-align: center;
}

.vsew-device-table-vitals .vsew-vital-chips {
  flex-wrap: wrap;
  gap: 2px 0;
  justify-content: center;
}

.vsew-device-table-vitals .vsew-vital-item + .vsew-vital-item {
  margin-left: 8px;
}

.vsew-device-table-last-vital {
  font-size: 11px;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  color: #444;
  text-align: center;
}

.vsew-last-vital-age {
  color: #888;
  white-space: nowrap;
}

.vsew-device-table-last-event {
  font-size: 11px;
  line-height: 1.4;
  text-align: right;
}

.vsew-device-table-sensor .vsew-device-table-title,
.vsew-device-table-sensor .vsew-device-table-sub {
  display: block;
  text-align: left;
}

.vsew-device-table td.vsew-device-table-last-event,
.vsew-device-table th:nth-child(4) {
  text-align: right;
}

table.vsew-device-table td.vsew-device-table-last-vital,
table.vsew-device-table thead th:nth-child(3) {
  text-align: center;
}

.vsew-device-table-last-event .status-badge,
.vsew-device-table-last-event .status-text,
.vsew-device-table-last-event .muted {
  text-align: right;
}

.vsew-device-row {
  cursor: pointer;
}

.vsew-device-row:hover {
  background: #fafafa;
}

/* —— Admin shell (monitoring + admin) —— */
.vsew-admin-content {
  overflow: auto;
  flex: 1 1 0;
  min-height: 0;
  padding: 12px 14px 16px;
}

.vsew-admin-content .card,
.vsew-admin-content .hero {
  max-width: none;
}

.vsew-admin-content .hero {
  margin-bottom: 12px;
  border-radius: 0;
  padding: 16px 18px;
}

.vsew-admin-content .hero h1 {
  font-size: 22px;
}

.vsew-admin-content .card {
  border-radius: 0;
  box-shadow: none;
  border: 1px solid #dcdcdc;
  margin: 0 0 8px;
  padding: 14px 16px;
}

/* —— Charts —— */
.vsew-charts-block {
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
  flex: 0 0 auto;
}

.vsew-charts-split {
  display: flex;
  align-items: stretch;
  width: 100%;
  height: var(--vsew-charts-split-height, 335px);
  min-height: 200px;
  max-height: none;
}

.vsew-charts-height-gutter {
  flex: 0 0 7px;
  cursor: row-resize;
  background: #ececec;
  border-top: 1px solid #d0d0d0;
  border-bottom: 1px solid #d0d0d0;
  position: relative;
  z-index: 2;
  user-select: none;
  touch-action: none;
}

.vsew-charts-height-gutter::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36px;
  height: 3px;
  margin: -1px 0 0 -18px;
  border-radius: 2px;
  background: #b8b8b8;
}

.vsew-charts-height-gutter:hover,
.vsew-charts-height-gutter.is-dragging {
  background: #d4e4f8;
}

.vsew-charts-height-gutter:hover::after,
.vsew-charts-height-gutter.is-dragging::after {
  background: #6a9fd4;
}

body.vsew-split-drag-y {
  cursor: row-resize !important;
  user-select: none !important;
}

.vsew-chart-panel {
  background: #fff;
  border: 1px solid #dcdcdc;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.vsew-chart-panel--summary {
  flex: 0 0 75%;
  width: 75%;
  max-width: 88%;
  min-width: 35%;
}

.vsew-chart-panel--freq {
  flex: 1 1 0;
  min-width: 0;
}

.vsew-charts-gutter {
  flex: 0 0 7px;
  cursor: col-resize;
  background: #ececec;
  border-left: 1px solid #d0d0d0;
  border-right: 1px solid #d0d0d0;
  position: relative;
  z-index: 2;
  user-select: none;
  touch-action: none;
}

.vsew-charts-gutter::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 36px;
  margin: -18px 0 0 -1px;
  border-radius: 2px;
  background: #b8b8b8;
}

.vsew-charts-gutter:hover,
.vsew-charts-gutter.is-dragging {
  background: #d4e4f8;
}

.vsew-charts-gutter:hover::after,
.vsew-charts-gutter.is-dragging::after {
  background: #6a9fd4;
}

body.vsew-split-drag {
  cursor: col-resize !important;
  user-select: none !important;
}

.vsew-chart-slot {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 0;
  padding-top: 11px;
  box-sizing: border-box;
}

.vsew-chart-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px 10px;
  padding: 8px 10px;
  border-bottom: none;
  flex: 0 0 auto;
  min-height: 0;
  box-sizing: border-box;
}

.vsew-chart-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #111;
  grid-column: 1;
  min-width: 100px;
}

.vsew-chart-head-controls {
  grid-column: 2;
  justify-self: end;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  font-size: 11px;
  color: #666;
  padding-right: 28px;
}

.vsew-chart-head-controls label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.vsew-chart-head-controls input {
  width: 118px;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 3px 5px;
  font-family: var(--vsew-font, "Inter", "IBM Plex Sans", system-ui, sans-serif);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  height: 24px;
  box-sizing: border-box;
}

.vsew-chart-head-controls input[type="datetime-local"]:focus,
.vsew-chart-head-controls input[type="datetime-local"].has-value {
  width: 128px;
  min-width: 128px;
  max-width: none;
  padding-right: 2px;
}

.vsew-chart-head-controls input.num {
  width: 37px;
  min-width: 37px;
  padding-left: 4px;
  padding-right: 4px;
}

.vsew-chart-head-controls #freq-y-min,
.vsew-chart-head-controls #freq-y-max {
  width: 30px;
  min-width: 30px;
}

.vsew-legend-row {
  display: none;
}

.vsew-plot-legend-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  padding: 2px 2px 4px;
  font-size: 10px;
  font-weight: 500;
  color: #555;
  line-height: 1.2;
}

.vsew-plot-legend-bar__item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.vsew-plot-legend-bar__line {
  display: inline-block;
  width: 16px;
  height: 0;
  border-top: 1.5px solid;
  flex-shrink: 0;
}

.vsew-plot-legend-bar__line--dash {
  border-top-style: dashed;
}

.vsew-plot-legend-bar__dot {
  display: inline-block;
  border-radius: 50%;
  flex-shrink: 0;
  background: #64748b;
  box-sizing: border-box;
}

.vsew-plot-legend-bar__dot--axis {
  width: 10px;
  height: 10px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 0.5px rgba(15, 23, 42, 0.12);
}

.vsew-plot-legend-bar__size-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.vsew-plot-legend-bar__dot--s {
  width: 7px;
  height: 7px;
}

.vsew-plot-legend-bar__dot--m {
  width: 10px;
  height: 10px;
}

.vsew-plot-legend-bar__dot--l {
  width: 13px;
  height: 13px;
}

.vsew-plot-legend-bar--sensor {
  padding: 0 10px 4px;
  margin-top: -2px;
}

.vsew-plot-legend-bar__item--duration {
  color: #64748b;
}

.vsew-charts-block .vsew-chart-panel .vsew-chart-head + .vsew-plot-legend-bar--sensor {
  margin-bottom: 2px;
}

.vsew-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}

.vsew-swatch {
  width: var(--vsew-marker-size, 11px);
  height: var(--vsew-marker-size, 11px);
  border-radius: 50%;
  flex-shrink: 0;
}

.vsew-swatch.axis-x { background: var(--vsew-axis-x, #f4764e); }
.vsew-swatch.axis-y { background: var(--vsew-axis-y, #9ccc60); }
.vsew-swatch.axis-z { background: var(--vsew-axis-z, #4aa3d1); }

.vsew-chart {
  width: 100%;
  height: 100%;
  min-height: 180px;
  flex: 1 1 0;
  background: #fff;
}

.vsew-chart-panel--freq .vsew-chart-head {
  grid-template-columns: auto minmax(0, 1fr);
}

.vsew-chart-panel--freq .vsew-chart-head h3 {
  min-width: 0;
  white-space: nowrap;
  font-size: 13px;
}

.vsew-chart-panel--freq .vsew-chart-head-controls {
  flex-wrap: nowrap;
  white-space: nowrap;
  padding-right: 6px;
  gap: 5px;
}

@media print {
  .vsew-chart,
  .vsew-chart-panel,
  .vsew-chart-slot {
    background: #fff !important;
    -webkit-print-color-adjust: economy;
    print-color-adjust: economy;
  }
}

/* —— Audit —— */
.vsew-audit-panel {
  background: #fff;
  border: 1px solid #dcdcdc;
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.vsew-audit-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 10px;
  padding: 8px 10px;
  border-bottom: 1px solid #ebebeb;
  flex: 0 0 auto;
}

.vsew-audit-toolbar h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #111;
  margin-right: 8px;
  align-self: center;
  white-space: nowrap;
}

.vsew-audit-toolbar .fld {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.vsew-audit-toolbar .fld > span {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  color: #888;
  letter-spacing: 0.05em;
}

.vsew-audit-toolbar input,
.vsew-audit-toolbar select {
  border: 1px solid #c8c8c8;
  border-radius: 3px;
  padding: 4px 7px;
  font-size: 12px;
  height: 26px;
  background: #fff;
  box-sizing: border-box;
}

.vsew-audit-toolbar .fld-search input {
  width: 160px;
}

.vsew-audit-toolbar .fld-pair {
  display: flex;
  gap: 4px;
}

.vsew-audit-toolbar .fld-pair input {
  width: 48px;
}

.vsew-audit-toolbar-spacer {
  flex: 1;
}

.vsew-audit-dl {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: #333;
  text-decoration: none;
  white-space: nowrap;
}

.vsew-audit-dl svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
}

.vsew-table-wrap {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
}

.vsew-measurement table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  table-layout: fixed;
}

.vsew-measurement table:not(.vsew-device-table) th,
.vsew-measurement table:not(.vsew-device-table) td {
  padding: 7px 11px;
  border-bottom: 1px solid #e8e8e8;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}

#audit-table {
  --audit-col-gap: 10px;
}

#audit-table th,
#audit-table td {
  padding-left: var(--audit-col-gap);
  padding-right: var(--audit-col-gap);
}

#audit-table td:nth-child(15),
#audit-table th:nth-child(15) {
  overflow: visible;
  text-overflow: clip;
}

#audit-table td:nth-child(15) code {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.vsew-measurement th {
  position: sticky;
  top: 0;
  background: #f5f5f5;
  color: #777;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  z-index: 1;
  white-space: normal;
  line-height: 1.25;
  hyphens: auto;
  padding-right: 12px;
}

.vsew-measurement th .col-resize-handle {
  position: absolute;
  right: 0;
  top: 0;
  width: 7px;
  height: 100%;
  cursor: col-resize;
  z-index: 2;
}

.vsew-measurement th .col-resize-handle:hover {
  background: rgba(106, 159, 212, 0.35);
}

body.vsew-col-resize-drag {
  cursor: col-resize !important;
  user-select: none !important;
}

.vsew-measurement tbody tr:hover {
  background: #fafafa;
}

.vsew-measurement tr.selected {
  background: #eef4ff;
  outline: 1px solid #93b4f5;
}

.vsew-measurement td a {
  color: #2563eb;
  text-decoration: underline;
  font-weight: 500;
}

.vsew-measurement .status-text.status-GREEN,
.vsew-measurement .status-text.status-EVENT { color: #3d6b7a; }
.vsew-measurement .status-text.status-YELLOW { color: #b8860b; }
.vsew-measurement .status-text.status-RED { color: #c95a5a; }
.vsew-measurement .status-text.status-CRITICAL { color: #b42020; font-weight: 600; }

.vsew-table-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding: 8px 10px;
  border-top: 1px solid #ebebeb;
  font-size: 12px;
  color: #666;
  flex: 0 0 auto;
}

.vsew-table-footer select {
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 3px 6px;
  font-size: 12px;
  background: #fff;
}

.vsew-pager {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.vsew-pager button {
  width: 26px;
  height: 26px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  color: #444;
}

.vsew-pager button:disabled {
  opacity: 0.4;
  cursor: default;
}

@media (max-width: 1200px) {
  .vsew-chart-panel--summary {
    min-width: 30%;
  }

  .vsew-event-charts-block .vsew-chart-panel--summary {
    min-width: 0;
  }
}

/* Event charts: avoid squashing when the window is narrow but still above the phone breakpoint */
@media (max-width: 1100px) and (min-width: 901px) {
  .vsew-event-charts-block .vsew-event-chart-slot {
    flex: 0 0 auto;
    min-height: 0;
  }

  .vsew-event-charts-block .vsew-event-chart:not(.vsew-event-chart--stacked):not(.vsew-event-chart--fft.vsew-event-chart--stacked) {
    height: 340px !important;
    min-height: 340px !important;
  }

  .vsew-event-charts-block .vsew-event-chart--stacked:not(.vsew-event-chart--fft) {
    height: 480px !important;
    min-height: 480px !important;
  }

  .vsew-event-charts-block .vsew-event-chart--fft:not(.vsew-event-chart--stacked) {
    height: 340px !important;
    min-height: 340px !important;
  }

  .vsew-event-charts-block .vsew-event-chart--fft.vsew-event-chart--stacked {
    height: 460px !important;
    min-height: 460px !important;
  }
}

@media (max-width: 900px) {
  .vsew-event-charts-split {
    flex-direction: column;
    height: auto;
    min-height: 0;
  }

  .vsew-event-charts-block .vsew-chart-panel--summary,
  .vsew-event-charts-block .vsew-chart-panel--freq {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    min-height: 320px;
  }

  .vsew-event-charts-block .vsew-charts-gutter {
    flex: 0 0 7px;
    width: 100%;
    height: 7px;
    cursor: row-resize;
    border-left: none;
    border-right: none;
    border-top: 1px solid #d0d0d0;
    border-bottom: 1px solid #d0d0d0;
  }

  .vsew-event-charts-block .vsew-charts-gutter::after {
    width: 36px;
    height: 3px;
    margin: -1px 0 0 -18px;
  }
}

/* Phone landscape: logical width often >900px — keep stacked full-width charts */
@media (max-height: 520px) and (orientation: landscape) and (max-width: 1200px) {
  .vsew-charts-split,
  .vsew-event-charts-split {
    flex-direction: column !important;
    height: auto !important;
  }

  .vsew-charts-split .vsew-chart-panel--summary,
  .vsew-charts-split .vsew-chart-panel--freq,
  .vsew-event-charts-block .vsew-chart-panel--summary,
  .vsew-event-charts-block .vsew-chart-panel--freq {
    width: 100% !important;
    max-width: none !important;
    flex: 0 0 auto !important;
    min-width: 0 !important;
  }

  .vsew-event-charts-block .vsew-charts-gutter {
    width: 100%;
    height: 7px;
  }
}

/* —— Event page (Einzelereignisprotokoll) —— */
.vsew-content-event {
  --vsew-ctx-data-size: clamp(15px, 1.15vw, 19px);
  --vsew-event-value-size: var(--vsew-ctx-data-size);
  --vsew-event-unit-size: calc(var(--vsew-ctx-data-size) * 0.72);
  overflow: hidden;
  overflow-x: hidden;
  gap: 8px;
  flex: 1 1 0;
  min-height: 0;
}

.vsew-topbar-event {
  align-items: stretch;
}

.vsew-topbar-event-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vsew-topbar-event-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.vsew-topbar-event-tools {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  flex-shrink: 0;
}

.vsew-topbar-event .vsew-breadcrumb {
  flex: 1 1 auto;
  min-width: 0;
  margin-bottom: 0;
}

.vsew-topbar-event .vsew-sensor-title {
  flex: none;
  min-width: 0;
  width: 100%;
}

.vsew-guest-sensor-cta {
  flex-shrink: 0;
  max-width: min(220px, 46vw);
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 5px 9px;
  font-size: 11px;
}

.vsew-guest-cta-short {
  display: none;
}

.vsew-topbar-event-left {
  flex: 1 1 320px;
  min-width: 0;
}

.vsew-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  font-size: 11px;
  color: #888;
  margin: 0 0 6px;
}

.vsew-breadcrumb a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}

.vsew-breadcrumb a:hover {
  text-decoration: underline;
}

.vsew-breadcrumb-sep {
  color: #bbb;
}

.vsew-breadcrumb-current {
  color: #555;
  font-weight: 500;
}

.vsew-event-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.vsew-event-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #111;
  letter-spacing: -0.02em;
}

.vsew-event-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: #666;
}

.vsew-event-sub a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}

.vsew-event-sub a:hover {
  text-decoration: underline;
}

.vsew-event-kpi-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.vsew-event-kpi-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 4px 8px;
  border: 1px solid #dcdcdc;
  border-radius: 4px;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: #222;
  white-space: nowrap;
}

.vsew-event-kpi-chip .vsew-meta-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #888;
}

.vsew-event-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.vsew-audit-dl.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.vsew-event-banner {
  padding: 8px 10px;
  border: 1px solid #dcdcdc;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.45;
  flex: 0 0 auto;
}

.vsew-event-banner strong {
  display: block;
  margin-bottom: 2px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.vsew-event-banner--ok {
  background: #f3faf5;
  border-color: #b8dfc4;
  color: #1f4d2c;
}

.vsew-event-banner--warning {
  background: #fff8f0;
  border-color: #f0d4a8;
  color: #7c4a12;
}

.vsew-event-panel {
  background: #fff;
  border: 1px solid #dcdcdc;
  padding: 10px 12px;
  flex: 0 0 auto;
}

.vsew-content-event .vsew-event-banner {
  flex: 0 0 auto;
}

.vsew-event-panel-title {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #888;
}

.vsew-event-panel-title-short {
  display: none;
}

.vsew-event-panel--collapsible > .vsew-event-panel__summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 0;
  padding: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.vsew-event-panel--collapsible > .vsew-event-panel__summary::-webkit-details-marker {
  display: none;
}

.vsew-event-panel--collapsible > .vsew-event-panel__summary::after {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-right: 1.5px solid #888;
  border-bottom: 1.5px solid #888;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.vsew-event-panel--collapsible[open] > .vsew-event-panel__summary::after {
  transform: rotate(45deg);
  margin-top: -3px;
}

.vsew-event-panel--collapsible > .vsew-event-panel__summary .vsew-event-panel-title,
.vsew-event-panel--collapsible > .vsew-event-panel__summary .vsew-event-context-head__combined {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.vsew-event-panel--collapsible > .vsew-event-panel__body {
  margin-top: 8px;
}

.vsew-event-panel--collapsible > .vsew-event-panel__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.18s ease;
}

.vsew-event-panel--collapsible[open] > .vsew-event-panel__body {
  grid-template-rows: 1fr;
}

.vsew-event-panel__body-inner {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .vsew-collapsible__body,
  .vsew-event-panel--collapsible > .vsew-event-panel__body {
    transition: none;
  }
}

.vsew-event-meta-grid,
.vsew-event-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px 12px;
}

.vsew-event-kpi-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.vsew-meta-cell {
  min-width: 0;
}

.vsew-meta-label {
  display: block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 2px;
}

.vsew-meta-value {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #222;
  line-height: 1.35;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.vsew-event-charts-block {
  flex: 1 1 0;
  min-height: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.vsew-event-charts-split {
  flex: 1 1 0;
  min-height: 300px;
  height: var(--vsew-event-charts-split-height, 400px);
  max-height: none;
}

.vsew-event-charts-split.is-wave-separated {
  min-height: 420px;
}

.vsew-event-charts-block .vsew-event-chart-panel {
  height: 100%;
  flex: 0 0 auto;
  margin: 0;
  min-height: 0;
  overflow: hidden;
}

.vsew-event-charts-block .vsew-chart-panel--summary {
  flex: 0 0 75%;
  width: 75%;
  max-width: 88%;
  min-width: 0;
}

.vsew-event-charts-block .vsew-chart-panel--freq {
  flex: 1 1 0;
  min-width: 0;
}

.vsew-event-chart-panel {
  height: auto;
  flex: 0 0 auto;
  margin: 0;
}

.vsew-event-chart-head {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title toggle"
    "hint hint";
  align-items: center;
}

.vsew-event-charts-block .vsew-chart-head {
  padding: 6px 10px 4px;
}

.vsew-event-charts-block .vsew-chart-head h3 {
  font-size: 14px;
  line-height: 1.2;
  grid-area: title;
  min-width: 0;
}

.vsew-event-chart-head .vsew-device-view-toggle {
  grid-area: toggle;
  justify-self: end;
  align-self: center;
  flex-shrink: 0;
}

.vsew-event-chart-head .vsew-mobile-chart-hint {
  grid-area: hint;
  margin: 0;
}

.vsew-event-chart-head .vsew-device-view-toggle button {
  white-space: nowrap;
}

.vsew-toggle-label-short {
  display: none;
}

.vsew-event-chart-slot {
  min-height: 280px;
  padding: 8px 10px 10px;
}

.vsew-event-charts-block .vsew-chart-slot,
.vsew-event-charts-block .vsew-event-chart-slot {
  flex: 1 1 0;
  min-height: 0;
  padding: 0 10px 6px;
}

.vsew-event-view-panel {
  display: none;
  width: 100%;
}

.vsew-event-view-panel.is-active {
  display: block;
}

.vsew-event-charts-block .vsew-event-view-panel.is-active {
  height: 100%;
}

.vsew-event-chart {
  width: 100%;
  height: 340px;
  min-height: 260px;
}

.vsew-event-charts-block .vsew-event-chart {
  height: 100%;
  min-height: 0;
}

.vsew-event-chart--stacked {
  height: 520px;
  min-height: 400px;
}

.vsew-event-charts-block .vsew-event-chart--stacked {
  height: 100%;
  min-height: 220px;
}

.vsew-event-chart--fft {
  height: 300px;
  min-height: 240px;
}

.vsew-event-charts-block .vsew-event-chart--fft {
  height: 100%;
  min-height: 0;
}

.vsew-event-chart--fft.vsew-event-chart--stacked {
  height: 480px;
}

.vsew-event-charts-block .vsew-event-chart--fft.vsew-event-chart--stacked {
  height: 100%;
  min-height: 200px;
}

.vsew-event-charts-block .vsew-event-spectral-summary-wrap {
  flex: 0 0 auto;
  margin: 0;
  padding: 0 8px 8px;
  overflow-x: auto;
}

.vsew-event-fallback-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid #dcdcdc;
  border-radius: 4px;
  background: #fff;
}

.vsew-event-source-note,
.vsew-event-muted {
  margin: 0;
  padding: 0 10px 10px;
  font-size: 11px;
  color: #888;
  line-height: 1.45;
}

.vsew-event-fft-note {
  padding: 0 10px 6px;
}

.vsew-event-source-note code,
.vsew-event-muted code {
  font-size: 10px;
}

.vsew-event-table-wrap {
  margin: 0 10px 8px;
  overflow-x: auto;
  border: 1px solid #ebebeb;
}

.vsew-event-spectrum-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
}

.vsew-event-spectrum-table th,
.vsew-event-spectrum-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #ebebeb;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.vsew-event-spectrum-table th {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888;
  background: #f7f7f7;
}

.vsew-swatch.axis-n {
  background: #64748b;
}

.vsew-measurement .status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}

.vsew-measurement .status-text.status-GREEN,
.vsew-measurement .status-text.status-EVENT {
  color: #3d6b7a;
}

.vsew-measurement .status-text.status-YELLOW {
  color: #b8860b;
}

.vsew-measurement .status-text.status-RED {
  color: #c95a5a;
}

.vsew-measurement .status-text.status-CRITICAL {
  color: #b42020;
}

.hidden {
  display: none !important;
}

@media (max-width: 1100px) {
  .vsew-event-meta-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .vsew-event-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.vsew-breadcrumb--content {
  margin: 0 0 6px;
  flex: 0 0 auto;
}

.vsew-event-downloads-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.vsew-event-dl-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #333;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.vsew-event-dl-link:hover {
  color: #1d4ed8;
  text-decoration: none;
}

.vsew-event-dl-link.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.vsew-event-dl-icon {
  display: block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.vsew-event-context-panel {
  --vsew-ctx-data-size: clamp(15px, 1.15vw, 19px);
  --vsew-ctx-row-gap: 0.38em;
  min-width: 0;
}

.vsew-event-context-head__combined {
  margin: 0 0 10px;
  line-height: 1.35;
}

.vsew-topbar-event .vsew-event-page-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.vsew-event-context-strip {
  min-width: 0;
  padding: 0;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: linear-gradient(180deg, #fcfcfc 0%, #f6f6f6 100%);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

/* 9×3: Spalten 1–4 je 16,8 %, 5–9 je 6,56 % */
.vsew-event-ctx-table {
  container-type: inline-size;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 16.8fr)) repeat(5, minmax(0, 6.56fr));
  grid-template-rows: auto auto auto;
  row-gap: var(--vsew-ctx-row-gap);
  column-gap: clamp(4px, 0.65vw, 12px);
  align-items: start;
  justify-items: start;
  width: 100%;
  min-width: 0;
  padding: 8px 12px 9px;
  box-sizing: border-box;
}

.vsew-event-ctx-tile {
  display: contents;
}

.vsew-event-ctx-cell {
  width: 100%;
  min-width: 0;
  justify-self: stretch;
  box-sizing: border-box;
  text-align: left;
}

.vsew-event-ctx-kicker {
  margin: 0;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9a9a9a;
  line-height: 1.2;
}

.vsew-event-ctx-slot {
  min-width: 0;
}

.vsew-event-ctx-row-primary {
  display: block;
  font-size: var(--vsew-ctx-data-size);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #0f0f0f;
  font-variant-numeric: tabular-nums;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.vsew-event-ctx-cell--projekt-name .vsew-event-ctx-row-primary {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.vsew-event-ctx-row-foot {
  display: block;
  font-size: 11.25px;
  font-weight: 500;
  letter-spacing: 0.03em;
  line-height: 1.4;
  color: #8a8a8a;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.vsew-event-ctx-row-foot strong {
  font-weight: 700;
  color: #5c5c5c;
}

.vsew-event-ctx-mp-combo {
  text-transform: none;
}

.vsew-event-ctx-metric__value {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  justify-content: flex-start;
  gap: 1px 2px;
  font-variant-numeric: tabular-nums;
  line-height: 1.08;
  max-width: 100%;
}

.vsew-event-ctx-metric__num {
  font-size: var(--vsew-ctx-data-size);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.vsew-event-ctx-metric__pct,
.vsew-event-ctx-metric__unit {
  font-size: var(--vsew-event-unit-size);
  font-weight: 700;
  line-height: 1.08;
}

.vsew-event-ctx-metric__unit {
  margin-left: 0.15em;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #666;
  text-transform: lowercase;
}

.vsew-event-ctx-metric--trigger .vsew-event-ctx-metric__num {
  color: #2a2a2a;
}


.vsew-event-ctx-metric--save .vsew-event-ctx-metric__num,
.vsew-event-ctx-metric--save .vsew-event-ctx-metric__pct {
  color: var(--vsew-threshold-save, #8c8c8c);
}

.vsew-event-ctx-metric--hint .vsew-event-ctx-metric__num,
.vsew-event-ctx-metric--hint .vsew-event-ctx-metric__pct {
  color: var(--vsew-threshold-hint, #dda634);
}

.vsew-event-ctx-metric--warning .vsew-event-ctx-metric__num,
.vsew-event-ctx-metric--warning .vsew-event-ctx-metric__pct {
  color: var(--vsew-threshold-warning, #ef4e4e);
}

.vsew-event-ctx-metric--critical .vsew-event-ctx-metric__num,
.vsew-event-ctx-metric--critical .vsew-event-ctx-metric__pct {
  color: var(--vsew-threshold-critical, #b42020);
}

.vsew-event-ctx-cell--thr-install .vsew-event-ctx-install-note {
  margin: 0;
  font-size: 10px;
  font-weight: 500;
  font-style: italic;
  line-height: 1.45;
  color: #7a7a7a;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

@media (min-width: 901px) {
  /* Spalten 1–4: je 16,8 % — Spalten 5–9: je 6,56 % */
  .vsew-event-ctx-table {
    grid-template-columns: repeat(4, minmax(0, 16.8fr)) repeat(5, minmax(0, 6.56fr));
  }

  .vsew-event-ctx-cell--at-1-1,
  .vsew-event-ctx-cell--at-1-2,
  .vsew-event-ctx-cell--at-1-3 {
    grid-column: 1 / span 2;
  }

  .vsew-event-ctx-cell--at-1-1 { grid-row: 1; }
  .vsew-event-ctx-cell--at-1-2 { grid-row: 2; }
  .vsew-event-ctx-cell--at-1-3 { grid-row: 3; }

  .vsew-event-ctx-cell--at-3-1 { grid-column: 3; grid-row: 1; }
  .vsew-event-ctx-cell--at-3-2 { grid-column: 3; grid-row: 2; }
  .vsew-event-ctx-cell--at-3-3 { grid-column: 3; grid-row: 3; }
  .vsew-event-ctx-cell--at-4-1 { grid-column: 4; grid-row: 1; }
  .vsew-event-ctx-cell--at-4-2 { grid-column: 4; grid-row: 2; }
  .vsew-event-ctx-cell--at-4-3 { grid-column: 4; grid-row: 3; }

  .vsew-event-ctx-cell--at-4-1,
  .vsew-event-ctx-cell--at-4-2,
  .vsew-event-ctx-cell--at-4-3 {
    transform: translateX(0.8cqw);
    border-left: 1px solid #e8e8e8;
    padding-left: clamp(6px, 0.6vw, 12px);
  }

  .vsew-event-ctx-cell--at-5-1 { grid-column: 5; grid-row: 1; }
  .vsew-event-ctx-cell--at-6-1 { grid-column: 6; grid-row: 1; }
  .vsew-event-ctx-cell--at-7-1 { grid-column: 7; grid-row: 1; }
  .vsew-event-ctx-cell--at-8-1 { grid-column: 8; grid-row: 1; }
  .vsew-event-ctx-cell--at-9-1 { grid-column: 9; grid-row: 1; }
  .vsew-event-ctx-cell--at-5-2 { grid-column: 5; grid-row: 2; }
  .vsew-event-ctx-cell--at-6-2 { grid-column: 6; grid-row: 2; }
  .vsew-event-ctx-cell--at-7-2 { grid-column: 7; grid-row: 2; }
  .vsew-event-ctx-cell--at-8-2 { grid-column: 8; grid-row: 2; }
  .vsew-event-ctx-cell--at-9-2 { grid-column: 9; grid-row: 2; }

  .vsew-event-ctx-cell--at-5-3 {
    grid-column: 5 / span 5;
    grid-row: 3;
  }

  .vsew-event-ctx-cell--at-3-1,
  .vsew-event-ctx-cell--at-3-2,
  .vsew-event-ctx-cell--at-3-3 {
    border-left: 1px solid #e8e8e8;
    padding-left: clamp(6px, 0.6vw, 12px);
  }

  .vsew-event-ctx-cell--at-5-1,
  .vsew-event-ctx-cell--at-5-2,
  .vsew-event-ctx-cell--at-5-3 {
    border-left: 1px solid #e8e8e8;
    padding-left: clamp(6px, 0.6vw, 12px);
  }

  /* Zeile 2: einheitliche Primär-Typografie wie DIN 4150-3; Grenzwert-Farben + Einheiten unverändert */
  .vsew-event-ctx-cell--at-1-2 .vsew-event-ctx-row-primary,
  .vsew-event-ctx-cell--at-3-2 .vsew-event-ctx-row-primary,
  .vsew-event-ctx-cell--at-4-2 .vsew-event-ctx-row-primary,
  .vsew-event-ctx-cell--at-5-2 .vsew-event-ctx-metric__num,
  .vsew-event-ctx-cell--at-6-2 .vsew-event-ctx-metric__num,
  .vsew-event-ctx-cell--at-7-2 .vsew-event-ctx-metric__num,
  .vsew-event-ctx-cell--at-8-2 .vsew-event-ctx-metric__num,
  .vsew-event-ctx-cell--at-9-2 .vsew-event-ctx-metric__num {
    font-size: var(--vsew-ctx-data-size);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
  }

  /* Zeile 3: einheitliche Fußzeilen-Typografie */
  .vsew-event-ctx-cell--at-1-3 .vsew-event-ctx-row-foot,
  .vsew-event-ctx-cell--at-1-3 .vsew-event-ctx-mp-combo,
  .vsew-event-ctx-cell--at-3-3 .vsew-event-ctx-row-foot,
  .vsew-event-ctx-cell--at-4-3 .vsew-event-ctx-row-foot,
  .vsew-event-ctx-cell--at-5-3 .vsew-event-ctx-row-foot {
    font-size: 11.25px;
    font-weight: 500;
    font-style: normal;
    letter-spacing: 0.03em;
    line-height: 1.4;
    color: #8a8a8a;
  }

  .vsew-event-ctx-cell--at-5-3 .vsew-event-ctx-install-note {
    font-size: 11.25px;
    font-weight: 500;
    font-style: italic;
    letter-spacing: 0.03em;
    line-height: 1.4;
    color: #7a7a7a;
  }

  .vsew-event-ctx-cell--at-1-3 .vsew-event-ctx-row-foot strong,
  .vsew-event-ctx-cell--at-3-3 .vsew-event-ctx-row-foot strong,
  .vsew-event-ctx-cell--at-4-3 .vsew-event-ctx-row-foot strong {
    font-weight: 700;
    color: #5c5c5c;
  }
}

.vsew-event-context-card__sub .status-badge {
  font-size: 10px;
  vertical-align: baseline;
}

.vsew-event-params-panel {
  min-width: 0;
}

.vsew-event-params-head__combined {
  margin: 0 0 10px;
  line-height: 1.35;
}

.vsew-event-params-strip {
  --vsew-par-data-size: clamp(15px, 1.15vw, 19px);
  --vsew-par-row-gap: 0.38em;
  --vsew-par-unit-size: calc(var(--vsew-par-data-size) * 0.8);
  --vsew-par-unit-size-row2: calc(var(--vsew-par-unit-size) * 0.8);
  min-width: 0;
  padding: 0;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: linear-gradient(180deg, #fcfcfc 0%, #f6f6f6 100%);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

/* 8 Spalten × 3 Zeilen — gleichmäßig über die volle Breite (Desktop) */
.vsew-event-par-table {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-template-rows: auto auto auto;
  row-gap: var(--vsew-par-row-gap);
  column-gap: clamp(4px, 0.65vw, 12px);
  align-items: start;
  justify-items: start;
  width: 100%;
  min-width: 0;
  padding: 8px 12px 9px;
  box-sizing: border-box;
}

/* Kacheln: Desktop — Kinder im 8×3-Raster; Mobil — eigene Unterraster */
.vsew-event-par-tile {
  display: contents;
}

@media (min-width: 901px) {
  .vsew-event-par-cell--at-1-1 { grid-column: 1; grid-row: 1; }
  .vsew-event-par-cell--at-1-2 { grid-column: 1; grid-row: 2; }
  .vsew-event-par-cell--at-1-3 { grid-column: 1; grid-row: 3; }
  .vsew-event-par-cell--at-2-1 { grid-column: 2; grid-row: 1; }
  .vsew-event-par-cell--at-2-2 { grid-column: 2; grid-row: 2; }
  .vsew-event-par-cell--at-2-3 { grid-column: 2; grid-row: 3; }
  .vsew-event-par-cell--at-3-1 { grid-column: 3; grid-row: 1; }
  .vsew-event-par-cell--at-3-2 { grid-column: 3; grid-row: 2; }
  .vsew-event-par-cell--at-3-3 { grid-column: 3; grid-row: 3; }
  .vsew-event-par-cell--at-4-1 { grid-column: 4; grid-row: 1; }
  .vsew-event-par-cell--at-4-2 { grid-column: 4; grid-row: 2; }
  .vsew-event-par-cell--at-4-3 { grid-column: 4; grid-row: 3; }
  .vsew-event-par-cell--at-5-1 { grid-column: 5; grid-row: 1; }
  .vsew-event-par-cell--at-5-2 { grid-column: 5; grid-row: 2; }
  .vsew-event-par-cell--at-5-3 { grid-column: 5; grid-row: 3; }
  .vsew-event-par-cell--at-6-1 { grid-column: 6; grid-row: 1; }
  .vsew-event-par-cell--at-6-2 { grid-column: 6; grid-row: 2; }
  .vsew-event-par-cell--at-6-3 { grid-column: 6; grid-row: 3; }
  .vsew-event-par-cell--at-7-1 { grid-column: 7; grid-row: 1; }
  .vsew-event-par-cell--at-7-2 { grid-column: 7; grid-row: 2; }
  .vsew-event-par-cell--at-7-3 { grid-column: 7; grid-row: 3; }
  .vsew-event-par-cell--at-8-1 { grid-column: 8; grid-row: 1; }
  .vsew-event-par-cell--at-8-2 { grid-column: 8; grid-row: 2; }
  .vsew-event-par-cell--at-8-3 { grid-column: 8; grid-row: 3; }

  .vsew-event-par-cell--at-5-1,
  .vsew-event-par-cell--at-5-2,
  .vsew-event-par-cell--at-5-3 {
    border-left: 1px solid #e8e8e8;
    padding-left: clamp(4px, 0.5vw, 10px);
  }
}

.vsew-event-par-cell {
  width: 100%;
  min-width: 0;
  justify-self: stretch;
  box-sizing: border-box;
  text-align: left;
}

.vsew-event-par-cell--empty {
  min-height: 0;
  min-width: 0;
}

.vsew-event-par-util-pct {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  white-space: nowrap;
}

.vsew-event-par-val-num {
  font-size: var(--vsew-par-data-size);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.vsew-content-event .vsew-event-par-val-unit {
  font-size: var(--vsew-par-unit-size);
  font-weight: 600;
  line-height: 1.15;
  color: #5c5c5c;
}

/* Zeile 2: Einheiten %, s, Hz, mm/s um 20 % kleiner */
.vsew-event-params-strip .vsew-event-par-cell[class*="--at-"][class*="-2"] .vsew-event-par-val-unit {
  font-size: var(--vsew-par-unit-size-row2);
}

.vsew-event-par-peak-val {
  display: inline-flex;
  align-items: baseline;
  gap: 0.22em;
  white-space: nowrap;
}

.vsew-event-par-row-sub.vsew-status-text {
  font-weight: 700;
}

.vsew-event-par-row-sub.vsew-status-text.status-EVENT,
.vsew-event-par-row-sub.vsew-status-text.status-GREEN {
  color: var(--vsew-status-normal, #3d6b7a);
}

.vsew-event-par-row-sub.vsew-status-text.status-YELLOW {
  color: var(--vsew-threshold-hint, #dda634);
}

.vsew-event-par-row-sub.vsew-status-text.status-RED {
  color: var(--vsew-threshold-warning, #ef4e4e);
}

.vsew-event-par-row-sub.vsew-status-text.status-CRITICAL {
  color: var(--vsew-threshold-critical, #b42020);
}

.vsew-event-par-slot {
  min-width: 0;
}

.vsew-event-par-slot--empty {
  min-height: 0;
}

.vsew-event-par-row-primary {
  display: inline-flex;
  align-items: baseline;
  gap: 0.22em;
  font-size: var(--vsew-par-data-size);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #0f0f0f;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.vsew-event-par-row-sub {
  display: block;
  font-size: calc(var(--vsew-par-data-size) * 0.8);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.15;
  color: #5c5c5c;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.vsew-event-par-peak-kanal {
  font-size: var(--vsew-par-data-size);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.15;
  white-space: nowrap;
}

.vsew-event-par-peak-kanal--x {
  color: var(--vsew-axis-x, #f4764e);
}

.vsew-event-par-peak-kanal--y {
  color: var(--vsew-axis-y, #9ccc60);
}

.vsew-event-par-peak-kanal--z {
  color: var(--vsew-axis-z, #4aa3d1);
}

.vsew-event-par-peak-kanal--n {
  color: #64748b;
}

.vsew-event-par-peak-val .vsew-event-par-val-num {
  font-size: var(--vsew-par-data-size);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #0f0f0f;
  font-variant-numeric: tabular-nums;
}

.vsew-event-par-peak-freq {
  font-size: calc(var(--vsew-par-data-size) * 0.8);
  font-weight: 600;
  line-height: 1.15;
  color: #5c5c5c;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.vsew-event-par-row-primary .vsew-event-par-val-num {
  font-size: inherit;
  font-weight: inherit;
}

.vsew-event-subtitle {
  margin: 4px 0 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #888;
}

.vsew-event-spectrum-table--compact {
  width: 100%;
  table-layout: fixed;
  font-size: 10px;
}

.vsew-event-spectrum-table--compact th,
.vsew-event-spectrum-table--compact td {
  padding: 4px 5px;
  line-height: 1.25;
}

.vsew-event-spectrum-table--compact th:first-child,
.vsew-event-spectrum-table--compact td:first-child {
  width: 12.5%;
}

.vsew-event-spectrum-table--compact th:not(:first-child),
.vsew-event-spectrum-table--compact td:not(:first-child) {
  width: 21.875%;
}

.vsew-event-spectrum-table--compact thead th {
  font-size: 8px;
  letter-spacing: 0.02em;
  line-height: 1.2;
  white-space: nowrap;
}

.vsew-event-spectrum-table--compact th[scope="row"] {
  font-size: 10px;
  font-weight: 700;
  color: #444;
  text-transform: none;
  background: #fafafa;
}

.vsew-event-spectral-summary-wrap {
  margin-top: 0;
}

.vsew-spectral-mark {
  display: inline-block;
  width: 10px;
  height: 0;
  border-top: 2px dotted #64748b;
  vertical-align: middle;
}

.vsew-spectral-mark.q25 {
  border-top-color: #94a3b8;
}

.vsew-spectral-mark.q50 {
  border-top-color: #475569;
}

.vsew-spectral-mark.q75 {
  border-top-color: #1e293b;
}

@media (max-width: 1200px) {
  .vsew-event-ctx-cell--projekt-name .vsew-event-ctx-row-primary {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}

@media (max-width: 900px) {
  .vsew-event-context-head__combined {
    margin-bottom: 8px;
  }

  .vsew-event-ctx-table {
    display: flex;
    flex-direction: column;
    gap: 0;
    grid-template-columns: none;
    grid-template-rows: none;
    padding: 0;
  }

  .vsew-event-ctx-tile {
    display: grid;
    grid-template-rows: auto auto auto;
    row-gap: var(--vsew-ctx-row-gap);
    column-gap: clamp(6px, 2vw, 12px);
    width: 100%;
    padding: 8px 12px 9px;
    box-sizing: border-box;
    align-items: start;
    justify-items: start;
    border-bottom: 1px solid #e8e8e8;
  }

  .vsew-event-ctx-tile--projekt {
    grid-template-columns: minmax(0, 1fr);
  }

  .vsew-event-ctx-tile--sensor-din {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vsew-event-ctx-tile--thresholds {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border-bottom: none;
  }

  .vsew-event-ctx-cell[class*="--at-"]:not(.vsew-event-ctx-cell--thr-install) {
    grid-column: auto;
    grid-row: auto;
    border-left: none;
    padding-left: 0;
  }

  .vsew-event-ctx-tile--thresholds .vsew-event-ctx-cell--thr-install {
    grid-column: 1 / -1;
    grid-row: 3;
    width: 100%;
    max-width: 100%;
    justify-self: stretch;
  }

  .vsew-event-ctx-tile--thresholds .vsew-event-ctx-cell--thr-install .vsew-event-ctx-install-note {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: auto;
  }

  .vsew-event-ctx-tile--projekt .vsew-event-ctx-cell--projekt-name .vsew-event-ctx-row-primary {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: auto;
  }

  .vsew-event-ctx-tile--projekt .vsew-event-ctx-mp-combo,
  .vsew-event-ctx-tile--sensor-din .vsew-event-ctx-row-foot {
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: auto;
  }

  .vsew-event-ctx-tile--thresholds .vsew-event-ctx-kicker {
    overflow-wrap: normal;
    word-break: keep-all;
    max-width: 100%;
  }

  .vsew-topbar-event-row {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .vsew-topbar-event .vsew-event-page-title {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    line-height: 1.35;
  }

  .vsew-event-page-title__lead,
  .vsew-event-page-title__id {
    display: block;
  }

  .vsew-event-page-title__id {
    margin-top: 3px;
    font-size: 12px;
    font-weight: 600;
    color: #5c5c5c;
    letter-spacing: 0.01em;
    overflow-wrap: anywhere;
    word-break: break-all;
  }

  .vsew-event-par-table {
    display: flex;
    flex-direction: column;
    gap: 0;
    grid-template-columns: none;
    grid-template-rows: none;
    padding: 0;
  }

  .vsew-event-par-tile {
    display: grid;
    grid-template-rows: auto auto auto;
    row-gap: var(--vsew-par-row-gap);
    column-gap: clamp(6px, 2vw, 12px);
    width: 100%;
    padding: 8px 12px 9px;
    box-sizing: border-box;
    align-items: start;
    justify-items: start;
    border-bottom: 1px solid #e8e8e8;
  }

  .vsew-event-par-tile--cols-ab,
  .vsew-event-par-tile--cols-cd {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vsew-event-par-tile--cols-peaks {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-bottom: none;
  }

  .vsew-event-par-cell[class*="--at-"] {
    grid-column: auto;
    grid-row: auto;
  }

  .vsew-event-par-cell--at-5-1,
  .vsew-event-par-cell--at-5-2,
  .vsew-event-par-cell--at-5-3 {
    border-left: none;
    padding-left: 0;
  }
}

@media (max-width: 720px) {
  .vsew-event-context-strip {
    grid-template-columns: 1fr;
  }

  .vsew-topbar .vsew-event-downloads {
    justify-content: flex-start;
    width: 100%;
  }
}

/* —— Mobile layout (≤900px): drawer nav, page scroll, stacked charts —— */
@media (max-width: 900px) {
  .vsew-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .vsew-measurement {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .vsew-measurement-shell {
    display: block;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .vsew-mobile-nav-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 10px 12px;
    background: #f7f7f7;
    border-bottom: 1px solid #dcdcdc;
  }

  .vsew-nav-drawer-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    background: #fff;
    color: #222;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
  }

  .vsew-mobile-nav-title {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .vsew-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(0, 0, 0, 0.35);
  }

  .vsew-sidebar-backdrop[hidden] {
    display: none;
  }

  .vsew-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(280px, 86vw);
    max-width: 86vw;
    z-index: 40;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
  }

  .vsew-measurement-shell.vsew-nav-open .vsew-sidebar {
    transform: translateX(0);
  }

  body.vsew-nav-drawer-open {
    overflow: hidden;
  }

  /* Phone layout must scroll: base layout uses 100vh + overflow:hidden */
  .vsew-measurement {
    height: auto;
    max-height: none;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .vsew-measurement-shell {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .vsew-main {
    min-height: 0;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .vsew-content,
  .vsew-content-event {
    overflow: visible;
    overflow-x: visible;
    min-height: 0;
  }

  /* On phones, avoid internal flex scroll traps: let the page scroll to the audit table */
  .vsew-audit-panel {
    flex: 0 0 auto;
    min-height: auto;
    overflow: visible;
  }

  .vsew-table-wrap {
    flex: 0 0 auto;
    overflow: visible;
  }

  .vsew-event-panel-title-long {
    display: none;
  }

  .vsew-event-panel-title-short {
    display: inline;
  }

  .vsew-event-panel--collapsible:not([open]) {
    padding-bottom: 8px;
  }

  .vsew-event-panel--collapsible > .vsew-event-panel__summary .vsew-event-context-head__combined {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .vsew-charts-split,
  .vsew-event-charts-split {
    flex-direction: column;
    height: auto !important;
    min-height: 0;
  }

  .vsew-charts-split .vsew-chart-panel--summary,
  .vsew-charts-split .vsew-chart-panel--freq,
  .vsew-event-charts-block .vsew-chart-panel--summary,
  .vsew-event-charts-block .vsew-chart-panel--freq {
    flex: 0 0 auto;
    width: 100% !important;
    max-width: none;
    min-height: 0;
    height: auto;
    overflow: visible;
  }

  .vsew-event-charts-block .vsew-event-chart-panel {
    height: auto;
    overflow: visible;
    display: flex;
    flex-direction: column;
  }

  .vsew-event-charts-block .vsew-chart-panel--summary {
    flex: 0 0 auto;
    width: 100% !important;
    min-height: 0;
  }

  .vsew-event-charts-block .vsew-chart-panel--freq {
    flex: 0 0 auto;
    min-height: 0;
  }

  .vsew-event-charts-block .vsew-event-chart-slot {
    flex: 0 0 auto;
    min-height: 300px;
    height: auto;
    overflow: visible;
    padding-top: 0;
  }

  .vsew-event-charts-block .vsew-plot-legend-bar {
    margin-bottom: 2px;
  }

  .vsew-event-charts-block .vsew-event-chart .plot-container.plotly,
  .vsew-event-charts-block .vsew-event-chart .js-plotly-plot {
    margin-top: 0;
  }

  .vsew-event-charts-block .vsew-event-view-panel.is-active {
    height: auto;
    min-height: 300px;
  }

  .vsew-event-charts-block .vsew-event-chart {
    height: 360px !important;
    min-height: 360px !important;
    max-height: none;
  }

  .vsew-event-charts-block .vsew-event-chart--stacked {
    height: 528px !important;
    min-height: 528px !important;
  }

  .vsew-event-charts-block .vsew-event-chart--fft {
    height: 360px !important;
    min-height: 360px !important;
  }

  .vsew-event-charts-block .vsew-event-chart--fft.vsew-event-chart--stacked {
    height: 504px !important;
    min-height: 504px !important;
  }

  .vsew-event-charts-block .vsew-event-spectral-summary-wrap {
    flex: 0 0 auto;
    margin-top: 4px;
  }

  .vsew-guest-sensor-cta {
    width: auto;
    max-width: min(200px, 44vw);
    margin-bottom: 0;
  }

  .vsew-guest-cta-long {
    display: none;
  }

  .vsew-guest-cta-short {
    display: inline;
  }

  .vsew-event-chart-head .vsew-device-view-toggle button {
    padding: 4px 7px;
    font-size: 10px;
    line-height: 1.2;
  }

  #fft-view-toggle .vsew-toggle-label-long {
    display: none;
  }

  #fft-view-toggle .vsew-toggle-label-short {
    display: inline;
  }

  .vsew-charts-split .vsew-charts-gutter,
  .vsew-event-charts-block .vsew-charts-gutter,
  .vsew-charts-height-gutter {
    display: none;
  }

  .vsew-chart-slot {
    touch-action: pan-y;
    min-height: 260px;
  }

  .vsew-event-chart-slot {
    touch-action: pan-y;
  }

  .vsew-chart-slot .js-plotly-plot,
  .vsew-event-chart-slot .js-plotly-plot,
  .vsew-chart-slot .plot-container.plotly,
  .vsew-event-chart-slot .plot-container.plotly {
    touch-action: pan-y;
  }

  .vsew-mobile-chart-hint {
    display: block;
    font-size: 10px;
    color: #888;
    line-height: 1.3;
  }

  .vsew-filter-bar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .vsew-topbar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .vsew-audit-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .vsew-sidebar--guest .vsew-nav-group--guest .vsew-nav a {
    font-weight: 600;
  }

  /* Admin: avoid nested scroll trap (gray blank area when jumping to #admin-empfaenger) */
  .vsew-admin-content {
    overflow: visible;
    flex: none;
    min-height: auto;
  }

  .vsew-admin-content .card[id^="admin-"] {
    scroll-margin-top: 72px;
  }

  .vsew-sidebar-backdrop:not([hidden]) {
    pointer-events: auto;
  }
}

@media (min-width: 901px) {
  .vsew-mobile-nav-bar,
  .vsew-sidebar-backdrop {
    display: none;
  }

  .vsew-mobile-chart-hint {
    display: none;
  }
}

/* Plotly modebar: nearly invisible until the chart or toolbar is hovered */
.vsew-chart-slot .modebar,
.vsew-event-chart-slot .modebar {
  opacity: 0.07;
  transition: opacity 0.15s ease;
}

.vsew-chart-slot .modebar:hover,
.vsew-event-chart-slot .modebar:hover,
.vsew-chart-slot .js-plotly-plot:hover .modebar,
.vsew-event-chart-slot .js-plotly-plot:hover .modebar,
.vsew-chart-slot .plot-container.plotly:hover .modebar,
.vsew-event-chart-slot .plot-container.plotly:hover .modebar {
  opacity: 1;
}
