/* Device Workspace > Overview — live observability panel.
   Spacing scale: 4 / 8 / 12 / 16. Color only communicates state. */

/* ---------------------------------------------------------- shared micro type */
.ov-m__label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-muted);
  margin-bottom: 2px;
  white-space: nowrap;
}
.ov-unit {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 3px;
}
.ov-arr {
  font-size: 0.8em;
  font-weight: 700;
  color: var(--text-muted);
}

/* ---------------------------------------------------------- summary strip — Status Overview
   Top white bar: title + ops + 24h / IP history / Live
   Bottom row: segmented metrics with inset vertical dividers
   Desktop: one stable composition at every viewport (≥1280–2560).
   Only column width scales; padding / gaps / type / structure stay fixed. */
.ov-strip {
  --ov-seg-pad-x: 12px;
  --ov-seg-pad-y: 8px;
  --ov-divider-inset: 8px;

  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0;
  margin-top: 0;
  margin-bottom: 8px;
  min-width: 0;
  overflow: hidden;
}

/* White header block above metrics (reference Status Overview) */
.ov-strip__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
  min-width: 0;
}
.ov-strip__top-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  /* Grow into the left side; may shrink so anomaly text can ellipsize.
     Right actions stay flex-shrink: 0 and never relocate. */
  flex: 1 1 auto;
  flex-wrap: nowrap;
}
.ov-strip__title {
  font-size: var(--fs-14);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
}
.ov-strip__ops {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
  font: inherit;
  border: none;
  background: transparent;
  padding: 0;
  color: inherit;
}
.ov-strip__ops-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--neutral);
  flex: none;
}
.ov-strip__ops-ico {
  display: inline-flex;
  color: var(--warn-text);
  flex: none;
}
.ov-strip__ops-ico .icon {
  width: 13px;
  height: 13px;
}
.ov-strip__ops-count {
  font-size: var(--fs-11);
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.ov-strip__ops-text {
  font-size: var(--fs-13);
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.ov-strip__ops--empty {
  display: none;
}
.ov-strip__ops--ok .ov-strip__ops-dot {
  background: var(--ok);
  animation: ov-pulse 2.4s ease-in-out infinite;
}
.ov-strip__ops--warn .ov-strip__ops-dot {
  background: var(--warn);
  animation: ov-pulse 1.4s ease-in-out infinite;
}
.ov-strip__ops--danger .ov-strip__ops-dot {
  background: var(--danger);
  animation: ov-pulse 1.1s ease-in-out infinite;
}
.ov-strip__ops--neutral .ov-strip__ops-dot { background: var(--neutral); }

/* Same chip look as the old anomalies badge */
.ov-strip__ops--btn {
  gap: 6px 10px;
  padding: 5px 10px;
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.12s, background 0.12s;
}
.ov-strip__ops--btn:hover {
  border-color: var(--warn-border);
  background: color-mix(in srgb, var(--warn) 12%, transparent);
}
.ov-strip__ops--btn:focus { outline: none; }
.ov-strip__ops--btn:focus-visible { box-shadow: var(--focus-ring); }
.ov-strip__ops--btn .ov-strip__ops-text {
  font-size: var(--fs-11);
  font-weight: 550;
}
.ov-strip__ops--btn .ov-strip__ops-ico {
  animation: ov-pulse 1.4s ease-in-out infinite;
}
.ov-strip__ops--btn.ov-strip__ops--danger {
  border-color: var(--danger-border);
  background: var(--danger-soft);
}
.ov-strip__ops--btn.ov-strip__ops--danger:hover {
  border-color: var(--danger-border);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}
.ov-strip__ops--btn.ov-strip__ops--danger .ov-strip__ops-ico {
  color: var(--danger);
}

.ov-strip__top-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  min-width: 0;
}

/* Metrics zone — full-width row under the top bar.
   Desktop: explicit 12-col proportional grid (stable across resolutions).
   Groups use display:contents so all 12 segs share one track list.
   minmax floors keep readable columns; overflow-x scrolls when the card is narrower. */
.ov-strip__metrics {
  display: grid;
  grid-template-columns:
    minmax(120px, 1.15fr)
    minmax(130px, 1.25fr)
    minmax(114px, 1.10fr)
    minmax(94px, 0.90fr)
    minmax(100px, 0.95fr)
    minmax(108px, 1.05fr)
    minmax(78px, 0.75fr)
    minmax(78px, 0.75fr)
    minmax(84px, 0.80fr)
    minmax(78px, 0.75fr)
    minmax(84px, 0.80fr)
    minmax(68px, 0.65fr);
  align-items: stretch;
  column-gap: 0;
  min-width: 0;
  width: 100%;
  padding: 4px 6px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  box-sizing: border-box;
}
.ov-strip__metrics::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* Flatten groups into the metrics grid (desktop). Mobile restores display:grid on groups. */
.ov-strip__group {
  display: contents;
}
.ov-strip__group--ip::before {
  display: none;
}

/* Each metric = a column; inset divider between columns (Status Overview style) */
.ov-strip__seg {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 5px;
  padding: var(--ov-seg-pad-y) var(--ov-seg-pad-x);
  border-radius: 0;
  background: transparent;
  min-width: 0;
  flex-shrink: 1;
  overflow: hidden;
}
.ov-strip__head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}
.ov-strip__ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue);
  flex: none;
}
.ov-strip__ico .icon {
  width: 12px;
  height: 12px;
  stroke-width: 1.75;
}
.ov-strip__seg::before {
  content: "";
  position: absolute;
  left: 0;
  top: var(--ov-divider-inset);
  bottom: var(--ov-divider-inset);
  width: 1px;
  background: var(--border);
  pointer-events: none;
}
.ov-strip__group--device > .ov-strip__seg:first-child::before {
  display: none;
}
.ov-strip__seg--interactive { transition: background 0.12s; }
.ov-strip__seg--interactive:hover { background: var(--hover); }

