/**
 * Sentri Hub — operator UI (extends shared theme.css from edge).
 * When edge design tokens change, refresh hub/static/theme.css from
 * edge/src/sentri/static/theme.css then run collectstatic.
 */

.hub-body {
  --hub-accent: #3d7dd6;
  --hub-live: #e85d4a;
  --hub-ok: #2d9d6a;
  --hub-warn: #c9a227;
  --hub-off: #6b7280;
  --hub-card-gap: 1.25rem;
  max-width: 100%;
}

html.hub-app {
  max-width: 100%;
  overflow-x: hidden;
}

.hub-top {
  flex-wrap: nowrap;
  gap: 0.85rem 1rem;
}

.hub-top .hub-brand-block {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex-shrink: 0;
}

.hub-nav {
  flex: 1 1 auto;
  justify-content: flex-end;
  gap: 0.1rem 0.85rem;
  min-width: 0;
}

.hub-nav > a,
.hub-nav .nav-console > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.hub-nav > a i,
.hub-nav .nav-console-menu a i {
  font-size: 0.85em;
  opacity: 0.9;
  width: 1em;
  text-align: center;
}

.hub-nav-sep {
  display: inline-block;
  width: 1px;
  height: 1.1rem;
  background: var(--border, #2a2f3a);
  margin: 0 0.15rem;
  flex-shrink: 0;
}

.hub-top-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: 0;
}

@media (max-width: 960px) {
  .hub-body {
    overflow-x: hidden;
  }
  .hub-container,
  .hub-settings-section-nav,
  .hub-settings-card,
  .hub-page-head,
  .hub-readiness-banner {
    max-width: 100%;
    min-width: 0;
  }
  .hub-top {
    flex-wrap: wrap;
  }
  .hub-top-actions {
    order: 2;
  }
  .hub-top .nav-toggle {
    order: 3;
  }
  .hub-nav {
    order: 4;
  }
  .hub-nav-sep {
    display: none;
  }
}

.hub-container {
  padding-bottom: 2.5rem;
}

.hub-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: var(--hub-card-gap);
}

.hub-page-head h1 {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
}

.hub-lead {
  margin: 0;
  max-width: 42rem;
  line-height: 1.5;
}

.hub-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.hub-card-title {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Flash messages — card chrome lives in theme.css (.hub-notice / .hub-flash). */
.hub-page-notices {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}
.hub-page-notices:not(:has(.hub-notice:not([hidden]))) {
  display: none;
  margin: 0;
}
.hub-page-notices .hub-notice {
  margin: 0;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, #e6b35a 48%, var(--border, #333));
  background: color-mix(in srgb, #e6b35a 12%, var(--bg, #0e1116));
}
.hub-page-notices .hub-notice[hidden] {
  display: none;
}
.hub-page-notices .hub-notice--error {
  border-color: color-mix(in srgb, var(--danger, #e05a5a) 50%, var(--border, #333));
  background: color-mix(in srgb, var(--danger, #e05a5a) 12%, var(--bg, #0e1116));
}
.hub-page-notices .hub-notice-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}
.hub-page-notices .hub-notice-body {
  min-width: 0;
}
.hub-page-notices .hub-notice-body p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
}
.hub-page-notices .hub-notice--warning .hub-notice-body strong {
  color: #f3d7a4;
}
.hub-page-notices .hub-notice-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.4rem;
}
#hub-running-banner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
#hub-running-banner .hub-notice-inner {
  cursor: pointer;
}
#hub-running-banner .hub-notice-inner + .hub-notice-inner {
  padding-top: 0.75rem;
  border-top: 1px solid color-mix(in srgb, #e6b35a 35%, transparent);
}
.hub-service-plan-list {
  margin: 0.4rem 0 0.8rem;
  padding-left: 1.1rem;
}
.hub-service-plan-list li {
  margin: 0.28rem 0;
}
.hub-service-plan-state {
  display: inline-block;
  margin: 0 0.35rem;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.hub-service-plan-help {
  margin: 0.2rem 0 0.8rem;
}
.hub-service-plan-help-body {
  max-height: 16rem;
  overflow: auto;
}
.hub-service-plan-help-body p,
.hub-service-plan-help-body h3 {
  margin: 0.45rem 0;
}
.hub-service-plan-help-body h3 {
  font-size: 0.95rem;
}
.hub-service-plan-next {
  border: 0;
  margin: 0 0 0.6rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
}
.hub-service-plan-next legend {
  padding: 0;
  margin-bottom: 0.35rem;
  font-weight: 650;
}
@media (max-width: 720px) {
  .hub-page-notices .hub-notice-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}
.hub-flash-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: var(--hub-card-gap);
}

.hub-flash {
  padding: 0.65rem 0.85rem;
}

/* Status badges */
.hub-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.hub-badge--ok {
  background: rgba(45, 157, 106, 0.2);
  color: #8ee4b8;
}

.hub-badge--live {
  background: rgba(232, 93, 74, 0.25);
  color: #ffb4a8;
}

.hub-badge--warn {
  background: rgba(201, 162, 39, 0.2);
  color: #f0d78a;
}

.hub-badge--update {
  background: rgba(90, 130, 230, 0.22);
  color: #c5d6ff;
}

.hub-badge--off,
.hub-badge--muted {
  background: rgba(107, 114, 128, 0.25);
  color: #b8bcc4;
}

.hub-pulse {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
  animation: hub-pulse 1.2s ease-in-out infinite;
}

@keyframes hub-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

/* Stat row */
.hub-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 0.75rem;
  margin-bottom: var(--hub-card-gap);
}

.hub-stat-card {
  background: var(--card-bg, rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hub-stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted, #9ca3af);
}

.hub-stat-value {
  font-size: 1.25rem;
  font-weight: 600;
}

/* —— Live view —— */
.hub-body[data-hub-section="live"] .hub-container {
  max-width: none;
  width: 100%;
}

.hub-live-page {
  --live-sidebar-w: 16.5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: calc(100dvh - 8.5rem);
}

.hub-live-hero {
  margin-bottom: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.hub-live-eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.hub-live-hero-text h1 {
  margin: 0 0 0.25rem;
  font-size: clamp(1.35rem, 2.4vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hub-live-lead {
  font-size: 0.9rem;
  max-width: 36rem;
}

.hub-live-actions {
  align-items: flex-end;
}

.hub-live-phone-edges {
  display: none;
}

@media (hover: none) and (pointer: coarse) {
  .hub-live-phone-edges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    width: 100%;
  }

  .hub-live-phone-edge {
    min-height: 1.7rem;
    padding: 0.05rem 0.45rem;
    font-size: 0.72rem;
  }
}

.hub-live-control {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hub-live-control-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.hub-live-select {
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  min-width: 11rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238b95a8' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
}

.hub-live-select:hover,
.hub-live-select:focus {
  border-color: var(--accent-dim);
  outline: none;
}

.hub-live-workspace {
  display: grid;
  grid-template-columns: var(--live-sidebar-w) minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
}

.hub-live-sidebar {
  position: sticky;
  top: 1rem;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 7rem);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hub-live-sidebar > .hub-live-picker-list {
  flex: 1 1 auto;
  min-height: 0;
}

.hub-live-sidebar-head {
  flex-shrink: 0;
  padding: 0.85rem 1rem 0.7rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(91, 156, 245, 0.08) 0%, transparent 100%);
  list-style: none;
  cursor: default;
}

.hub-live-sidebar-head::-webkit-details-marker {
  display: none;
}

.hub-live-sidebar-head::marker {
  content: "";
}

.hub-live-sidebar-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.hub-live-sidebar-title::before {
  content: "";
  width: 3px;
  height: 1em;
  border-radius: 2px;
  background: var(--accent);
}

.hub-live-sidebar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.65rem;
}

.hub-live-picker-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hub-live-picker-item {
  margin: 0;
}

.hub-live-picker-label {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.hub-live-picker-label:hover {
  background: rgba(91, 156, 245, 0.06);
  border-color: rgba(91, 156, 245, 0.2);
}

.hub-live-picker-label:has(.hub-live-picker-cb:checked) {
  border-color: rgba(91, 156, 245, 0.45);
  background: rgba(91, 156, 245, 0.12);
  box-shadow: inset 0 0 0 1px rgba(91, 156, 245, 0.15);
}

.hub-live-picker-cb {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.hub-live-picker-switch {
  width: 2.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: var(--bg0);
  border: 1px solid var(--border);
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}

.hub-live-picker-switch::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0.2rem;
  width: 0.95rem;
  height: 0.95rem;
  margin-top: -0.475rem;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.2s, background 0.2s;
}

.hub-live-picker-label:has(.hub-live-picker-cb:checked) .hub-live-picker-switch {
  background: rgba(91, 156, 245, 0.35);
  border-color: var(--accent-dim);
}

.hub-live-picker-label:has(.hub-live-picker-cb:checked) .hub-live-picker-switch::after {
  transform: translateX(1rem);
  background: var(--accent);
}

.hub-live-picker-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--idle);
}

.hub-live-picker-dot--on {
  background: var(--success);
  box-shadow: 0 0 8px rgba(62, 207, 142, 0.5);
}

.hub-live-picker-dot--rec {
  background: var(--recording);
  box-shadow: 0 0 10px rgba(240, 98, 146, 0.65);
  animation: hub-pulse 1.2s ease-in-out infinite;
}

.hub-live-picker-dot--off {
  background: var(--idle);
  opacity: 0.55;
}

.hub-live-picker-meta {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.hub-live-picker-name {
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hub-live-picker-sub {
  font-size: 0.72rem;
  line-height: 1.2;
}

.hub-live-picker-offline {
  color: var(--muted);
}

.hub-live-picker-rec {
  color: var(--recording);
  font-weight: 600;
}

.hub-live-picker-buffering {
  color: #64b5f6;
}

.hub-live-picker-reconnecting {
  color: var(--warn);
}

.hub-live-picker-dot--buffering {
  background: #64b5f6;
  box-shadow: 0 0 0 2px rgba(100, 181, 246, 0.35);
}

.hub-live-main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

/* One top chrome: layout mode controls + status meta (no overlapping strips). */
.hub-live-top-chrome {
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
}

.hub-live-status-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
  padding: 0.2rem 0.45rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
}

.hub-live-status-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: hub-pulse 2s ease-in-out infinite;
}

.hub-live-status-text {
  margin: 0;
  min-width: 0;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hub-live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, clamp(16rem, 28vw, 32rem)), 1fr));
  gap: 0.85rem;
  flex: 1 1 auto;
  align-content: start;
}

.hub-live-layout-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem 0.85rem;
  flex-wrap: wrap;
  margin: 0;
  padding: 0.4rem 0.55rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg1);
  position: relative;
  z-index: 5;
}

.hub-live-layout-start {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1 1 auto;
}

.hub-live-layout-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex: 1 1 12rem;
  min-width: 0;
}

