/* Gemeinsame V2-Navigation und Seiten-Grundelemente. */
.v2-btn { text-decoration:none; }
.v2-btn:disabled { opacity:.5; cursor:wait; }
button,input,select { font:inherit; }
:focus-visible { outline:2px solid var(--v2-accent-light); outline-offset:3px; }
.v2-page-note { font-size:.875rem; color:var(--v2-text-secondary); }
.v2-page-notice { padding:1rem; border:1px solid var(--v2-border); border-radius:12px; background:var(--v2-bg-card); }
.v2-page-header .v2-header-actions { flex-wrap:wrap; }

@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation-duration:.01ms!important; transition-duration:.01ms!important; } }

/* Gemeinsames Funktionslayout der bestätigten K51-Oberflächen. */
.k51-product,.v2-detail-header-title {display:flex;align-items:center;gap:1rem;min-width:0;}
.k51-logo {display:block;width:80px;height:auto;flex:none;}
.k51-product a,.v2-detail-header-title>a {flex:none;}
.v2-page-footer {display:flex;justify-content:flex-end;padding:1.25rem 0 .5rem;}
.v2-header-actions {flex-wrap:nowrap;}
.v2-header-actions .v2-refresh-status {max-width:14rem;white-space:normal;text-align:right;}
.v2-context-back {color:var(--v2-text-secondary);text-decoration:none;font-size:.875rem;}
.v2-context-back:hover {color:var(--v2-text-primary);}

.v2-label-short{display:none;}
@media(max-width:650px){.v2-label-long{display:none;}.v2-label-short{display:inline;}}

/* Fleet groups keep the same column width even with only one or two locations. */
.v2-location-groups {display:grid;gap:1.7rem;}
.v2-generation {min-width:0;}
.v2-generation h2 {margin:0 0 .75rem;font-size:.85rem;font-weight:600;color:var(--v2-text-muted);}
.v2-overview .k51-product .v2-subtitle {margin-top:.2rem;}
/* Navigation is blue, never the green/amber/red of operational status. */
:root,[data-theme="dark"] {--v2-control-blue:#78b8ff;--v2-control-blue-border:#53769e;--v2-control-blue-bg:rgba(70,139,218,.12);--v2-control-blue-hover:rgba(70,139,218,.20);}
[data-theme="light"] {--v2-control-blue:#215da0;--v2-control-blue-border:#8aa8cd;--v2-control-blue-bg:rgba(70,139,218,.08);--v2-control-blue-hover:rgba(70,139,218,.15);}
.v2-btn-hmi,.v2-btn-hmi:hover,.v2-btn-hmi:active,.v2-btn-hmi:focus-visible {
 color:var(--v2-control-blue);border-color:var(--v2-control-blue-border);background:var(--v2-control-blue-bg);
}
.v2-btn-hmi:hover {background:var(--v2-control-blue-hover);}
.v2-sensor-tab.active,.v2-sensor-chip.checked {
 color:var(--v2-control-blue);border-color:var(--v2-control-blue-border);background:var(--v2-control-blue-bg);
}
.v2-sensor-tab.active:hover,.v2-sensor-chip.checked:hover {background:var(--v2-control-blue-hover);}

.v2-location-card {container-type:inline-size;}
@container (max-width:350px) {
 .v2-location-card .v2-label-long {display:none;}
 .v2-location-card .v2-label-short {display:inline;}
}

.v2-chart-sensor-groups {display:flex;flex-wrap:wrap;gap:.4rem;margin-bottom:.55rem;}
.v2-chart-sensor-group.active,.v2-chart-sensor-group.active:hover {
 color:var(--v2-control-blue);border-color:var(--v2-control-blue-border);background:var(--v2-control-blue-bg);
}
.v2-chart-sensor-group:focus-visible {outline-color:var(--v2-control-blue);}

/* Phone headers: logo + title/subtitle left, two controls above the time right. */
@media(max-width:768px) {
 .v2-overview .v2-header-content,.v2-detail-header .v2-header-content,.v2-hmi .v2-header-content {
  display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:.5rem .65rem;
 }
 .v2-overview .v2-header-title,.v2-detail-header .v2-header-title,.v2-hmi .v2-header-title {
  grid-column:1;grid-row:1;min-width:0;
 }
 .k51-product,.v2-detail-header-title {gap:.6rem;min-width:0;}
 .k51-product>div,.v2-detail-header-title>div {min-width:0;}
 .k51-logo {width:52px;}
 .v2-header .v2-header-title h1 {font-size:1rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
 .v2-header .v2-header-title .v2-subtitle {font-size:.75rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
 .v2-overview .v2-header-actions,.v2-detail-header .v2-header-actions,.v2-hmi .v2-header-actions {
  grid-column:2;grid-row:1;display:grid;grid-template-columns:38px 38px;
  grid-template-rows:38px auto;gap:.2rem .35rem;margin:0;padding:0;align-items:center;justify-items:center;
 }
 .v2-header-actions button {grid-row:1;width:38px;height:38px;min-width:38px;min-height:38px;padding:.4rem;justify-content:center;}
 .v2-header-actions button:first-of-type {grid-column:1;}
 .v2-header-actions button:last-of-type {grid-column:2;}
 .v2-header-actions .v2-refresh-label {display:none;}
 .v2-header .v2-header-actions .v2-refresh-status {
  display:block;grid-column:1/-1;grid-row:2;margin:0;max-width:none;font-size:.75rem;
  line-height:1.15;text-align:center;white-space:nowrap;overflow:visible;font-variant-numeric:tabular-nums;
 }
 .v2-overview .v2-header-stats {grid-column:1/-1;grid-row:2;justify-content:center;gap:.35rem;}
 .v2-overview .v2-stat-pill {padding:.2rem .55rem;font-size:.8rem;}
}