/* Desktop: no per-seg min/max widths — column fr tracks own the proportions.
   Mobile overrides restore compact mins where needed. */
.ov-strip__seg--wide { min-width: 0; }
.ov-strip__seg--carrier {
  min-width: 0;
  max-width: none;
}
.ov-strip__seg--carrier .ov-strip__value {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.ov-strip__group--device .ov-strip__seg:not(.ov-strip__seg--wide):not(.ov-strip__seg--carrier) {
  min-width: 0;
}
.ov-strip__group--ip .ov-strip__seg {
  min-width: 0;
  padding: var(--ov-seg-pad-y) var(--ov-seg-pad-x);
}

.ov-strip__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-muted);
  white-space: nowrap;
  line-height: 1.2;
}
.ov-strip__value {
  font-size: var(--fs-14);
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 18px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.ov-strip__value--tech {
  font-family: var(--mono);
  font-size: var(--fs-13);
  font-weight: 600;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.ov-strip__value--muted {
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--text);
}
/* The number is read first, the unit second. */
.ov-strip .ov-unit {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
}
.ov-strip .ov-arr {
  font-weight: 600;
  color: var(--text-muted);
}

.ov-strip__group--ip .ov-strip__value {
  font-size: var(--fs-14);
  font-weight: 700;
  color: var(--text);
}

.ov-strip__toolbar {
  display: flex;
  flex-wrap: nowrap;
  flex-shrink: 0;
  align-items: center;
  white-space: nowrap;
  gap: 8px;
}
.ov-period-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px 0 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-12);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.ov-period-select:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}
.ov-period-select:focus { outline: none; }
.ov-period-select:focus-visible { box-shadow: var(--focus-ring); }
.ov-period-select__ico {
  display: inline-flex;
  color: var(--icon-secondary);
}
.ov-period-select__ico .icon {
  width: 13px;
  height: 13px;
}
.ov-period-select__chev {
  display: inline-flex;
  color: var(--icon-muted);
}
.ov-period-select__chev .icon {
  width: 12px;
  height: 12px;
}
.ov-strip__history {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 8px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--fs-12);
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
.ov-strip__history .icon {
  width: 13px;
  height: 13px;
  color: var(--icon-secondary);
}
.ov-strip__history:hover {
  color: var(--text);
  background: var(--surface-2);
}
.ov-strip__history:focus { outline: none; }
.ov-strip__history:focus-visible { box-shadow: var(--focus-ring); }