.hub-live-layout-end {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.hub-live-layout-end[hidden] {
  display: none !important;
}

.hub-live-wall-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.hub-live-wall-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.hub-live-wall-actions .btn > i,
.hub-live-wall-actions .btn > .fa-solid {
  margin-right: 0;
  width: 0.95em;
  text-align: center;
}

.hub-live-wall-actions[hidden] {
  display: none !important;
}

.hub-live-layout-label {
  margin-right: 0.25rem;
}

.hub-live-layout-btn--active,
.hub-live-layout-more-btn--active {
  background: rgba(92, 159, 212, 0.18);
  color: var(--accent, #5c9fd4);
}

.hub-live-layout-sep {
  width: 1px;
  height: 1.25rem;
  background: var(--border);
  margin: 0 0.35rem;
}

.hub-live-layout-more {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.hub-live-layout-more-menu {
  position: absolute;
  top: calc(100% + 0.3rem);
  left: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
  min-width: 8.5rem;
  padding: 0.3rem;
  border-radius: 8px;
  border: 1px solid var(--border, #2a2f3a);
  background: var(--card, #1a1f2b);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.hub-live-layout-more-menu[hidden] {
  display: none !important;
}

.hub-live-layout-more-menu .hub-live-layout-btn {
  justify-content: flex-start;
  text-align: left;
}

.hub-live-fleet-go-live--active {
  background: rgba(198, 40, 40, 0.22);
  color: #f07178;
  box-shadow: inset 0 0 0 1px rgba(198, 40, 40, 0.35);
}

.hub-live-fleet-couple {
  min-width: 2.1rem;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
}

.hub-live-fleet-couple--on {
  color: var(--accent, #5c9fd4);
}

.hub-live-fleet-couple--off {
  color: var(--muted, #888);
}

.hub-live-fleet-buffer {
  min-width: 2.1rem;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
}

.hub-live-fleet-buffer--on {
  color: var(--accent, #5c9fd4);
}

.hub-live-fleet-buffer--off {
  color: var(--muted, #888);
}

.hub-live-card--dragging {
  opacity: 0.55;
}

.hub-live-card--drag-over {
  outline: 2px dashed var(--accent, #5c9fd4);
  outline-offset: 2px;
}

.hub-live-drag-handle {
  border: none;
  background: transparent;
  color: var(--muted, #888);
  cursor: grab;
  padding: 0.15rem 0.35rem;
  margin-right: 0.35rem;
  line-height: 1;
}

.hub-live-drag-handle:active {
  cursor: grabbing;
}

.hub-live-card-head {
  cursor: default;
}

.hub-live-card-head--draggable {
  cursor: default;
}

.hub-live-card-head--draggable:active {
  cursor: default;
}

.hub-live-grid--layout-focus .hub-live-card--hero {
  grid-column: 1 / -1;
}

.hub-live-grid--layout-focus .hub-live-card--hero .hub-live-stage {
  min-height: min(58vh, 34rem);
}

.hub-live-grid--layout-single .hub-live-card:not(.hub-live-card--hero) {
  display: none;
}

.hub-live-grid--layout-single {
  grid-template-columns: 1fr;
  max-width: min(96rem, 100%);
  margin: 0 auto;
}

.hub-live-empty-grid,
.hub-live-empty-setup {
  text-align: center;
  padding: 2.5rem 1.5rem;
}

.hub-live-empty-icon {
  font-size: 2.25rem;
  color: var(--muted);
  opacity: 0.65;
  margin-bottom: 0.85rem;
}

.hub-live-empty-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.hub-live-card {
  display: flex;
  flex-direction: column;
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.hub-live-card--rec,
.hub-live-card:has(.hub-live-badge--rec) {
  border-color: rgba(240, 98, 146, 0.35);
  box-shadow: 0 0 0 1px rgba(240, 98, 146, 0.12), var(--shadow);
}

.hub-live-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.7rem 0.9rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
}

.hub-live-card-title-block {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.hub-live-card-title-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.hub-live-open-ui {
  flex: 0 0 auto;
  min-height: 2rem;
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
}

.hub-live-card-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.hub-live-card-stream-meta {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
  opacity: 0.72;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hub-live-grid--layout-wall .hub-live-card-stream-meta {
  font-size: 0.62rem;
  opacity: 0.65;
}

a.hub-live-card-title {
  flex: 1;
  min-width: 0;
}

.hub-edge-ui-link {
  color: inherit;
  text-decoration: none;
}

.hub-edge-ui-link:hover {
  color: var(--accent, #7eb8ff);
  text-decoration: underline;
}

.hub-live-picker-name-row {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.hub-live-picker-edge-link {
  flex-shrink: 0;
  font-size: 0.75rem;
  opacity: 0.75;
}

.hub-live-picker-edge-link:hover {
  opacity: 1;
}

.hub-library-edge-ui-link {
  margin-left: 0.35rem;
  font-size: 0.75rem;
  vertical-align: middle;
}

.hub-edge-node-title-link {
  font-size: inherit;
  font-weight: inherit;
}

.hub-live-card-title::before {
  content: "\f03d";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.75rem;
  color: var(--muted);
}

.hub-live-badge {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.hub-live-badge--ok {
  background: rgba(62, 207, 142, 0.18);
  color: var(--success);
  border: 1px solid rgba(62, 207, 142, 0.35);
}

.hub-live-badge--rec {
  background: rgba(240, 98, 146, 0.2);
  color: var(--recording);
  border: 1px solid rgba(240, 98, 146, 0.4);
}

.hub-live-badge--warn {
  background: rgba(230, 179, 90, 0.18);
  color: var(--warn);
  border: 1px solid rgba(230, 179, 90, 0.35);
}

.hub-live-badge--off {
  background: rgba(120, 144, 156, 0.2);
  color: var(--idle);
  border: 1px solid rgba(120, 144, 156, 0.35);
}

.hub-live-badge--buffering {
  background: rgba(100, 181, 246, 0.16);
  color: #64b5f6;
  border: 1px solid rgba(100, 181, 246, 0.35);
}

.hub-live-badge--reconnecting {
  background: rgba(230, 179, 90, 0.14);
  color: var(--warn);
  border: 1px solid rgba(230, 179, 90, 0.32);
}

.sentri-health-tier-host {
  cursor: help;
}

.sentri-health-tier-popover {
  position: fixed;
  z-index: 12000;
  max-width: min(26rem, calc(100vw - 1.5rem));
  max-height: min(70vh, 28rem);
  overflow: auto;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 22, 28, 0.96);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  color: var(--text, #e8eef4);
  font-size: 0.78rem;
  line-height: 1.4;
  pointer-events: auto;
}

.sentri-health-tier-popover-title {
  margin: 0 0 0.55rem;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.sentri-health-tier-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.sentri-health-tier-item {
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.03);
}

.sentri-health-tier-item--active {
  border-color: rgba(100, 181, 246, 0.45);
  background: rgba(100, 181, 246, 0.08);
}

.sentri-health-tier-mini {
  margin-bottom: 0.3rem;
}

.sentri-health-tier-copy {
  color: var(--muted, #9aabba);
  font-size: 0.72rem;
}

.hub-live-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  /* Floor so absolute video never collapses to a skinny strip (proxy / phone / freeform). */
  min-height: clamp(10rem, 28vw, 16rem);
  background: #0a0b0f;
}

@media (max-width: 720px) {
  .hub-live-stage {
    min-height: clamp(11rem, 52vw, 18rem);
  }

  .hub-live-grid {
    grid-template-columns: 1fr;
  }
}

.hub-live-stage--chrome-host .live-chrome {
  z-index: 6;
  padding-bottom: 0.5rem;
}

.hub-live-stage--chrome-host .live-chrome-hold-shot {
  z-index: 2;
  top: 0;
  left: 0;
  right: 0;
  bottom: 2.75rem;
  height: auto;
}

.hub-live-stage--chrome-host .live-chrome-live {
  position: absolute;
  right: 0.5rem;
  bottom: 2.85rem;
  z-index: 8;
  flex-shrink: 0;
  white-space: nowrap;
}

.hub-live-stage--chrome-host .live-chrome-scrub-wrap {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 0.35rem 0;
  touch-action: none;
}

.hub-live-stage--chrome-host .live-chrome-scrub {
  width: 100%;
  height: 0.5rem;
  cursor: ew-resize;
  touch-action: none;
}

.hub-live-stage--chrome-host .live-chrome-time {
  flex: 0 0 8.25rem;
  width: 8.25rem;
  min-width: 8.25rem;
  max-width: 8.25rem;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .hub-live-stage--chrome-host .live-chrome-time {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    max-width: none;
  }
}

.hub-live-stage--chrome-host .hub-live-overlay {
  bottom: 2.75rem;
  z-index: 1;
  pointer-events: none;
}

.hub-live-stage--chrome-host .hub-live-overlay--panel {
  z-index: 9;
  pointer-events: auto;
}

.hub-live-stage--chrome-host:fullscreen {
  aspect-ratio: auto;
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
}

.hub-live-video,
.hub-live-standby {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 0;
}

.hub-live-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  text-align: center;
  font-size: 0.85rem;
  line-height: 1.45;
  background: rgba(5, 6, 8, 0.72);
  backdrop-filter: blur(4px);
  z-index: 2;
}

/* display:flex above can override UA [hidden] — only show overlay when needed */
.hub-live-overlay[hidden] {
  display: none !important;
}

.hub-live-overlay--panel {
  align-items: stretch;
  justify-content: flex-start;
  text-align: left;
  overflow: auto;
}

.hub-live-offline {
  width: min(100%, 28rem);
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.hub-live-offline-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
}

.hub-live-offline p {
  margin: 0;
}

.hub-live-offline-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.2rem 0.75rem;
  margin: 0;
}

.hub-live-offline-facts dt {
  color: var(--muted, #9aa);
}

.hub-live-offline-facts dd {
  margin: 0;
}

.hub-live-overlay--soft {
  inset: auto;
  top: 0.45rem;
  left: 0.45rem;
  right: auto;
  bottom: auto;
  padding: 0.25rem 0.5rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: none;
  pointer-events: none;
}

.hub-live-health {
  border-top: 1px solid var(--border);
  background: var(--bg2);
  cursor: help;
}

.hub-live-health--updating {
  cursor: pointer;
}

.hub-live-health-head {
  display: none;
}

.hub-live-health-inner {
  padding: 0.38rem 0.5rem 0.42rem;
}

.hub-live-health-strip {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.hub-live-hchip {
  flex: 1 1 0;
  min-width: 2.15rem;
  max-width: 2.85rem;
  height: 2.25rem;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.28);
  color: var(--muted);
  cursor: default;
  pointer-events: auto;
}

.hub-live-hchip i {
  font-size: 0.95rem;
}

.hub-live-hchip--ok {
  color: var(--sentri-success, #3dd68c);
  border-color: color-mix(in srgb, var(--sentri-success, #3dd68c) 35%, transparent);
  background: color-mix(in srgb, var(--sentri-success, #3dd68c) 12%, rgba(0, 0, 0, 0.28));
}

.hub-live-hchip--warn {
  color: var(--sentri-warn, var(--warn, #e6b84d));
  border-color: color-mix(in srgb, var(--sentri-warn, #e6b84d) 40%, transparent);
  background: color-mix(in srgb, var(--sentri-warn, #e6b84d) 14%, rgba(0, 0, 0, 0.28));
}

.hub-live-hchip--bad {
  color: var(--sentri-danger, #f07178);
  border-color: color-mix(in srgb, var(--sentri-danger, #f07178) 40%, transparent);
  background: color-mix(in srgb, var(--sentri-danger, #f07178) 14%, rgba(0, 0, 0, 0.28));
}

.hub-live-hchip--muted {
  color: var(--muted);
}

.hub-live-hchip--skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  background-size: 200% 100%;
  animation: hub-skel 1.2s ease-in-out infinite;
}

.hub-live-stat {
  display: none;
}

.hub-live-grid--freeform {
  align-items: stretch;
}

.hub-live-grid--freeform .hub-live-card {
  display: grid;
  grid-template-rows: auto auto auto;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  height: auto;
  align-self: start;
  overflow: hidden;
  position: relative;
}

.hub-live-grid--freeform .hub-live-card-head {
  grid-row: 1;
  min-width: 0;
}

.hub-live-grid--freeform .hub-live-stage {
  grid-row: 2;
  min-width: 0;
  /* Same 16:9 stage as grid mode — freeform rowSpan used to stretch tiles into wide rectangles. */
  min-height: clamp(10rem, 28vw, 16rem);
  height: auto;
  aspect-ratio: 16 / 9;
}

.hub-live-grid--freeform .hub-live-health {
  grid-row: 3;
  min-width: 0;
  z-index: 2;
}

.hub-live-resize-handle {
  position: absolute;
  right: 0.2rem;
  bottom: 0.2rem;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border: 0;
  border-radius: 4px;
  cursor: nwse-resize;
  touch-action: none;
  background: color-mix(in srgb, var(--accent, #3b82f6) 55%, transparent);
  z-index: 6;
}

.hub-live-resize-handle::after {
  content: "";
  display: block;
  width: 0.55rem;
  height: 0.55rem;
  margin: 0.25rem 0 0 0.25rem;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
}

.hub-live-badge .fa-solid {
  margin-right: 0.15rem;
  font-size: 0.75em;
}

.hub-live-buffer-note {
  margin: 0.35rem 0 0;
  text-align: center;
}

/* —— Wall layout (viewport mosaic + glass overlays) —— */
body.hub-body--live-wall .hub-top,
body.hub-body--live-wall .hub-footer,
body.hub-body--live-wall .hub-flash-wrap,
body.hub-body--live-wall .hub-banner,
body.hub-body--live-wall .hub-notice,
body.hub-body--live-wall .sentri-banner-stack,
body.hub-body--live-wall .sentri-update-banner,
body.hub-body--live-wall .skip-link {
  display: none !important;
}

body.hub-body--live-wall .hub-container {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
  min-height: 100dvh;
}

body.hub-body--live-wall .hub-live-hero {
  display: none;
}

body.hub-body--live-wall .hub-live-page {
  min-height: 100dvh;
  height: 100dvh;
  background: #050608;
}

body.hub-body--live-wall .hub-live-page:fullscreen,
body.hub-body--live-wall .hub-live-page:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: #050608;
}

.hub-live-page--wall .hub-live-workspace {
  grid-template-columns: 1fr;
  gap: 0;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  position: relative;
}

.hub-live-page--wall .hub-live-sidebar {
  display: none;
  position: fixed;
  top: calc(4.1rem + env(safe-area-inset-top, 0px));
  left: max(0.65rem, env(safe-area-inset-left, 0px));
  z-index: 40;
  width: min(20rem, calc(100vw - 1.3rem));
  max-height: min(70dvh, calc(100dvh - 5.25rem));
  margin: 0;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.hub-live-page--wall.hub-live-page--wall-picker-open .hub-live-sidebar {
  display: flex;
}

.hub-live-page--wall .hub-live-main {
  height: 100%;
  gap: 0;
  padding:
    calc(var(--hub-wall-chrome-pad, 3.65rem) + env(safe-area-inset-top, 0px))
    env(safe-area-inset-right, 0px)
    env(safe-area-inset-bottom, 0px)
    env(safe-area-inset-left, 0px);
}

.hub-live-page--wall .hub-live-top-chrome {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  margin: 0.85rem 0 0;
  width: min(56rem, calc(100% - 2.5rem));
  max-width: calc(100% - 2.5rem);
}

.hub-live-page--wall .hub-live-layout-bar {
  margin: 0;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 10, 14, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 0.5rem 0.85rem;
}

.hub-live-page--wall .hub-live-layout-start {
  flex: 0 1 auto;
}

.hub-live-page--wall .hub-live-layout-meta {
  flex: 1 1 auto;
  justify-content: flex-end;
  min-width: 0;
}

.hub-live-page--wall .hub-live-layout-more-menu {
  background: rgba(8, 10, 14, 0.92);
  border-color: rgba(255, 255, 255, 0.12);
}

.hub-live-page--wall .hub-live-layout-label {
  display: none;
}

.hub-live-page--wall .hub-live-status-bar {
  position: static;
  margin: 0;
  padding: 0.15rem 0.35rem;
  border: none;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  max-width: min(22rem, 42vw);
}

.hub-live-page--wall .hub-live-status-text {
  font-size: 0.68rem;
}

.hub-live-page--wall .hub-live-empty-grid {
  margin: auto;
  max-width: 22rem;
}

.hub-live-grid--layout-wall {
  --wall-cols: 2;
  display: grid;
  grid-template-columns: repeat(var(--wall-cols), minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 2px;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  align-content: stretch;
  background: #000;
}

.hub-live-grid--layout-wall .hub-live-card {
  /* Stage fills; health is a dedicated bottom bar so it never covers video controls. */
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  height: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #000;
  overflow: hidden;
}

.hub-live-grid--layout-wall .hub-live-card--rec,
.hub-live-grid--layout-wall .hub-live-card:has(.hub-live-badge--rec) {
  box-shadow: inset 0 0 0 2px rgba(240, 98, 146, 0.55);
}

.hub-live-grid--layout-wall .hub-live-card-head,
.hub-live-grid--layout-wall .hub-live-stage {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.hub-live-grid--layout-wall .hub-live-health {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  z-index: 2;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 8, 12, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: none;
}

.hub-live-grid--layout-wall .hub-live-stage {
  position: relative;
  aspect-ratio: auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  z-index: 0;
}

.hub-live-grid--layout-wall .hub-live-card-head,
.hub-live-grid--layout-wall .hub-live-health {
  width: 100%;
}

.hub-live-grid--layout-wall .hub-live-card-head {
  z-index: 4;
  align-self: start;
  justify-self: stretch;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-bottom: 0;
  background: linear-gradient(
    180deg,
    rgba(6, 8, 12, 0.72) 0%,
    rgba(6, 8, 12, 0.35) 70%,
    transparent 100%
  );
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
}

.hub-live-grid--layout-wall .hub-live-card-head a,
.hub-live-grid--layout-wall .hub-live-card-badge,
.hub-live-grid--layout-wall .hub-live-detection-slot,
.hub-live-grid--layout-wall .hub-edge-controls-slot,
.hub-live-grid--layout-wall .hub-edge-controls {
  pointer-events: auto;
}

.hub-live-grid--layout-wall .hub-live-drag-handle {
  display: none;
}

.hub-live-grid--layout-wall .hub-live-card-title-block {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}

.hub-live-grid--layout-wall .hub-live-card-title {
  font-size: 0.88rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

.hub-live-grid--layout-wall .hub-live-health {
  pointer-events: none;
}

.hub-live-grid--layout-wall .hub-live-health--updating {
  pointer-events: auto;
}

.hub-live-grid--layout-wall .hub-live-hchip {
  pointer-events: auto;
}

.hub-live-grid--layout-wall .hub-live-health-head {
  display: none;
}

.hub-live-grid--layout-wall .hub-live-health-inner {
  padding: 0.4rem 0.55rem 0.45rem;
}

.hub-live-grid--layout-wall .hub-live-health-strip {
  gap: 0.35rem 0.4rem;
}

.hub-live-grid--layout-wall .hub-live-stat {
  padding: 0.28rem 0.35rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.hub-live-grid--layout-wall .hub-live-stat-k {
  font-size: 0.55rem;
}

.hub-live-grid--layout-wall .hub-live-stat-v {
  font-size: 0.74rem;
}

/* Wall: compact toggles inline left of the REC/status badge (hover-reveal). */
.hub-live-grid--layout-wall .hub-edge-controls-slot,
.hub-live-grid--layout-wall .hub-edge-controls,
.hub-live-grid--layout-wall .hub-edge-controls-slot--inline {
  position: static;
  z-index: 5;
  flex: 0 0 auto;
  order: 2;
  width: auto;
  max-width: none;
  margin: 0;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.hub-live-grid--layout-wall .hub-live-card-badge {
  order: 4;
  margin-left: 0;
  flex-shrink: 0;
}

.hub-live-grid--layout-wall .hub-live-detection-slot {
  order: 3;
  margin-left: 0;
}

.hub-live-grid--layout-wall .hub-live-card:hover .hub-edge-controls-slot,
.hub-live-grid--layout-wall .hub-live-card:hover .hub-edge-controls,
.hub-live-grid--layout-wall .hub-live-card:focus-within .hub-edge-controls-slot,
.hub-live-grid--layout-wall .hub-live-card:focus-within .hub-edge-controls {
  opacity: 1;
  pointer-events: auto;
}

.hub-live-page--wall .hub-live-layout-end {
  margin-left: 0.25rem;
}

.hub-live-grid--layout-wall .hub-live-stage--chrome-host .hub-live-overlay {
  bottom: 2.75rem;
}

.hub-live-grid--layout-wall .hub-live-stage--chrome-host .live-chrome {
  opacity: 0;
  transition: opacity 0.18s ease;
  z-index: 6;
}

.hub-live-grid--layout-wall .hub-live-card:hover .live-chrome,
.hub-live-grid--layout-wall .hub-live-card:focus-within .live-chrome {
  opacity: 1;
}

/* Skeleton loading */
@keyframes hub-live-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.hub-live-skeleton-shimmer,
.hub-live-skeleton-line,
.hub-live-skeleton-pill {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.12) 45%,
    rgba(255, 255, 255, 0.04) 90%
  );
  background-size: 200% 100%;
  animation: hub-live-shimmer 1.35s ease-in-out infinite;
  border-radius: 6px;
}

.hub-live-card--skeleton {
  pointer-events: none;
}

.hub-live-card--skeleton .hub-live-card-title {
  color: var(--text);
}

.hub-live-skeleton-pill {
  display: inline-block;
  width: 4.5rem;
  height: 1.25rem;
  border-radius: 999px;
}

.hub-live-stage--skeleton {
  display: flex;
  align-items: stretch;
  overflow: hidden;
}

.hub-live-stage--skeleton .hub-live-skeleton-shimmer {
  flex: 1;
  border-radius: 0;
}

.hub-live-stat--skeleton {
  gap: 0.35rem;
  background: transparent;
  border-color: transparent;
}

.hub-live-skeleton-line--k {
  display: block;
  height: 0.55rem;
  width: 55%;
}

.hub-live-skeleton-line--v {
  display: block;
  height: 0.75rem;
  width: 72%;
}

.hub-live-picker-dot--loading {
  background: var(--muted);
  opacity: 0.5;
  animation: hub-pulse 1s ease-in-out infinite;
}

.hub-live-picker-loading {
  color: var(--muted);
  font-style: italic;
}

.hub-live-page--loading .hub-live-status-dot {
  background: var(--muted);
}

.hub-live-page--ready .hub-live-status-dot {
  background: var(--success);
}

@media (prefers-reduced-motion: reduce) {
  .hub-live-skeleton-shimmer,
  .hub-live-skeleton-line,
  .hub-live-skeleton-pill,
  .hub-live-picker-dot--loading {
    animation: none;
    background: rgba(255, 255, 255, 0.08);
  }
}

@media (max-width: 960px) {
  .hub-live-page {
    min-height: 0;
  }

  .hub-live-workspace {
    grid-template-columns: 1fr;
  }

  .hub-live-sidebar {
    position: static;
    max-height: none;
  }

  .hub-live-sidebar-head {
    cursor: pointer;
  }

  .hub-live-sidebar:not([open]) .hub-live-sidebar-head {
    border-bottom: 0;
  }

  .hub-live-picker-list {
    max-height: 12rem;
  }

  .hub-live-lead {
    display: none;
  }

  .hub-live-layout-btn,
  .hub-live-wall-actions .btn {
    min-height: 2.25rem;
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }
}

@media (max-width: 720px) {
  .hub-live-card-head {
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.55rem;
  }

  .hub-live-card-title-block {
    flex: 1 1 auto;
    min-width: 0;
  }

  .hub-live-card-title {
    font-size: 0.88rem;
  }

  .hub-live-phone-edges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    width: 100%;
  }

  .hub-live-phone-edge {
    min-height: 1.7rem;
    padding: 0.05rem 0.45rem;
    font-size: 0.72rem;
  }

  .hub-live-card-badge,
  .hub-live-tile-badges {
    display: inline-flex;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 0.2rem;
    margin-top: 0;
    justify-content: flex-end;
  }

  .hub-live-health-strip {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--accent, #5b9cf5) 45%, transparent) transparent;
    -webkit-overflow-scrolling: touch;
  }

  .hub-live-hchip {
    flex: 0 0 auto;
    width: 2.15rem;
    min-width: 2.15rem;
    max-width: 2.15rem;
    height: 2.15rem;
  }

  .hub-live-grid:not(.hub-live-grid--layout-wall) {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }

  .hub-live-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .hub-live-control {
    flex: 1 1 100%;
  }

  .hub-live-select {
    width: 100%;
  }

  .hub-live-page--wall .hub-live-top-chrome {
    left: max(0.75rem, env(safe-area-inset-left, 0px));
    right: max(0.75rem, env(safe-area-inset-right, 0px));
    transform: none;
    width: auto;
    max-width: none;
    margin-top: 0.75rem;
  }

  .hub-live-page--wall .hub-live-layout-bar {
    border-radius: 14px;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .hub-live-page--wall .hub-live-layout-start,
  .hub-live-page--wall .hub-live-layout-meta {
    flex: 1 1 100%;
  }

  .hub-live-page--wall .hub-live-layout-meta {
    justify-content: space-between;
  }

  .hub-live-page--wall .hub-live-status-bar {
    max-width: none;
    flex: 1 1 auto;
  }

  .hub-live-page--wall .hub-live-main {
    padding-top: calc(var(--hub-wall-chrome-pad, 5.5rem) + env(safe-area-inset-top, 0px));
  }

  .hub-live-layout-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .hub-live-layout-start,
  .hub-live-layout-meta,
  .hub-live-layout-end {
    flex-wrap: nowrap;
  }

  .hub-live-layout-meta {
    flex: 0 0 auto;
    justify-content: flex-end;
    gap: 0.35rem;
  }

  .hub-live-status-bar {
    flex: 0 1 auto;
    min-width: 0;
  }

  .hub-live-status-text {
    white-space: nowrap;
    max-width: 7.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hub-live-fleet-go-live {
    white-space: nowrap;
  }

  .hub-live-grid--layout-wall .hub-live-health-strip {
    gap: 0.2rem;
  }

  .hub-live-grid--layout-wall .hub-live-health-inner {
    padding: 0.28rem 0.35rem 0.35rem;
  }

  .hub-live-grid--layout-wall .hub-live-card-title {
    font-size: 0.78rem;
  }

  .hub-live-grid--layout-wall .hub-live-card-head {
    padding: 0.35rem 0.45rem;
  }

  .hub-live-grid--layout-wall .hub-live-stat-k {
    font-size: 0.48rem;
  }

  .hub-live-grid--layout-wall .hub-live-stat-v {
    font-size: 0.62rem;
  }
}

@media (max-width: 720px) and (orientation: landscape) {
  .hub-live-page--wall .hub-live-main {
    padding-top: calc(var(--hub-wall-chrome-pad, 3.4rem) + env(safe-area-inset-top, 0px));
  }

  .hub-live-page--wall .hub-live-layout-bar {
    flex-wrap: wrap;
    padding: 0.25rem 0.4rem;
  }

  .hub-live-page--wall .hub-live-layout-start,
  .hub-live-page--wall .hub-live-layout-meta {
    flex: 1 1 100%;
  }

  .hub-live-page--wall .hub-live-status-bar {
    max-width: none;
  }

  .hub-live-page--wall .hub-live-layout-label {
    display: none;
  }

  .hub-live-grid--layout-wall .hub-live-card {
    grid-template-rows: minmax(0, 1fr);
  }

  .hub-live-grid--layout-wall .hub-live-health {
    grid-row: 1;
    align-self: end;
    z-index: 3;
    background: linear-gradient(0deg, rgba(6, 8, 12, 0.88) 0%, rgba(6, 8, 12, 0.45) 100%);
    border-top: 0;
  }

  .hub-live-grid--layout-wall .hub-live-card-stream-meta {
    display: none;
  }
}

.hub-scan-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.hub-scan-form .hub-field--grow {
  flex: 1 1 12rem;
  min-width: 10rem;
}

.hub-scan-hint {
  margin-top: 0.5rem;
}

/* —— System health (mirrors edge telemetry layout) —— */
.hub-health-page .page-head h1 {
  font-size: 1.65rem;
}

.hub-health-summary-inline {
  display: inline;
}

.hub-health-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.75rem 0 1rem;
}

.hub-health-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.hub-health-tab:hover {
  color: #fff;
  border-color: rgba(120, 144, 156, 0.55);
}

.hub-health-tab--active {
  color: #8ee4b8;
  border-color: rgba(129, 199, 132, 0.55);
  background: rgba(129, 199, 132, 0.12);
}

.hub-health-panel {
  margin-bottom: 1.5rem;
}

.hub-panel-lead {
  margin: 0 0 1rem;
  max-width: 44rem;
}

.hub-health-grid-dash {
  margin-bottom: 1rem;
}

.hub-readiness-banner {
  margin-bottom: 1rem;
}

.hub-readiness-banner ul {
  margin: 0.5rem 0 0 1.25rem;
  padding: 0;
}

.hub-card-desc {
  margin: -0.35rem 0 0.75rem;
  line-height: 1.4;
}

.hub-stat-hint {
  margin: 0.35rem 0 0;
  line-height: 1.3;
}

.hub-fleet-status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.hub-fleet-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 4.5rem;
  padding: 0.5rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.25);
}

.hub-fleet-pill-n {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
}

.hub-fleet-pill-l {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 0.15rem;
}

.hub-fleet-pill--ok .hub-fleet-pill-n {
  color: #8ee4b8;
}

.hub-fleet-pill--live .hub-fleet-pill-n {
  color: #ffb4a8;
}

.hub-fleet-pill--warn .hub-fleet-pill-n {
  color: #e8c66a;
}

.hub-fleet-pill--off .hub-fleet-pill-n {
  color: rgba(255, 255, 255, 0.45);
}

/* Fleet charts */
.hub-fleet-charts-mount {
  min-height: 4rem;
}

.hub-fleet-toolbar-card {
  margin-bottom: 0.85rem;
  padding: 0.85rem 1rem;
}

.hub-fleet-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
}

.hub-fleet-toolbar-hint {
  margin: 0.55rem 0 0;
}

.hub-fleet-shared-legend,
.hub-ingest-shared-legend {
  flex: 1 1 16rem;
  min-width: 0;
}

.hub-fleet-legend-bar,
.hub-ingest-legend-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
}

.hub-fleet-legend-label {
  margin-right: 0.15rem;
}

.hub-fleet-legend-chips,
.hub-ingest-legend-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.hub-fleet-legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.22);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
}

.hub-fleet-legend-chip:hover {
  border-color: rgba(129, 199, 132, 0.45);
}

.hub-fleet-legend-chip--off {
  opacity: 0.42;
  text-decoration: line-through;
}

.hub-fleet-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
  gap: 0.85rem;
}

.hub-fleet-chart-card {
  min-width: 0;
  padding: 0.85rem 1rem 0.75rem;
}

.hub-fleet-chart-card--skel {
  min-height: 14rem;
}

.hub-fleet-chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.45rem;
}

.hub-fleet-chart-title,
.hub-fleet-chart-head h2 {
  margin: 0 0 0.15rem;
  font-size: 0.98rem;
}

.hub-fleet-chart-desc {
  margin: 0;
  max-width: 28rem;
}

.hub-fleet-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.65rem;
  justify-content: flex-end;
  max-width: 100%;
}

.hub-fleet-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.85);
}

.hub-fleet-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.hub-fleet-chart-shell {
  position: relative;
}

.hub-fleet-chart-shell .telemetry-canvas {
  width: 100%;
  max-width: none;
}

.hub-chart-skeleton {
  min-height: 8.5rem;
  display: none;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.55rem;
  padding: 1rem 0.25rem 0.5rem;
}

.hub-chart-skeleton.is-active {
  display: flex;
}

.hub-fleet-chart-shell .telemetry-canvas[hidden],
.hub-fleet-chart-tip[hidden],
.telemetry-live-pill[hidden] {
  display: none !important;
}

.hub-ingest-kpi-n[data-loading="1"],
.hub-ingest-state-pill[data-state="loading"] {
  min-width: 2.4rem;
  border-radius: 6px;
  background: linear-gradient(90deg, #334155 0%, #475569 50%, #334155 100%);
  background-size: 200% 100%;
  animation: hub-skel 1.2s ease-in-out infinite;
  color: transparent;
}

.hub-ingest-state-pill[data-state="loading"] {
  min-width: 6.5rem;
  min-height: 1.6rem;
}

.hub-health-problems-pills {
  flex-shrink: 0;
}

.hub-fleet-chart-tip {
  max-width: 20rem;
  white-space: normal;
  line-height: 1.35;
}

.hub-fleet-chart-hint {
  margin: 0.4rem 0 0;
  font-size: 0.72rem;
}

.hub-fleet-trend {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.hub-fleet-trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hub-fleet-trend-arrow {
  font-size: 0.95rem;
  line-height: 1;
}

.hub-fleet-trend--up .hub-fleet-trend-badge {
  color: #e6b35a;
  border-color: rgba(230, 179, 90, 0.4);
  background: rgba(230, 179, 90, 0.12);
}

.hub-fleet-trend--down .hub-fleet-trend-badge {
  color: #3ecf8e;
  border-color: rgba(62, 207, 142, 0.4);
  background: rgba(62, 207, 142, 0.12);
}

.hub-fleet-trend--flat .hub-fleet-trend-badge {
  color: rgba(210, 216, 228, 0.9);
}

.hub-fleet-trend--empty {
  color: rgba(255, 255, 255, 0.45);
}

.hub-fleet-trend-vals strong {
  font-weight: 700;
}

.hub-fleet-chart-trend {
  text-align: right;
}

/* Transfer-rate legend toggles (Monitoring/Ingest shared chips) */
.hub-ingest-page .transfer-rate-legend-item,
.hub-health-page .transfer-rate-legend-item {
  font-family: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0.15rem 0.35rem;
  cursor: pointer;
}

.hub-ingest-page .transfer-rate-legend-item--off,
.hub-health-page .transfer-rate-legend-item--off {
  opacity: 0.42;
  text-decoration: line-through;
}

.telemetry-chart-range-btn--active {
  color: var(--accent, #8ee4b8);
  border-color: rgba(129, 199, 132, 0.55);
  background: rgba(129, 199, 132, 0.12);
}

/* Edge node KPI strip */
.hub-edge-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.hub-edge-kpi {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.22);
  min-height: 4.25rem;
}

.hub-edge-kpi-val {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
  color: #e8eaed;
}

.hub-edge-kpi-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.25rem;
}

.hub-edge-kpi-sub {
  margin-top: 0.15rem;
  font-size: 0.72rem;
}

.hub-edge-kpi--live .hub-edge-kpi-val {
  color: #ffb4a8;
}

.hub-edge-kpi--warn .hub-edge-kpi-val {
  color: #e8c66a;
}

.hub-edge-kpi--ok .hub-edge-kpi-val {
  color: #8ee4b8;
}

.hub-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.hub-detail-table th {
  text-align: left;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  padding: 0.35rem 0.75rem 0.35rem 0;
  vertical-align: top;
  width: 38%;
}

.hub-detail-table td {
  padding: 0.35rem 0;
  word-break: break-word;
}

.hub-storage-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  margin-top: 0.65rem;
  overflow: hidden;
}

.hub-storage-bar--lg {
  height: 8px;
  margin-top: 0.75rem;
}

.hub-storage-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3d7dd6, #5c8fd6);
  max-width: 100%;
}

.hub-hub-stat-card h2 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}

.hub-edge-health-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hub-edge-node {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.hub-edge-node--offline {
  opacity: 0.92;
  border-color: rgba(107, 114, 128, 0.35);
}

.hub-edge-node--revoked {
  opacity: 0.75;
}

.hub-edge-node-details > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.03);
}

.hub-edge-node-details > summary::-webkit-details-marker {
  display: none;
}

.hub-edge-node-summary-main h3 {
  margin: 0;
  font-size: 1.05rem;
}

.hub-edge-node-summary-main .hub-device-id {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
}

.hub-edge-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.hub-edge-chip {
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(61, 125, 214, 0.2);
  color: rgba(255, 255, 255, 0.85);
}

.hub-edge-node-body {
  padding: 0 1rem 1rem;
}

.hub-edge-node-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.hub-edge-section-label {
  margin: 1rem 0 0.5rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.5);
}

.hub-health-drill {
  margin-top: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.15);
}

.hub-health-drill > summary {
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.hub-health-drill > summary::-webkit-details-marker {
  display: none;
}

.hub-health-drill-title {
  font-weight: 600;
  font-size: 0.92rem;
}

.hub-health-drill-desc {
  line-height: 1.35;
}

.hub-health-drill-body {
  padding: 0 0.75rem 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.hub-log-pre--tall {
  max-height: 16rem;
}

.hub-json-pre {
  max-height: 12rem;
  font-size: 0.72rem;
}

.hub-dl-grid--compact {
  font-size: 0.88rem;
}

.hub-fleet-big {
  font-size: 2rem;
  font-weight: 700;
  margin: 0.25rem 0;
  line-height: 1.1;
}

.hub-fleet-big--live {
  color: #ffb4a8;
}

.hub-fleet-big--warn {
  color: #e8c66a;
}

.hub-fleet-big--off {
  color: rgba(255, 255, 255, 0.45);
}

.hub-fleet-table td,
.hub-fleet-table th {
  vertical-align: top;
}

.hub-fleet-row--off {
  opacity: 0.85;
}

.hub-health-grid-dash .span-3 {
  grid-column: span 3;
}

@media (max-width: 900px) {
  .hub-health-grid-dash .span-3,
  .hub-health-grid-dash .span-4 {
    grid-column: span 12;
  }
}

.hub-empty-card {
  text-align: center;
  padding: 2rem 1.5rem;
}

/* —— Devices —— */
.hub-devices-page {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hub-devices-hero {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}

.hub-devices-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.hub-devices-hero-text h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hub-devices-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.hub-devices-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 5.5rem;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg1);
  box-shadow: var(--shadow);
}

.hub-devices-stat-n {
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.hub-devices-stat-n--ok {
  color: var(--success);
}

.hub-devices-stat-n--live {
  color: var(--recording);
}

.hub-devices-stat-l {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-top: 0.2rem;
}

.hub-devices-hero-actions {
  margin-top: 0.85rem;
}

.hub-card-stack,
.hub-devices-workspace {
  display: flex;
  flex-direction: column;
  gap: var(--hub-card-gap);
  align-items: stretch;
}

.hub-card-stack > .card,
.hub-card-stack > section.card {
  margin: 0;
}

.hub-devices-panel {
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hub-devices-panel-title {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hub-devices-panel-title i {
  color: var(--accent);
  font-size: 0.95rem;
}

.hub-devices-connect {
  position: relative;
}

.hub-devices-connect-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.hub-devices-connect-head .hub-devices-panel-title {
  margin: 0;
}

.hub-devices-scan {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: flex-end;
}

.hub-devices-scan-btn {
  white-space: nowrap;
}

.hub-devices-hint {
  margin: 0.75rem 0 0;
  line-height: 1.45;
}

.hub-devices-hint code {
  font-size: 0.78rem;
}

.hub-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
}

.hub-field[hidden] {
  display: none;
}

.hub-field--grow {
  flex: 1 1 12rem;
  min-width: 10rem;
}

.hub-field-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.hub-input,
.hub-field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="range"]):not([type="file"]),
select.hub-input,
textarea.hub-input {
  width: 100%;
  max-width: 100%;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.4;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

/* Compact toolbar selects (Events / Activity / Library) — avoid width:100% smash */
.hub-library-toolbar select.hub-input,
.hub-events-toolbar select.hub-input,
.hub-activity-toolbar select.hub-input,
select.hub-toolbar-select {
  width: auto;
  min-width: 9.5rem;
  max-width: 16rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239aabba' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  padding-right: 1.75rem;
}

.hub-library-coverage-card {
  margin-bottom: 1rem;
}

.hub-fleet-chart-stats {
  margin: 0.15rem 0 0.45rem;
  font-variant-numeric: tabular-nums;
}

.hub-fleet-chart-stats--up {
  color: var(--warn, #e6b35a);
}

.hub-fleet-chart-stats--down {
  color: var(--success, #3ecf8e);
}

body.hub-library-day-modal-open {
  overflow: hidden;
}

/* Native <dialog> UA styles set color to CanvasText (black) — override for dark hub theme. */
#hub-library-day-modal {
  color: var(--text, #e8eaef);
}

#hub-library-day-modal:not([hidden]) {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 11000;
  align-items: center;
  justify-content: center;
  padding: 3vh 4vw;
  margin: 0;
  border: 0;
  max-width: none;
  max-height: none;
  width: 100%;
  background: rgba(0, 0, 0, 0.55);
  color: var(--text, #e8eaef);
}

#hub-library-day-modal .library-day-modal-panel {
  width: min(1400px, calc(100vw - 4rem));
  max-height: calc(100vh - 6rem);
  margin: 0;
  padding: 1rem 1.15rem 1.1rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  color: var(--text, #e8eaef);
  background: var(--bg2, #141820);
}

#hub-library-day-modal .library-day-modal-head {
  flex: 0 0 auto;
  margin-bottom: 0.65rem;
}

#hub-library-day-modal .library-day-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden auto;
}

#hub-library-day-modal .hub-library-ingest-chip {
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
  top: auto;
  margin: 0;
}

#hub-library-day-modal #hub-library-playback-dock:not([hidden]) {
  flex: 0 1 auto;
  min-height: 0;
  max-height: min(36vh, 340px);
  overflow: auto;
  margin-bottom: 0.5rem;
}

#hub-library-day-modal.library-day-modal--playback .library-day-modal-body {
  display: none;
}

#hub-library-day-modal.library-day-modal--playback #hub-library-playback-dock:not([hidden]) {
  flex: 1 1 auto;
  max-height: none;
  min-height: min(70vh, 640px);
  margin-bottom: 0;
}

#hub-library-day-modal #hub-library-intent-panel:not([hidden]) {
  flex: 0 1 auto;
  min-height: 0;
  max-height: min(28vh, 240px);
  overflow: auto;
  margin-bottom: 0;
}

.hub-library-intent-panel--flash {
  outline: 2px solid var(--accent, #6ea8fe);
  outline-offset: 2px;
}

#hub-library-day-modal .hub-library-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow: hidden;
}

#hub-library-day-modal .hub-library-main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow: hidden;
}

/* Timeline sits in the page/modal flow — not trapped in a scroll box. */
#hub-library-day-modal .hub-library-timelines,
.hub-library-timelines--main {
  flex: 0 0 auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

#hub-library-day-modal .hub-library-day-chrome {
  flex: 0 0 auto;
  min-height: 0;
}

#hub-library-day-modal .hub-library-day-filters {
  gap: 0.25rem;
}

#hub-library-day-modal #hub-library-segments-more {
  display: none !important;
}

#hub-library-day-modal .hub-library-day-empty {
  margin: 0.35rem 0 0.15rem;
  padding: 0.65rem 0.75rem;
  border: 1px dashed var(--border, #333);
  border-radius: 8px;
  background: var(--bg1, rgba(255, 255, 255, 0.02));
}

#hub-library-day-modal .hub-library-day-filters {
  gap: 0.25rem;
}

#hub-library-day-modal .hub-library-day-filter-group {
  min-height: 0;
}

#hub-library-day-modal .hub-library-day-summary {
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

#hub-library-day-modal .hub-library-day-main .day-timeline-card {
  margin: 0;
}

#hub-library-day-modal .hub-library-day-main .day-timeline-toolbar--compact {
  padding: 0.28rem 0.5rem;
  margin-bottom: 0.4rem !important;
  gap: 0.35rem 0.5rem;
}

#hub-library-day-modal .hub-library-day-main .day-zoom-hint--range {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#hub-library-day-modal .hub-library-day-main .day-zoom-help {
  flex: 0 0 auto;
  padding: 0.2rem 0.45rem;
}

#hub-library-day-modal .hub-library-day-main .day-track-wrap {
  overflow-x: hidden;
}

#hub-library-day-modal .hub-library-day-main .day-track {
  min-height: 5.75rem;
  overflow-x: hidden;
}
#hub-library-day-modal .hub-library-day-main .day-track.day-track--lanes {
  height: auto;
  min-height: calc(var(--day-lane-count, 1) * 2.65rem + 1.75rem);
}

#hub-library-day-modal .hub-library-day-main .day-track-lane--solo .day-clip-block {
  min-height: 2.75rem;
  top: 1.2rem;
  bottom: 1.2rem;
}

/* Day timeline status key (also in theme.css — keep here so hub cache-bust picks it up). */
.hub-library-timeline-shell .day-timeline-legend,
.day-timeline-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.9rem;
  margin: 0.2rem 0 0.5rem;
  padding: 0.35rem 0.15rem;
  font-size: 0.72rem;
  line-height: 1.3;
  color: var(--muted, #8b95a8);
}
.hub-library-timeline-shell .day-timeline-legend-item,
.day-timeline-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}
.day-timeline-swatch {
  width: 0.9rem;
  height: 0.55rem;
  border-radius: 3px;
  display: inline-block;
  flex: 0 0 auto;
  box-sizing: border-box;
}
.day-timeline-swatch--hub {
  background: hsl(210, 62%, 48%);
}
.day-timeline-swatch--edge {
  background: repeating-linear-gradient(
    -45deg,
    hsla(32, 80%, 45%, 0.95),
    hsla(32, 80%, 45%, 0.95) 3px,
    hsla(32, 80%, 45%, 0.28) 3px,
    hsla(32, 80%, 45%, 0.28) 6px
  );
  border: 1px solid hsl(32, 80%, 52%);
}
.day-timeline-swatch--sync {
  background: hsl(245, 45%, 42%);
  box-shadow: inset 0 0 0 1px rgba(199, 210, 254, 0.85);
}
.day-timeline-swatch--err {
  background: #ef4444;
}
.day-timeline-legend-note {
  font-size: 0.68rem;
  opacity: 0.9;
}
.day-timeline-mark {
  position: relative;
  width: 0.85rem;
  height: 0.85rem;
  display: inline-block;
  flex: 0 0 auto;
}
.day-timeline-mark--motion::before,
.day-timeline-mark--object::before,
.day-timeline-mark--scene::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  border-radius: 1px;
}
.day-timeline-mark--motion::before {
  background: #ffb347;
}
.day-timeline-mark--object::before {
  background: #7ee0a8;
}
.day-timeline-mark--scene::before {
  background: #c084fc;
}
.day-timeline-mark--line::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 25%;
  bottom: 25%;
  border-radius: 2px;
  background: rgba(255, 179, 71, 0.8);
}
.day-timeline-mark--dot::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: #7ee0a8;
}

/* Status fills for library day bars (hue via --bar-hue). */
.hub-library-timeline-shell .day-clip-block--hub-on-hub {
  background: hsl(var(--bar-hue, 210), 62%, 48%) !important;
  border: 1px solid hsla(var(--bar-hue, 210), 62%, 62%, 0.75) !important;
}
.hub-library-timeline-shell .day-clip-block--hub-edge-only {
  background: repeating-linear-gradient(
    -45deg,
    hsla(var(--bar-hue, 32), 70%, 46%, 0.92),
    hsla(var(--bar-hue, 32), 70%, 46%, 0.92) 4px,
    hsla(var(--bar-hue, 32), 70%, 46%, 0.28) 4px,
    hsla(var(--bar-hue, 32), 70%, 46%, 0.28) 8px
  ) !important;
  border: 1.5px solid hsl(var(--bar-hue, 32), 70%, 52%) !important;
}
.hub-library-timeline-shell .day-clip-block--hub-syncing,
.hub-library-timeline-shell .day-clip-block--hub-syncing-live,
.hub-library-timeline-shell .day-clip-block--hub-syncing-backfill {
  background: hsl(var(--bar-hue, 245), 48%, 40%) !important;
  border: 1.5px solid rgba(199, 210, 254, 0.85) !important;
  animation: day-bar-sync-pulse 1.8s ease-in-out infinite;
}
.hub-library-timeline-shell .day-clip-block--hub-sync-error {
  background: #ef4444 !important;
}
.hub-library-timeline-shell .day-clip-block--sync-gradient.day-clip-block--hub-on-hub,
.hub-library-timeline-shell .day-clip-block--sync-gradient.day-clip-block--hub-edge-only,
.hub-library-timeline-shell .day-clip-block--sync-gradient.day-clip-block--hub-syncing,
.hub-library-timeline-shell .day-clip-block--sync-gradient.day-clip-block--hub-syncing-live,
.hub-library-timeline-shell .day-clip-block--sync-gradient.day-clip-block--hub-syncing-backfill,
.hub-library-timeline-shell .day-clip-block--sync-gradient.day-clip-block--hub-sync-error {
  /* Inline 90deg gradient from day-timeline.js (setProperty priority). */
  background-image: none;
  animation: none;
}

#hub-library-day-modal .hub-library-fleet-head--compact {
  margin-bottom: 0.35rem;
}

#hub-library-day-modal .hub-library-fleet-head--compact .hub-library-edge-title {
  margin: 0;
  font-size: 0.95rem;
}