.ov-strip__live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 3px 0 2px;
  height: 28px;
  color: var(--blue);
  font-size: var(--fs-12);
  font-weight: 600;
  white-space: nowrap;
}
.ov-strip__live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue);
  animation: ov-pulse 1.6s ease-in-out infinite;
}

.ov-anomaly {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  cursor: pointer;
  min-width: 0;
  transition: border-color 0.12s, background 0.12s;
}
.ov-anomaly:hover { background: var(--hover); border-color: var(--border-strong, var(--border)); }
.ov-anomaly:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.ov-anomaly__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  align-self: center;
  flex: none;
}
.ov-anomaly--info .ov-anomaly__dot { background: var(--blue); }
.ov-anomaly--warning .ov-anomaly__dot { background: var(--warn); }
.ov-anomaly--critical .ov-anomaly__dot { background: var(--danger); }
.ov-anomaly__title {
  font-size: var(--fs-11);
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.ov-anomaly__detail {
  font-size: var(--fs-11);
  font-weight: 550;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------- cards grid */
.ov-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  align-items: start;
}
@media (min-width: 1400px) {
  .ov-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}
@media (min-width: 1800px) {
  .ov-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

.ov-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 9px 12px 7px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.05);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  min-width: 0;
}
/* Interactive card hover — structural (stronger neutral border), not a bright brand outline */
.ov-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.05), 0 8px 18px rgba(15, 23, 42, 0.07);
}
.ov-card:focus-visible { outline: none; box-shadow: var(--focus-ring); }

[data-theme="dark"] .ov-card {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18), 0 4px 14px rgba(0, 0, 0, 0.22);
}
[data-theme="dark"] .ov-card:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.22), 0 8px 20px rgba(0, 0, 0, 0.28);
}

/* Persistent highlight — every port counted in the anomalies strip */
.ov-card.has-anomaly {
  border-color: var(--warn-border);
  background: color-mix(in srgb, var(--warn) 6%, var(--surface));
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 0 0 2px color-mix(in srgb, var(--warn) 14%, transparent);
}
.ov-card.has-anomaly--critical {
  border-color: var(--danger-border, var(--danger));
  background: color-mix(in srgb, var(--danger) 6%, var(--surface));
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 0 0 2px color-mix(in srgb, var(--danger) 14%, transparent);
}
.ov-card.has-anomaly--info {
  border-color: color-mix(in srgb, var(--blue) 45%, var(--border));
  background: color-mix(in srgb, var(--blue) 5%, var(--surface));
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 0 0 2px color-mix(in srgb, var(--blue) 12%, transparent);
}
.ov-card.has-anomaly .ov-card__flag { display: inline-flex; }
.ov-list__row.has-anomaly {
  background: color-mix(in srgb, var(--warn) 7%, var(--surface));
  box-shadow: inset 2px 0 0 var(--warn);
}
.ov-list__row.has-anomaly--critical {
  background: color-mix(in srgb, var(--danger) 7%, var(--surface));
  box-shadow: inset 2px 0 0 var(--danger);
}
.ov-list__row.has-anomaly--info {
  background: color-mix(in srgb, var(--blue) 6%, var(--surface));
  box-shadow: inset 2px 0 0 var(--blue);
}

/* Alert drill-down: temporary warn flash so the client spots the port */
.ov-card.is-alert {
  border-color: var(--warn-border);
  background: var(--warn-soft);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 0 0 3px color-mix(in srgb, var(--warn) 18%, transparent);
  animation: ov-card-alert 2.2s ease-out;
}
@keyframes ov-card-alert {
  0%, 18% {
    border-color: var(--warn-border);
    background: color-mix(in srgb, var(--warn) 14%, var(--surface));
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 0 0 4px color-mix(in srgb, var(--warn) 22%, transparent);
  }
  40% {
    border-color: var(--warn-border);
    background: var(--warn-soft);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 0 0 3px color-mix(in srgb, var(--warn) 14%, transparent);
  }
  100% {
    border-color: var(--border);
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.05);
  }
}

.ov-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.ov-card__identity {
  flex: 1;
  min-width: 0;
}
.ov-card__titleline {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
  line-height: 1.15;
}
.ov-card__proto {
  flex: none;
  font-size: var(--fs-12);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
}
.ov-card__dot-sep {
  flex: none;
  color: var(--text-disabled);
  font-size: var(--fs-11);
  font-weight: 500;
  line-height: 1;
}
.ov-card__port {
  font-family: var(--mono);
  font-size: var(--fs-12);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.ov-card__state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  padding-top: 1px;
}
.ov-card__flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  color: var(--warn-text);
  background: var(--warn-soft);
}
.ov-card__flag .icon { width: 11px; height: 11px; }
.ov-card__expand {
  display: inline-flex;
  color: var(--icon-muted);
  transition: transform 0.18s, color 0.14s;
}
.ov-card:hover .ov-card__expand { color: var(--icon-secondary); }
.ov-card__expand .icon { width: 13px; height: 13px; }
.ov-card.is-expanded .ov-card__expand { transform: rotate(180deg); color: var(--icon-secondary); }

.ov-card__label {
  margin-top: 1px;
  font-size: var(--fs-11);
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

/* Health — dot only; label in dark tooltip on hover */
.ov-health {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: default;
  flex: none;
}
.ov-health__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}
.ov-health--healthy .ov-health__dot { background: var(--ok); animation: ov-pulse 2.4s ease-in-out infinite; }
.ov-health--warning .ov-health__dot { background: var(--warn); }
.ov-health--degraded .ov-health__dot { background: var(--warn); animation: ov-pulse 1.4s ease-in-out infinite; }
.ov-health--critical .ov-health__dot { background: var(--danger); animation: ov-pulse 1.1s ease-in-out infinite; }
.ov-health--expired .ov-health__dot {
  background: transparent;
  border: 2px solid var(--danger);
  width: 5px;
  height: 5px;
}
.ov-health--off .ov-health__dot { background: var(--neutral); }

/* Metrics */
.ov-card__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px 8px;
  margin-top: 7px;
}
.ov-card__metrics--secondary { margin-top: 5px; }
.ov-card__metrics--secondary .ov-m__value {
  font-size: var(--fs-13);
  font-weight: 600;
}
.ov-card--vpn .ov-card__metrics--secondary {
  grid-template-columns: repeat(2, 1fr);
}
/* VPN cards gain a destinations row — tighten spacing to keep the height on par
   with proxy cards, which carry an extra auxiliary metrics row instead. */
.ov-card--vpn .ov-card__metrics--secondary { margin-top: 4px; }
.ov-card--vpn .ov-card__dests { margin-top: 4px; }
.ov-card__metrics--aux {
  margin-top: 5px;
  padding-top: 4px;
  border-top: 1px solid var(--border-soft);
}
.ov-card__metrics--aux .ov-m__label {
  font-size: 9px;
  font-weight: 500;
}
.ov-card__metrics--aux .ov-m__value {
  font-size: var(--fs-12);
  font-weight: 550;
  color: var(--text-secondary);
}
.ov-m { min-width: 0; }
.ov-card__metrics .ov-m__label {
  font-size: 10px;
  font-weight: 500;
  margin-bottom: 1px;
}
.ov-m__value {
  display: block;
  font-size: var(--fs-13);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s;
  line-height: 1.2;
}
.ov-m__value--tech {
  font-family: var(--mono);
  font-size: var(--fs-12);
  font-weight: 550;
}
.ov-m__value--state {
  font-size: var(--fs-12);
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0;
}
.ov-m__dim {
  font-size: var(--fs-11);
  font-weight: 600;
  color: var(--text-muted);
}
.ov-m__value.ov-val--warn { color: var(--warn-text); }
.ov-m__value.ov-val--danger { color: var(--danger); }