#hub-library-day-modal .hub-library-fleet-head--compact .hub-library-fleet-stats {
  margin: 0.15rem 0 0;
}

.hub-library-toolbar {
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: flex-end;
}

.hub-library-edge-picker-wrap {
  margin-top: 0.35rem;
}

.hub-input:focus,
.hub-field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="range"]):not([type="file"]):focus,
select.hub-input:focus,
textarea.hub-input:focus {
  outline: none;
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px rgba(91, 156, 245, 0.2);
}

.hub-devices-discover {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.hub-devices-discover-title {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.hub-devices-discover-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hub-devices-discover-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(91, 156, 245, 0.25);
  background: rgba(91, 156, 245, 0.08);
}

.hub-devices-discover-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.hub-devices-discover-id {
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88rem;
}

.hub-devices-discover-url {
  word-break: break-all;
}

.hub-devices-manual {
  margin-top: 1.15rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.hub-devices-manual-summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5rem 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text);
}

.hub-devices-manual-summary::-webkit-details-marker {
  display: none;
}

.hub-devices-manual[open] .hub-devices-manual-summary {
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.hub-devices-manual-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.75rem;
  align-items: end;
}

.hub-devices-manual-form .hub-field--grow {
  grid-column: 1 / -1;
}

.hub-devices-manual-submit {
  justify-self: start;
  margin-top: 0.25rem;
}

.hub-devices-fleet-wrap {
  min-width: 0;
}

.hub-devices-fleet-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.hub-devices-fleet-head .hub-devices-panel-title {
  margin: 0;
}

.hub-devices-fleet {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.hub-device-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.9rem 1rem 1rem;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.hub-device-card .hub-edge-kpi-row,
.hub-device-card .hub-health-drill {
  margin-left: 0;
  margin-right: 0;
}

.hub-device-card--rec {
  border-color: rgba(240, 98, 146, 0.35);
  box-shadow: 0 0 0 1px rgba(240, 98, 146, 0.1), var(--shadow);
}

.hub-device-card--offline {
  opacity: 0.88;
}

.hub-device-card--revoked {
  opacity: 0.6;
}

.hub-device-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.75rem 1rem 0;
}

.hub-device-card-identity {
  min-width: 0;
}

.hub-device-card-title-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  max-width: 100%;
}

.hub-device-card-name {
  font-weight: 700;
  font-size: 1rem;
  display: block;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  max-width: 100%;
  flex: 1 1 auto;
}

.hub-device-card-name:hover {
  color: var(--accent);
  text-decoration: none;
}

.hub-device-card-id-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  margin-top: 0.15rem;
}

.hub-device-card-id,
.hub-device-id {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hub-device-card-id-row .hub-device-card-id {
  margin-top: 0;
  flex: 1 1 auto;
}

.hub-device-card-version {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.01em;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.14));
  background: transparent;
}