/* Active sessions micro utilization bar — legacy; no longer rendered */
.ov-bar {
  display: block;
  height: 2px;
  margin-top: 3px;
  max-width: 56px;
  border-radius: 2px;
  background: var(--border-soft);
  overflow: hidden;
}
.ov-bar i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: color-mix(in srgb, var(--blue) 55%, transparent);
  transition: width 0.4s ease;
}

/* Micro-sparkline — trend hint inside the Traffic cell */
.ov-microspark {
  display: block;
  width: 100%;
  max-width: 68px;
  height: 12px;
  margin-top: 3px;
  opacity: 0.85;
}

/* Destinations — single compact text line */
.ov-card__dests {
  margin-top: 5px;
  padding-top: 4px;
  border-top: 1px solid var(--border-soft);
  min-width: 0;
}
.ov-card__dests-label {
  display: block;
  font-size: 9px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 1px;
}
.ov-card__dests-row {
  display: flex;
  align-items: baseline;
  min-width: 0;
}
.ov-card__dests-list {
  font-size: var(--fs-11);
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
  min-width: 0;
}
.ov-card__dests-more {
  flex: none;
  font-size: var(--fs-11);
  font-weight: 500;
  white-space: nowrap;
}
.ov-dest { color: var(--text-secondary); }
.ov-dest__sep {
  color: var(--text-disabled);
  margin: 0 5px;
}
.ov-dest--more {
  color: var(--blue);
  font-weight: 650;
}

/* Expanded detail — technical metrics only */
.ov-card__extra {
  display: none;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-soft);
  animation: ov-fade 0.16s ease-out;
}
.ov-card.is-expanded .ov-card__extra { display: block; }
.ov-card__metrics--extra { margin-top: 0; }

/* Footer */
.ov-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 5px;
  padding-top: 4px;
  border-top: 1px solid var(--border-soft);
  font-size: 9px;
  font-weight: 500;
  color: var(--text-muted);
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
.ov-card__activity { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-card__activity b { color: var(--text-secondary); font-weight: 600; }
.ov-expiry { white-space: nowrap; }
.ov-expiry--warn { color: var(--warn-text); font-weight: 650; }
.ov-expiry--danger { color: var(--danger); font-weight: 650; }

/* Empty state */
.ov-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 40px 24px;
}
.ov-empty__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
  margin-bottom: 2px;
}
.ov-empty__icon .icon { width: 21px; height: 21px; }
.ov-empty h3 { font-size: var(--fs-16); font-weight: 700; }
.ov-empty p { max-width: 380px; font-size: var(--fs-13); }
.ov-empty .btn { margin-top: 4px; }

/* Mobile workspace — primary actions + More sheet (no horizontal scroll) */
@media (max-width: 767px) {
  .ov-ws-actions {
    display: block;
    min-width: 0;
    margin: 0 0 12px;
    overflow: visible;
  }

  .ov-ws-actions .ws-toolbar__proxy-acts--mobile {
    display: flex;
    align-items: stretch;
    gap: 6px;
    width: 100%;
    min-width: 0;
  }

  .ov-ws-actions .ws-action {
    flex: 1 1 0;
    min-width: 0;
    height: 32px;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
    border-radius: 7px;
  }

  .ov-ws-actions .ws-action .icon {
    width: 13px;
    height: 13px;
  }

  .ov-ws-actions .ws-action__inner {
    gap: 5px;
  }

  .ov-ws-actions .ws-action__inner > span {
    line-height: 16px;
  }

  .ov-ws-actions .ws-action--proxy-slot {
    flex: 1 1 0;
  }

  .ov-ws-actions .ws-action--change-ip {
    flex: 1 1 0;
  }

  .ov-ws-actions .ws-action--more {
    flex: 0 0 32px;
    width: 32px;
    min-width: 32px;
    max-width: 32px;
    padding: 0;
  }

  .ov-ws-actions .ws-action--more .ws-action__inner {
    justify-content: center;
  }

  .ov-ws-actions .ws-action--more .icon {
    width: 16px;
    height: 16px;
  }

  .ov-ws-actions .ws-action__inner > span {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Status Overview — compact 3-metric strip, no horizontal scroll */
  .ov-strip--mobile .ov-strip__top {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 10px;
  }
  .ov-strip--mobile .ov-strip__top-main {
    flex: 1 1 100%;
    min-width: 0;
  }
  .ov-strip--mobile .ov-strip__top-actions {
    flex: 1 1 100%;
    min-width: 0;
  }
  .ov-strip--mobile .ov-strip__toolbar {
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
  }
  .ov-strip--mobile .ov-strip__history span {
    display: none;
  }
  .ov-strip--mobile .ov-strip__metrics {
    display: block;
    overflow-x: hidden;
    padding: 6px 8px 10px;
  }
  .ov-strip--mobile .ov-strip__group--device {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    grid-auto-flow: unset;
    grid-auto-columns: unset;
    column-gap: 0;
  }
  .ov-strip--mobile .ov-strip__group--device .ov-strip__seg {
    min-width: 0 !important;
    max-width: none;
    padding: 6px 4px;
    align-items: center;
    text-align: center;
  }
  .ov-strip--mobile .ov-strip__group--device .ov-strip__seg::before {
    display: block;
  }
  .ov-strip--mobile .ov-strip__group--device > .ov-strip__seg:first-child::before {
    display: none;
  }
  .ov-strip--mobile .ov-strip__head {
    justify-content: center;
    gap: 2px;
  }
  .ov-strip--mobile .ov-strip__ico {
    display: none;
  }
  .ov-strip--mobile .ov-strip__label {
    font-size: 9px;
    font-weight: 500;
    line-height: 1.1;
    white-space: normal;
    text-align: center;
  }
  .ov-strip--mobile .ov-strip__value {
    font-size: 11px;
    line-height: 1.2;
    justify-content: center;
    text-align: center;
  }
  .ov-strip--mobile .ov-strip__value--tech {
    font-size: 10px;
  }
  .ov-strip--mobile .ov-unit {
    font-size: 9px;
  }
}

/* Animations */
@keyframes ov-pulse { 50% { opacity: 0.35; } }
@keyframes ov-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .ov-strip__live-dot, .ov-health__dot, .ov-strip__ops-dot, .ov-strip__ops-ico { animation: none !important; }
  .ov-card__extra { animation: none; }
  .ov-card__expand, .ov-bar i { transition: none; }
  .ov-card.is-alert {
    animation: none;
    border-color: var(--warn-border);
    background: var(--warn-soft);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 18%, transparent);
  }
  .ov-list__row.is-alert { animation: none; }
}

/* Strip density — do NOT vary by container/viewport on desktop.
   (Previous @container rules changed padding/min-widths and made
   1280px look like a different layout than 1920px.) */

@media (max-width: 1100px) {
  .ov-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}
@media (max-width: 720px) {
  .ov-grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------- view toggle */
.ov-view-toggle {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  gap: 1px;
}
.ov-view-toggle__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 22px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--icon-secondary);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.ov-view-toggle__btn .icon {
  width: 14px;
  height: 14px;
  pointer-events: none;
}
.ov-view-toggle__btn:hover {
  color: var(--icon);
  background: var(--hover);
}
.ov-view-toggle__btn.is-active {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border);
}
.ov-view-toggle__btn:focus { outline: none; }
.ov-view-toggle__btn:focus-visible { box-shadow: var(--focus-ring); }

/* ---------------------------------------------------------- connections list */
.ov-grid,
.ov-list {
  animation: ov-fade 0.12s ease;
}
@media (prefers-reduced-motion: reduce) {
  .ov-grid,
  .ov-list { animation: none; }
}