.hub-device-card-meta {
  margin: 0;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.hub-device-card-row {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 0.5rem;
  align-items: baseline;
}

.hub-device-card-row dt {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.hub-device-card-row dd {
  margin: 0;
  min-width: 0;
  word-break: break-word;
}

.hub-device-card-link {
  font-size: 0.82rem;
  word-break: break-all;
}

.hub-device-card-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

.hub-device-metric {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.55rem;
  border-radius: 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  text-transform: capitalize;
}

.hub-device-metric i {
  color: var(--muted);
  font-size: 0.72rem;
}

.hub-device-card-error {
  margin: 0 1rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  background: rgba(240, 113, 120, 0.1);
  border: 1px solid rgba(240, 113, 120, 0.25);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.4;
  max-height: 6.5rem;
  overflow: auto;
}

.hub-device-card-section {
  margin: 0;
  padding: 0.65rem 1rem 0;
  border-top: 1px solid var(--border);
}

.hub-device-card-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.hub-device-card-section-title {
  margin: 0 0 0.45rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.hub-device-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 0.75rem;
  margin: 0;
}

.hub-device-upload-grid div {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.hub-device-upload-grid dt {
  margin: 0;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--muted);
}

.hub-device-upload-grid dd {
  margin: 0;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.hub-device-tls-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.hub-badge--err {
  background: rgba(240, 113, 120, 0.15);
  color: #f07178;
  border-color: rgba(240, 113, 120, 0.35);
}

.hub-tls-panel-root {
  margin-top: 0.5rem;
}

.hub-tls-panel-grid {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 52rem) {
  .hub-tls-panel-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .hub-tls-panel-actions {
    grid-column: 1 / -1;
  }
}

.hub-tls-panel-block h3 {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
}

.hub-tls-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hub-devices-tls-status {
  min-height: 1.25rem;
  margin: 0.35rem 0 0.75rem;
}

.hub-devices-tls-status:not(:empty) {
  color: var(--hub-accent, #3d7dd6);
}

.hub-tls-restart-modal .hub-browse-dialog {
  width: min(480px, 100%);
}

.hub-tls-restart-body {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  text-align: center;
}

.hub-tls-restart-spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--hub-accent, #3d7dd6);
  border-radius: 50%;
  animation: hub-tls-spin 0.85s linear infinite;
}

.hub-tls-restart-spinner[hidden] {
  display: none !important;
}

.hub-tls-restart-spinner--ok {
  animation: none;
  border: none;
  width: auto;
  height: auto;
  font-size: 2.5rem;
  color: var(--hub-ok, #2d9d6a);
}

.hub-tls-restart-spinner--err {
  animation: none;
  border: none;
  width: auto;
  height: auto;
  font-size: 2.5rem;
  color: #f07178;
}

@keyframes hub-tls-spin {
  to {
    transform: rotate(360deg);
  }
}

.hub-tls-restart-message {
  margin: 0;
  font-size: 0.95rem;
}

.hub-tls-restart-countdown {
  margin: 0;
  font-size: 0.8rem;
}

.hub-archive-migrate-banner {
  margin-bottom: 1rem;
}

.hub-archive-migrate-body {
  gap: 0.75rem;
}

.hub-archive-migrate-progress-wrap {
  width: 100%;
  height: 0.65rem;
  border-radius: 999px;
  background: var(--border, rgba(255, 255, 255, 0.12));
  overflow: hidden;
}

.hub-archive-migrate-progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #64b5f6, #81c784);
  transition: width 0.35s ease;
}

.hub-ingest-tls-panel {
  margin-bottom: 1rem;
}

.hub-ingest-tls-panel[hidden] {
  display: none !important;
}

.hub-ingest-tls-caption {
  margin-top: 0.25rem;
}

.hub-device-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  padding: 0.35rem 1rem 0.55rem;
  margin: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
}

.hub-device-card-actions .btn {
  min-height: 1.85rem;
}

.hub-device-inline-form {
  display: inline;
  margin: 0;
}

.hub-device-deregister-form {
  margin-left: auto;
}

.hub-device-revoked-banner {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(120, 144, 156, 0.12);
}

/* Edge remote controls (camera / recording) — dashboard-style switches */
.hub-edge-controls-slot {
  padding: 0 0.85rem;
}

.hub-edge-controls-slot--skeleton {
  min-height: 3.25rem;
}

.hub-op-toggles {
  width: 100%;
}

.hub-op-toggles--busy {
  opacity: 0.75;
  pointer-events: none;
}

.hub-op-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.55rem 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text);
  font-family: inherit;
  font-size: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.hub-op-toggle:hover:not(:disabled) {
  border-color: rgba(91, 156, 245, 0.35);
  background: rgba(91, 156, 245, 0.06);
}

.hub-op-toggle:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hub-op-toggle:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.hub-op-toggle[data-loading="1"] {
  cursor: progress;
}

.hub-op-toggle-track {
  flex-shrink: 0;
  width: 2.5rem;
  height: 1.4rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  position: relative;
  transition: background 0.2s, border-color 0.2s;
}

.hub-op-toggle-thumb {
  position: absolute;
  top: 50%;
  left: 0.18rem;
  width: 1rem;
  height: 1rem;
  margin-top: -0.5rem;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s, background 0.2s;
}

.hub-op-toggle--on .hub-op-toggle-track {
  background: rgba(91, 156, 245, 0.35);
  border-color: var(--accent-dim);
}

.hub-op-toggle--on .hub-op-toggle-thumb {
  transform: translateX(1.1rem);
  background: var(--accent);
}

.hub-op-toggle--recording.hub-op-toggle--on .hub-op-toggle-track {
  background: rgba(240, 98, 146, 0.3);
  border-color: rgba(240, 98, 146, 0.5);
}

.hub-op-toggle--recording.hub-op-toggle--on .hub-op-toggle-thumb {
  background: var(--recording);
  box-shadow: 0 0 10px rgba(240, 98, 146, 0.55);
}

.hub-op-toggle-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.hub-op-toggle-title {
  font-weight: 700;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.hub-op-toggle-title i {
  color: var(--muted);
  font-size: 0.75rem;
}

.hub-op-toggle-sub {
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.25;
}

.hub-op-toggle-state {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
}

.hub-op-toggle--on .hub-op-toggle-state {
  color: var(--success);
}

.hub-op-toggle--recording.hub-op-toggle--on .hub-op-toggle-state {
  color: var(--recording);
}

.hub-live-card .hub-edge-controls-slot {
  padding: 0;
  border: 0;
  background: transparent;
  flex-shrink: 0;
}

/*
 * Live grid / focus / 1-up: compact Cam/Rec pills inline left of the status badge
 * (same size as wall). mount() rewrites the slot to .hub-edge-controls.
 */
.hub-live-grid:not(.hub-live-grid--layout-wall) .hub-live-card .hub-edge-controls-slot,
.hub-live-grid:not(.hub-live-grid--layout-wall) .hub-live-card .hub-edge-controls,
.hub-live-grid:not(.hub-live-grid--layout-wall) .hub-live-card .hub-edge-controls-slot--inline {
  flex: 0 0 auto;
  order: 2;
  width: auto;
  max-width: none;
  margin: 0;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
  opacity: 1;
  pointer-events: auto;
}

.hub-live-card-head {
  flex-wrap: nowrap;
}

.hub-live-drag-handle {
  order: 0;
}

.hub-live-card-title-block {
  order: 1;
  min-width: 0;
}

.hub-live-card-badge {
  order: 3;
  margin-left: auto;
  flex-shrink: 0;
}

.hub-live-detection-slot {
  order: 3;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

.hub-live-detection {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.12rem 0.28rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hub-live-det-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  font-size: 0.62rem;
  color: rgba(160, 170, 180, 0.45);
  opacity: 0.55;
  transition: color 0.15s ease, opacity 0.15s ease;
}

.hub-live-det-icon.is-on {
  opacity: 1;
}

.hub-live-det-icon--motion.is-on {
  color: #ffb347;
}

.hub-live-det-icon--object.is-on {
  color: #7ee0a8;
}

.hub-live-det-icon--scene.is-on {
  color: #c084fc;
}

.hub-live-skeleton-pill--det {
  width: 3.4rem;
}

.hub-live-grid:not(.hub-live-grid--layout-wall) .hub-live-card-badge {
  margin-left: 0;
}

.hub-live-grid:not(.hub-live-grid--layout-wall) .hub-live-detection-slot {
  margin-left: auto;
}

.hub-op-toggles--compact {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.hub-op-toggles--compact .hub-op-toggle {
  width: auto;
  gap: 0.3rem;
  padding: 0.2rem 0.35rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border-color: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hub-op-toggles--compact .hub-op-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

/* Icon-only compact pills — keep camera title visible in the head row. */
.hub-op-toggles--compact .hub-op-toggle-label-text {
  display: none;
}

.hub-op-toggles--compact .hub-op-reboot {
  min-width: 1.9rem;
  min-height: 1.9rem;
  padding: 0.2rem 0.4rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border-color: rgba(255, 255, 255, 0.14);
}

.hub-op-toggles--compact .hub-op-reboot-label {
  display: none;
}

.hub-op-toggles--compact .hub-op-toggle-label i {
  width: 0.9em;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
}

.hub-op-toggles--compact .hub-op-toggle-track {
  width: 1.65rem;
  height: 0.95rem;
}

.hub-op-toggles--compact .hub-op-toggle-thumb {
  width: 0.7rem;
  height: 0.7rem;
  margin-top: -0.35rem;
}

.hub-op-toggles--compact .hub-op-toggle--on .hub-op-toggle-thumb {
  transform: translateX(0.62rem);
}

/* Device card: compact remote-control panel */
.hub-device-card .hub-edge-controls-slot {
  padding: 0 1rem;
  margin: 0;
  min-width: 0;
  box-sizing: border-box;
}

.hub-device-card-ops {
  padding: 0.45rem 0.5rem 0.5rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  box-sizing: border-box;
}

.hub-device-card-ops--skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 3.5rem;
}

.hub-device-card-ops-title {
  margin: 0 0 0.35rem;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.hub-op-toggles--card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  width: 100%;
}

.hub-op-toggles--card .hub-op-toggle {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  width: 100%;
  min-width: 0;
  padding: 0.4rem 0.5rem;
  box-sizing: border-box;
}

.hub-op-toggles--card .hub-op-toggle-label {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hub-op-toggles--card .hub-op-toggle-label i {
  flex-shrink: 0;
  width: 0.9rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.72rem;
}

.hub-op-toggles--card .hub-op-toggle-track {
  flex-shrink: 0;
  width: 2.15rem;
  height: 1.2rem;
}

.hub-op-toggles--card .hub-op-toggle-thumb {
  width: 0.85rem;
  height: 0.85rem;
  margin-top: -0.425rem;
}

.hub-op-toggles--card .hub-op-toggle--on .hub-op-toggle-thumb {
  transform: translateX(0.95rem);
}

/* Live / wide tiles: two-up panel */
.hub-op-toggles--tile {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.hub-devices-status-line {
  margin: 0 0 0.75rem;
}

.hub-device-card-meta--skeleton {
  padding: 0 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

@media (max-width: 520px) {
  .hub-op-toggles--tile {
    grid-template-columns: 1fr;
  }
}

.hub-devices-empty {
  text-align: center;
  padding: 2.5rem 1.5rem;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  background: var(--bg1);
}

.hub-devices-empty-icon {
  font-size: 2.25rem;
  color: var(--muted);
  opacity: 0.65;
  margin-bottom: 0.85rem;
}

.hub-devices-empty-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.hub-sync-ok {
  color: var(--success);
  font-weight: 600;
}

.hub-sync-pending {
  color: var(--warn);
}

.hub-sync-q {
  color: var(--muted);
}

/* Legacy table (edge archive page) */
.hub-table-wrap {
  overflow-x: auto;
}

.hub-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.hub-table th,
.hub-table td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.hub-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.hub-device-name {
  font-weight: 600;
  display: block;
}

@media (max-width: 960px) {
  .hub-devices-workspace {
    gap: 1rem;
  }
}

@media (max-width: 640px) {
  .hub-devices-hero {
    flex-direction: column;
  }

  .hub-devices-stats {
    width: 100%;
    justify-content: stretch;
  }

  .hub-devices-stat {
    flex: 1;
    min-width: 0;
  }
}

.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
}

.hub-offload-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.hub-library-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.25rem;
  margin-top: 1rem;
}

.hub-library-segments {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 28rem;
  overflow-y: auto;
}

.hub-library-segment-item {
  margin-bottom: 0.35rem;
}

.hub-library-play-btn {
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border, #333);
  border-radius: 6px;
  background: var(--surface-2, #1a1a1a);
  color: inherit;
  cursor: pointer;
}

.hub-library-video {
  width: 100%;
  max-height: 24rem;
  background: #000;
  border-radius: 8px;
}

@media (max-width: 900px) {
  .hub-library-layout {
    grid-template-columns: 1fr;
  }
}

.hub-fleet-library-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  align-items: flex-end;
  margin-bottom: 0.75rem;
}

.hub-fleet-toolbar-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hub-fleet-edge-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  max-width: 42rem;
}

.hub-fleet-edge-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border, #333);
  border-radius: 999px;
  font-size: 0.9rem;
  cursor: pointer;
}

.hub-fleet-picker-actions {
  margin-top: 0.25rem;
}

.hub-fleet-library-body {
  display: grid;
  grid-template-columns: 1fr minmax(16rem, 22rem);
  gap: 1.25rem;
  margin-top: 1rem;
}

.hub-fleet-timelines {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.hub-fleet-timeline-card {
  padding: 0.75rem 1rem 1rem;
}

.hub-fleet-timeline-head {
  margin-bottom: 0.5rem;
}

.hub-fleet-timeline-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.hub-fleet-timeline-sub {
  margin: 0.15rem 0 0;
}

.hub-fleet-player-panel {
  position: sticky;
  top: 1rem;
  align-self: start;
}

.hub-library-timeline-shell {
  margin-bottom: 1rem;
}

/* Unified hub library shell (fleet + per-edge) */
.hub-library-shell {
  margin-top: 0.5rem;
}

.hub-library-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.hub-library-toolbar-block {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: flex-end;
}

.hub-library-legend {
  gap: 0.5rem 1rem;
}

.hub-library-loc-filter-wrap {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.hub-library-loc-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.hub-lib-loc-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--border, #333);
  background: var(--bg2, rgba(255, 255, 255, 0.03));
  color: var(--text);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s, opacity 0.15s;
  opacity: 0.55;
}

.hub-lib-loc-btn--active {
  opacity: 1;
  font-weight: 600;
}

.hub-lib-loc-btn i {
  flex-shrink: 0;
  font-size: 0.9em;
  line-height: 1;
}

.hub-lib-loc-btn > span {
  line-height: 1.2;
}

.hub-lib-loc-btn:hover {
  border-color: rgba(91, 156, 245, 0.35);
}

.hub-lib-loc-btn--active.hub-lib-loc-btn--hub,
.hub-lib-loc-btn--hub:hover {
  border-color: var(--accent, #3b82f6);
  background: rgba(59, 130, 246, 0.12);
}

.hub-lib-loc-btn--active.hub-lib-loc-btn--edge,
.hub-lib-loc-btn--edge:hover {
  border-color: #d97706;
  background: rgba(217, 119, 6, 0.12);
}

.hub-lib-loc-btn--active.hub-lib-loc-btn--sync,
.hub-lib-loc-btn--sync:hover {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.12);
}

.hub-lib-loc-btn--active.hub-lib-loc-btn--err,
.hub-lib-loc-btn--err:hover {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

.hub-lib-loc-btn--active.hub-lib-loc-btn--gap,
.hub-lib-loc-btn--gap:hover {
  border-color: rgba(148, 163, 184, 0.75);
  background: rgba(148, 163, 184, 0.12);
}

.hub-lib-loc-btn--active:not(.hub-lib-loc-btn--hub):not(.hub-lib-loc-btn--edge):not(.hub-lib-loc-btn--sync):not(.hub-lib-loc-btn--err):not(.hub-lib-loc-btn--gap) {
  border-color: var(--accent, #3b82f6);
  background: rgba(91, 156, 245, 0.12);
}

.hub-library-day-filters {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 0 0 auto;
}

.hub-library-day-chrome {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 0 0 auto;
  padding: 0.55rem 0.7rem 0.55rem;
  border: 1px solid var(--border, #333);
  border-radius: 10px;
  background: var(--bg1, rgba(255, 255, 255, 0.03));
}

.hub-library-day-summary {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.65rem 0.9rem;
  flex-wrap: wrap;
}

.hub-library-day-summary-main {
  flex: 1 1 14rem;
  min-width: 0;
}

.hub-library-day-summary-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.hub-library-day-summary-date {
  font-size: 0.92rem;
}

.hub-library-ingest-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
  padding: 0.28rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(56, 120, 220, 0.45);
  background: rgba(56, 120, 220, 0.16);
  font-size: 0.78rem;
}

.hub-library-ingest-chip[hidden] {
  display: none !important;
}

.hub-library-ingest-chip-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.22);
  animation: hub-lib-ingest-pulse 1.4s ease-in-out infinite;
}

@keyframes hub-lib-ingest-pulse {
  50% { opacity: 0.35; }
}

.hub-library-day-filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
}

.hub-library-day-chrome .hub-library-day-filters {
  display: grid;
  grid-template-columns: auto auto minmax(10rem, 1fr) auto;
  gap: 0.35rem 0.75rem;
  align-items: start;
}

.hub-library-day-chrome .hub-library-day-filter-group {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  min-width: 0;
}

.hub-library-day-chrome .hub-library-day-filter-group + .hub-library-day-filter-group,
.hub-library-day-chrome .hub-library-day-filter-actions {
  position: relative;
  padding-left: 0.95rem;
}

.hub-library-day-chrome .hub-library-day-filter-group + .hub-library-day-filter-group::before,
.hub-library-day-chrome .hub-library-day-filter-actions::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2rem;
  bottom: 0.15rem;
  width: 1px;
  background: rgba(186, 210, 255, 0.42);
}

.hub-library-day-chrome .hub-library-day-filter-actions {
  margin-top: 1.05rem;
}

.hub-library-day-chrome .hub-library-edge-filter {
  flex-wrap: nowrap;
  max-width: 100%;
  padding-bottom: 0.15rem;
}

.hub-library-day-chrome .hub-lib-edge-chip {
  flex: 0 0 auto;
  padding: 0.22rem 0.55rem;
  font-size: 0.8rem;
}

.hub-library-day-chrome .hub-lib-loc-btn span {
  font-size: 0.75rem;
}

@media (max-width: 900px) {
  .hub-library-day-chrome .hub-library-day-filters {
    grid-template-columns: 1fr 1fr;
  }
  .hub-library-day-chrome .hub-library-day-filter-group--cameras,
  .hub-library-day-chrome .hub-library-day-filter-actions {
    grid-column: 1 / -1;
    padding-left: 0;
    padding-top: 0.5rem;
  }
  .hub-library-day-chrome .hub-library-day-filter-group--cameras::before,
  .hub-library-day-chrome .hub-library-day-filter-actions::before {
    top: 0;
    bottom: auto;
    left: 0;
    right: 0;
    width: auto;
    height: 1px;
  }
  .hub-library-day-chrome .hub-library-day-filter-actions {
    margin-top: 0;
  }
}

.hub-library-day-filter-label {
  flex: 0 0 auto;
  min-width: 3.4rem;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #9aa3b2);
}

.hub-library-day-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.hub-library-day-filter-actions {
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.1rem;
}

.hub-lib-edge-chip:not(.hub-lib-edge-chip--on) {
  opacity: 0.45;
}

.hub-library-day-coverage-note {
  margin: 0.2rem 0 0.45rem;
  line-height: 1.35;
}

.hub-lib-edge-swatch {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  background: hsl(var(--hub-lib-edge-hue, 210) 62% 52%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.hub-lib-legend-item--gap {
  border-color: rgba(148, 163, 184, 0.45);
  background: repeating-linear-gradient(
    -45deg,
    rgba(148, 163, 184, 0.18),
    rgba(148, 163, 184, 0.18) 3px,
    rgba(148, 163, 184, 0.05) 3px,
    rgba(148, 163, 184, 0.05) 6px
  );
}

.day-gap-bands {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.day-gap-band {
  position: absolute;
  top: 0.45rem;
  bottom: 0.45rem;
  border-radius: 4px;
  background: repeating-linear-gradient(
    -45deg,
    rgba(148, 163, 184, 0.22),
    rgba(148, 163, 184, 0.22) 4px,
    rgba(148, 163, 184, 0.06) 4px,
    rgba(148, 163, 184, 0.06) 8px
  );
  border: 1px dashed rgba(148, 163, 184, 0.35);
  opacity: 0.9;
}

.hub-library-day-summary-progress {
  margin: 0.35rem 0 0.55rem;
}

.hub-library-day-progress-track {
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  border: 1px solid var(--border, #333);
}

.hub-library-day-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, hsl(210 62% 48%), hsl(160 50% 42%));
  border-radius: inherit;
  min-width: 0;
  transition: width 0.2s ease;
}

.hub-library-day-progress-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: var(--muted, #9aa3b2);
}

.hub-library-day-summary-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
}

.hub-library-edge-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  max-width: 48rem;
}

.hub-library-picker-actions {
  margin-top: 0.15rem;
}

.hub-lib-edge-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border, #333);
  border-radius: 999px;
  background: var(--bg2, rgba(255, 255, 255, 0.03));
  color: var(--text);
  font-size: 0.88rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.hub-lib-edge-chip:hover {
  border-color: rgba(91, 156, 245, 0.35);
}

.hub-lib-edge-chip--on {
  border-color: var(--accent, #3b82f6);
  background: rgba(59, 130, 246, 0.14);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.hub-lib-edge-chip-name {
  line-height: 1.2;
}

.hub-library-edge-picker-wrap {
  margin-bottom: 0.85rem;
}

.hub-lib-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--muted, #9ca3af);
}

.hub-lib-legend-item::before {
  content: "";
  width: 0.85rem;
  height: 0.55rem;
  border-radius: 3px;
}

.hub-lib-legend-item--hub::before {
  background: var(--accent, #3b82f6);
}

.hub-lib-legend-item--edge::before {
  background: repeating-linear-gradient(
    -45deg,
    hsla(32, 80%, 45%, 0.95),
    hsla(32, 80%, 45%, 0.95) 3px,
    hsla(32, 80%, 45%, 0.28) 3px,
    hsla(32, 80%, 45%, 0.28) 6px
  );
  border: 1px solid hsl(32, 80%, 52%);
}

.hub-lib-legend-item--sync::before {
  background: #6366f1;
  animation: hub-lib-pulse 1.4s ease-in-out infinite;
}

.hub-lib-legend-item--err::before {
  background: #ef4444;
}

.hub-lib-legend-item--evt-motion::before {
  background: #ffb347;
  width: 2px;
  height: 0.7rem;
  border-radius: 1px;
}

.hub-lib-legend-item--evt-object::before {
  background: #7ee0a8;
  width: 2px;
  height: 0.7rem;
  border-radius: 1px;
}

.hub-lib-legend-item--evt-scene::before {
  background: #c084fc;
  width: 2px;
  height: 0.7rem;
  border-radius: 1px;
}

.hub-lib-loc-btn--evt-motion.hub-lib-loc-btn--active {
  border-color: rgba(255, 179, 71, 0.65);
}

.hub-lib-loc-btn--evt-object.hub-lib-loc-btn--active {
  border-color: rgba(126, 224, 168, 0.65);
}

.hub-lib-loc-btn--evt-scene.hub-lib-loc-btn--active {
  border-color: rgba(192, 132, 252, 0.65);
}

.hub-lib-stat--events {
  color: var(--text, #e8eaef);
}

@keyframes hub-lib-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.hub-library-sync-strip {
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  background: var(--surface-2, rgba(255, 255, 255, 0.03));
}

.hub-library-intent-panel {
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(99, 102, 241, 0.28);
  background: linear-gradient(
    180deg,
    rgba(99, 102, 241, 0.06) 0%,
    rgba(255, 255, 255, 0.02) 100%
  );
}

.hub-library-intent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.hub-library-intent-head .hub-card-title {
  margin: 0;
}

.hub-library-intent-stats-host {
  margin-bottom: 0.85rem;
}

.hub-library-intent-progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 0.55rem;
}

.hub-library-intent-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6366f1, #22c55e);
  transition: width 0.35s ease;
}

.hub-library-intent-stat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  font-size: 0.85rem;
}

.hub-library-intent-stat strong {
  font-weight: 600;
}

.hub-library-intent-stat--active strong {
  color: #a5b4fc;
}

.hub-library-intent-stat--fail strong {
  color: #f87171;
}

.hub-library-intent-section {
  margin-top: 0.75rem;
}

.hub-library-intent-subtitle {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.hub-library-intent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.hub-library-intent-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid rgba(255, 255, 255, 0.12);
}

.hub-library-intent-row--offloading,
.hub-library-intent-row--waiting_arrival,
.hub-library-intent-row--queued {
  border-left-color: #818cf8;
}

.hub-library-intent-row--failed {
  border-left-color: #f87171;
}

.hub-library-intent-row--ready {
  border-left-color: #4ade80;
}

.hub-library-intent-meta {
  font-size: 0.82rem;
  line-height: 1.35;
  min-width: 0;
}

.hub-library-intent-state {
  font-weight: 600;
}

.hub-library-intent-error {
  color: #fca5a5;
}

.hub-library-intent-actions {
  flex-shrink: 0;
}

.hub-notification-progress {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  margin-top: 0.35rem;
  overflow: hidden;
}

.hub-notification-progress-bar {
  height: 100%;
  background: #6366f1;
  border-radius: inherit;
}

.hub-library-edge-picker-wrap {
  margin-bottom: 1rem;
}

.hub-library-body {
  display: grid;
  grid-template-columns: 1fr minmax(16rem, 22rem);
  gap: 1.25rem;
}

.hub-library-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.hub-library-timelines {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hub-library-fleet-card {
  border: 1px solid rgba(99, 102, 241, 0.35);
  background: linear-gradient(
    180deg,
    rgba(99, 102, 241, 0.08) 0%,
    rgba(255, 255, 255, 0.02) 100%
  );
}

.hub-library-fleet-head {
  margin-bottom: 0.65rem;
}

.hub-library-fleet-stats {
  margin: 0.25rem 0 0;
}

.day-coverage-bands {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.day-coverage-band {
  position: absolute;
  top: 0.55rem;
  bottom: 0.55rem;
  background: rgba(91, 156, 245, 0.12);
  border-left: 1px solid rgba(91, 156, 245, 0.25);
  border-right: 1px solid rgba(91, 156, 245, 0.25);
  border-radius: 4px;
}

.day-track-vlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.day-track-vline {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  margin-left: -0.5px;
  background: rgba(255, 255, 255, 0.06);
}

.day-track-vline--major {
  background: rgba(255, 255, 255, 0.14);
}

.day-ruler-tick--major {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
}

.hub-library-edge-card {
  padding: 0.75rem 1rem 1rem;
}

.hub-library-edge-head {
  margin-bottom: 0.5rem;
}

.hub-library-edge-title {
  margin: 0;
  font-size: 1.05rem;
}

.hub-library-day-track {
  position: relative;
  height: 2.25rem;
  border-radius: 6px;
  background: var(--surface-2, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border, #333);
  overflow: hidden;
}

.hub-library-track-empty {
  margin: 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}

.hub-library-seg-bar {
  position: absolute;
  top: 0.25rem;
  bottom: 0.25rem;
  min-width: 3px;
  padding: 0;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  opacity: 0.92;
}

.hub-library-seg-bar:hover {
  opacity: 1;
  filter: brightness(1.1);
}

.hub-library-seg-bar--on_hub {
  background: var(--accent, #3b82f6);
}

.hub-library-seg-bar--edge_only {
  background: transparent;
  border: 2px dashed #d97706;
  box-sizing: border-box;
}

.hub-library-seg-bar--syncing {
  background: #6366f1;
  animation: hub-lib-pulse 1.4s ease-in-out infinite;
}

.hub-library-seg-bar--sync_error {
  background: #ef4444;
}

.hub-library-segment-panel {
  padding: 0.75rem 1rem;
}

.hub-library-segment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 24rem;
  overflow-y: auto;
}

.hub-library-segments-sentinel {
  list-style: none;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
}

.hub-library-segment-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  padding: 0.5rem 0.6rem;
  margin-bottom: 0.35rem;
  border: 1px solid var(--border, #333);
  border-radius: 6px;
  border-left-width: 3px;
  color: var(--text, #e8eaef);
  background: var(--bg1, rgba(255, 255, 255, 0.02));
}

.hub-library-segment-row--on_hub {
  border-left-color: var(--accent, #3b82f6);
}

.hub-library-segment-row--edge_only {
  border-left-color: #d97706;
}

.hub-library-segment-row--syncing,
.hub-library-segment-row--syncing_live,
.hub-library-segment-row--syncing_backfill {
  border-left-color: #6366f1;
}

.hub-library-segment-row--sync_error {
  border-left-color: #ef4444;
}

.hub-library-segment-row--focus {
  outline: 2px solid var(--accent, #3b82f6);
  outline-offset: 1px;
}

.hub-library-segment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.55rem;
  font-size: 0.88rem;
  line-height: 1.35;
  flex: 1 1 14rem;
  min-width: 0;
  color: var(--text, #e8eaef);
}

.hub-lib-seg-edge {
  font-weight: 600;
  color: var(--text, #e8eaef);
}

.hub-lib-seg-time {
  font-variant-numeric: tabular-nums;
  color: var(--text, #e8eaef);
}

.hub-lib-seg-cam {
  color: var(--muted, #8b95a8);
  font-size: 0.82rem;
}

.hub-lib-seg-loc {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.08rem 0.4rem;
  border-radius: 0.35rem;
  color: var(--text, #e8eaef);
}

.hub-lib-seg-loc--on_hub {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.hub-lib-seg-loc--edge_only {
  background: rgba(217, 119, 6, 0.15);
  color: #fdba74;
}

.hub-lib-seg-loc--syncing {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

.hub-lib-seg-loc--sync_error {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

.hub-lib-seg-size {
  color: var(--muted, #8b95a8);
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
}

.hub-lib-seg-err {
  flex: 1 1 100%;
  color: #fca5a5;
  font-size: 0.78rem;
}

.hub-library-segment-actions {
  flex-shrink: 0;
}

.hub-library-timeline-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.45rem;
  margin: 0.1rem 0 0.35rem;
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--border, #333);
  border-radius: 8px;
  background: var(--bg1, rgba(255, 255, 255, 0.02));
  color: var(--muted, #8b95a8);
  font-size: 0.76rem;
}

.hub-library-timeline-legend-label {
  font-weight: 600;
  color: var(--text, #e8eaef);
  margin-right: 0.1rem;
}

.hub-library-legend-help {
  margin-left: auto;
  padding: 0.12rem 0.35rem;
}

.hub-library-timeline-legend-note {
  flex: 1 1 100%;
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted, #8b95a8);
}

.hub-library-player-panel {
  position: sticky;
  top: 1rem;
  align-self: start;
  padding: 0.75rem 1rem;
}

@media (max-width: 1100px) {
  .hub-library-body {
    grid-template-columns: 1fr;
  }
  .hub-library-player-panel {
    position: static;
  }
}

@media (max-width: 1100px) {
  .hub-fleet-library-body {
    grid-template-columns: 1fr;
  }
  .hub-fleet-player-panel {
    position: static;
  }
}

.hub-library-body--stack {
  display: block;
}

.hub-library-playback-dock {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
}

.hub-library-playback-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.hub-library-playback-head-main {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.hub-library-playback-head-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.hub-library-playback-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.hub-library-playback-nav .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.hub-library-playback-meta {
  min-width: 2.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.hub-library-playback-scope {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.hub-library-playback-scope--clip {
  color: var(--accent, #5c9fd4);
  background: rgba(92, 159, 212, 0.14);
  border-color: rgba(92, 159, 212, 0.35);
}

.hub-library-playback-scope--segment {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.hub-library-playback-hint {
  margin: 0.35rem 0 0;
}

.hub-library-player-host {
  min-height: 12rem;
}

/* hub-top-actions layout lives with .hub-top rules above */

.hub-notifications-wrap {
  position: relative;
}

.hub-notifications-bell {
  position: relative;
  border: 1px solid var(--sentri-border, var(--border, #333));
  background: var(--sentri-bg2, transparent);
  color: inherit;
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  cursor: pointer;
}

.hub-notifications-bell[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--sentri-accent, #3b82f6) 55%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sentri-accent, #3b82f6) 18%, transparent);
}

.hub-notifications-badge {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--sentri-accent, #3b82f6);
  color: #fff;
  font-size: 0.65rem;
  line-height: 1.1rem;
  text-align: center;
}

.hub-notice-tab-count {
  position: relative;
}

.hub-notice-tab-badge {
  position: static;
  display: inline-block;
  margin-left: 0.35rem;
  vertical-align: middle;
}

.hub-notice-tab-badge[hidden] {
  display: none;
}

.hub-notifications-panel.is-expanded {
  width: min(42rem, 96vw);
}

.hub-notifications-panel:not(.is-expanded) .hub-notice-tags,
.hub-notifications-panel:not(.is-expanded) .hub-notice-facts {
  display: none;
}

.hub-notifications-panel:not(.is-expanded) .hub-notice-body {
  -webkit-line-clamp: 1;
}

.hub-notifications-panel.is-expanded .hub-notice-body {
  -webkit-line-clamp: 6;
}

.hub-notifications-panel.is-expanded .hub-notice-row {
  padding: 0.75rem 0.8rem;
}

#hub-notifications-layout[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--sentri-accent, #3b82f6) 55%, var(--sentri-border, #2a2f3a));
  background: color-mix(in srgb, var(--sentri-accent, #3b82f6) 18%, transparent);
}

.hub-notifications-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  width: min(28rem, 94vw);
  height: min(32rem, 70vh);
  max-width: calc(100vw - 1rem);
  max-height: calc(100vh - 4.5rem);
  overflow: hidden;
  display: none;
  flex-direction: column;
  z-index: 40;
  padding: 0;
  container-type: inline-size;
  container-name: hub-notices;
  background:
    radial-gradient(900px 220px at 8% -50%, color-mix(in srgb, var(--sentri-accent) 16%, transparent), transparent),
    var(--sentri-bg1, var(--card, #12161f));
  border: 1px solid var(--sentri-border, var(--border, #2a2f3a));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

.hub-notifications-panel:not([hidden]) {
  display: flex;
}

.hub-notifications-panel[hidden] {
  display: none !important;
}

.hub-notifications-close {
  display: none;
}

@media (max-width: 960px) {
  .hub-notifications-resize {
    display: none;
  }
}

/* Phone sheet sits on the body, under the top bar, in the space the nav menu uses.
   position:fixed inside .top is trapped by the header backdrop-filter and slides off screen. */
body.hub-notices-open {
  overflow: hidden;
}

body.hub-notices-open .hub-notifications-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: auto !important;
  max-width: none;
  height: auto;
  max-height: none;
  margin: 0;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  z-index: 90;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: none;
}

body.hub-notices-open .hub-notifications-close {
  display: inline-flex;
}

body.hub-notices-open #hub-notifications-layout {
  display: none;
}

body.hub-notices-open .hub-notifications-panel:not(.is-expanded) .hub-notice-tags {
  display: flex;
}

body.hub-notices-open .hub-notifications-panel:not(.is-expanded) .hub-notice-facts {
  display: block;
}

body.hub-notices-open .hub-notifications-panel:not(.is-expanded) .hub-notice-body {
  -webkit-line-clamp: 4;
}

body.hub-notices-open .hub-notifications-list {
  overscroll-behavior: contain;
}

@media (max-width: 720px) {
  .hub-notice-modal {
    align-items: flex-end;
    padding: 0;
  }

  .hub-notice-modal .logs-detail-dialog {
    width: 100%;
    max-width: none;
    max-height: min(88dvh, 100%);
    border-radius: 16px 16px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .hub-inbox-page .hub-page-head {
    flex-direction: column;
    gap: 0.75rem;
  }

  .hub-inbox-page .hub-inbox-head-actions {
    width: 100%;
    align-items: stretch;
  }

  .hub-inbox-page .hub-notice-filters {
    flex: 1 1 100%;
    width: 100%;
    padding: 0.25rem 0 0.55rem;
  }

  .hub-inbox-page .hub-ingest-hero-main,
  .hub-inbox-page .hub-ingest-hero-kpis {
    flex-wrap: wrap;
  }

  .hub-inbox-page #hub-inbox-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .hub-inbox-page #hub-inbox-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.15rem 0.5rem;
    padding: 0.75rem 0.2rem;
  }

  .hub-inbox-page #hub-inbox-table td {
    border: 0;
    padding: 0.1rem 0;
  }

  .hub-inbox-page #hub-inbox-table td:nth-child(1) {
    color: var(--sentri-muted, #8b93a7);
    font-size: 0.75rem;
  }

  .hub-inbox-page #hub-inbox-table td:nth-child(2) {
    grid-column: 1 / -1;
  }

  .hub-inbox-page #hub-inbox-table .hub-inbox-tags {
    width: auto;
    max-width: none;
  }

  .hub-inbox-page #hub-inbox-table td:nth-child(6) {
    grid-column: 2;
    grid-row: 1;
    text-align: right;
  }
}

.hub-notifications-panel-head {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.95rem 1rem 0.45rem;
}

.hub-notifications-eyebrow {
  margin: 0 0 0.15rem;
}

.hub-notifications-panel-head strong {
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.hub-notifications-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.hub-notifications-mark-all {
  flex-shrink: 0;
}

.hub-notifications-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6.1rem, 1fr));
  flex: 0 0 auto;
  gap: 0.4rem;
  padding: 0.15rem 0.85rem 0.75rem;
  max-width: 100%;
}

.hub-notifications-tabs .hub-notice-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  padding: 0.38rem 0.45rem;
  text-align: center;
}

.hub-notice-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.hub-inbox-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  max-width: 100%;
}

.hub-inbox-head-actions .hub-notice-filters {
  flex: 1 1 14rem;
  min-width: 0;
  padding: 0.15rem 0 0.35rem;
}

.hub-notice-filter {
  appearance: none;
  flex: 0 0 auto;
  border: 1px solid var(--sentri-border, #2a2f3a);
  background: color-mix(in srgb, var(--sentri-bg2, #1a1f2b) 80%, transparent);
  color: var(--sentri-muted, #8b93a7);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.2;
}

.hub-notice-filter:hover,
.hub-notice-filter:focus-visible {
  border-color: color-mix(in srgb, var(--sentri-accent, #3b82f6) 50%, var(--sentri-border, #2a2f3a));
  color: var(--sentri-fg, #e8ecf4);
}

.hub-notice-filter.is-active,
.hub-notice-filter[aria-pressed="true"] {
  background: var(--sentri-accent, #3b82f6);
  border-color: var(--sentri-accent, #3b82f6);
  color: #fff;
}

.hub-notifications-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0 0.65rem 0.85rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.hub-notifications-resize {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: nesw-resize;
  z-index: 2;
}

.hub-notifications-resize::before {
  content: "";
  position: absolute;
  left: 0.28rem;
  bottom: 0.28rem;
  width: 0.55rem;
  height: 0.55rem;
  border-left: 2px solid var(--sentri-muted, #8b93a7);
  border-bottom: 2px solid var(--sentri-muted, #8b93a7);
  opacity: 0.8;
}

.hub-notice-sev,
.hub-notice-kind-icon {
  grid-row: 1 / span 2;
}

.hub-notice-main {
  grid-column: 3;
  grid-row: 1;
  min-width: 0;
}

.hub-notice-tags {
  grid-column: 3;
  grid-row: 2;
}

.hub-notice-actions {
  grid-column: 4;
  grid-row: 1 / span 2;
}

.hub-notice-object-digest {
  width: 100%;
  opacity: 0.92;
}


.hub-notifications-empty {
  margin: 0.5rem 0.35rem 0.75rem;
}

.hub-notice-section-label {
  margin: 0.35rem 0.35rem 0.1rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sentri-muted, #8b93a7);
}

.hub-notice-section-label--live {
  color: var(--sentri-warn, #e8b86d);
}

.hub-notice-divider {
  height: 1px;
  margin: 0.45rem 0.35rem;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--sentri-border, #2a2f3a) 90%, white),
    transparent
  );
}

.hub-notice-row {
  display: grid;
  grid-template-columns: 4px 2.15rem minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: start;
  width: 100%;
  text-align: left;
  border: 1px solid color-mix(in srgb, var(--sentri-border, #2a2f3a) 85%, transparent);
  border-radius: 12px;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--sentri-bg2, #1a1f2b) 55%, transparent),
      color-mix(in srgb, var(--sentri-bg1, #12161f) 88%, transparent)
    );
  color: inherit;
  font: inherit;
  padding: 0.6rem 0.65rem;
  cursor: pointer;
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 5%, transparent);
  transition: border-color 0.12s ease, background 0.12s ease;
}

.hub-notice-row:hover,
.hub-notice-row:focus-visible {
  border-color: color-mix(in srgb, var(--sentri-accent, #3b82f6) 42%, var(--sentri-border, #2a2f3a));
}

.hub-notice-row.is-unread {
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--sentri-accent, #3b82f6) 14%, var(--sentri-bg2, #1a1f2b)),
      color-mix(in srgb, var(--sentri-bg2, #1a1f2b) 92%, transparent)
    );
}

.hub-notice-row.is-read {
  opacity: 0.82;
}

.hub-notice-sev {
  display: block;
  align-self: stretch;
  border-radius: 99px;
  background: var(--sentri-muted, #8b93a7);
}

.hub-notice-row--info .hub-notice-sev {
  background: var(--sentri-accent, #3b82f6);
}

.hub-notice-row--success .hub-notice-sev {
  background: var(--sentri-success, #3ecf8e);
}

.hub-notice-row--warning .hub-notice-sev {
  background: var(--sentri-warn, #e6b35a);
}

.hub-notice-row--error .hub-notice-sev {
  background: var(--sentri-danger, #f07178);
}

.hub-notice-row--cat-ingest {
  border-color: color-mix(in srgb, var(--sentri-accent, #3b82f6) 40%, var(--sentri-border, #2a2f3a));
}

.hub-notice-row--cat-security {
  border-color: color-mix(in srgb, var(--sentri-danger, #f07178) 38%, var(--sentri-border, #2a2f3a));
}

.hub-notice-row--cat-fleet {
  border-color: color-mix(in srgb, #7dd3fc 38%, var(--sentri-border, #2a2f3a));
}

.hub-notice-row--cat-library {
  border-color: color-mix(in srgb, #c4b5fd 38%, var(--sentri-border, #2a2f3a));
}

.hub-notice-row--cat-system {
  border-color: color-mix(in srgb, var(--sentri-success, #3ecf8e) 32%, var(--sentri-border, #2a2f3a));
}

.hub-notice-kind-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  margin-top: 0.05rem;
  border-radius: 10px;
  color: var(--sentri-fg, #e8ecf4);
  background: color-mix(in srgb, var(--sentri-muted, #8b93a7) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--sentri-border, #2a2f3a) 80%, transparent);
  font-size: 0.92rem;
}

.hub-notice-kind-icon--info {
  color: var(--sentri-accent, #3b82f6);
  background: color-mix(in srgb, var(--sentri-accent, #3b82f6) 16%, transparent);
  border-color: color-mix(in srgb, var(--sentri-accent, #3b82f6) 35%, transparent);
}

.hub-notice-kind-icon--success {
  color: var(--sentri-success, #3ecf8e);
  background: color-mix(in srgb, var(--sentri-success, #3ecf8e) 16%, transparent);
  border-color: color-mix(in srgb, var(--sentri-success, #3ecf8e) 35%, transparent);
}

.hub-notice-kind-icon--warning {
  color: var(--sentri-warn, #e6b35a);
  background: color-mix(in srgb, var(--sentri-warn, #e6b35a) 16%, transparent);
  border-color: color-mix(in srgb, var(--sentri-warn, #e6b35a) 38%, transparent);
}

.hub-notice-kind-icon--error {
  color: var(--sentri-danger, #f07178);
  background: color-mix(in srgb, var(--sentri-danger, #f07178) 16%, transparent);
  border-color: color-mix(in srgb, var(--sentri-danger, #f07178) 38%, transparent);
}

.hub-notice-copy {
  min-width: 0;
}

.hub-notice-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.hub-notice-title {
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.25;
}

.hub-notice-body {
  margin: 0.22rem 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--sentri-muted, #8b93a7);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hub-notice-facts {
  margin: 0.28rem 0 0;
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1.35;
  color: var(--sentri-fg, #e8ecf4);
}

.hub-notice-when {
  flex-shrink: 0;
  white-space: nowrap;
}

.hub-notice-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.35rem;
}

.hub-notice-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: help;
  border: 1px solid color-mix(in srgb, var(--sentri-border, #2a2f3a) 85%, white);
  color: var(--sentri-muted, #8b93a7);
  background: color-mix(in srgb, var(--sentri-bg1, #12161f) 88%, white);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.hub-notice-tag--source {
  color: var(--sentri-fg, #e8ecf4);
  border-color: color-mix(in srgb, var(--sentri-accent, #3b82f6) 45%, transparent);
  background: color-mix(in srgb, var(--sentri-accent, #3b82f6) 12%, var(--sentri-bg1, #12161f));
}

.hub-notice-tag--progress {
  color: #c5ddff;
  border-color: color-mix(in srgb, #60a5fa 55%, transparent);
  background: color-mix(in srgb, #3b82f6 18%, transparent);
}

.hub-notice-tag--warn {
  color: #f3d7a1;
  border-color: color-mix(in srgb, #e8b86d 55%, transparent);
  background: color-mix(in srgb, #e8b86d 16%, transparent);
}

.hub-notice-tag--bad {
  color: #f5c2c0;
  border-color: color-mix(in srgb, #e06c6c 55%, transparent);
  background: color-mix(in srgb, #e06c6c 16%, transparent);
}

.hub-notice-tag--ok {
  color: #b7e4c7;
  border-color: color-mix(in srgb, #3dd68c 50%, transparent);
  background: color-mix(in srgb, #3dd68c 14%, transparent);
}

.hub-notice-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

.hub-notice-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.hub-notice-icon-btn:hover,
.hub-notice-icon-btn:focus-visible {
  border-color: var(--sentri-border, #2a2f3a);
  background: color-mix(in srgb, var(--sentri-accent, #3b82f6) 12%, transparent);
}

.hub-notice-detail-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.hub-notice-detail-head .hub-notice-kind-icon {
  flex-shrink: 0;
  margin-top: 0;
}

.hub-notice-detail-head h2 {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.hub-notice-modal .logs-detail-dialog {
  max-width: 36rem;
  background:
    radial-gradient(800px 200px at 0% -40%, color-mix(in srgb, var(--sentri-accent) 14%, transparent), transparent),
    var(--sentri-bg1, var(--card, #12161f));
}

.hub-notice-modal[data-severity="success"] .logs-detail-dialog {
  background:
    radial-gradient(800px 200px at 0% -40%, color-mix(in srgb, var(--sentri-success) 16%, transparent), transparent),
    var(--sentri-bg1, var(--card, #12161f));
}

.hub-notice-modal[data-severity="error"] .logs-detail-dialog {
  background:
    radial-gradient(800px 200px at 0% -40%, color-mix(in srgb, var(--sentri-danger) 16%, transparent), transparent),
    var(--sentri-bg1, var(--card, #12161f));
}

.hub-notice-modal[data-severity="warning"] .logs-detail-dialog {
  background:
    radial-gradient(800px 200px at 0% -40%, color-mix(in srgb, var(--sentri-warn) 16%, transparent), transparent),
    var(--sentri-bg1, var(--card, #12161f));
}

.hub-notice-detail-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.hub-notice-status {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid color-mix(in srgb, var(--sentri-warn, #e6b35a) 45%, transparent);
  color: var(--sentri-warn, #e6b35a);
  background: color-mix(in srgb, var(--sentri-warn, #e6b35a) 12%, transparent);
}

.hub-notice-status[data-read="1"] {
  border-color: color-mix(in srgb, var(--sentri-success, #3ecf8e) 45%, transparent);
  color: var(--sentri-success, #3ecf8e);
  background: color-mix(in srgb, var(--sentri-success, #3ecf8e) 12%, transparent);
}

.hub-notice-detail-lede {
  margin: 0 0 0.75rem;
  font-size: 0.98rem;
  line-height: 1.45;
}

.hub-notice-related {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
}

.hub-notice-detail-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--sentri-border, #2a2f3a);
}

@media (max-width: 720px) {
  .hub-notifications-panel-head {
    padding: 0.85rem 0.9rem 0.35rem;
  }

  .hub-notifications-panel-head strong {
    font-size: 1.15rem;
  }

  .hub-notifications-tabs {
    padding: 0.35rem 0.75rem 0.8rem;
  }

  .hub-notice-filter {
    min-height: 2.2rem;
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
  }

  .hub-notice-icon-btn {
    width: 2.4rem;
    height: 2.4rem;
  }

  .hub-notice-row {
    padding: 0.8rem 0.7rem;
  }

  .hub-notice-title {
    font-size: 0.95rem;
  }

  .hub-notice-modal .logs-detail-dialog {
    width: 100%;
    max-width: none;
    max-height: min(88dvh, 100%);
    border-radius: 16px 16px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

.hub-inbox-pager [hidden] {
  display: none !important;
}

.hub-notice-modal[hidden] {
  display: none !important;
}

.hub-inbox-row--unread td:first-child {
  box-shadow: inset 3px 0 0 var(--sentri-accent, #3b82f6);
}

.hub-inbox-tags {
  width: 9.5rem;
  max-width: 12rem;
  vertical-align: middle;
}

.hub-inbox-tags .hub-notice-tags {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  grid-column: auto;
  grid-row: auto;
  overflow: hidden;
}

.hub-inbox-tags .hub-notice-tag {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-activity-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.85rem;
  width: 100%;
}

.hub-activity-filters .hub-field {
  min-width: 8.5rem;
}

.hub-activity-filters .hub-field:last-child {
  flex: 1 1 12rem;
}

.logs-toolbar.hub-activity-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.95rem 1rem 1rem;
}

.logs-page .hub-activity-filters .hub-field:last-child {
  flex: 0 1 auto;
}

.logs-page .hub-activity-filters .hub-field--grow {
  flex: 1 1 14rem;
}

.logs-page .hub-field[hidden] {
  display: none !important;
}

.logs-page .logs-toolbar .hub-check--row {
  margin: 0;
  align-self: end;
  min-width: 12.5rem;
}

.logs-page .logs-toolbar .hub-check--row > span {
  font-weight: 650;
}

.logs-page .logs-toolbar .hub-check--row .muted {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.logs-page .hub-logs-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-left: auto;
  align-self: end;
}

.hub-activity-scroll {
  max-height: min(36rem, 62vh);
}

.hub-notification-row {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border, #333);
  border-radius: 6px;
}

.hub-notification-row--unread {
  border-left: 3px solid var(--accent, #3b82f6);
}

.hub-notification-row--sev-warning {
  border-color: rgba(230, 179, 90, 0.45);
}

.hub-notification-row--sev-error {
  border-color: rgba(240, 113, 120, 0.45);
}

.hub-notification-row--sev-success {
  border-color: rgba(62, 207, 142, 0.45);
}

.hub-notification-title {
  font-size: 0.9rem;
  font-weight: 600;
}

.day-clip-block--hub-on-hub {
  background: hsl(var(--bar-hue, 210), 62%, 48%) !important;
  border: 1px solid hsla(var(--bar-hue, 210), 62%, 62%, 0.75) !important;
}

.day-clip-block--hub-edge-only {
  background: repeating-linear-gradient(
    -45deg,
    hsla(var(--bar-hue, 32), 70%, 46%, 0.92),
    hsla(var(--bar-hue, 32), 70%, 46%, 0.92) 4px,
    hsla(var(--bar-hue, 32), 70%, 46%, 0.28) 4px,
    hsla(var(--bar-hue, 32), 70%, 46%, 0.28) 8px
  ) !important;
  border: 1.5px solid hsl(var(--bar-hue, 32), 70%, 52%) !important;
  box-sizing: border-box;
}

.day-clip-block--hub-syncing,
.day-clip-block--hub-syncing-live,
.day-clip-block--hub-syncing-backfill {
  background: hsl(var(--bar-hue, 245), 48%, 40%) !important;
  border: 1.5px solid rgba(199, 210, 254, 0.85) !important;
  box-shadow: inset 0 0 0 1px rgba(165, 180, 252, 0.35);
  animation: day-bar-sync-pulse 1.8s ease-in-out infinite;
}

.day-clip-block--hub-sync-error {
  background: #ef4444 !important;
  border: 1px solid #fca5a5 !important;
}

@keyframes day-bar-sync-pulse {
  0%,
  100% {
    filter: brightness(1);
    box-shadow: inset 0 0 0 1px rgba(165, 180, 252, 0.35);
  }
  50% {
    filter: brightness(1.12);
    box-shadow:
      inset 0 0 0 1px rgba(199, 210, 254, 0.7),
      0 0 0 1px rgba(129, 140, 248, 0.35);
  }
}

@media (prefers-reduced-motion: reduce) {
  .day-clip-block--hub-syncing,
  .day-clip-block--hub-syncing-live,
  .day-clip-block--hub-syncing-backfill {
    animation: none;
  }
}

.day-clip-block[data-detail-kind="cluster"] {
  opacity: 0.88;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.12),
    rgba(255, 255, 255, 0.12) 3px,
    transparent 3px,
    transparent 7px
  );
}

/* Phase A L0: real stint clip bars (solid; not time-bucket hatch). */
.day-clip-block--stint,
.day-clip-block[data-detail-kind="clip"] {
  opacity: 0.95;
}

.day-clip-block--hub-on-hub .day-clip-block-label,
.day-clip-block--hub-edge-only .day-clip-block-label,
.day-clip-block--hub-syncing .day-clip-block-label,
.day-clip-block--hub-sync-error .day-clip-block-label,
.day-clip-block--focus .day-clip-block-label {
  color: #fff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

.hub-library-edge-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin: 0.35rem 0 0.25rem;
}

.hub-lib-stat {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.12rem 0.45rem;
  border-radius: 0.35rem;
}

.hub-lib-stat--hub {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.hub-lib-stat--edge {
  background: rgba(217, 119, 6, 0.15);
  color: #fdba74;
}

.hub-lib-stat--sync {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

.hub-lib-stat--err {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

.hub-library-segment-more {
  margin-top: 0.5rem;
  align-items: center;
  gap: 0.75rem;
}

/* Health */
.hub-dl-grid {
  display: grid;
  grid-template-columns: minmax(8rem, auto) 1fr;
  gap: 0.5rem 1.25rem;
  margin: 0;
}

.hub-dl-grid dt {
  color: var(--muted, #9ca3af);
  font-size: 0.85rem;
}

.hub-dl-grid dd {
  margin: 0;
}

.hub-dl-compact {
  display: grid;
  grid-template-columns: minmax(5.5rem, auto) 1fr;
  gap: 0.35rem 0.75rem;
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
}

.hub-dl-compact dt {
  color: var(--muted, #9ca3af);
}

.hub-dl-compact dd {
  margin: 0;
}

.hub-break {
  word-break: break-all;
}

.hub-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.hub-health-node {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.15);
}

.hub-health-node--offline {
  border-color: rgba(107, 114, 128, 0.35);
}

.hub-health-node--revoked {
  opacity: 0.6;
}

.hub-health-node-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.hub-health-node-head h3 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
}

.hub-reason-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.82rem;
}

.hub-error-text {
  color: #f0a89a;
  font-size: 0.82rem;
}

.hub-log-details summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.hub-log-pre {
  margin: 0;
  padding: 0.65rem;
  max-height: 12rem;
  overflow: auto;
  font-size: 0.72rem;
  line-height: 1.45;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  white-space: pre-wrap;
  word-break: break-word;
}

.hub-breadcrumb {
  margin-bottom: 0.75rem;
  font-size: 0.88rem;
}

.hub-breadcrumb a {
  text-decoration: none;
}

.hub-breadcrumb a:hover {
  text-decoration: underline;
}

.hub-activity-trail {
  margin: 0 0 0.85rem;
}
.hub-activity-trail h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}
.hub-activity-trail ol {
  margin: 0;
  padding-left: 1.2rem;
}
.hub-activity-trail li {
  margin: 0.15rem 0;
}

/* Hub settings */
.hub-kv-list {
  display: grid;
  grid-template-columns: minmax(10rem, 14rem) 1fr;
  gap: 0.5rem 1.25rem;
  margin: 0;
}

.hub-kv-list dt {
  margin: 0;
  font-weight: 600;
  color: var(--muted, #9ca3af);
}

.hub-kv-list dd {
  margin: 0;
}

.hub-web-push-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}
.hub-web-push-list li {
  margin: 0.35rem 0;
  font-size: 0.85rem;
  word-break: break-all;
}
.hub-web-push-subs {
  margin-top: 0.5rem;
}

.hub-settings-card {
  margin-bottom: var(--hub-card-gap);
}

.hub-tunnel-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin: 0 0 0.85rem;
  align-items: baseline;
}

.hub-tunnel-stats-sep {
  opacity: 0.55;
}

.hub-session-row--tunnel td:nth-child(2) {
  font-weight: 600;
}

.hub-settings-prose {
  margin: 0 0 1rem;
  line-height: 1.5;
  max-width: 52rem;
}

.hub-settings-note {
  margin: 0 0 1rem;
}

.hub-settings-fields .field {
  margin-bottom: 1rem;
}

.hub-settings-fields .field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Checkbox drawing is the element default. .hub-check is an alias of .sentri-check-row. */

.hub-check--ack {
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--warn, #b26a00) 45%, var(--border));
  background: color-mix(in srgb, var(--warn, #b26a00) 10%, transparent);
  margin: 0.75rem 0 0.35rem;
  align-items: center;
}

.sentri-sentry-setup {
  margin: 0.75rem 0 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border, #ccc);
  background: rgba(0, 0, 0, 0.03);
  font-size: 0.9rem;
}
.sentri-sentry-setup > summary {
  cursor: pointer;
  font-weight: 600;
  list-style-position: outside;
}
.sentri-sentry-setup-steps {
  margin: 0.65rem 0 0.35rem 1.1rem;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.sentri-sentry-setup-steps ul {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
}
.sentri-sentry-setup .field-hint,
.sentri-sentry-setup .muted {
  margin-top: 0.5rem;
}

.hub-dev-options-card {
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* display:flex above wins over the UA [hidden] rule — keep Sentry UI gated. */
.hub-dev-options-card[hidden] {
  display: none !important;
}

.hub-obs-action--error {
  color: var(--danger, #c62828);
}

.sentri-obs-dirty-pill {
  margin: 0.5rem 0 0;
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--warn-fg, #5c3b00);
  background: var(--warn-bg, #fff3cd);
  border: 1px solid var(--warn-border, #e0c36a);
}

.sentri-dsn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.sentri-dsn-row input[type="password"],
.sentri-dsn-row input[type="text"] {
  flex: 1 1 12rem;
  min-width: 0;
}

.sentri-dsn-configured {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--ok-fg, #0d5c2e);
  background: var(--ok-bg, #e6f6ec);
  border: 1px solid var(--ok-border, #8fcea6);
}

.sentri-dsn-configured::before {
  content: "✓";
  font-weight: 700;
}

.sentri-dsn-masked {
  margin: 0.35rem 0 0;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  border: 1px dashed var(--border);
  background: var(--bg2);
  font-size: 0.82rem;
  word-break: break-all;
}

.hub-dev-options-group {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg2);
}

.hub-dev-options-group .hub-settings-subtitle {
  margin: 0 0 0.65rem;
}

.hub-dev-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
  align-items: start;
}

.hub-dev-options-profiling {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.hub-sentry-overhead-note {
  margin: 0;
}

@media (max-width: 720px) {
  .hub-dev-options-grid {
    grid-template-columns: 1fr;
  }
}

.hub-remote-ngrok {
  margin: 0.25rem 0 1rem;
}

.hub-remote-flow-summary {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--accent, #3b82f6) 8%, var(--bg2));
}

.hub-remote-ngrok-ops {
  margin-top: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg2);
}

.hub-remote-ngrok-ops--active {
  border-color: color-mix(in srgb, var(--ok, #2f7d32) 40%, var(--border));
}

.hub-remote-ngrok-setup--compact .hub-remote-step:not([data-step="save"]) {
  opacity: 0.92;
}

.hub-remote-ngrok-setup-details {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg2);
}

.hub-remote-ngrok-setup-details > summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.hub-remote-ngrok-compact {
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--ok, #2f7d32) 35%, var(--border));
  background: color-mix(in srgb, var(--ok, #2f7d32) 8%, var(--bg2));
}

.hub-remote-ngrok-compact p {
  margin: 0;
}

.hub-remote-upstream {
  margin: 0.25rem 0 0.5rem;
  word-break: break-all;
}

.hub-remote-ngrok-health {
  margin: 0.5rem 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg2, #161a22) 88%, transparent);
}

.hub-remote-ngrok-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.5rem 1rem;
  margin: 0;
}

.hub-remote-ngrok-health-grid dt {
  font-weight: 600;
  margin: 0;
}

.hub-remote-ngrok-health-grid dd {
  margin: 0.15rem 0 0;
  word-break: break-word;
}

.hub-remote-health--ok {
  color: var(--ok, #2f7d32);
  font-weight: 600;
}

.hub-remote-health--bad {
  color: var(--danger, #c62828);
  font-weight: 600;
}

.hub-remote-relay-status {
  margin: 0 0 0.85rem;
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg2, #161a22) 88%, transparent);
}

.hub-remote-relay-state {
  margin: 0 0 0.65rem;
  font-weight: 600;
}

.hub-remote-relay-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.55rem 1rem;
  margin: 0 0 0.75rem;
}

.hub-remote-relay-details > div {
  min-width: 0;
}

.hub-remote-relay-details dt {
  font-weight: 600;
  margin: 0;
  font-size: 0.85em;
  color: var(--muted, #8b93a7);
}

.hub-remote-relay-details dd {
  margin: 0.15rem 0 0;
  word-break: break-word;
}

.hub-remote-traffic {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg2, #161a22) 92%, transparent);
}
.hub-remote-traffic .hub-ingest-window-pills {
  margin: 0.35rem 0 0.45rem;
}
.hub-remote-traffic-path {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.hub-remote-traffic-when {
  font-size: 0.75rem;
}

.hub-remote-traffic-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.hub-remote-traffic-title {
  margin: 0;
  font-size: 1rem;
}

.hub-remote-xfer {
  margin: 0.65rem 0 1rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg2, #161a22) 88%, transparent);
}

.hub-remote-xfer-title {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}

.hub-remote-xfer-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.65rem;
  margin: 0.65rem 0 0.85rem;
}

.hub-remote-xfer-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.hub-remote-xfer-value {
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.hub-remote-xfer-days {
  max-height: 11rem;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  background: var(--bg2);
}

.hub-remote-xfer-day {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.82rem;
  padding: 0.28rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.hub-remote-xfer-day:last-child {
  border-bottom: 0;
}

.hub-remote-traffic-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.55rem 0 0.75rem;
}

.hub-remote-traffic-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg2);
  font-size: 0.78rem;
}

.hub-remote-traffic-pill--warn {
  border-color: color-mix(in srgb, var(--warn, #e6a700) 45%, var(--border));
}

.hub-remote-traffic-pill--bad {
  border-color: color-mix(in srgb, var(--danger, #c62828) 45%, var(--border));
}

.hub-remote-traffic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.85rem;
}

.hub-remote-traffic-table-wrap {
  max-height: 12rem;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  background: var(--bg2);
}

.hub-remote-traffic-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8rem;
  padding: 0.2rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.hub-remote-traffic-row:last-child {
  border-bottom: 0;
}

.hub-remote-traffic-row code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-remote-ngrok-log-pre {
  max-height: 18rem;
  overflow: auto;
  padding: 0.65rem 0.75rem;
  margin: 0.5rem 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg, #0f1115) 92%, #000);
  color: var(--text, #e8eaed);
  font-family: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.hub-remote-start-why {
  color: var(--warn, #b26a00);
  margin: 0 0 0.5rem;
}

.hub-remote-help {
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.hub-remote-help summary {
  cursor: pointer;
  font-weight: 600;
}

.hub-remote-help ul {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
}

.hub-remote-lan-sync {
  margin: 1.1rem 0 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg2) 80%, transparent);
}

.hub-remote-lan-sync-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.hub-remote-lan-sync-actions {
  margin-top: 0.65rem;
}

.hub-remote-restart-expect {
  margin: 0.5rem 0 0;
}

.hub-remote-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.hub-remote-step {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg2);
}

.hub-remote-step--ok {
  border-color: color-mix(in srgb, var(--ok, #2f7d32) 45%, var(--border));
}

.hub-remote-step--warn {
  border-color: color-mix(in srgb, var(--warn, #b26a00) 45%, var(--border));
}

.hub-remote-step--bad {
  border-color: color-mix(in srgb, var(--danger, #b3261e) 50%, var(--border));
  background: color-mix(in srgb, var(--danger, #b3261e) 6%, var(--bg2));
}

.hub-remote-step-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.4rem;
}

.hub-remote-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--accent, #3b82f6);
  color: #fff;
}

.hub-remote-step-detail {
  margin: 0 0 0.35rem;
}

.hub-remote-step-detail--bad {
  color: var(--danger, #b3261e);
}

.hub-remote-install-hint {
  margin: 0.35rem 0 0;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px dashed color-mix(in srgb, var(--danger, #b3261e) 40%, var(--border));
  background: color-mix(in srgb, var(--danger, #b3261e) 8%, transparent);
  font-size: 0.85rem;
}

.hub-remote-field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0.25rem 0 0.35rem;
}

.hub-remote-detected-url {
  margin-top: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--accent, #4f8dee) 8%, var(--bg2, #161922));
  display: grid;
  gap: 0.35rem;
}

.hub-remote-detected-url-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.75rem;
}

.hub-remote-detected-url-value {
  margin: 0;
  font-size: 0.92rem;
  word-break: break-all;
}

.hub-remote-detected-url--ready {
  border-color: color-mix(in srgb, #7fd99a 45%, var(--border));
}

.hub-remote-detected-url--pending .hub-remote-detected-url-value {
  color: var(--muted);
}

.hub-settings-toggles {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.hub-settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.25rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg2);
}

.hub-settings-toggle-row[hidden] {
  display: none;
}

.hub-settings-toggle-row > input[type="hidden"] {
  display: none;
}

.hub-settings-toggle-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}

.hub-settings-toggle-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  cursor: pointer;
}

.hub-settings-toggle-desc {
  margin: 0;
}

.hub-settings-switch {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  width: 2.85rem;
  height: 1.55rem;
  cursor: pointer;
}

body.hub-body input.hub-settings-switch-input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.hub-settings-switch-track {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  transition: background 0.2s, border-color 0.2s;
}

.hub-settings-switch-track::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0.18rem;
  width: 1.05rem;
  height: 1.05rem;
  margin-top: -0.525rem;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s, background 0.2s;
}

.hub-settings-switch-input:checked + .hub-settings-switch-track {
  background: rgba(91, 156, 245, 0.35);
  border-color: var(--accent-dim, #5b9cf5);
}

.hub-settings-switch-input:checked + .hub-settings-switch-track::after {
  transform: translateX(1.25rem);
  background: var(--accent, #5b9cf5);
}

.hub-settings-switch-input:focus-visible + .hub-settings-switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hub-settings-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

#hub-settings-save-btn[hidden] {
  display: none !important;
}

.hub-settings-danger {
  margin-top: 1.35rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hub-settings-danger-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.hub-settings-danger-copy {
  margin: 0 0 0.85rem;
  max-width: 52rem;
}

.hub-settings-danger-actions {
  align-items: center;
}

.hub-god-mode-card {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(240, 113, 120, 0.5);
  border-radius: var(--radius, 8px);
  background: rgba(240, 113, 120, 0.1);
}

.hub-god-mode-title {
  margin: 0 0 0.55rem;
  font-size: 1rem;
  color: var(--danger, #f07178);
}

.hub-god-mode-copy {
  margin: 0.45rem 0 0.35rem;
  color: rgba(255, 180, 185, 0.92);
  max-width: 52rem;
}

/* .hub-alert / .hub-alert-warn / .hub-alert-ok card chrome → theme.css .hub-notice */
.hub-alert {
  padding: 0.65rem 0.85rem;
}

.hub-remote-status--live {
  color: #1f7a3a;
  font-weight: 600;
}

.hub-edge-settings-root .hub-subtitle {
  font-size: 0.95rem;
  margin: 1.25rem 0 0.5rem;
}

/* Fleet settings bulk apply (/fleet/settings/) */
.hub-fleet-settings-page-hint {
  margin: 0 0 1rem;
  max-width: 48rem;
  line-height: 1.45;
}

.hub-fleet-settings-form {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  max-width: 52rem;
}

.hub-fleet-settings-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.05rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg2) 72%, transparent);
}

.hub-fleet-settings-section-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--text);
}

.hub-fleet-settings-hint {
  margin: 0;
  line-height: 1.45;
  max-width: 46rem;
}

.hub-fleet-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1rem;
}

.hub-fleet-settings-field {
  margin: 0;
  min-width: 0;
}

.hub-fleet-settings-field .hub-input,
.hub-fleet-settings-field select.hub-input {
  width: 100%;
  max-width: none;
}

.hub-fleet-settings-nested {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.15rem;
  padding: 0.85rem 0.9rem;
  border-radius: 10px;
  border: 1px dashed var(--border);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
}

.hub-fleet-settings-nested[hidden] {
  display: none !important;
}

.hub-fleet-edge-picks {
  list-style: none;
  margin: 0.15rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.hub-fleet-edge-picks .hub-check--row {
  margin: 0;
}

.hub-fleet-edge-picks .hub-check--row span {
  gap: 0.1rem;
}

.hub-fleet-sync-days {
  margin: 0.15rem 0;
}

.hub-fleet-settings-toggle {
  margin: 0;
}

.hub-fleet-settings-actions {
  margin-top: 0.25rem;
  padding-top: 0.25rem;
}

.hub-fleet-apply-results {
  margin-top: 0.35rem;
  overflow-x: auto;
}

.hub-fleet-apply-results .hub-table {
  width: 100%;
  font-size: 0.88rem;
}

.hub-edge-settings-hint {
  margin: 0.35rem 0 0.75rem;
  line-height: 1.45;
  max-width: 40rem;
}

@media (max-width: 720px) {
  .hub-fleet-settings-grid {
    grid-template-columns: 1fr;
  }

  .hub-fleet-settings-section {
    padding: 0.85rem 0.8rem;
  }

  .hub-fleet-settings-form {
    gap: 1rem;
  }
}

.hub-edge-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.hub-edge-tab {
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text);
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.hub-edge-tab:hover {
  border-color: var(--accent);
}

.hub-edge-tab--active {
  background: rgba(92, 159, 212, 0.18);
  border-color: var(--accent, #5c9fd4);
  color: var(--accent, #5c9fd4);
}

.hub-edge-panel[hidden] {
  display: none !important;
}

.hub-edge-settings-form .field label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.hub-edge-settings-form .field input[type="url"],
.hub-edge-settings-form .field input[type="text"],
.hub-edge-settings-form .field input[type="number"],
.hub-edge-settings-form .field input[type="password"],
.hub-edge-settings-form .field select {
  width: 100%;
  max-width: 28rem;
}

/* Archive path browser (Settings) */
.hub-archive-path-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.hub-archive-path-row input[type="text"] {
  flex: 1 1 16rem;
  min-width: 12rem;
}

.btn-link.hub-archive-browse-current {
  background: none;
  border: none;
  padding: 0;
  color: var(--hub-accent, #3d7dd6);
  cursor: pointer;
  font-size: inherit;
  text-decoration: underline;
}

/* Archive storage meters (settings) */
.hub-storage-meters {
  display: grid;
  gap: 1.1rem;
  margin: 1rem 0 1.25rem;
}

.hub-storage-meter-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
  font-size: 0.92rem;
}

.hub-storage-meter-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.hub-storage-meter-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  max-width: 100%;
  transition: width 0.35s ease;
}

.hub-storage-meter-fill--archive {
  background: linear-gradient(90deg, #3d7dd6, #5b9cf0);
}

.hub-storage-meter-fill--free {
  background: linear-gradient(90deg, #2d9a6b, #4bc48a);
}

.hub-storage-meter-track--stack {
  display: flex;
  overflow: hidden;
}

.hub-storage-meter-track--stack .hub-storage-meter-fill {
  width: 0;
  border-radius: 0;
  flex: none;
}

.hub-storage-meter-fill--db {
  background: #c4a35a;
}

.hub-storage-meter-fill--other {
  background: color-mix(in srgb, var(--muted, #889) 55%, transparent);
}

.hub-storage-places {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 16rem;
  overflow: auto;
}

.hub-storage-place-path {
  display: block;
  margin-top: 0.15rem;
  word-break: break-all;
}

.hub-events-page .hub-events-footage-days {
  max-width: 16rem;
}

.hub-events-page .hub-events-footage-kinds {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.35rem 0;
}

.hub-events-page .hub-events-footage-kinds .sentri-check-row {
  margin: 0;
}

.hub-events-page .hub-events-footage-cameras {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(22rem, 36vh);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0.15rem 0 0.35rem;
}

.hub-events-page .hub-events-footage-cameras .sentri-check-row {
  margin: 0;
}

.hub-events-page .hub-events-footage-impact {
  margin: 0;
}

.hub-notifications-bell--live {
  color: #e0a24a;
  border-color: #e0a24a;
  animation: hub-bell-live 1.6s ease-in-out infinite;
}

@keyframes hub-bell-live {
  50% {
    box-shadow: 0 0 0 3px color-mix(in srgb, #e0a24a 40%, transparent);
  }
}

.hub-storage-meter-cards {
  display: flex;
  flex-direction: column;
  gap: var(--hub-card-gap, 1.25rem);
  margin: 1rem 0 1.25rem;
}

.hub-storage-meter-card {
  margin: 0;
}

.hub-storage-meter-card > .hub-card-title {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.hub-storage-meter-card > .muted.small {
  margin: 0 0 0.75rem;
}

.hub-storage-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  list-style: none;
  margin: 0 0 0.55rem;
  padding: 0;
  font-size: 0.85rem;
}

.hub-storage-legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.hub-storage-swatch {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 2px;
  display: inline-block;
}

.hub-storage-swatch--archive {
  background: #3d7dd6;
}

.hub-storage-swatch--db {
  background: #c4a35a;
}

.hub-storage-swatch--other {
  background: color-mix(in srgb, var(--muted, #889) 70%, transparent);
}

.hub-storage-meter-barline {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.hub-storage-meter-barline .hub-storage-meter-track {
  flex: 1 1 auto;
  min-width: 0;
}

.hub-storage-meter-end {
  flex: 0 0 auto;
  text-align: right;
  min-width: 6.5rem;
}

.hub-storage-meter-end-k {
  display: block;
  color: var(--muted, #8b95a8);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.hub-storage-meter-end strong {
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
}

.hub-storage-meter-caption {
  margin: 0.35rem 0 0;
}

.hub-storage-kv {
  margin-top: 0.5rem;
}

.hub-archive-path-preview {
  margin-top: 0.35rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Archive folder browser modal */
.hub-browse-modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.hub-browse-modal[hidden] {
  display: none !important;
}

.hub-browse-modal--open {
  opacity: 1;
  pointer-events: auto;
}

.hub-browse-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

body.hub-browse-open {
  overflow: hidden;
}

.hub-browse-dialog {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(85vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--surface, #1a1d24);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s ease;
}

.hub-browse-modal--open .hub-browse-dialog {
  transform: translateY(0) scale(1);
}

.hub-browse-dialog--loading .hub-browse-list {
  opacity: 0.55;
  pointer-events: none;
}

.hub-browse-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.15rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hub-browse-dialog-title {
  margin: 0;
  font-size: 1.15rem;
}

.hub-browse-dialog-sub {
  margin: 0.25rem 0 0;
}

.hub-browse-hints {
  padding: 0.5rem 1.15rem 0;
}

.hub-browse-hint {
  margin: 0 0 0.35rem;
  display: flex;
  gap: 0.4rem;
  align-items: flex-start;
  font-size: 0.85rem;
  color: var(--muted, #9ca3af);
}

.hub-browse-pathbar {
  padding: 0.5rem 1.15rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.hub-browse-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.1rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  max-height: 4.5rem;
  overflow-y: auto;
}

.hub-browse-crumb-btn {
  background: none;
  border: none;
  color: var(--hub-accent, #3d7dd6);
  cursor: pointer;
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
  font-size: inherit;
}

.hub-browse-crumb-btn:hover,
.hub-browse-crumb-btn:focus {
  background: rgba(61, 125, 214, 0.12);
  outline: none;
}

.hub-browse-crumb-sep {
  color: var(--muted, #9ca3af);
  user-select: none;
  padding: 0 0.05rem;
}

.hub-browse-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.hub-browse-filter {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  min-width: 10rem;
  margin-left: auto;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hub-browse-filter input {
  flex: 1;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 0.88rem;
  min-width: 0;
}

.hub-browse-filter input:focus {
  outline: none;
}

.hub-browse-body {
  flex: 1;
  min-height: 12rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.hub-browse-list {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0.5rem;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.hub-browse-list li {
  margin: 0;
}

.hub-browse-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 0.92rem;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.hub-browse-row-icon {
  color: var(--hub-accent, #3d7dd6);
  width: 1.25rem;
  text-align: center;
}

.hub-browse-row-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-browse-row-enter {
  opacity: 0.35;
  font-size: 0.75rem;
}

.hub-browse-row:hover,
.hub-browse-row:focus {
  background: rgba(61, 125, 214, 0.12);
  outline: none;
}

.hub-browse-row--selected {
  background: rgba(61, 125, 214, 0.2);
  border-color: rgba(61, 125, 214, 0.45);
}

.hub-browse-row--selected .hub-browse-row-enter {
  opacity: 1;
}

.hub-browse-empty,
.hub-browse-loading,
.hub-browse-error {
  padding: 1.25rem 1rem;
  list-style: none;
  text-align: center;
  color: var(--muted, #9ca3af);
}

.hub-browse-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  margin-right: 0.4rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--hub-accent, #3d7dd6);
  border-radius: 50%;
  animation: hub-browse-spin 0.7s linear infinite;
  vertical-align: -0.15rem;
}

@keyframes hub-browse-spin {
  to {
    transform: rotate(360deg);
  }
}

.hub-browse-dialog-foot {
  padding: 0.75rem 1.15rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hub-browse-volume {
  margin: 0 0 0.4rem;
}

.hub-browse-selection {
  margin: 0 0 0.65rem;
  word-break: break-all;
  font-size: 0.88rem;
}

.hub-browse-foot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .hub-page-head {
    flex-direction: column;
  }

  .hub-live-grid:not(.hub-live-grid--layout-wall) {
    grid-template-columns: 1fr;
  }

  .hub-kv-list {
    grid-template-columns: 1fr;
  }

  .hub-settings-fields .field-row {
    grid-template-columns: 1fr;
  }

  .hub-browse-modal {
    padding: 0;
    align-items: stretch;
  }

  .hub-browse-dialog {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .hub-ingest-head-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Ingest dashboard */
.hub-ingest-page .hub-page-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
}

.hub-ingest-head-actions {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.hub-ingest-gap-notice {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid #d97706;
  background: color-mix(in srgb, #d97706 8%, transparent);
}

.hub-ingest-edge-upload {
  margin-bottom: 1rem;
}

.hub-ingest-edge-caption {
  margin: 0 0 0.75rem;
}

.hub-ingest-edge-error {
  max-width: none;
  word-break: break-word;
}

.hub-ingest-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 1rem;
}

.hub-ingest-split {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 960px) {
  .hub-ingest-split {
    grid-template-columns: 1fr;
  }
}

.hub-ingest-analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 1rem;
  align-items: start;
}

@media (max-width: 720px) {
  .hub-ingest-analytics-grid {
    grid-template-columns: 1fr;
  }
}

.hub-ingest-pie-svg {
  max-width: 120px;
  display: block;
  margin: 0 auto;
}

.hub-ingest-pie-legend {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
}

.hub-ingest-pie-swatch {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 2px;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.hub-ingest-hero-summary {
  margin-bottom: 1rem;
}

.hub-ingest-section-head {
  margin-bottom: 0.75rem;
}

.hub-health-ingest-kpis {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border, #334155);
  border-radius: 0.5rem;
}

.hub-edge-node--skeleton {
  padding: 1rem;
  opacity: 0.55;
}

.hub-skel-line {
  height: 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: 0.25rem;
  background: linear-gradient(90deg, #334155 0%, #475569 50%, #334155 100%);
  background-size: 200% 100%;
  animation: hub-skel 1.2s ease-in-out infinite;
}

.hub-skel-line--short {
  width: 40%;
}

@keyframes hub-skel {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.hub-edge-version {
  margin-left: 0.5rem;
}

.hub-fleet-updates-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.75rem;
}

.hub-ingest-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.hub-ingest-stat-n {
  font-size: 1.35rem;
  font-weight: 600;
}

.hub-ingest-stat-l {
  font-size: 0.82rem;
  color: var(--muted, #9ca3af);
}

.hub-ingest-chart-wrap {
  min-height: 10rem;
  margin-top: 0.75rem;
}

.hub-ingest-diagram--compact {
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.hub-ingest-charts-card {
  margin-bottom: 1rem;
  padding: 0.95rem 1rem 1rem;
}

.hub-ingest-charts-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.65rem;
}

.hub-ingest-shared-legend {
  margin-bottom: 0.75rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.18);
}

.hub-ingest-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1rem;
}

@media (max-width: 960px) {
  .hub-ingest-charts-grid {
    grid-template-columns: 1fr;
  }
}

.hub-ingest-chart-panel {
  min-width: 0;
  padding: 0.65rem 0.75rem 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(0, 0, 0, 0.14);
}

.hub-ingest-chart-panel-title {
  margin: 0 0 0.15rem;
  font-size: 0.95rem;
}

.hub-ingest-table-scroll {
  max-height: 22rem;
  overflow: auto;
}

.hub-ingest-live-rate-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
}

.hub-ingest-histogram {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 10rem;
  overflow-x: auto;
  padding-bottom: 1.5rem;
}

.hub-ingest-histogram .hub-ingest-bar {
  flex: 1 0 28px;
  max-width: 48px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  position: relative;
}

.hub-ingest-histogram .hub-ingest-bar-fill {
  display: block;
  width: 100%;
  min-height: 2px;
  background: linear-gradient(180deg, #5b9cf0, #3d7dd6);
  border-radius: 3px 3px 0 0;
  transition: height 0.25s ease;
}

.hub-ingest-histogram .hub-ingest-bar-label {
  position: absolute;
  bottom: -1.35rem;
  font-size: 0.65rem;
  color: var(--muted, #9ca3af);
  transform: rotate(-45deg);
  transform-origin: top left;
  white-space: nowrap;
}

.hub-ingest-progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 0.25rem;
  max-width: 12rem;
}

.hub-ingest-progress-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #3d7dd6, #5b9cf0);
  border-radius: 999px;
}

.hub-sync-ingest {
  color: var(--hub-accent, #3d7dd6);
}

/* Fleet / ingest freshness (cached → updating → live) */
.hub-devices-status-line,
.hub-ingest-status-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.hub-device-card-status-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem 0.5rem;
}

.hub-device-freshness-slot .hub-freshness,
.hub-devices-freshness-slot .hub-freshness,
.hub-ingest-freshness-slot .hub-freshness,
.hub-live-freshness-slot .hub-freshness {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.hub-freshness--cached {
  background: transparent;
  color: var(--hub-accent, #5b9cf5);
  border-color: color-mix(in srgb, var(--hub-accent, #5b9cf5) 55%, transparent);
}

.hub-freshness--updating {
  background: rgba(61, 125, 214, 0.15);
  color: var(--hub-accent, #3d7dd6);
}

.hub-freshness--live {
  background: rgba(45, 154, 107, 0.18);
  color: #4bc48a;
}

.hub-freshness--live .hub-pulse {
  width: 6px;
  height: 6px;
  margin: 0;
}

.hub-freshness-age {
  font-weight: 400;
  opacity: 0.85;
}

.hub-device-card--skeleton .hub-device-freshness-slot {
  display: none;
}

.hub-device-card--refreshing {
  opacity: 0.97;
}

/* Operator auth (setup / login) — minimal shell */
.hub-auth-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg, #0f1117);
}

.hub-auth-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem 2.5rem;
  max-width: none;
}

.hub-auth-brand {
  text-align: center;
  margin-bottom: 1.75rem;
}

.hub-auth-brand .brand {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hub-auth-brand .brand-sub {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.hub-auth-card,
.hub-panel.hub-auth-card {
  width: min(100%, 26rem);
  padding: 1.75rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: var(--shadow, 0 8px 32px rgba(0, 0, 0, 0.35));
}

.hub-auth-card h1 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 650;
}

.hub-auth-footer {
  margin-top: 1.5rem;
  text-align: center;
}

.auth-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
}

.auth-form label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
}

.auth-form .btn-primary {
  margin-top: 0.35rem;
  justify-self: start;
}

.hub-activity-detail {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
}

.hub-activity-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.hub-activity-detail-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.hub-activity-subjects {
  display: grid;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.hub-activity-subject {
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm, 6px);
  background: var(--surface-2, rgba(255, 255, 255, 0.04));
}

.hub-activity-row {
  cursor: pointer;
}

.hub-activity-row:hover td {
  background: var(--surface-2, rgba(255, 255, 255, 0.03));
}

.hub-activity-chip {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.78rem;
  background: var(--surface-2, rgba(255, 255, 255, 0.06));
}

.hub-pill {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: lowercase;
  background: var(--surface-2, rgba(255, 255, 255, 0.06));
}

.hub-ingest-live-rate-card {
  margin-bottom: 1rem;
}

.hub-ingest-live-rate-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 0.75rem;
}

.hub-ingest-live-rate-caption {
  margin: 0.35rem 0 0;
  max-width: 42rem;
}

.hub-ingest-rate-hero-wrap {
  text-align: right;
}

.hub-ingest-rate-hero-label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted, #9ca3af);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hub-ingest-rate-hero {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #5b9cf0;
}

.hub-ingest-rate-cell {
  min-width: 6.5rem;
}

.hub-ingest-rate-now {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.15rem;
}

.transfer-rate-chart {
  min-height: 10rem;
  margin: 0.5rem 0;
}

.transfer-rate-chart-empty {
  padding: 2rem 1rem;
  text-align: center;
}

.transfer-rate-chart-svg {
  display: block;
  width: 100%;
}

.transfer-rate-grid {
  stroke: rgba(148, 163, 184, 0.15);
  stroke-width: 1;
}

.transfer-rate-axis-y,
.transfer-rate-axis-x {
  fill: var(--muted, #9ca3af);
  font-size: 10px;
}

.transfer-rate-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  margin-top: 0.5rem;
}

.transfer-rate-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
}

.transfer-rate-legend-swatch {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 2px;
  flex-shrink: 0;
}

.transfer-sparkline {
  display: block;
  opacity: 0.9;
}

.transfer-sparkline-empty {
  font-size: 0.75rem;
}

/* Library coverage panel */
.hub-library-coverage {
  margin: 0.75rem 0;
  padding: 0.85rem 1rem;
}

.hub-library-coverage-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.hub-cov-alert-list {
  list-style: none;
  margin: 0 0 0.6rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hub-cov-alert {
  font-size: 0.85rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  border-left: 3px solid transparent;
}

.hub-cov-alert--missing {
  background: rgba(220, 60, 60, 0.12);
  border-left-color: #dc3c3c;
}

.hub-cov-alert--low {
  background: rgba(230, 170, 40, 0.12);
  border-left-color: #e6aa28;
}

.hub-cov-alert-day {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.hub-cov-ok {
  margin: 0 0 0.5rem;
}

.hub-cov-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  padding-bottom: 0.35rem;
  margin: 0 -0.15rem;
  padding-left: 0.15rem;
  padding-right: 0.15rem;
}

.hub-cov-table {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: min-content;
  padding-bottom: 0.1rem;
}

.hub-cov-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.hub-cov-row--head {
  align-items: flex-end;
  margin-bottom: 0.1rem;
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--bg1, var(--bg2, #141820));
}

.hub-cov-edge {
  flex: 0 0 9rem;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--bg1, var(--bg2, #141820));
  padding-right: 0.35rem;
  box-shadow: 4px 0 8px -6px rgba(0, 0, 0, 0.55);
}

.hub-cov-edge--spacer {
  visibility: hidden;
  pointer-events: none;
  box-shadow: none;
  position: sticky;
  left: 0;
  z-index: 4;
  background: var(--bg1, var(--bg2, #141820));
}

.hub-cov-cells {
  display: flex;
  gap: 3px;
}

.hub-cov-cells--head {
  align-items: flex-end;
}

.hub-cov-daylab {
  flex: 0 0 auto;
  width: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.05rem;
  line-height: 1.1;
  font-size: 0.58rem;
  color: var(--muted, #9ca3af);
  font-variant-numeric: tabular-nums;
  user-select: none;
  position: relative;
  z-index: 1;
}

.hub-cov-daylab-month {
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text, #e8eaef);
  opacity: 0.85;
}

.hub-cov-daylab-n {
  opacity: 0.9;
}

.hub-cov-cell {
  width: 14px;
  height: 18px;
  border-radius: 3px;
  border: 1px solid rgba(127, 127, 127, 0.25);
  padding: 0;
  cursor: pointer;
  display: inline-block;
  flex: 0 0 auto;
}

.hub-cov-cell--empty {
  background: rgba(127, 127, 127, 0.1);
}

.hub-cov-cell--thin {
  background: rgba(60, 170, 90, 0.35);
}

.hub-cov-cell--mid {
  background: rgba(60, 170, 90, 0.65);
}

.hub-cov-cell--full {
  background: rgba(60, 170, 90, 1);
}

.hub-cov-cell--low {
  background: rgba(230, 170, 40, 0.85);
}

.hub-cov-cell--missing {
  background: rgba(220, 60, 60, 0.85);
}

.hub-cov-cell:hover {
  outline: 2px solid rgba(90, 140, 255, 0.8);
  outline-offset: 1px;
}

.hub-cov-legend {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
  align-items: center;
}

.hub-cov-legend i.hub-cov-cell {
  width: 11px;
  height: 13px;
  cursor: default;
  vertical-align: -2px;
  margin-right: 0.25rem;
}

.hub-library-calendar-card {
  margin-bottom: 0.85rem;
}

/* Calendar day tiles share coverage heat colors (green/amber/red). */
.hub-library-calendar-card .cal-cell--cov.hub-cov-cell--empty,
.hub-events-page .cal-cell--cov.hub-cov-cell--empty {
  background: rgba(127, 127, 127, 0.1);
}
.hub-library-calendar-card .cal-cell--cov.hub-cov-cell--thin,
.hub-events-page .cal-cell--cov.hub-cov-cell--thin {
  background: rgba(60, 170, 90, 0.35);
  border-color: rgba(60, 170, 90, 0.45);
}
.hub-library-calendar-card .cal-cell--cov.hub-cov-cell--mid,
.hub-events-page .cal-cell--cov.hub-cov-cell--mid {
  background: rgba(60, 170, 90, 0.65);
  border-color: rgba(60, 170, 90, 0.55);
}
.hub-library-calendar-card .cal-cell--cov.hub-cov-cell--full,
.hub-events-page .cal-cell--cov.hub-cov-cell--full {
  background: rgba(60, 170, 90, 0.95);
  border-color: rgba(60, 170, 90, 0.7);
}
.hub-library-calendar-card .cal-cell--cov.hub-cov-cell--low,
.hub-events-page .cal-cell--cov.hub-cov-cell--low {
  background: rgba(230, 170, 40, 0.85);
  border-color: rgba(230, 170, 40, 0.65);
}
.hub-library-calendar-card .cal-cell--cov.hub-cov-cell--missing,
.hub-events-page .cal-cell--cov.hub-cov-cell--missing {
  background: rgba(220, 60, 60, 0.85);
  border-color: rgba(220, 60, 60, 0.65);
}

/* Per-edge coverage pips on calendar cells (replaces coverage map rows). */
.hub-library-calendar-card .cal-edge-pips {
  display: flex;
  gap: 0.18rem;
  justify-content: center;
  margin-top: 0.15rem;
  min-height: 0.35rem;
}
.hub-library-calendar-card .cal-edge-pip {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  flex: 0 0 auto;
}
.hub-library-calendar-card .cal-edge-pip--hub {
  background: rgba(60, 170, 90, 0.95);
}
.hub-library-calendar-card .cal-edge-pip--low {
  background: rgba(230, 170, 40, 0.95);
}
.hub-library-calendar-card .cal-edge-pip--missing {
  background: rgba(220, 60, 60, 0.95);
}
.hub-library-calendar-card .cal-edge-pip--empty {
  background: rgba(255, 255, 255, 0.18);
}
.hub-library-calendar-legend {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0.35rem 0 0.15rem;
}

.hub-library-risk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin: 0.35rem 0 0.75rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: rgba(20, 28, 36, 0.55);
  border: 1px solid rgba(127, 127, 127, 0.22);
}

.hub-library-risk-chips {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  flex: 1 1 auto;
  min-width: 0;
}

.hub-risk-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: inherit;
}

.hub-risk-chip-count {
  font-variant-numeric: tabular-nums;
  min-width: 1.1em;
  text-align: center;
}

.hub-risk-chip--critical {
  background: rgba(220, 60, 60, 0.18);
  border-color: rgba(220, 60, 60, 0.55);
  color: #f0b4b4;
}

.hub-risk-chip--warning {
  background: rgba(230, 170, 40, 0.16);
  border-color: rgba(230, 170, 40, 0.5);
  color: #e8d09a;
}

.hub-risk-chip--info {
  background: rgba(90, 140, 200, 0.14);
  border-color: rgba(90, 140, 200, 0.45);
  color: #b8cce8;
}

.hub-risk-chip[aria-pressed="true"] {
  outline: 2px solid rgba(200, 210, 220, 0.45);
  outline-offset: 1px;
}

.hub-risk-ok {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.hub-risk-meta {
  margin-left: 0.25rem;
}

.hub-library-risk-panel {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(127, 127, 127, 0.25);
  background: rgba(16, 22, 28, 0.65);
}

.hub-risk-panel-title {
  margin: 0 0 0.4rem;
  font-size: 0.92rem;
}

.hub-risk-finding-list {
  list-style: none;
  margin: 0 0 0.65rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hub-risk-finding {
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  border-left: 3px solid transparent;
}

.hub-risk-finding p {
  margin: 0.2rem 0 0;
}

.hub-risk-finding--critical {
  background: rgba(220, 60, 60, 0.12);
  border-left-color: #dc3c3c;
}

.hub-risk-finding--warning {
  background: rgba(230, 170, 40, 0.12);
  border-left-color: #e6aa28;
}

.hub-risk-finding--info {
  background: rgba(90, 140, 200, 0.1);
  border-left-color: #5a8cc8;
}

.hub-risk-inputs {
  margin: 0.35rem 0 0;
}

@media (max-width: 640px) {
  .hub-library-risk-bar {
    align-items: stretch;
  }
  .hub-risk-meta {
    width: 100%;
    margin-left: 0;
  }
}

.hub-library-secondary {
  margin-bottom: 0.85rem;
  padding: 0.65rem 0.85rem;
}

.hub-library-secondary-summary {
  cursor: pointer;
  font-weight: 600;
  list-style-position: outside;
}

.cal-cell--selected {
  outline: 2px solid rgba(90, 140, 255, 0.85);
  outline-offset: 1px;
}

/* Remote access security checklist */
.hub-remote-checklist {
  margin: 1rem 0 0.5rem;
}

.hub-remote-checklist .hub-settings-subtitle {
  margin: 0 0 0.55rem;
}

.hub-remote-check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hub-remote-check-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg2);
}

.hub-remote-check-badge {
  flex: 0 0 auto;
  min-width: 3.1rem;
  text-align: center;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.4;
}

.hub-remote-check-item--ok .hub-remote-check-badge {
  color: var(--ok, #2f7d32);
  background: color-mix(in srgb, var(--ok, #2f7d32) 14%, transparent);
}

.hub-remote-check-item--warn .hub-remote-check-badge {
  color: var(--warn, #b26a00);
  background: color-mix(in srgb, var(--warn, #b26a00) 14%, transparent);
}

.hub-remote-check-item--bad .hub-remote-check-badge {
  color: var(--danger, #b3261e);
  background: color-mix(in srgb, var(--danger, #b3261e) 14%, transparent);
}

.hub-remote-check-item--bad {
  border-color: color-mix(in srgb, var(--danger, #b3261e) 40%, var(--border));
}

.hub-remote-check-body {
  min-width: 0;
}

.hub-remote-check-label {
  display: block;
  font-size: 0.9rem;
}

.hub-remote-check-detail {
  margin: 0.2rem 0 0;
}

.hub-remote-check-ok {
  color: var(--ok, #2f7d32);
}

.hub-remote-check-warn {
  color: var(--warn, #b26a00);
}

.hub-remote-check-bad {
  color: var(--danger, #b3261e);
  font-weight: 600;
}

#hub-remote-ngrok-panel .btn-row {
  margin-top: 0.5rem;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* Software updates (hub self-update + fleet edge apply) */
.sentri-updates-apply {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.55rem;
}
.sentri-updates-console {
  margin: 0;
  max-height: 16rem;
  overflow: auto;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border, #333);
  background: rgba(0, 0, 0, 0.08);
  font-size: 0.75rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.sentri-updates-panel {
  margin-top: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border, #ccc);
}
.sentri-update-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.hub-fleet-updates-root {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.75rem;
}
.hub-fleet-updates-lead {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--muted, #9aa3b5);
  max-width: 52rem;
}
.hub-fleet-update-pipeline {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.55rem 0.35rem;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border, #3a4254);
  background: rgba(0, 0, 0, 0.16);
}
.hub-fleet-update-step {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  flex: 1 1 12rem;
  min-width: 11rem;
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
}
.hub-fleet-update-step.is-selected {
  outline: 1px solid var(--accent, #5b9cf5);
}
.hub-fleet-update-step.is-wait {
  border-color: rgba(91, 156, 245, 0.45);
  background: rgba(91, 156, 245, 0.08);
}
.hub-fleet-update-step.is-ok {
  border-color: rgba(62, 207, 142, 0.4);
  background: rgba(62, 207, 142, 0.07);
}
.hub-fleet-update-step.is-err {
  border-color: rgba(240, 113, 120, 0.45);
  background: rgba(240, 113, 120, 0.07);
}
.hub-fleet-update-step-index {
  flex: 0 0 auto;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text, #e8ecf4);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border, #3a4254);
}
.hub-fleet-update-step.is-wait .hub-fleet-update-step-index {
  border-color: rgba(91, 156, 245, 0.55);
  background: rgba(91, 156, 245, 0.2);
}
.hub-fleet-update-step.is-ok .hub-fleet-update-step-index {
  border-color: rgba(62, 207, 142, 0.55);
  background: rgba(62, 207, 142, 0.2);
}
.hub-fleet-update-step-body {
  min-width: 0;
}
.hub-fleet-update-step-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text, #e8ecf4);
}
.hub-fleet-update-step-state {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--muted, #9aa3b5);
}
.hub-fleet-update-step-join {
  flex: 0 0 auto;
  align-self: center;
  width: 1.25rem;
  height: 2px;
  margin: 0 0.15rem;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}
@media (max-width: 640px) {
  .hub-fleet-update-step-join {
    width: 2px;
    height: 0.85rem;
    margin: 0 auto;
  }
  .hub-fleet-update-pipeline {
    flex-direction: column;
  }
}
.hub-fleet-updates-summary {
  display: grid;
  gap: 0.45rem;
}
.hub-fleet-updates-summary p,
.hub-fleet-updates-stat {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.4;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border, #3a4254);
  background: rgba(0, 0, 0, 0.12);
}
.hub-fleet-updates-configure {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.hub-fleet-updates-configure .hub-field {
  margin: 0;
}
.hub-fleet-updates-configure .hub-ingest-window-pills {
  align-self: flex-start;
  width: max-content;
  max-width: 100%;
}
.hub-fleet-updates-configure .hub-ingest-window-pills.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}
#hub-fleet-updates-edge-options,
#hub-fleet-updates-hub-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
#hub-fleet-updates-edge-options[hidden],
#hub-fleet-updates-hub-options[hidden] {
  display: none;
}
.hub-fleet-updates-hero {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.hub-fleet-updates-hero .sentri-updates-roster {
  margin-bottom: 0;
}
.hub-fleet-updates-version-now {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  font-weight: 650;
}
.hub-fleet-updates-version-subject {
  margin: 0.45rem 0 0;
  font-size: 0.88rem;
}
.hub-fleet-updates-summary p:empty,
.hub-fleet-updates-stat:empty {
  display: none;
}
.hub-fleet-updates-version {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
}
.hub-fleet-updates-version-main {
  flex: 1 1 18rem;
  min-width: 0;
}
.hub-fleet-updates-version-main .hub-ingest-window-pills {
  margin-top: 0.35rem;
}
.hub-fleet-updates-version-pick {
  flex: 0 1 14rem;
  min-width: 11rem;
  margin: 0;
}
.hub-fleet-updates-version .hub-field {
  flex: 0 1 auto;
  min-width: 0;
}
.hub-fleet-updates-root > .sentri-card {
  margin: 0;
}
.hub-fleet-updates-token-actions {
  margin: 0;
}
.hub-fleet-updates-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.65rem;
  align-items: center;
}
.hub-fleet-updates-actions--primary {
  padding-top: 0.15rem;
}
.hub-fleet-updates-actions--secondary {
  padding-top: 0;
}
.hub-fleet-updates-targets {
  display: grid;
  gap: 0.35rem;
  margin: 0.1rem 0;
  max-height: 14rem;
  overflow: auto;
}
.hub-fleet-updates-targets.is-log-columns,
.settings-modal-panel--wide .hub-fleet-updates-targets.is-log-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 0.65rem;
  max-height: none;
  overflow: visible;
  flex: 1 1 auto;
}
.settings-modal-panel--wide:has(.hub-fleet-updates-targets.is-log-columns) {
  width: min(76rem, 100%);
}
.hub-fleet-update-target-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: pointer;
}
.hub-fleet-updates-targets.is-log-columns .hub-fleet-update-target {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  cursor: default;
}
.hub-fleet-updates-targets.is-log-columns .sentri-updates-console {
  max-height: min(18rem, 34vh);
  margin: 0.45rem 0 0;
}
.hub-fleet-updates-targets:empty {
  display: none;
}
.hub-fleet-update-target {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border, #ccc);
  background: rgba(0, 0, 0, 0.03);
  font: inherit;
  font-size: 0.9rem;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.hub-fleet-update-target.is-ok {
  border-color: rgba(34, 160, 90, 0.45);
}
.hub-fleet-update-target.is-err {
  border-color: rgba(200, 70, 70, 0.5);
}
.hub-fleet-update-target.is-wait {
  border-color: rgba(180, 140, 40, 0.45);
}
.hub-fleet-update-target.is-selected {
  border-color: var(--accent, #5b9cf5);
  box-shadow: 0 0 0 1px var(--accent, #5b9cf5);
}
.hub-fleet-update-target-label {
  font-weight: 600;
}

/* POST-2.8 UI improvements */
.hub-ingest-diagram-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 0.75rem; align-items: start; }
.hub-ingest-gap-notice--prominent { border-left: 4px solid #e6a700; background: rgba(230,167,0,0.08); }
.hub-device-overflow-wrap { position: relative; display: inline-block; }
.hub-device-overflow-menu { position: absolute; right: 0; top: 100%; z-index: 20; min-width: 10rem; background: var(--card, #1a1f2b); border: 1px solid var(--border, #2a2f3a); border-radius: 6px; padding: 0.25rem; box-shadow: 0 8px 24px rgba(0,0,0,0.35); }
.hub-device-menu-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; color: inherit; padding: 0.35rem 0.5rem; cursor: pointer; text-decoration: none; font: inherit; }
.hub-live-tile-badges {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0;
  flex-shrink: 0;
}
.hub-live-tile-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.18rem 0.4rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  white-space: nowrap;
  line-height: 1;
}
.hub-live-tile-badge i {
  font-size: 0.68rem;
}
.hub-live-tile-badge--ok {
  color: var(--success, #3dd68c);
  background: rgba(62, 207, 142, 0.14);
  border-color: rgba(62, 207, 142, 0.32);
}
.hub-live-tile-badge--warn {
  color: var(--warn, #e6b84d);
  background: rgba(230, 179, 90, 0.14);
  border-color: rgba(230, 179, 90, 0.32);
}
.hub-live-tile-badge--off,
.hub-live-tile-badge--idle {
  color: var(--muted);
  background: rgba(120, 144, 156, 0.16);
}
.hub-live-tile-badge--rec {
  color: var(--recording, #f06292);
  background: rgba(240, 98, 146, 0.18);
  border-color: rgba(240, 98, 146, 0.38);
}
.hub-live-tile-badge--stale { background: rgba(230,167,0,0.2); color: var(--warn, #e6b84d); }
.hub-live-wall-exit-corner {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 1200;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 6px;
  padding: 0.45rem 0.65rem;
  background: rgba(0,0,0,0.72);
  color: #fff;
  cursor: pointer;
}

/* Author display:inline-flex otherwise beats the UA [hidden] rule. */
.hub-live-wall-exit-corner[hidden] {
  display: none !important;
}

/* Toolbar already has Exit Wall; corner control overlaps the glass chrome on phones. */
@media (max-width: 960px) {
  .hub-live-wall-exit-corner {
    display: none !important;
  }
}
.hub-library-lead {
  font-size: 0.9rem;
  max-width: 34rem;
}
.live-chrome-mode-chip { font-size: 0.72rem; font-weight: 700; padding: 0.15rem 0.45rem; border-radius: 4px; letter-spacing: 0.04em; }
.live-chrome-mode-chip--live { background: #c62828; color: #fff; }
.live-chrome-mode-chip--review { background: rgba(255,255,255,0.12); color: #f0c674; }
.live-chrome-live[hidden] { display: none !important; }
.sentri-live-reconnect-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.35rem; background: rgba(0,0,0,0.55); color: #fff; font-size: 0.85rem; z-index: 5; pointer-events: none; }
.sentri-live-reconnect-overlay[hidden] { display: none !important; }
.live-chrome-hold-shot { position: absolute; top: 0; left: 0; right: 0; bottom: 2.75rem; width: 100%; height: auto; object-fit: contain; z-index: 2; pointer-events: none; background: #0a0b0f; }
.live-chrome-hold-shot[hidden] { display: none !important; }
.hub-tls-stepper { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; list-style: none; padding: 0; margin: 0 0 0.75rem; }
.hub-tls-step { display: flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; opacity: 0.55; }
.hub-tls-step--active { opacity: 1; font-weight: 600; }
.hub-tls-step--ok { opacity: 1; color: #6fcf97; }
.hub-tls-step--warn { opacity: 1; color: #e6a700; }
.hub-tls-step-n { display: inline-flex; width: 1.25rem; height: 1.25rem; align-items: center; justify-content: center; border-radius: 999px; background: rgba(255,255,255,0.1); font-size: 0.75rem; }

#hub-tls-panel .hub-tls-panel-grid {
  margin-top: 0.85rem;
}

#hub-tls-panel .sentri-disclosure-body .sentri-disclosure {
  margin-top: 0.85rem;
}

#hub-tls-panel .sentri-card {
  padding: 0.85rem 1rem;
}
.hub-library-intent-sticky { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.45rem 0.65rem; margin-bottom: 0.5rem; background: rgba(56,120,220,0.15); border: 1px solid rgba(56,120,220,0.35); border-radius: 6px; }
.hub-storage-stats--loading [data-stat-bar] { opacity: 0.35; }
.hub-stat-bar--skeleton { animation: hub-pulse-skeleton 1.2s ease-in-out infinite; }
@keyframes hub-pulse-skeleton { 0%,100%{opacity:.35} 50%{opacity:.7} }
.hub-field-error { color: #f07178; margin: 0.25rem 0 0; }
.hub-input--invalid { border-color: #f07178; }

/* —— Hub phone / large-phone layout (Library first, then shell) —— */
@media (max-width: 480px) {
  .hub-page-head h1 {
    font-size: 1.35rem;
  }

  .hub-lead,
  .hub-library-lead {
    font-size: 0.88rem;
    max-width: none;
  }

  .hub-page-actions {
    width: 100%;
  }

  .hub-page-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
    min-height: 2.5rem;
  }

  .hub-top-actions .btn,
  .hub-top .nav-toggle {
    min-height: 2.75rem;
  }

  .hub-nav > a,
  .hub-nav .nav-console > summary {
    min-height: 2.75rem;
  }

  .hub-settings-card.card,
  .hub-devices-panel.card,
  .hub-library-shell.card {
    padding: 0.95rem 0.9rem;
  }

  .hub-settings-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hub-settings-actions .btn {
    width: 100%;
    justify-content: center;
    min-height: 2.6rem;
  }

  .hub-settings-toggle-row {
    gap: 0.65rem;
    padding: 0.55rem 0;
  }

  .hub-devices-stats {
    gap: 0.45rem;
  }

  .hub-devices-stat {
    padding: 0.55rem 0.45rem;
  }

  .hub-devices-discover-card {
    flex-direction: column;
    align-items: stretch;
  }

  .hub-devices-discover-card .btn {
    width: 100%;
    justify-content: center;
    min-height: 2.5rem;
  }

  /* Library toolbar / filters */
  .hub-library-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .hub-library-legend {
    display: none;
  }

  .hub-library-loc-filter {
    gap: 0.35rem;
  }

  .hub-lib-loc-btn {
    min-height: 2.4rem;
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
  }

  .hub-library-loc-legend {
    font-size: 0.72rem;
    line-height: 1.35;
  }

  .hub-library-day-picker-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    width: 100%;
  }

  .hub-library-picker-tab {
    width: 100%;
    justify-content: center;
    min-height: 2.5rem;
  }

  .hub-library-calendar-card.card {
    padding: 0.85rem 0.75rem;
    overflow: hidden;
  }

  .hub-library-coverage-card.card {
    padding: 0.85rem 0.75rem;
    overflow: visible;
  }

  .library-calendar-embed-lead {
    font-size: 0.8rem;
    max-width: none;
  }

  /* Keep month nav usable (theme stacks calendar-nav under 560px). */
  .hub-library-calendar-card .calendar-nav--embed {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
  }

  .hub-library-calendar-card .calendar-nav--embed .btn {
    min-height: 2.4rem;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  .hub-library-calendar-card .calendar-current {
    flex: 1 1 100%;
    order: -1;
    text-align: center;
    font-size: 0.95rem;
  }

  .hub-library-calendar-card .calendar-weekdays--embed .cal-wd {
    font-size: 0;
    letter-spacing: 0;
  }

  .hub-library-calendar-card .calendar-weekdays--embed .cal-wd::before {
    content: attr(data-wd-short);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
  }

  .hub-library-calendar-card .calendar-grid--embed {
    gap: 0.28rem;
  }

  .hub-library-calendar-card .cal-cell--embed {
    min-height: 2.85rem;
    padding: 0.32rem 0.22rem;
    align-items: center;
    justify-content: flex-start;
  }

  .hub-library-calendar-card .cal-cell--embed .cal-day-num {
    font-size: 0.92rem;
  }

  .hub-library-calendar-card .cal-cell--embed .cal-count {
    font-size: 0.58rem;
  }

  .hub-library-coverage-head {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
  }

  .hub-library-coverage-head .hub-card-title {
    font-size: 1rem;
  }

  .hub-library-coverage-head .btn {
    width: 100%;
    justify-content: center;
    min-height: 2.5rem;
  }

  .hub-library-coverage {
    padding: 0.55rem 0;
    margin: 0.35rem 0 0;
  }

  .hub-cov-row {
    gap: 0.4rem;
    padding: 0.2rem 0;
  }

  .hub-cov-edge {
    flex: 0 0 5.25rem;
    max-width: 5.25rem;
    font-weight: 600;
    font-size: 0.78rem;
  }

  .hub-cov-scroll {
    margin: 0 -0.35rem;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
    -webkit-mask-image: linear-gradient(
      to right,
      transparent 0,
      #000 0.35rem,
      #000 calc(100% - 0.35rem),
      transparent 100%
    );
    mask-image: linear-gradient(
      to right,
      transparent 0,
      #000 0.35rem,
      #000 calc(100% - 0.35rem),
      transparent 100%
    );
  }

  .hub-cov-cells {
    gap: 4px;
    padding-bottom: 0.1rem;
  }

  .hub-cov-daylab {
    width: 28px;
    font-size: 0.62rem;
  }

  .hub-cov-daylab-month {
    font-size: 0.55rem;
  }

  .hub-cov-cell {
    width: 28px;
    height: 34px;
    border-radius: 5px;
  }

  .hub-cov-legend {
    gap: 0.55rem 0.75rem;
    font-size: 0.72rem;
  }

  .hub-cov-legend i.hub-cov-cell {
    width: 14px;
    height: 16px;
  }

  #hub-library-day-modal:not([hidden]) {
    padding: 0;
    align-items: stretch;
  }

  #hub-library-day-modal .library-day-modal-panel {
    width: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
    padding: 0.75rem 0.8rem 0.9rem;
  }

  .hub-library-ingest-chip {
    flex-wrap: wrap;
  }

  .hub-library-timeline-legend {
    font-size: 0.78rem;
  }
}

/* Tall phones in landscape (~384–430 CSS px height still tall; width often 740–915). */
@media (max-width: 920px) and (orientation: landscape) and (max-height: 480px) {
  .hub-library-calendar-card .cal-cell--embed {
    min-height: 2.2rem;
    padding: 0.2rem 0.25rem;
  }

  .hub-library-calendar-card .cal-cell--embed .cal-count {
    display: none;
  }

  .hub-cov-cell {
    width: 22px;
    height: 26px;
  }

  .hub-cov-daylab {
    width: 22px;
  }

  .hub-library-loc-filter {
    gap: 0.3rem;
  }

  .hub-lib-loc-btn {
    min-height: 2.2rem;
  }

  #hub-library-day-modal .hub-library-timelines,
  .hub-library-timelines--main {
    min-height: min(32vh, 240px);
    max-height: min(48vh, 360px);
  }
}

/* Mid phones / large phones still portrait but wider than 480 (Galaxy ~412). */
@media (min-width: 481px) and (max-width: 560px) {
  .hub-library-calendar-card .calendar-nav--embed {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .hub-library-calendar-card .calendar-current {
    flex: 1 1 auto;
    text-align: center;
  }

  .hub-library-calendar-card .cal-cell--embed {
    min-height: 2.7rem;
  }

  .hub-cov-cell {
    width: 18px;
    height: 24px;
  }

  .hub-cov-daylab {
    width: 18px;
  }

  .hub-lib-loc-btn {
    min-height: 2.35rem;
  }
}

/* Settings + shell: keep bottom cards and footer actions clear of browser chrome. */
@media (max-width: 720px) {
  body.hub-body[data-hub-section="settings"] .hub-container {
    padding-bottom: max(4.75rem, calc(3.25rem + env(safe-area-inset-bottom, 0px)));
  }

  body.hub-body[data-hub-section="settings"] .hub-settings-advanced {
    margin-bottom: 0.75rem;
  }

  body.hub-body[data-hub-section="help"] .hub-container,
  body.hub-body[data-hub-section="health"] .hub-container,
  body.hub-body[data-hub-section="logs"] .hub-container {
    padding-bottom: max(3.5rem, calc(2.5rem + env(safe-area-inset-bottom, 0px)));
  }
}

@media (max-width: 920px) and (orientation: landscape) {
  body.hub-body .hub-container {
    padding-bottom: max(2.5rem, calc(1.5rem + env(safe-area-inset-bottom, 0px)));
  }

  body.hub-body[data-hub-section="settings"] .hub-container {
    padding-bottom: max(3.5rem, calc(2.25rem + env(safe-area-inset-bottom, 0px)));
  }
}

/* Analytics & alerts page */
.hub-analytics-page .card {
  margin-bottom: 1.25rem;
}
.hub-analytics-page .hub-lead {
  max-width: 44rem;
}
.hub-analytics-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.85rem;
}
.hub-analytics-section-head h2 {
  margin: 0 0 0.25rem;
}
.hub-analytics-rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1rem 1.25rem;
}
.hub-analytics-rule {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--card, #161922) 88%, #000);
  min-width: 0;
}
.hub-analytics-rule-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}
.hub-analytics-rule-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.hub-analytics-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid var(--border);
}
#hub-studio-runtime-badge {
  text-transform: none;
  letter-spacing: 0.01em;
  font-size: 0.75rem;
}
.hub-analytics-badge--on {
  color: var(--ok, #3d9a55);
  background: color-mix(in srgb, var(--ok, #3d9a55) 14%, transparent);
  border-color: color-mix(in srgb, var(--ok, #3d9a55) 40%, var(--border));
}
.hub-analytics-badge--off {
  color: var(--muted);
}
.hub-analytics-badge--secondary {
  color: var(--accent, #5b9cf5);
  background: color-mix(in srgb, var(--accent, #5b9cf5) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent, #5b9cf5) 35%, var(--border));
}
.hub-analytics-badge--soon {
  color: var(--warn, #c9a227);
  background: color-mix(in srgb, var(--warn, #c9a227) 12%, transparent);
  border-color: color-mix(in srgb, var(--warn, #c9a227) 40%, var(--border));
}
.hub-analytics-badge--motion {
  color: #9ec5ff;
  background: color-mix(in srgb, #5b9cf5 16%, transparent);
  border-color: color-mix(in srgb, #5b9cf5 45%, var(--border));
}
.hub-analytics-badge--object {
  color: #8ee0b0;
  background: color-mix(in srgb, #3d9a55 18%, transparent);
  border-color: color-mix(in srgb, #3d9a55 45%, var(--border));
}
.hub-analytics-badge--scene,
.hub-analytics-badge--event {
  color: #e6d7a8;
  background: color-mix(in srgb, #c9a227 14%, transparent);
  border-color: color-mix(in srgb, #c9a227 40%, var(--border));
}
.hub-analytics-badge--label {
  color: var(--text, #e8edf5);
  background: color-mix(in srgb, var(--text, #e8edf5) 8%, transparent);
  text-transform: capitalize;
}
.hub-analytics-badge--count {
  color: var(--muted, #c5d0dc);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 650;
}
.hub-analytics-badge-n {
  margin-left: 0.35rem;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}
.hub-analytics-empty-hint {
  margin: 0.65rem 0 0;
  padding: 0.55rem 0.65rem;
  border-left: 3px solid var(--accent, #5b9cf5);
  background: color-mix(in srgb, var(--accent, #5b9cf5) 8%, transparent);
}
.hub-analytics-rule--hub {
  max-width: 48rem;
}
.hub-analytics-motion-card {
  scroll-margin-top: 4.5rem;
}
.hub-analytics-motion-studio {
  margin-top: 0.35rem;
}
.hub-analytics-motion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.85rem 1.1rem;
  margin: 0.35rem 0 0.85rem;
}
.hub-analytics-motion-edges-field {
  grid-column: 1 / -1;
  max-width: 36rem;
}
.hub-analytics-motion-edges-field select[multiple] {
  min-height: 6.5rem;
  width: 100%;
}
.hub-analytics-motion-current {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--card, #161922) 82%, #000);
}
.hub-analytics-motion-current p {
  margin: 0;
}
.hub-analytics-motion-footnote {
  margin: 0.35rem 0 0;
  max-width: 48rem;
}
.hub-analytics-edge-motion-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.75rem 1rem;
  margin: 0.65rem 0;
}
.hub-analytics-edge-motion-row select[multiple] {
  min-height: 5.5rem;
}
.hub-analytics-edge-motion-actions {
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}
.hub-analytics-toolbar {
  margin-bottom: 0.85rem;
}
.hub-analytics-stats {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 1rem;
  max-width: 28rem;
}
.hub-analytics-clip-link {
  color: var(--accent, #6ea8fe);
  text-decoration: none;
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: bottom;
}
.hub-analytics-clip-link:hover,
.hub-analytics-clip-link:focus {
  text-decoration: underline;
}
.hub-analytics-take-here {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--accent, #6ea8fe);
  text-decoration: none;
  white-space: nowrap;
}
.hub-analytics-take-here:hover,
.hub-analytics-take-here:focus {
  text-decoration: underline;
}
.hub-analytics-history-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}
.hub-analytics-history-scroll {
  max-height: min(26rem, 52vh);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--card, #161922) 88%, #000);
}
.hub-events-page .hub-events-daynav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin-bottom: 0;
}
.hub-events-page .hub-events-daynav-label {
  min-width: 9rem;
}
.hub-events-page .hub-events-clock {
  margin: 0;
}
.hub-events-page .hub-events-clock .hub-input {
  min-width: 7.5rem;
}
.hub-events-page .hub-events-cal {
  margin-top: 0.75rem;
  max-width: 28rem;
}
.hub-events-page .hub-events-cal-head,
.hub-events-page .hub-events-cal-week,
.hub-events-page .hub-events-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.25rem;
  align-items: center;
}
.hub-events-page .hub-events-cal-head {
  grid-template-columns: auto 1fr auto;
  margin-bottom: 0.35rem;
}
.hub-events-page .hub-events-cal-head strong {
  text-align: center;
}
.hub-events-page .hub-events-cal-week {
  margin-bottom: 0.25rem;
  color: var(--muted, #9aa3b5);
  font-size: 0.75rem;
  text-align: center;
}
.hub-events-page .hub-events-cal-grid {
  align-items: stretch;
}
.hub-events-page .hub-events-object-note {
  grid-column: 1 / -1;
  margin: 0.35rem 0 0;
}
.hub-events-page .hub-events-day-title {
  margin: 0;
  font-size: 1.15rem;
}
.hub-events-page .hub-events-day-title + p {
  margin: 0.1rem 0 0;
}
.hub-events-page .hub-events-glance {
  margin-top: 0.85rem;
}
.hub-events-page .hub-events-hours {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  gap: 0.15rem;
  height: 5.6rem;
  margin-top: 0.85rem;
  align-items: stretch;
}
.hub-events-page .hub-events-hour {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 0.15rem;
  cursor: pointer;
  color: var(--muted, #8b95a8);
  font-size: 0.62rem;
}
.hub-events-page .hub-events-hour-bar {
  display: block;
  width: 100%;
  max-width: 0.85rem;
  border-radius: 3px 3px 0 0;
  background: color-mix(in srgb, var(--accent, #6ea8fe) 72%, var(--border, #333));
}
.hub-events-page .hub-events-hour--on .hub-events-hour-bar {
  background: var(--accent, #6ea8fe);
  box-shadow: 0 0 0 1px var(--accent, #6ea8fe);
}
.hub-events-page .hub-events-hour-label {
  height: 0.85rem;
  line-height: 0.85rem;
}
.hub-events-page .hub-events-feed {
  max-height: min(36rem, 68vh);
  overflow: auto;
  padding: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--card, #161922) 88%, #000);
  scroll-snap-type: y proximity;
}
.hub-events-page #hub-events-feed {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.hub-events-page #hub-events-feed.is-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12.25rem, 1fr));
  gap: 0.65rem;
  align-items: stretch;
}
.hub-events-page #hub-events-feed:not(.is-grid) .hub-events-card {
  min-height: 8.25rem;
  height: auto;
  align-items: center;
  overflow: visible;
}
.hub-events-page .hub-events-empty {
  margin: 0.35rem;
}
.hub-events-page .hub-events-card {
  display: grid;
  grid-template-columns: 10.5rem minmax(0, 1fr);
  gap: 0.7rem;
  padding: 0.45rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg, #0e1116) 35%, transparent);
  cursor: pointer;
  scroll-snap-align: start;
}
.hub-events-page #hub-events-feed.is-grid .hub-events-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 18.5rem;
  height: auto;
  padding: 0;
  overflow: visible;
}
.hub-events-page #hub-events-feed.is-grid .hub-events-card-main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 0.2rem;
  min-height: 0;
  padding: 0.7rem 0.8rem 0.85rem;
  overflow: visible;
}
.hub-events-page #hub-events-feed.is-grid .hub-events-card-top,
.hub-events-page #hub-events-feed.is-grid .hub-events-card-meta,
.hub-events-page #hub-events-feed.is-grid .hub-events-card-tags,
.hub-events-page #hub-events-feed.is-grid .hub-events-card-actions {
  flex: 0 0 auto;
  overflow: visible;
}
.hub-events-page #hub-events-feed.is-grid .hub-events-card-actions {
  margin-top: auto;
}
.hub-events-page #hub-events-feed.is-grid .hub-events-card-top {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
}
.hub-events-page #hub-events-feed.is-grid .hub-events-card-when {
  margin-left: 0;
  order: -1;
  font-weight: 650;
}
.hub-events-page #hub-events-feed.is-grid .hub-events-card-thumb {
  height: 8.6rem;
  border: 0;
  border-radius: 0;
}
.hub-events-page .hub-events-card:hover,
.hub-events-page .hub-events-card:focus-visible {
  border-color: color-mix(in srgb, var(--accent, #6ea8fe) 55%, var(--border));
}
.hub-events-page .hub-events-card.hub-analytics-row--highlight {
  outline: 2px solid var(--accent, #6ea8fe);
  outline-offset: 1px;
}
.hub-events-page .hub-events-card-thumb {
  width: 100%;
  height: 6.2rem;
  object-fit: cover;
  border-radius: 6px;
  background: color-mix(in srgb, var(--border, #333) 55%, transparent);
  border: 1px solid var(--border, #333);
}
.hub-events-page .hub-events-card-visual {
  position: relative;
}
.hub-events-page .hub-events-card-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  pointer-events: none;
  background: #10141c;
}
.hub-events-page .hub-events-card-thumb--empty {
  display: block;
  opacity: 0.35;
}
.hub-events-page .hub-events-card-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.65rem;
  align-items: baseline;
}
.hub-events-page .hub-events-card-when {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.hub-events-page .hub-events-card-meta {
  margin: 0.3rem 0 0.4rem;
  color: var(--muted, #8b95a8);
  font-size: 0.85rem;
  line-height: 1.4;
}
.hub-events-page .hub-events-card-tags {
  display: block;
  margin-top: 0.15rem;
}

.hub-events-page .hub-events-activity-line {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.35;
  color: var(--text, #e8edf5);
}
.hub-events-page .hub-events-card-actions {
  margin-top: 0.4rem;
}
.hub-events-page {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.hub-events-page .hub-page-head,
.hub-events-page .card {
  margin-bottom: 0;
}
.hub-events-page .card h2 {
  margin-bottom: 0.15rem;
}
.hub-events-page .hub-analytics-section-head {
  margin-bottom: 0.45rem;
}
.hub-events-page .hub-events-toolbar-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.7rem 0.9rem;
  overflow: visible;
  z-index: 4;
}
.hub-events-page .hub-events-filter-pop {
  position: absolute;
  top: calc(100% - 0.35rem);
  right: 0.75rem;
  z-index: 6;
  width: min(34rem, calc(100vw - 2rem));
  padding: 0.75rem 0.8rem 0.65rem;
  border-radius: 12px;
  border: 1px solid var(--border, #333);
  background: var(--bg1, #16181f);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
.hub-events-page .hub-events-filter-pop[hidden] {
  display: none;
}
.hub-events-page .hub-events-filter-pop .hub-field-label {
  font-size: 0.68rem;
}
.hub-events-page .hub-events-filter-pop .hub-input {
  padding: 0.32rem 0.55rem;
  border-radius: 8px;
  font-size: 0.84rem;
  line-height: 1.3;
  background: var(--bg2, #12141a);
}
.hub-events-page .hub-events-drop {
  position: relative;
}
.hub-events-page .hub-events-native-select {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
.hub-events-page .hub-events-drop-btn {
  width: 100%;
  text-align: left;
  padding: 0.32rem 1.7rem 0.32rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border, #333);
  background-color: var(--bg2, #12141a);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted, #8b95a8) 50%),
    linear-gradient(135deg, var(--muted, #8b95a8) 50%, transparent 50%);
  background-position: calc(100% - 14px) 55%, calc(100% - 9px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  color: inherit;
  font: inherit;
  font-size: 0.84rem;
  cursor: pointer;
}
.hub-events-page .hub-events-drop-btn:focus-visible {
  outline: 2px solid var(--accent, #6ea8fe);
  outline-offset: 1px;
}
.hub-events-page .hub-events-drop-menu {
  position: absolute;
  z-index: 8;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 14rem;
  overflow: auto;
  padding: 0.25rem;
  border-radius: 10px;
  border: 1px solid var(--border, #333);
  background: var(--bg1, #161b24);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}
.hub-events-page .hub-events-drop-menu[hidden] {
  display: none;
}
.hub-events-page .hub-events-drop-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.84rem;
  padding: 0.4rem 0.55rem;
  border-radius: 7px;
  cursor: pointer;
}
.hub-events-page .hub-events-drop-item:hover,
.hub-events-page .hub-events-drop-item.is-on {
  background: color-mix(in srgb, var(--accent, #6ea8fe) 22%, transparent);
}
.hub-events-page .hub-events-filter-pop-actions {
  display: flex;
  justify-content: flex-end;
}
.hub-events-page .hub-events-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.hub-events-page .hub-events-daynav {
  flex: 1 1 auto;
  margin-bottom: 0;
}
.hub-events-page .hub-events-filter-count[hidden] {
  display: none;
}
.hub-events-page .hub-events-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  margin-left: 0.2rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent, #6ea8fe) 28%, transparent);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}
.hub-events-page .hub-events-filter-summary {
  display: none;
}
.hub-events-page .hub-events-filters-panel {
  width: min(36rem, 100%);
}
.hub-events-page .hub-events-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem 0.85rem;
  margin: 0.35rem 0 1rem;
}
.hub-events-page .hub-events-list-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem 0.85rem;
}
.hub-events-page .hub-events-view {
  display: inline-flex;
  gap: 0.25rem;
}
.hub-events-page .hub-events-view [aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--accent, #6ea8fe) 65%, var(--border, #333));
  background: color-mix(in srgb, var(--accent, #6ea8fe) 16%, transparent);
}
.hub-events-page .hub-events-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-top: 0.15rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border, #333);
}
.hub-events-page .hub-events-chips-label {
  margin-right: 0.15rem;
  color: var(--muted, #8b95a8);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.hub-events-page .hub-events-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid color-mix(in srgb, var(--accent, #6ea8fe) 45%, var(--border, #333));
  background: color-mix(in srgb, var(--accent, #6ea8fe) 14%, transparent);
  color: inherit;
  border-radius: 999px;
  padding: 0.28rem 0.45rem 0.28rem 0.7rem;
  font-size: 0.8rem;
  line-height: 1.2;
  cursor: pointer;
}
.hub-events-page .hub-events-chip-x {
  color: var(--muted, #8b95a8);
  font-size: 0.95rem;
  line-height: 1;
}
.hub-events-page .hub-events-chip:hover .hub-events-chip-x {
  color: inherit;
}
.hub-events-page .hub-events-chip-clear {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--muted, #8b95a8);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.2rem 0.15rem;
}
.hub-events-page .hub-events-chip-clear:hover {
  color: inherit;
}
.hub-events-page .hub-events-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.65rem;
}
.hub-events-page .hub-events-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border, #333);
  background: color-mix(in srgb, var(--panel, #16181d) 88%, transparent);
  color: inherit;
  text-align: left;
}
.hub-events-page .hub-events-stat:disabled {
  cursor: default;
}
.hub-events-page button.hub-events-stat:not(:disabled) {
  cursor: pointer;
}
.hub-events-page .hub-events-stat.is-on {
  border-color: color-mix(in srgb, var(--accent, #6ea8fe) 70%, var(--border, #333));
}
.hub-events-page .hub-events-stat-value {
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.hub-events-page .hub-events-stat-label {
  color: var(--muted, #8b95a8);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.hub-events-page .hub-events-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(16rem, 0.9fr);
  gap: 0.55rem;
  align-items: stretch;
}
.hub-events-page .hub-events-doctor-body {
  max-height: min(36rem, 62vh);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.5rem;
}

.hub-events-page .hub-events-doctor-rows {
  display: flex;
  flex-direction: column;
}

.hub-events-page .hub-events-doctor-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 8.5rem minmax(9rem, 12rem);
  gap: 0.85rem;
  align-items: center;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border, #333);
}

.hub-events-page .hub-events-doctor-row .hub-field {
  margin: 0;
}

.hub-events-page .hub-events-doctor-row p {
  margin: 0.2rem 0 0;
}

.hub-events-page .hub-events-doctor-saved {
  text-align: right;
}

.hub-events-page .hub-events-doctor-saved-k {
  display: block;
  color: var(--muted, #8b95a8);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.hub-events-page .hub-events-doctor-saved-v {
  display: block;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.hub-events-page .hub-events-doctor-row.is-changed .hub-events-doctor-saved-v {
  color: var(--accent, #6ea8fe);
}

.hub-events-page .hub-events-doctor-now {
  color: var(--muted, #8b95a8);
  font-size: 0.85rem;
}

.hub-events-page .hub-events-doctor-edge.card {
  margin: 0;
  padding: 0.85rem 1rem;
}

@media (max-width: 720px) {
  .hub-events-page .hub-events-doctor-row {
    grid-template-columns: 1fr 1fr;
  }

  .hub-events-page .hub-events-doctor-row > :first-child {
    grid-column: 1 / -1;
  }
}

.hub-events-page .hub-events-doctor-edge h3 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}

.hub-analytics-motion-current h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.hub-analytics-motion-readout .hub-events-doctor-readout,
.hub-events-page .hub-events-doctor-readout {
  display: grid;
  grid-template-columns: minmax(8rem, 14rem) minmax(0, 1fr);
  gap: 0.2rem 0.75rem;
  margin: 0.35rem 0 0;
}

.hub-analytics-motion-readout .hub-events-doctor-readout dt,
.hub-events-page .hub-events-doctor-readout dt {
  margin: 0;
  color: var(--muted, #8b95a8);
}

.hub-analytics-motion-readout .hub-events-doctor-readout dd,
.hub-events-page .hub-events-doctor-readout dd {
  margin: 0;
}

.hub-events-page .hub-events-doctor-out {
  max-height: 16rem;
  overflow: auto;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
}
.hub-events-page .hub-events-doctor-bars {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.75rem;
}
.hub-events-page .hub-events-doctor-bar-row {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 0.5rem;
  align-items: end;
}
.hub-events-page .hub-events-doctor-bar-label {
  color: var(--muted, #8b95a8);
  font-size: 0.75rem;
}
.hub-events-page .hub-events-doctor-bar-track {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 3.25rem;
}
.hub-events-page .hub-events-doctor-bar-track span {
  flex: 1 1 0;
  min-height: 2px;
  background: var(--accent, #6ea8fe);
  border-radius: 2px 2px 0 0;
}
.hub-events-page .hub-events-doctor-rank {
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.hub-events-page .hub-events-timeline-card,
.hub-events-page .hub-events-map-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.hub-events-page .hub-events-lanes {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 8rem;
}
.hub-events-page .hub-events-lane {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  grid-template-rows: minmax(2.6rem, 1fr);
  gap: 0.5rem;
  align-items: stretch;
  min-height: 2.6rem;
}
.hub-events-page .hub-events-lane-name {
  align-self: center;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--text, #e8edf5);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hub-events-page .hub-events-chart--lane .hub-events-bars {
  min-height: 3.6rem;
}
.hub-events-page .hub-events-analytics {
  max-height: min(68vh, 34rem);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0.35rem 0 0.85rem;
}
.hub-events-page .hub-events-analytics-block h3 {
  margin: 0;
  font-size: 0.95rem;
}
.hub-events-page .hub-events-analytics-block p {
  margin: 0.15rem 0 0.35rem;
}
.hub-events-page .hub-events-curve {
  width: 100%;
  height: 5.2rem;
  display: block;
}
.hub-events-page .hub-events-curve polygon {
  fill: color-mix(in srgb, var(--accent, #6ea8fe) 22%, transparent);
}
.hub-events-page .hub-events-curve polyline {
  fill: none;
  stroke: var(--accent, #9ec5ff);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.hub-events-page .hub-events-curve-tick {
  fill: var(--muted, #8b95a8);
  font-size: 9px;
  font-family: inherit;
}
.hub-events-page .hub-events-analytics-places {
  margin: 0;
  font-weight: 650;
}
.hub-events-page .hub-events-same-moment {
  margin-top: 0.75rem;
}
.hub-events-page .hub-events-same-title {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #8b95a8);
}
.hub-events-page .hub-events-same-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.65rem;
  max-height: 16rem;
  overflow: auto;
}
.hub-events-page .hub-events-same-card {
  margin: 0;
}
.hub-events-page .hub-events-same-card video {
  width: 100%;
  height: 8.5rem;
  object-fit: contain;
  background: #10141c;
  border-radius: 8px;
}
.hub-events-page .hub-events-same-card figcaption {
  margin-top: 0.3rem;
  font-size: 0.85rem;
  font-weight: 650;
}
.hub-events-page .hub-events-chart {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  height: 100%;
  min-height: 2.8rem;
  min-width: 0;
}
.hub-events-page .hub-events-bars {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  align-items: flex-end;
  gap: 3px;
  min-height: 2.6rem;
  padding: 0.35rem 0.2rem 0.2rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}
.hub-events-page .hub-events-bars::after {
  content: "";
  position: absolute;
  left: 0.35rem;
  right: 0.35rem;
  bottom: 0.2rem;
  height: 1px;
  background: rgba(255, 255, 255, 0.14);
  pointer-events: none;
}
.hub-events-page .hub-events-bar-col {
  flex: 1 1 0;
  height: 100%;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.hub-events-page .hub-events-bar-stack {
  display: flex;
  flex-direction: column-reverse;
  width: 100%;
  border-radius: 4px 4px 2px 2px;
  overflow: hidden;
}
.hub-events-page .hub-events-bar-seg,
.hub-events-page .hub-events-chart-legend i {
  background: linear-gradient(180deg, #c5d0de, #7d8b9c);
}
.hub-events-page .hub-events-bar-seg[data-series="motion"],
.hub-events-page .hub-events-chart-legend i[data-series="motion"] {
  background: linear-gradient(180deg, #9ec5ff, #3d7dff);
}
.hub-events-page .hub-events-bar-seg[data-series="object"],
.hub-events-page .hub-events-chart-legend i[data-series="object"] {
  background: linear-gradient(180deg, #ffe08a, #e0a020);
}
.hub-events-page .hub-events-bar-seg[data-series="scene_change"],
.hub-events-page .hub-events-chart-legend i[data-series="scene_change"] {
  background: linear-gradient(180deg, #d7b8ff, #8a5cff);
}
.hub-events-page .hub-events-bar-seg {
  display: block;
  width: 100%;
  min-height: 2px;
}
.hub-events-page .hub-events-bar-col.is-quiet .hub-events-bar-stack {
  height: 3px;
  background: rgba(255, 255, 255, 0.16);
}
.hub-events-page .hub-events-bar-col.is-on .hub-events-bar-stack {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85);
}
.hub-events-page .hub-events-bar-col.is-outside {
  opacity: 0.28;
}
.hub-events-page .hub-events-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  margin-top: 0.35rem;
  color: var(--muted, #8b95a8);
  font-size: 0.72rem;
}
.hub-events-page .hub-events-chart-legend i {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.35rem;
  border-radius: 2px;
  vertical-align: -1px;
}
.hub-events-page .hub-events-chart-axis {
  display: flex;
  justify-content: space-between;
  gap: 0.25rem;
  margin-top: 0.2rem;
  color: var(--muted, #8b95a8);
  font-size: 0.65rem;
  font-variant-numeric: tabular-nums;
}
.hub-events-page .hub-events-heatmap.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  text-align: center;
}
.hub-events-page .hub-events-map-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  max-width: 18rem;
}
.hub-events-page .hub-events-camera-picks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}
.hub-events-page .hub-events-map-card .hub-events-heatmap {
  flex: 1 1 auto;
  min-height: 11rem;
}
.hub-events-page .hub-events-heatmap {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 28%),
    #10141c;
  border: 1px solid var(--border, #333);
}
.hub-events-page .hub-events-heat-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}
.hub-events-page .hub-events-pager {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.hub-events-page .hub-events-pager--foot {
  justify-content: flex-end;
  margin-top: 0.75rem;
}
.hub-events-page .hub-events-pager-label {
  font-size: 0.82rem;
  color: var(--muted, #8b95a8);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 960px) {
  .hub-events-page .hub-events-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .hub-events-page .hub-events-stage {
    grid-template-columns: 1fr;
  }
  .hub-events-page .hub-events-card {
    grid-template-columns: 1fr;
  }
  .hub-events-page .hub-events-bars {
    min-height: 8.5rem;
  }
}
@media (max-width: 720px) {
  .hub-events-page .hub-page-head {
    gap: 0.65rem;
  }
  .hub-events-page .hub-page-head h1 {
    font-size: 1.35rem;
  }
  .hub-events-page .hub-page-actions {
    width: 100%;
  }
  .hub-events-page .hub-page-actions .btn {
    min-height: 2.5rem;
  }
  .hub-events-page .hub-events-filters {
    grid-template-columns: 1fr;
  }
  .hub-events-page .hub-events-filter-pop {
    position: static;
    left: auto;
    right: auto;
    width: auto;
    max-height: none;
    margin-top: 0.15rem;
    box-shadow: none;
  }
  .hub-events-page .hub-events-drop-item {
    min-height: 2.5rem;
    padding: 0.55rem 0.7rem;
  }
  .hub-events-page .hub-events-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    gap: 0.45rem;
  }
  .hub-events-page .hub-events-daynav {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 2.75rem minmax(0, 1fr) minmax(0, 1fr) 2.75rem;
    grid-template-areas:
      "prev title title next"
      "today today cal cal"
      "from from to to";
    gap: 0.4rem;
    width: 100%;
  }
  .hub-events-page #hub-events-day-prev {
    grid-area: prev;
    min-height: 2.5rem;
  }
  .hub-events-page .hub-events-daynav-label {
    grid-area: title;
    min-width: 0;
    align-self: center;
  }
  .hub-events-page #hub-events-day-next {
    grid-area: next;
    min-height: 2.5rem;
  }
  .hub-events-page #hub-events-day-today {
    grid-area: today;
    min-height: 2.5rem;
  }
  .hub-events-page #hub-events-cal-open {
    grid-area: cal;
    min-height: 2.5rem;
  }
  .hub-events-page .hub-events-daynav label:has(#hub-events-time-from) {
    grid-area: from;
  }
  .hub-events-page .hub-events-daynav label:has(#hub-events-time-to) {
    grid-area: to;
  }
  .hub-events-page .hub-events-clock .hub-input {
    min-width: 0;
    width: 100%;
    min-height: 2.5rem;
  }
  .hub-events-page .hub-events-bar > .btn {
    min-height: 2.5rem;
    justify-content: center;
  }
  .hub-events-page #hub-events-footage-open {
    grid-column: 1 / -1;
  }
  .hub-events-page .hub-events-cal {
    max-width: none;
  }
  .hub-events-page .hub-events-cal-grid .cal-cell {
    min-height: 2.45rem;
  }
  .hub-events-page .hub-events-stats {
    gap: 0.4rem;
  }
  .hub-events-page .hub-events-stat {
    padding: 0.55rem 0.6rem;
  }
  .hub-events-page .hub-events-stat-value {
    font-size: 1.15rem;
  }
  .hub-events-page .hub-analytics-section-head,
  .hub-events-page .hub-status-timeline-head {
    gap: 0.55rem;
  }
  .hub-events-page .hub-events-map-card .btn-row,
  .hub-events-page .hub-events-list-tools {
    width: 100%;
    justify-content: stretch;
  }
  .hub-events-page .hub-events-list-tools .hub-field {
    flex: 1 1 7.5rem;
  }
  .hub-events-page .hub-events-list-tools .hub-input {
    min-height: 2.5rem;
  }
  .hub-events-page .hub-events-view .btn,
  .hub-events-page .hub-events-map-card .btn {
    min-height: 2.5rem;
  }
  .hub-events-page .hub-events-camera-picks {
    width: 100%;
  }
  .hub-events-page .hub-events-camera-picks .btn {
    min-height: 2.5rem;
    flex: 1 1 8rem;
  }
  .hub-events-page .hub-events-card-thumb {
    height: 10.5rem;
  }
  .hub-events-page #hub-events-feed.is-grid {
    grid-template-columns: 1fr;
  }
  .hub-events-page .hub-events-chart-axis {
    font-size: 0.72rem;
  }
  .hub-events-page .hub-library-playback-head,
  .hub-events-page .hub-library-playback-head-actions {
    flex-wrap: wrap;
    width: 100%;
  }
}
@media (max-width: 640px) {
  .hub-events-page .hub-events-hour-label {
    display: none;
  }
  .hub-events-page .hub-events-lane {
    grid-template-columns: 1fr;
  }
  .hub-events-page .hub-events-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.hub-analytics-history-table {
  margin: 0;
}
.hub-analytics-history-table tbody tr:last-child td {
  border-bottom: none;
}
.hub-analytics-col-thumb {
  width: 5.5rem;
}
.hub-analytics-td-thumb {
  width: 5.5rem;
  padding: 0.35rem 0.45rem !important;
  vertical-align: middle;
}
.hub-analytics-event-thumb {
  display: block;
  width: 4.75rem;
  height: 2.65rem;
  object-fit: cover;
  border-radius: 4px;
  background: color-mix(in srgb, var(--border, #333) 55%, transparent);
  border: 1px solid var(--border, #333);
}
.hub-analytics-event-thumb--empty {
  opacity: 0.35;
}
.hub-analytics-event-row {
  cursor: pointer;
}
.hub-analytics-event-row:hover td {
  background: color-mix(in srgb, var(--accent, #5b9cf5) 10%, transparent);
}
.hub-analytics-event-row:focus-visible {
  outline: 2px solid var(--accent, #5b9cf5);
  outline-offset: -2px;
}
.hub-analytics-event-row--disabled {
  cursor: default;
  opacity: 0.72;
}
.hub-analytics-seg {
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hub-analytics-playback-dock {
  margin: 0.75rem 0 1.25rem;
}
.session-scrub-ticks--analysis {
  position: relative;
  height: 0.7rem;
  margin-bottom: 0.15rem;
  pointer-events: auto;
}
.session-analysis-tick {
  position: absolute;
  top: 0;
  bottom: 0.1rem;
  width: 3px;
  margin-left: -1.5px;
  border: 0;
  padding: 0;
  border-radius: 2px;
  cursor: pointer;
  z-index: 2;
  opacity: 0.92;
}
.session-analysis-tick--span {
  width: auto;
  min-width: 3px;
  margin-left: 0;
  opacity: 0.72;
}
.session-analysis-tick:hover,
.session-analysis-tick--active {
  width: 4px;
  margin-left: -2px;
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}
.analysis-overlay-canvas {
  pointer-events: none;
}
.hub-analytics-row--highlight td {
  background: color-mix(in srgb, var(--accent, #5b9cf5) 18%, transparent);
}
.hub-analytics-empty {
  padding: 1.25rem 1rem !important;
}
.hub-analytics-type {
  font-weight: 650;
}
.hub-analytics-type--motion {
  color: var(--accent, #5b9cf5);
}
.hub-analytics-type--scene_change {
  color: var(--ok, #3d9a55);
}
.hub-analytics-type--object {
  color: var(--sentri-accent, #7dd3a0);
}

.hub-studio {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.35rem;
}
.hub-studio-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
}
.hub-studio-toolbar .hub-field {
  min-width: 10rem;
}
.hub-studio-toolbar #hub-studio-edit {
  margin-left: auto;
}
.hub-studio-source {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg2, #12161e);
}
.hub-studio-source-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}
.hub-studio-source-btn[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent, #5b9cf5) 18%, transparent);
  color: var(--text);
}
.hub-studio-preview {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
}
.hub-studio-canvas-wrap {
  max-height: min(36rem, 62vh);
  overflow: auto;
  border: 1px solid var(--border, var(--sentri-border, #2a3340));
  border-radius: var(--radius, 0.75rem);
  padding: 0;
  background: var(--bg1, var(--surface, #14161f));
}
.hub-studio-canvas-wrap--loading {
  position: relative;
}
.hub-studio-canvas-wrap--loading::after {
  content: "";
  position: absolute;
  inset: 0.75rem;
  border-radius: 8px;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--muted, #8b95a8) 8%, transparent),
    color-mix(in srgb, var(--muted, #8b95a8) 18%, transparent),
    color-mix(in srgb, var(--muted, #8b95a8) 8%, transparent)
  );
  background-size: 200% 100%;
  animation: hub-studio-skel 1.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes hub-studio-skel {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.hub-studio-canvas-wrap--empty {
  min-height: 12rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hub-studio-canvas-wrap--empty .hub-studio-stage {
  min-height: 0;
}
.hub-studio-canvas-wrap--empty canvas {
  display: none;
}
.hub-studio-canvas-wrap--modal {
  max-height: min(28rem, 48vh);
}
.hub-studio-stage {
  position: relative;
  display: block;
  width: 100%;
  min-height: 12rem;
}
.hub-studio-stage img,
.hub-studio-stage canvas {
  display: block;
  max-width: 100%;
  height: auto;
}
.hub-studio-stage img[hidden] {
  display: none !important;
}
.hub-studio-stage canvas {
  position: absolute;
  left: 0;
  top: 0;
}
#hub-studio-overlay {
  pointer-events: none;
}
#hub-studio-modal-overlay {
  cursor: crosshair;
}
.hub-studio-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.hub-studio-legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.hub-studio-swatch {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 3px;
  border: 1px solid transparent;
}
.hub-studio-swatch--watch {
  background: rgba(80, 200, 120, 0.35);
  border-color: rgba(80, 200, 120, 0.95);
}
.hub-studio-swatch--ignore {
  background: rgba(220, 80, 80, 0.35);
  border-color: rgba(220, 80, 80, 0.95);
}
.hub-studio-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.55rem;
}
.hub-studio-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 650;
  border: 1px solid color-mix(in srgb, var(--muted, #8b95a8) 45%, var(--border));
  color: var(--muted, #8b95a8);
  background: color-mix(in srgb, var(--muted, #8b95a8) 8%, transparent);
}
.hub-studio-chip[data-on="1"] {
  color: var(--ok, var(--success, #3d9a55));
  background: color-mix(in srgb, var(--ok, var(--success, #3d9a55)) 14%, transparent);
  border-color: color-mix(in srgb, var(--ok, var(--success, #3d9a55)) 40%, var(--border));
}
.hub-studio-chip--neutral {
  color: var(--text);
  border-color: var(--border);
  background: color-mix(in srgb, var(--bg2, #1b1e2a) 80%, transparent);
}
.hub-studio-tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.hub-studio-tool[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent, #5b9cf5) 18%, transparent);
  border-color: color-mix(in srgb, var(--accent, #5b9cf5) 45%, var(--border));
  color: var(--text);
}
.hub-studio-zone-chips {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 9rem;
  overflow: auto;
  margin-top: 0.55rem;
}
.hub-studio-zone-chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg2, #12161e);
}
.hub-studio-zone-chip--watch {
  border-left: 3px solid rgba(80, 200, 120, 0.95);
}
.hub-studio-zone-chip--ignore {
  border-left: 3px solid rgba(220, 80, 80, 0.95);
}
.hub-studio-zone-chip--selected {
  outline: 1px solid var(--accent, #5b9cf5);
}
.hub-studio-zone-chip input[type="text"] {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
}
.hub-studio-kind {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.hub-studio-classes {
  border: 1px solid var(--sentri-border, #2a3340);
  border-radius: 0.5rem;
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0.75rem 0 0;
}
.hub-studio-classes .hub-settings-toggle-row {
  min-height: 0;
  padding: 0.55rem 0.7rem;
}
.hub-studio-extra {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.hub-studio-extra-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.8rem;
  cursor: pointer;
  background: var(--bg2, #12161e);
}
.hub-studio-extra-chip input {
  accent-color: var(--accent, #5b9cf5);
}
.hub-studio-extra-chip:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent, #5b9cf5) 50%, var(--border));
  background: color-mix(in srgb, var(--accent, #5b9cf5) 14%, transparent);
}
.hub-studio-slider {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.85rem 0 0;
}
.hub-studio-slider-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.88rem;
  font-weight: 600;
}
.hub-studio-slider-head strong {
  font-variant-numeric: tabular-nums;
  color: var(--accent, #5b9cf5);
}
.hub-studio-slider input[type="range"] {
  width: 100%;
  accent-color: var(--accent, #5b9cf5);
}
.hub-studio-slider-hints {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--muted);
}
.hub-studio-modal {
  z-index: 240;
  padding: 1rem;
}
.hub-studio-modal-panel {
  width: min(72rem, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  padding: 1.1rem 1.2rem 0.9rem;
}
.hub-studio-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.hub-studio-modal-head .settings-modal-title {
  margin-bottom: 0.2rem;
}
.hub-studio-modal-body {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.85fr);
  gap: 1rem;
  min-height: 0;
  flex: 1;
}
.hub-studio-modal-stage-col,
.hub-studio-inspector {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.hub-studio-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}
.hub-studio-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 650;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.hub-studio-tab[aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--accent, #5b9cf5);
}
.hub-studio-tab-panels {
  max-height: min(28rem, 52vh);
  overflow: auto;
  padding-right: 0.25rem;
}
.hub-studio-panel {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.hub-studio-panel[hidden] {
  display: none !important;
}
.hub-studio-modal-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.hub-studio-modal-foot-actions {
  margin-left: auto;
  display: flex;
  gap: 0.4rem;
}
@media (max-width: 900px) {
  .hub-studio-modal-body {
    grid-template-columns: 1fr;
  }
  .hub-studio-toolbar #hub-studio-edit {
    margin-left: 0;
  }
  .hub-studio-canvas-wrap,
  .hub-studio-canvas-wrap--modal,
  .hub-studio-tab-panels {
    max-height: min(22rem, 46vh);
  }
}
.hub-analytics-webhook-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.75rem 1rem;
  margin-bottom: 0.65rem;
}
.hub-analytics-webhook-scroll {
  max-height: min(14rem, 32vh);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 0.75rem;
}
@media (max-width: 720px) {
  .hub-analytics-history-scroll {
    max-height: min(20rem, 55vh);
  }
  .hub-analytics-rules-grid {
    grid-template-columns: 1fr;
  }
}

/* Status / uptime page */
.hub-status-page .card {
  margin-bottom: 1.25rem;
}
.hub-status-page .hub-lead {
  max-width: 42rem;
}
.hub-status-charts-head,
.hub-status-timeline-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.85rem;
}
.hub-status-charts-head h2,
.hub-status-timeline-head h2,
.hub-status-edges-card h2 {
  margin: 0 0 0.25rem;
}
.hub-status-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem 1.25rem;
}
.hub-status-chart-panel {
  min-width: 0;
}
.hub-status-chart-title {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
  font-weight: 650;
}
.hub-status-chart-hint {
  margin: 0 0 0.45rem;
  min-height: 1.2em;
}
.hub-status-chart-shell {
  min-height: 12rem;
}
.hub-status-chart-shell .telemetry-canvas {
  width: 100%;
  height: auto;
  display: block;
}
.hub-status-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.hub-status-table th,
.hub-status-table td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.hub-status-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: color-mix(in srgb, var(--card, #161922) 92%, #000);
  box-shadow: 0 1px 0 var(--border);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
}
.hub-status-state--online {
  color: var(--ok, #3d9a55);
  font-weight: 650;
}
.hub-status-state--offline {
  color: var(--danger, #e25555);
  font-weight: 650;
}
.hub-status-when {
  white-space: nowrap;
  min-width: 7.5rem;
}
.hub-status-when-rel {
  display: block;
  font-variant-numeric: tabular-nums;
}
.hub-status-when-abs {
  display: block;
  margin-top: 0.12rem;
  font-variant-numeric: tabular-nums;
}
/* Fixed-height scroll regions — never let long tables grow the page forever.
   Use .sentri-scroll-y (shared theme) for polished webkit + Firefox scrollbars. */
.hub-status-timeline-scroll {
  max-height: min(22rem, 48vh);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--card, #161922) 88%, #000);
}
.hub-status-edges-scroll {
  max-height: min(18rem, 40vh);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.hub-edge-archive-scroll {
  max-height: min(22rem, 50vh);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.hub-ingest-sync-act-scroll {
  max-height: min(16rem, 36vh);
  overflow: auto;
}
.hub-activity-detail-scroll {
  max-height: min(28rem, 55vh);
  overflow: auto;
  white-space: normal;
}
.hub-activity-sync-panel h3,
.hub-activity-sync-panel h4,
.hub-activity-subjects h3 {
  margin: 0.75rem 0 0.35rem;
  font-size: 0.95rem;
}
.hub-activity-install-log {
  max-height: min(16rem, 40vh);
  overflow: auto;
  margin-top: 0.5rem;
  white-space: pre-wrap;
}
.hub-edge-maint-log {
  max-height: min(28rem, 55vh);
}
.hub-installs-page {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.hub-installs-page > .card,
.hub-installs-board > .card {
  margin: 0;
}
.hub-installs-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 0.85rem;
  align-items: start;
}
.hub-installs-board.is-session {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
}
.hub-install-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.hub-install-card-head .hub-card-title {
  margin: 0;
}
.hub-install-card .sentri-updates-console {
  max-height: min(24rem, 42vh);
}
.hub-install-page-link {
  margin: 0.75rem 0 0;
}
.hub-installs-dock {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  z-index: 40;
  max-width: calc(100% - 2rem);
}
.hub-activity-outcomes {
  margin: 0.25rem 0 0.75rem;
  padding-left: 1.1rem;
}
.hub-maintenance-page {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.hub-maintenance-page > .card,
.hub-maintenance-page > section.card,
.hub-maintenance-page > form {
  margin: 0;
}

.hub-maint-result {
  max-height: min(16rem, 36vh);
  overflow: auto;
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: color-mix(in srgb, var(--card, #161922) 88%, #000);
  border-radius: 8px;
}
.hub-maint-params .field {
  margin-top: 0.75rem;
}
.hub-edge-archive-id {
  font-size: 0.78rem;
  word-break: break-all;
}
.hub-status-timeline-table {
  margin: 0;
}
.hub-status-timeline-table tbody tr:last-child td {
  border-bottom: none;
}
.hub-status-event-row:hover td {
  background: color-mix(in srgb, var(--accent, #5b9cf5) 8%, transparent);
}
@media (max-width: 720px) {
  .hub-status-timeline-scroll {
    max-height: min(18rem, 55vh);
  }
  .hub-status-charts-grid {
    grid-template-columns: 1fr;
  }
}

/* Fleet edge detail (/fleet/<id>/) */
.hub-edge-detail {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hub-edge-detail-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.25rem;
  padding: 0.25rem 0 0.35rem;
}

.hub-edge-detail-hero-main {
  min-width: 0;
  flex: 1 1 16rem;
}

.hub-edge-detail-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
}

.hub-edge-detail-title-row h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2.5vw, 1.85rem);
  line-height: 1.2;
}

.hub-edge-detail-meta {
  margin: 0.45rem 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.4rem;
}

.hub-edge-detail-sep {
  color: var(--muted);
}

.hub-edge-detail-url {
  word-break: break-all;
}

.hub-edge-detail-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.hub-edge-detail-banner {
  margin: 0;
}

.hub-edge-detail-glance {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: 0.75rem;
}

.hub-edge-glance-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  margin: 0;
}

.hub-edge-glance-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.hub-edge-glance-value {
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.hub-edge-detail-panel {
  margin: 0;
  padding: 1rem 1.1rem 1.15rem;
}

.hub-edge-detail-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.65rem;
}

.hub-edge-detail-panel-head .hub-card-title {
  margin: 0;
}

.hub-edge-panel-lead {
  margin: 0 0 0.75rem;
}

.hub-edge-ops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.65rem;
}

.hub-edge-ops-link {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg2);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}

.hub-edge-ops-link:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--bg2));
  text-decoration: none;
  color: var(--text);
}

.hub-edge-ops-link i {
  margin-top: 0.15rem;
  color: var(--accent);
  width: 1.1rem;
  text-align: center;
}

.hub-edge-ops-link span {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.hub-edge-ops-link--lan {
  opacity: 0.92;
}

.hub-edge-updates-row {
  align-items: flex-end;
}

.hub-field--inline {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 10rem;
}

.hub-edge-danger-panel {
  border-color: color-mix(in srgb, #e85d4a 35%, var(--border));
}

.hub-edge-danger-panel .hub-card-title {
  color: #ffb4a8;
}

@media (max-width: 640px) {
  .hub-edge-detail-hero-actions {
    width: 100%;
  }

  .hub-edge-detail-hero-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .hub-edge-detail-glance {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================================
   Ingest v2 — monitoring dashboard (2.21.82 redesign)
   ============================================================ */

.hub-ingest-v2 .hub-ingest-status-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.25rem 0 0.75rem;
}

.hub-ingest-freshness {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  border: 1px solid var(--sentri-border);
  color: var(--sentri-muted);
}

.hub-ingest-freshness[data-state="fresh"] {
  color: var(--sentri-success);
  border-color: color-mix(in srgb, var(--sentri-success) 45%, transparent);
}

.hub-ingest-freshness[data-state="stale"] {
  color: var(--sentri-warn);
  border-color: color-mix(in srgb, var(--sentri-warn) 45%, transparent);
}

/* --- hero ---------------------------------------------------- */

.hub-ingest-hero {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.1rem 1.25rem;
  background:
    radial-gradient(1200px 300px at 10% -40%, color-mix(in srgb, var(--sentri-accent) 14%, transparent), transparent),
    var(--sentri-bg1);
}

.hub-ingest-hero-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.hub-ingest-hero-state {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 240px;
  max-width: 46ch;
}

.hub-ingest-state-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: fit-content;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--sentri-border);
  background: var(--sentri-bg2);
  color: var(--sentri-muted);
}

.hub-ingest-state-pill::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: currentcolor;
}

.hub-ingest-state-pill[data-state="ok"],
.hub-ingest-state-pill[data-state="ok-live"] {
  color: var(--sentri-success);
  border-color: color-mix(in srgb, var(--sentri-success) 45%, transparent);
  background: color-mix(in srgb, var(--sentri-success) 10%, var(--sentri-bg2));
}

.hub-ingest-state-pill[data-state="ok-live"]::before {
  animation: hub-ingest-pulse 1.6s ease-in-out infinite;
}

.hub-ingest-hero .hub-ingest-state-pill[data-state="ok"]::before {
  animation: hub-ingest-pulse 1.6s ease-in-out infinite;
}

.hub-ingest-state-pill[data-state="warn"] {
  color: var(--sentri-warn);
  border-color: color-mix(in srgb, var(--sentri-warn) 45%, transparent);
  background: color-mix(in srgb, var(--sentri-warn) 10%, var(--sentri-bg2));
}

.hub-ingest-state-pill[data-state="bad"] {
  color: var(--sentri-danger);
  border-color: color-mix(in srgb, var(--sentri-danger) 45%, transparent);
  background: color-mix(in srgb, var(--sentri-danger) 12%, var(--sentri-bg2));
}

@keyframes hub-ingest-pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.35;
  }
}

.hub-ingest-state-reason {
  margin: 0;
}

.hub-ingest-hero-rate-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  text-align: right;
}

.hub-ingest-hero-rate {
  font-size: 2.2rem;
  font-weight: 750;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  color: var(--sentri-text);
}

.hub-ingest-hero-rate-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sentri-muted);
}

.hub-ingest-hero-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.6rem;
}

.hub-ingest-kpi {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--sentri-border);
  background: color-mix(in srgb, var(--sentri-bg2) 70%, transparent);
}

.hub-ingest-kpi-n {
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.hub-ingest-kpi-l {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sentri-muted);
}

.hub-ingest-kpi[hidden],
.hub-ingest-tls-chip[hidden] {
  display: none;
}

.hub-ingest-kpi--missed {
  border-color: color-mix(in srgb, var(--sentri-danger) 55%, transparent);
}

.hub-ingest-kpi--missed .hub-ingest-kpi-n,
.hub-ingest-kpi--missed .hub-ingest-kpi-l {
  color: var(--sentri-danger);
}

.hub-ingest-hero-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.hub-ingest-archive-line {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  flex: 1 1 100%;
  min-width: 0;
  width: 100%;
}

.hub-ingest-archive-line .hub-ingest-bar {
  display: block;
  width: 100%;
  max-width: none;
  flex: none;
}

.hub-ingest-tls-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--sentri-border);
  background: var(--sentri-bg2);
  color: var(--sentri-success);
}

.hub-ingest-tls-chip[data-state="bad"] {
  color: var(--sentri-danger);
  border-color: color-mix(in srgb, var(--sentri-danger) 55%, transparent);
}

/* --- shared bars --------------------------------------------- */

.hub-ingest-bar {
  display: block;
  width: 100%;
  max-width: none;
  flex: none;
  height: 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--sentri-border) 60%, transparent);
  overflow: hidden;
}

.hub-ingest-bar--slim {
  height: 5px;
}

.hub-ingest-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--sentri-accent);
  transition: width 0.4s ease;
}

.hub-ingest-bar-fill--warn {
  background: linear-gradient(90deg, var(--sentri-warn), var(--sentri-danger));
}

.hub-ingest-edge-lane--backfill {
  border-color: color-mix(in srgb, var(--hub-accent, #5b9cf5) 35%, var(--sentri-border));
}

.hub-ingest-edge-lane--active {
  border-color: color-mix(in srgb, var(--sentri-success) 55%, var(--sentri-border));
  background: color-mix(in srgb, var(--sentri-success) 8%, var(--sentri-bg2));
}

.hub-ingest-lane-active {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sentri-success);
}

/* --- edge cards ------------------------------------------------ */

.hub-ingest-edges-section {
  margin: 1rem 0;
}

.hub-ingest-edges-section .hub-ingest-section-head {
  margin-bottom: 0.6rem;
}

.hub-ingest-edge-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 0.9rem;
}

.hub-ingest-edge-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem 1.1rem;
  border-top: 3px solid var(--sentri-border);
}

.hub-ingest-edge-card[data-state="ok"] {
  border-top-color: var(--sentri-success);
}

.hub-ingest-edge-card[data-state="warn"] {
  border-top-color: var(--sentri-warn);
}

.hub-ingest-edge-card[data-state="bad"] {
  border-top-color: var(--sentri-danger);
}

.hub-ingest-edge-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.hub-ingest-edge-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.hub-ingest-edge-head p {
  margin: 0.1rem 0 0;
}

.hub-ingest-edge-card .hub-ingest-state-pill {
  font-size: 0.72rem;
  padding: 0.2rem 0.6rem;
  flex-shrink: 0;
}

.hub-ingest-edge-reason {
  margin: -0.25rem 0 0;
}

.hub-ingest-edge-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.hub-ingest-edge-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.hub-ingest-edge-row-head span {
  color: var(--sentri-muted);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}

.hub-ingest-edge-sub {
  margin: 0;
}

.hub-ingest-edge-missed {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--sentri-danger);
  border: 1px solid color-mix(in srgb, var(--sentri-danger) 45%, transparent);
  background: color-mix(in srgb, var(--sentri-danger) 8%, transparent);
}

.hub-ingest-edge-lanes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.hub-ingest-edge-lane {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--sentri-border);
  background: color-mix(in srgb, var(--sentri-bg2) 70%, transparent);
}

.hub-ingest-lane-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sentri-muted);
}

.hub-ingest-edge-rate {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.hub-ingest-rate-now {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.hub-ingest-edge-error {
  margin: 0;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--sentri-warn) 12%, var(--sentri-bg1));
  border: 1px solid color-mix(in srgb, var(--sentri-warn) 40%, transparent);
  color: var(--sentri-text);
  max-width: none;
  white-space: normal;
  overflow: visible;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.hub-ingest-edge-error-title {
  display: block;
  font-weight: 700;
  color: var(--sentri-warn);
  margin-bottom: 0.25rem;
}

.hub-ingest-edge-error-body {
  display: block;
  font-size: 0.85rem;
  max-height: 6.5rem;
  overflow: auto;
}

.hub-ingest-edge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
}

.hub-ingest-edge-actions .hub-ingest-alert-actions {
  min-width: 0;
}

/* --- transfer history ------------------------------------------ */

.hub-ingest-history-card {
  margin: 1rem 0;
}

.hub-ingest-history-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.hub-ingest-history-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.hub-ingest-v2.is-receiving .hub-ingest-hero-rate {
  color: var(--sentri-success);
  text-shadow: 0 0 24px color-mix(in srgb, var(--sentri-success) 45%, transparent);
}

.hub-ingest-window-pills {
  display: inline-flex;
  flex-wrap: wrap;
  border: 1px solid var(--sentri-border);
  border-radius: 999px;
  overflow: hidden;
  max-width: 100%;
}

.transfer-rate-tooltip {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  font-size: 0.78rem;
  line-height: 1.35;
  background: color-mix(in srgb, var(--sentri-bg0) 92%, transparent);
  border: 1px solid var(--sentri-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  min-width: 140px;
}

.hub-ingest-feed-search,
#hub-ingest-feed-search {
  min-width: 160px;
}

.hub-ingest-window-pill {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--sentri-muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.32rem 0.8rem;
  cursor: pointer;
}

.hub-ingest-window-pill + .hub-ingest-window-pill {
  border-left: 1px solid var(--sentri-border);
}

.hub-ingest-window-pill.is-active {
  background: var(--sentri-accent);
  color: #fff;
}

.hub-ingest-lane-select {
  max-width: 150px;
}

.hub-ingest-history-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 0.5rem 0;
}

/* --- events feed ------------------------------------------------ */

.hub-ingest-feed-card {
  margin: 1rem 0;
}

.hub-ingest-feed-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.hub-ingest-feed-filters {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.hub-ingest-feed-filters .hub-input {
  max-width: 190px;
}

.hub-ingest-feed-scroll {
  max-height: 460px;
}

.hub-ingest-feed-table th[data-sort] {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.hub-ingest-feed-table th[data-sort]:hover {
  color: var(--sentri-text);
}

.hub-ingest-feed-table th.is-sorted-asc::after {
  content: " ▲";
  font-size: 0.7em;
}

.hub-ingest-feed-table th.is-sorted-desc::after {
  content: " ▼";
  font-size: 0.7em;
}

.hub-ingest-feed-row {
  cursor: pointer;
}

.hub-ingest-feed-row:hover td {
  background: color-mix(in srgb, var(--sentri-accent) 8%, transparent);
}

.hub-ingest-feed-row:focus-visible td {
  background: color-mix(in srgb, var(--sentri-accent) 14%, transparent);
  outline: none;
}

.hub-ingest-feed-icon {
  color: var(--sentri-muted);
  margin-right: 0.25rem;
}

.hub-ingest-feed-title {
  max-width: 34ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-ingest-feed-rejected {
  color: var(--sentri-danger);
  font-size: 0.8em;
}

.hub-ingest-feed-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--sentri-border);
  color: var(--sentri-muted);
  white-space: nowrap;
}

.hub-ingest-feed-status[data-state="ok"] {
  color: var(--sentri-success);
  border-color: color-mix(in srgb, var(--sentri-success) 45%, transparent);
}

.hub-ingest-feed-status[data-state="ok-live"] {
  color: var(--sentri-accent);
  border-color: color-mix(in srgb, var(--sentri-accent) 45%, transparent);
}

.hub-ingest-feed-status[data-state="warn"] {
  color: var(--sentri-warn);
  border-color: color-mix(in srgb, var(--sentri-warn) 45%, transparent);
}

.hub-ingest-feed-status[data-state="bad"] {
  color: var(--sentri-danger);
  border-color: color-mix(in srgb, var(--sentri-danger) 45%, transparent);
}

/* --- job modal --------------------------------------------------- */

.hub-ingest-job-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.5rem;
}

.hub-ingest-job-cell {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--sentri-border);
  background: color-mix(in srgb, var(--sentri-bg2) 70%, transparent);
}

.hub-ingest-job-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sentri-muted);
}

.hub-ingest-job-value {
  font-size: 0.9rem;
  font-weight: 600;
}

.hub-ingest-job-events td {
  font-size: 0.84rem;
  white-space: nowrap;
}

.hub-ingest-job-events td.mono {
  white-space: normal;
  word-break: break-all;
  max-width: 32ch;
}

/* --- misc -------------------------------------------------------- */

.hub-ingest-edge-card--skeleton {
  min-height: 220px;
}

@media (max-width: 720px) {
  .hub-ingest-hero-main {
    flex-direction: column;
    align-items: stretch;
  }

  .hub-ingest-hero-rate-block {
    align-items: flex-start;
    text-align: left;
  }

  .hub-ingest-edge-lanes {
    grid-template-columns: 1fr;
  }

  .hub-ingest-hero-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hub-ingest-hero-state {
    min-width: 0;
  }
}

/* —— Phone / Samsung pass (portrait + coarse pointer + landscape) —— */

@media (max-width: 720px) {
  .hub-page-head h1 {
    font-size: 1.35rem;
  }

  .hub-lead {
    font-size: 0.9rem;
  }

  .hub-live-card-stream-meta {
    font-size: 0.62rem;
  }

  .hub-live-layout-start {
    flex-wrap: wrap;
    overflow-x: visible;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.1rem;
  }

  .hub-live-wall-actions {
    flex: 1 1 100%;
    width: 100%;
    justify-content: stretch;
  }

  .hub-live-wall-actions .btn {
    flex: 1 1 calc(33.33% - 0.4rem);
    justify-content: center;
    min-width: 0;
  }

  .hub-live-layout-btn,
  .hub-live-wall-actions .btn,
  .nav-toggle {
    min-height: 2.5rem;
  }

  .hub-footer .site-footer-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.65rem;
  }
}

@media (max-width: 430px) {
  .hub-live-tile-badge-text {
    display: none;
  }

  .hub-live-tile-badge {
    padding: 0.28rem;
    min-width: 1.7rem;
    min-height: 1.7rem;
    justify-content: center;
  }

  .hub-live-card-stream-meta {
    display: none;
  }
}

/* Wall mosaic: no hover on phones — keep camera/rec pills and live chrome usable. */
@media (hover: none), (pointer: coarse) {
  .hub-live-drag-handle {
    display: none;
  }

  .hub-op-toggles--compact .hub-op-toggle {
    min-height: 2.4rem;
    min-width: 2.4rem;
    padding: 0.3rem 0.4rem;
  }

  .hub-live-grid--layout-wall .hub-edge-controls-slot,
  .hub-live-grid--layout-wall .hub-edge-controls,
  .hub-live-grid--layout-wall .hub-edge-controls-slot--inline {
    opacity: 1;
    pointer-events: auto;
  }

  .hub-live-grid--layout-wall .hub-live-stage--chrome-host .live-chrome {
    opacity: 1;
  }

  .hub-live-grid--layout-wall .hub-live-tile-badges {
    display: none;
  }

  .hub-live-hchip {
    min-height: 2.25rem;
    min-width: 2.25rem;
  }
}

@media (max-width: 920px) and (orientation: landscape) {
  .hub-top.top {
    padding-top: calc(0.4rem + env(safe-area-inset-top, 0px));
    padding-bottom: 0.4rem;
  }

  .hub-page-head {
    margin-bottom: 0.65rem;
    gap: 0.5rem;
  }

  .hub-page-head h1 {
    font-size: 1.2rem;
    margin-bottom: 0.15rem;
  }

  .hub-lead,
  .hub-live-hero .hub-live-eyebrow {
    display: none;
  }

  .hub-live-hero {
    margin-bottom: 0.45rem;
    padding-bottom: 0.45rem;
  }

  .hub-live-page:not(.hub-live-page--wall) {
    min-height: 0;
  }

  .hub-ingest-hero {
    padding: 0.7rem 0.85rem;
    gap: 0.5rem;
  }

  .hub-card-title {
    margin-bottom: 0.55rem;
  }
}