.ov-list {
  --ov-list-cols:
    minmax(210px, 1.45fr)
    minmax(104px, 0.7fr)
    minmax(130px, 1fr)
    minmax(108px, 0.75fr)
    minmax(88px, 0.55fr)
    minmax(128px, 0.85fr)
    minmax(76px, 0.5fr)
    minmax(72px, 0.48fr)
    minmax(76px, 0.5fr)
    56px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  min-width: 0;
}
.ov-list__head,
.ov-list__row {
  display: grid;
  grid-template-columns: var(--ov-list-cols);
  align-items: center;
  column-gap: 10px;
  padding: 0 12px;
  min-width: 0;
}
.ov-list__head {
  height: 38px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-soft);
}
.ov-list__head .ov-list__cell {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ov-list__body {
  min-width: 0;
}
.ov-list__row {
  position: relative;
  min-height: 60px;
  max-height: 68px;
  border-bottom: 1px solid var(--border-soft);
  transition: background 0.12s;
}
.ov-list__row:last-child { border-bottom: none; }
.ov-list__row:hover { background: var(--hover); }
.ov-list__row.is-obs-open {
  background: color-mix(in srgb, var(--blue) 6%, var(--surface));
  box-shadow: inset 2px 0 0 var(--blue);
}
@supports not (background: color-mix(in srgb, white 50%, black)) {
  .ov-list__row.is-obs-open {
    background: var(--blue-soft);
  }
}
.ov-list__row.is-alert {
  background: var(--warn-soft);
  box-shadow: inset 2px 0 0 var(--warn);
  animation: ov-list-alert 2.2s ease-out;
}
@keyframes ov-list-alert {
  0%, 18% {
    background: color-mix(in srgb, var(--warn) 14%, var(--surface));
    box-shadow: inset 2px 0 0 var(--warn);
  }
  100% {
    background: var(--surface);
    box-shadow: inset 2px 0 0 transparent;
  }
}

.ov-list__cell {
  min-width: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.ov-list__cell--conn {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}
.ov-list__cell--conn .ov-health {
  margin-top: 4px;
  flex: none;
}
.ov-list__identity {
  min-width: 0;
  flex: 1;
}
.ov-list__title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.ov-list__name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ov-list__dot-sep {
  margin: 0 4px;
  color: var(--text-muted);
  font-weight: 600;
}
.ov-list__sub,
.ov-list__meta {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 1px;
  line-height: 1.25;
}
.ov-list__sub--label { display: none; }
.ov-list__meta { color: var(--text-muted); }
.ov-list__flag {
  display: inline-flex;
  color: var(--warn);
  flex: none;
}
.ov-list__flag .icon { width: 11px; height: 11px; }

.ov-list__cell--type {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ov-list__proto {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}
.ov-list__port {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.ov-list__cell--label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
}
.ov-list__cell--traffic {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ov-list__spark {
  width: 42px;
  height: 16px;
  flex: none;
  display: block;
}
.ov-list__num {
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.ov-list__num .ov-unit { font-weight: 600; }
.ov-list__num.ov-val--warn { color: var(--warn-text); }
.ov-list__num.ov-val--danger { color: var(--danger); }
.ov-list__na {
  color: var(--text-muted);
  font-weight: 500;
}
.ov-list__speed {
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ov-list__speed .ov-unit { margin-left: 4px; }

.ov-list__dests {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  margin: 0;
  padding: 2px 4px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  cursor: pointer;
  min-width: 0;
}
.ov-list__dests:hover { background: var(--hover); }
.ov-list__dests:focus { outline: none; }
.ov-list__dests:focus-visible { box-shadow: var(--focus-ring); }
.ov-list__fav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  font-size: 9px;
  font-weight: 700;
  flex: none;
  text-transform: uppercase;
}
.ov-list__fav--empty {
  color: var(--icon-muted);
}
.ov-list__fav--empty .icon {
  width: 11px;
  height: 11px;
}
.ov-list__dest-more,
.ov-list__dest-total {
  font-size: 11px;
  font-weight: 600;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ov-list__dest-total { display: none; }
.ov-list__dest-total.ov-list__na { color: var(--text-muted); }

.ov-list__status {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--surface-3);
  color: var(--text-secondary);
}
.ov-list__status--active {
  background: color-mix(in srgb, var(--ok) 14%, transparent);
  color: var(--ok-text, var(--ok));
}
.ov-list__status--down,
.ov-list__status--offline {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger);
}
.ov-list__status--warn {
  background: color-mix(in srgb, var(--warn) 14%, transparent);
  color: var(--warn-text);
}
.ov-list__status--expired,
.ov-list__status--disabled {
  background: var(--surface-3);
  color: var(--text-secondary);
}
@supports not (background: color-mix(in srgb, white 50%, black)) {
  .ov-list__status--active { background: var(--ok-soft, var(--surface-3)); }
  .ov-list__status--down,
  .ov-list__status--offline { background: var(--danger-soft, var(--surface-3)); }
  .ov-list__status--warn { background: var(--warn-soft, var(--surface-3)); }
}

.ov-list__cell--actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.ov-list__cell--sessions,
.ov-list__cell--success,
.ov-list__cell--latency,
.ov-list__cell--status {
  text-align: left;
}

.ov-list__compact {
  display: none;
}

/* Medium: fold Type/Port into Connection identity */
@media (max-width: 1500px) {
  .ov-list {
    --ov-list-cols:
      minmax(200px, 1.5fr)
      minmax(120px, 1fr)
      minmax(104px, 0.75fr)
      minmax(80px, 0.5fr)
      minmax(120px, 0.85fr)
      minmax(72px, 0.48fr)
      minmax(68px, 0.45fr)
      minmax(72px, 0.48fr)
      56px;
  }
  .ov-list__cell--type { display: none; }
}

/* Tighter desktop columns */
@media (max-width: 1280px) {
  .ov-list {
    --ov-list-cols:
      minmax(190px, 1.5fr)
      minmax(110px, 1fr)
      minmax(100px, 0.75fr)
      minmax(72px, 0.48fr)
      minmax(118px, 0.85fr)
      minmax(68px, 0.45fr)
      minmax(64px, 0.42fr)
      minmax(70px, 0.45fr)
      52px;
  }
  .ov-list__fav,
  .ov-list__dest-more { display: none; }
  .ov-list__dest-total {
    display: inline;
    font-size: 12px;
  }
}

/* Narrow desktop: fold label into connection second line via CSS order / hide label col */
@media (max-width: 1100px) {
  .ov-list {
    --ov-list-cols:
      minmax(180px, 1.6fr)
      minmax(96px, 0.7fr)
      minmax(64px, 0.45fr)
      minmax(110px, 0.85fr)
      minmax(64px, 0.42fr)
      minmax(52px, 0.35fr)
      48px;
  }
  .ov-list__cell--label,
  .ov-list__cell--success,
  .ov-list__head .ov-list__cell--label,
  .ov-list__head .ov-list__cell--success { display: none; }
  .ov-list__sub--tech { display: none; }
  .ov-list__sub--label { display: block; }
}

/* Very narrow: compact line items (still List, not Grid) */
@media (max-width: 860px) {
  .ov-list__head { display: none; }
  .ov-list__row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "conn actions"
      "compact compact";
    row-gap: 6px;
    column-gap: 8px;
    max-height: none;
    min-height: 0;
    padding: 10px 12px;
  }
  .ov-list__cell--conn { grid-area: conn; }
  .ov-list__cell--actions { grid-area: actions; align-self: start; }
  .ov-list__cell--type,
  .ov-list__cell--label,
  .ov-list__cell--traffic,
  .ov-list__cell--sessions,
  .ov-list__cell--speed,
  .ov-list__cell--success,
  .ov-list__cell--latency,
  .ov-list__cell--dests,
  .ov-list__cell--status { display: none !important; }
  .ov-list__compact {
    grid-area: compact;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
  }
  .ov-list__compact .ov-unit { font-size: 10px; }
  .ov-list__cell--conn .ov-list__meta { display: none; }
}
