/*
 * CloudControl UI foundation
 *
 * This file owns the application shell and shared visual primitives. Feature-
 * specific workspaces remain in style.css; keeping this layer separate prevents
 * another redesign pass from being mixed into the operational CSS.
 */

:root {
  --cc-accent: #087f89;
  --cc-accent-hover: #066a73;
  --cc-accent-soft: #e6f5f5;
  --cc-accent-ring: rgba(8, 127, 137, 0.2);
  --cc-page: #f3f6f7;
  --cc-surface: #ffffff;
  --cc-surface-subtle: #f8fafb;
  --cc-sidebar: #10262d;
  --cc-sidebar-deep: #0b1c22;
  --cc-sidebar-text: #d8e7ea;
  --cc-sidebar-muted: #8facb2;
  --cc-text: #17272d;
  --cc-text-soft: #40545c;
  --cc-muted: #60737b;
  --cc-border: #d7e0e4;
  --cc-border-strong: #c3d0d5;
  --cc-success: #087f5b;
  --cc-warning: #946008;
  --cc-danger: #c73753;
  --cc-radius-sm: 7px;
  --cc-radius: 10px;
  --cc-radius-lg: 14px;
  --cc-shadow-sm: 0 1px 2px rgba(16, 38, 45, 0.05);
  --cc-shadow-md: 0 12px 32px rgba(16, 38, 45, 0.1);

  /* Keep legacy feature styles on the same accessible foundation. */
  --accent: var(--cc-accent);
  --accent-strong: var(--cc-accent-hover);
  --accent-soft: var(--cc-accent-soft);
  --page: var(--cc-page);
  --panel: var(--cc-surface);
  --text: var(--cc-text);
  --muted: var(--cc-muted);
  --border: var(--cc-border);
  --border-dark: var(--cc-border-strong);
  --success: var(--cc-success);
  --warning: var(--cc-warning);
  --danger: var(--cc-danger);
  --ink: var(--cc-text);
  --warn: var(--cc-warning);
  --bg: var(--cc-surface);
  --fg: var(--cc-text);
  --shadow: var(--cc-shadow-md);
  --gl-color-bg-surface1: var(--cc-surface);
  --gl-color-bg-sidebar2: var(--cc-page);
  --gl-color-bg-page1: var(--cc-surface-subtle);
  --gl-color-brand-primary: var(--cc-accent);
  --gl-color-brand-background: var(--cc-accent-soft);
  --gl-color-text-level1: var(--cc-text);
  --gl-color-text-level2: var(--cc-text-soft);
  --gl-color-text-level3: var(--cc-muted);
  --gl-color-line-divider-primary: var(--cc-border);
}

html {
  min-width: 320px;
  background: var(--cc-page);
  scrollbar-color: #aebfc5 transparent;
}

body {
  min-width: 320px;
  background: var(--cc-page);
  color: var(--cc-text);
  font-size: 14px;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: #bde8e8;
  color: #10262d;
}

a,
button,
input,
select,
textarea,
summary {
  -webkit-tap-highlight-color: transparent;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--cc-accent-ring);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 400;
  top: 10px;
  left: 12px;
  transform: translateY(-160%);
  border-radius: var(--cc-radius-sm);
  background: var(--cc-sidebar);
  box-shadow: var(--cc-shadow-md);
  color: #fff;
  padding: 9px 13px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 150ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Application shell */

.app-shell {
  --cc-sidebar-width: 240px;
  display: grid;
  grid-template-columns: var(--cc-sidebar-width) minmax(0, 1fr);
  min-width: 0;
  background: var(--cc-page);
  transition: grid-template-columns 160ms ease;
}

/* Primary nav (Dashboard / Fleet / …) — the main app panel */
.app-shell.sidebar-collapsed {
  --cc-sidebar-width: 72px;
  grid-template-columns: 72px minmax(0, 1fr) !important;
  min-width: 0 !important;
}

.sidebar {
  z-index: 50;
  width: 100%;
  max-width: var(--cc-sidebar-width, 240px);
  height: 100dvh;
  overflow: hidden;
  border-right: 0;
  background:
    radial-gradient(circle at 12% 4%, rgba(35, 184, 190, 0.12), transparent 24%),
    linear-gradient(180deg, var(--cc-sidebar), var(--cc-sidebar-deep));
  color: var(--cc-sidebar-text);
  padding: 0;
  transition: max-width 160ms ease;
}

.app-shell.sidebar-collapsed .sidebar {
  width: 72px !important;
  max-width: 72px !important;
  min-width: 72px !important;
}

.app-shell.sidebar-collapsed .sidebar-brand-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 4px;
}

.app-shell.sidebar-collapsed .sidebar .brand {
  display: flex;
  flex: 0 0 auto;
  justify-content: center;
  align-items: center;
  gap: 0;
  min-height: 0;
  border-bottom: 0;
  padding: 0 !important;
}

.app-shell.sidebar-collapsed .sidebar .brand-copy,
.app-shell.sidebar-collapsed .sidebar .brand strong,
.app-shell.sidebar-collapsed .sidebar .brand small {
  display: none !important;
}

.app-shell.sidebar-collapsed .sidebar-brand-row .sidebar-rail-toggle {
  flex: 0 0 auto;
  width: 22px;
  height: 28px;
}

.app-shell.sidebar-collapsed .sidebar .nav {
  padding: 10px 6px !important;
  justify-items: center;
}

.app-shell.sidebar-collapsed .sidebar .nav summary,
.app-shell.sidebar-collapsed .sidebar .nav a {
  display: flex !important;
  justify-content: center;
  align-items: center;
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  margin: 0 auto;
  padding: 0 !important;
  gap: 0 !important;
}

.app-shell.sidebar-collapsed .sidebar .nav-label,
.app-shell.sidebar-collapsed .sidebar .nav summary::after,
.app-shell.sidebar-collapsed .sidebar .nav summary::-webkit-details-marker {
  display: none !important;
}

.app-shell.sidebar-collapsed .sidebar .nav-tree-panel-inner {
  padding-left: 0 !important;
}

.app-shell.sidebar-collapsed .sidebar .nav-tree-panel-inner a {
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  justify-content: center;
  padding: 0 !important;
}

.app-shell.sidebar-collapsed .sidebar-footer {
  padding: 10px 6px 12px !important;
  justify-items: center;
  gap: 8px;
}

.app-shell.sidebar-collapsed .sidebar-status #service-state,
.app-shell.sidebar-collapsed .sidebar-logout-label {
  display: none !important;
}

.app-shell.sidebar-collapsed .sidebar-status {
  justify-content: center;
  width: 100%;
}

.app-shell.sidebar-collapsed .button.sidebar-logout {
  width: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  padding: 0 !important;
}

.app-shell.sidebar-collapsed .sidebar-rail-toggle-icon {
  transform: scaleX(-1);
}

.sidebar-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 68px;
  border-bottom: 1px solid rgba(216, 231, 234, 0.1);
  padding: 10px 10px 10px 12px;
}

.sidebar .brand {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  border-bottom: 0;
  padding: 2px 4px;
  color: #fff;
  text-decoration: none;
}

.sidebar .brand:hover {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
}

.sidebar .brand-copy {
  min-width: 0;
}

.sidebar .brand strong {
  display: block;
  color: #fff;
  font-size: 15px;
  font-weight: 720;
  letter-spacing: -0.01em;
}

.sidebar .brand small {
  display: block;
  color: var(--cc-sidebar-muted);
  font-size: 11px;
}

.sidebar-brand-row .sidebar-rail-toggle {
  flex: 0 0 auto;
}

.sidebar .brand-mark {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(100, 226, 222, 0.38);
  border-radius: 9px;
  background: linear-gradient(145deg, rgba(72, 206, 207, 0.23), rgba(72, 206, 207, 0.05));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: #8ce4e0;
  font-size: 11px;
}

.sidebar .nav {
  display: grid;
  align-content: start;
  gap: 3px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 12px;
  scrollbar-color: rgba(216, 231, 234, 0.22) transparent;
}

.sidebar .nav details {
  min-width: 0;
}

.sidebar .nav summary,
.sidebar .nav a {
  width: auto;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  margin: 0;
  padding: 0 12px;
  color: #b9cdd1;
  font-size: 13px;
  font-weight: 560;
  transition: color 140ms ease, background 140ms ease, transform 140ms ease;
}

.sidebar .nav > a {
  padding-left: 12px;
}

.sidebar .nav summary:hover,
.sidebar .nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.sidebar .nav summary:focus-visible,
.sidebar .nav a:focus-visible {
  outline-color: rgba(99, 223, 217, 0.38);
}

.sidebar .nav summary::after {
  width: 6px;
  height: 6px;
  border-width: 0 1.5px 1.5px 0;
  opacity: 0.7;
}

.sidebar .nav-tree-panel-inner {
  display: grid;
  gap: 2px;
  margin: 4px 0 7px 20px;
  border-left: 1px solid rgba(216, 231, 234, 0.12);
  padding: 0 0 0 8px;
}

.sidebar .nav-tree-panel-inner a {
  min-height: 36px;
  padding: 0 10px;
  color: #9fb7bc;
  font-size: 12.5px;
}

.sidebar .nav a.active {
  background: rgba(65, 199, 200, 0.15);
  box-shadow: inset 3px 0 0 #56d7d3;
  color: #f4ffff;
}

.sidebar .nav-icon {
  width: 17px;
  height: 17px;
  opacity: 0.82;
  stroke-width: 1.8;
}

.sidebar .nav a.active .nav-icon {
  color: #79e1dd;
  opacity: 1;
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  min-height: auto;
  border-top: 1px solid rgba(216, 231, 234, 0.1);
  margin: 0;
  padding: 12px 12px 14px;
  color: var(--cc-sidebar-muted);
  font-size: 12px;
}

.sidebar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sidebar .live-dot {
  background: #617a80;
}

.sidebar .live-dot.online {
  background: #32c995;
  box-shadow: 0 0 0 4px rgba(50, 201, 149, 0.12);
}

/* Quiet panel-collapse control — icon only, matches dark rail */
.sidebar-rail-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  color: rgba(201, 218, 221, 0.72);
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}

.sidebar-rail-toggle:hover {
  border-color: rgba(216, 231, 234, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #f4ffff;
}

.sidebar-rail-toggle:focus-visible {
  outline: 2px solid rgba(99, 223, 217, 0.45);
  outline-offset: 1px;
}

.sidebar-rail-toggle-icon {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 160ms ease;
}

.button.sidebar-logout {
  width: 100%;
  min-height: 34px;
  border-color: rgba(216, 231, 234, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: #c9dadd;
  font-size: 12px;
}

.button.sidebar-logout:hover {
  border-color: rgba(216, 231, 234, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.workspace {
  min-width: 0;
  background: var(--cc-page);
}

.workspace-topbar {
  grid-template-columns: minmax(260px, 680px) minmax(140px, 1fr) auto;
  gap: 14px;
  min-height: 64px;
  border-bottom: 1px solid rgba(195, 208, 213, 0.8);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 0 rgba(16, 38, 45, 0.02);
  padding: 11px 24px;
  backdrop-filter: blur(14px);
}

.device-list-mode .workspace-topbar,
.edge-list-mode .workspace-topbar,
.edge-focus-mode .workspace-topbar {
  grid-template-columns: minmax(0, 1fr) auto;
}

.device-list-mode .topbar-search,
.edge-list-mode .topbar-search,
.edge-focus-mode .topbar-search {
  display: none;
}

.device-list-mode .notification-button,
.edge-list-mode .notification-button,
.edge-focus-mode .notification-button {
  grid-column: 2;
}

.mobile-nav-toggle,
.sidebar-scrim {
  display: none;
}

.topbar-search,
.search-box {
  min-height: 40px;
  border: 1px solid var(--cc-border);
  border-radius: 9px;
  background: var(--cc-surface-subtle);
  padding: 0 12px;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.topbar-search:hover,
.search-box:hover {
  border-color: var(--cc-border-strong);
  background: #fff;
}

.topbar-search:focus-within,
.search-box:focus-within {
  border-color: var(--cc-accent);
  background: #fff;
  box-shadow: 0 0 0 3px var(--cc-accent-ring);
}

.topbar-search input,
.search-box input {
  min-height: 36px;
  background: transparent;
  color: var(--cc-text);
  font-size: 13px;
}

.topbar-search input::placeholder,
.search-box input::placeholder {
  color: #7a8d94;
}

.topbar-stats {
  justify-self: end;
  gap: 6px;
  color: var(--cc-muted);
}

.topbar-stats span {
  border: 1px solid var(--cc-border);
  border-radius: 999px;
  background: var(--cc-surface-subtle);
  padding: 5px 9px;
  font-size: 11px;
}

.topbar-stats b {
  color: var(--cc-text);
  font-weight: 760;
}

.notification-button {
  width: 40px;
  min-height: 40px;
  border-color: var(--cc-border);
  border-radius: 9px;
  color: var(--cc-text-soft);
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.notification-button:hover {
  border-color: var(--cc-border-strong);
  background: var(--cc-surface-subtle);
  color: var(--cc-accent-hover);
}

.notification-button b {
  top: -7px;
  right: -7px;
  min-width: 19px;
  height: 19px;
  border: 2px solid #fff;
  border-radius: 10px;
  background: var(--cc-danger);
  font-size: 9px;
  line-height: 15px;
}

.view {
  width: min(100%, 1760px);
  margin: 0 auto;
  padding: 26px 28px 56px;
}

.view h1[tabindex="-1"]:focus {
  outline: none;
}

.view.device-detail-view {
  padding-top: 18px;
}

/* Page hierarchy */

h1,
h2,
h3 {
  color: var(--cc-text);
}

h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

h2 {
  font-size: 17px;
  font-weight: 660;
  letter-spacing: -0.012em;
}

h3 {
  font-size: 14px;
  font-weight: 650;
}

.page-head,
.device-titlebar {
  min-height: 0;
  margin: 0 0 14px;
}

.page-head {
  align-items: center;
  gap: 16px;
}

.page-head-main {
  min-width: 0;
}

.page-head-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 7px 10px;
}

.page-head-meta {
  color: var(--cc-muted);
  font-size: 11.5px;
  font-weight: 560;
}

.page-head-copy,
.device-titlebar p {
  max-width: 860px;
  margin-top: 5px;
  color: var(--cc-muted);
  font-size: 13.5px;
}

.eyebrow,
.breadcrumb {
  margin-bottom: 5px;
  color: var(--cc-accent-hover);
  font-size: 10.5px;
  font-weight: 720;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.devices-header {
  min-height: 44px;
  margin-bottom: 14px;
}

.devices-header h1 {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.devices-header-count {
  color: var(--cc-muted);
  font-size: 12px;
}

.panel-title {
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title h2 {
  line-height: 1.25;
}

.panel-title span,
.panel-title small {
  color: var(--cc-muted);
  font-size: 11px;
}

/* Shared controls */

input,
select,
textarea {
  min-height: 38px;
  border-color: var(--cc-border-strong);
  border-radius: var(--cc-radius-sm);
  color: var(--cc-text);
  padding-right: 11px;
  padding-left: 11px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

textarea {
  padding-top: 9px;
  padding-bottom: 9px;
  line-height: 1.45;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #aebfc5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--cc-accent);
  box-shadow: 0 0 0 3px var(--cc-accent-ring);
  outline: 0;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--cc-accent);
}

.button,
.action-menu summary {
  min-height: 38px;
  border-color: var(--cc-accent);
  border-radius: var(--cc-radius-sm);
  background: var(--cc-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  padding: 0 13px;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, color 140ms ease, transform 140ms ease;
}

.button:hover:not(:disabled),
.action-menu summary:hover {
  border-color: var(--cc-accent-hover);
  background: var(--cc-accent-hover);
  color: #fff;
}

.button:active:not(:disabled) {
  transform: translateY(1px);
}

.button.secondary,
button.secondary,
.action-menu summary.button.secondary {
  border-color: var(--cc-border-strong);
  background: #fff;
  color: var(--cc-text-soft);
}

.button.secondary:hover:not(:disabled),
button.secondary:hover:not(:disabled),
.action-menu summary.button.secondary:hover {
  border-color: #a8bbc1;
  background: var(--cc-surface-subtle);
  color: var(--cc-text);
}

.button.ghost,
button.ghost {
  color: var(--cc-text-soft);
}

.button.ghost:hover:not(:disabled),
button.ghost:hover:not(:disabled) {
  border-color: var(--cc-border);
  background: var(--cc-surface-subtle);
  color: var(--cc-text);
}

.button.danger,
button.danger {
  border-color: #e5a8b4;
  background: #fff;
  color: var(--cc-danger);
}

.button.danger:hover:not(:disabled),
button.danger:hover:not(:disabled) {
  border-color: var(--cc-danger);
  background: #fff4f6;
  color: #aa213e;
}

.compact-button,
.button.small {
  min-height: 30px;
  padding: 0 10px;
  font-size: 11.5px;
  font-weight: 650;
}

.button-row {
  align-items: center;
  gap: 8px;
}

/* Panels, summaries, and tables */

.console-grid {
  gap: 16px;
}

.console-panel,
.summary-cell,
.stat-box,
.wifi-card,
.device-titlebar,
.device-utilitybar,
.survey-filter-rail,
.goodcloud-device-hero,
.goodcloud-info-card,
.goodcloud-stat-panel {
  border-color: var(--cc-border);
  border-radius: var(--cc-radius);
  box-shadow: var(--cc-shadow-sm);
}

.console-grid > .console-panel:not(.table-panel),
.dashboard-fleet-grid > .console-panel:not(.table-panel),
.dashboard-secondary-grid > .console-panel:not(.table-panel) {
  padding: 18px;
}

.table-panel {
  overflow: hidden;
  border-radius: var(--cc-radius);
  padding: 0;
}

.table-panel > .panel-title,
.table-panel > .toolbar {
  padding: 14px 16px;
}

.table-panel .panel-title {
  border-bottom-color: var(--cc-border);
}

.table-panel > .panel-note,
.table-panel > .helper-text {
  min-height: 0;
  border-bottom: 1px solid var(--cc-border);
  margin: 0;
  padding: 9px 16px;
  background: var(--cc-surface-subtle);
  color: var(--cc-muted);
  font-size: 12px;
}

.summary-strip {
  gap: 12px;
  margin-bottom: 16px;
}

.summary-cell {
  position: relative;
  min-height: 108px;
  overflow: hidden;
  padding: 16px 17px;
  border-top-width: 1px;
}

.summary-cell::before {
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--cc-border-strong);
  content: "";
}

.summary-cell.good,
.summary-cell.warn,
.summary-cell.bad {
  border-top-color: var(--cc-border);
}

.summary-cell.good::before {
  background: var(--cc-success);
}

.summary-cell.warn::before {
  background: var(--cc-warning);
}

.summary-cell.bad::before {
  background: var(--cc-danger);
}

.summary-cell span,
.stat-box span {
  color: var(--cc-muted);
  font-size: 10.5px;
  font-weight: 720;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.summary-cell strong {
  margin: 8px 0 5px;
  color: var(--cc-text);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.summary-cell small,
.stat-box small {
  color: var(--cc-muted);
  font-size: 11.5px;
}

.stat-box {
  padding: 12px 13px;
  background: var(--cc-surface-subtle);
}

.dashboard-fleet-grid,
.dashboard-secondary-grid {
  gap: 16px;
  margin-bottom: 16px;
}

.attention-item {
  min-height: 42px;
  border-color: var(--cc-border);
  border-radius: var(--cc-radius-sm);
  padding: 9px 11px;
}

.attention-item.bad {
  border-top: 1px solid var(--cc-border);
  box-shadow: inset 3px 0 0 var(--cc-danger);
}

.attention-item:hover,
.attention-item:focus-visible {
  border-color: var(--cc-border-strong);
  background: var(--cc-surface-subtle);
  box-shadow: inset 3px 0 0 var(--cc-danger);
}

.survey-filter-rail {
  gap: 12px;
  padding: 11px 13px;
}

.survey-filter-rail > span {
  color: var(--cc-muted);
  font-size: 10px;
  letter-spacing: 0.07em;
}

.survey-filter-chip {
  min-height: 32px;
  border-color: var(--cc-border);
  background: var(--cc-surface-subtle);
  color: var(--cc-text-soft);
}

.survey-filter-chip:hover,
.survey-filter-chip:focus-visible,
.survey-filter-chip.active {
  border-color: #72bfc3;
  background: var(--cc-accent-soft);
  color: #12484d;
}

.toolbar {
  gap: 8px;
}

.toolbar.tight {
  border-bottom-color: var(--cc-border);
  background: var(--cc-surface-subtle);
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  container-type: inline-size;
  scrollbar-color: #b8c7cc transparent;
}

table {
  font-size: 12.5px;
}

th,
td {
  border-bottom-color: var(--cc-border);
  padding: 11px 13px;
}

th {
  height: 40px;
  background: var(--cc-surface-subtle);
  color: #4d626a;
  font-size: 10.5px;
  font-weight: 720;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

tbody tr {
  transition: background 120ms ease;
}

tbody tr:hover {
  background: #f8fbfb;
}

.priority-table .col-actions,
.device-fleet-table .device-col-actions,
.edge-fleet-table .edge-col-actions {
  position: sticky;
  right: 0;
  z-index: 1;
  background: #fff;
  white-space: nowrap;
}

.priority-table th.col-actions,
.device-fleet-table th.device-col-actions,
.edge-fleet-table th.edge-col-actions {
  z-index: 2;
  background: var(--cc-surface-subtle);
}

.priority-table tbody tr:hover .col-actions,
.device-fleet-table tbody tr:hover .device-col-actions,
.edge-fleet-table tbody tr:hover .edge-col-actions {
  background: #f8fbfb;
}

.table-footer {
  min-height: 44px;
  border-top: 0;
  background: var(--cc-surface-subtle);
  font-size: 11.5px;
}

.progressive-table-footer {
  border-top: 1px solid var(--cc-border);
  padding: 7px 13px;
}

.progressive-table-footer .button {
  margin-left: auto;
}

.table-link {
  color: var(--cc-accent-hover);
  font-weight: 650;
}

.empty-cell,
.empty {
  color: var(--cc-muted);
}

.status-badge {
  color: var(--cc-text-soft);
  font-size: 11.5px;
  font-weight: 620;
}

/* Health reasons use a body-level fixed tooltip (never clipped by list/table frames). */
.status-badge.has-reason,
.edge-detail-status.has-reason {
  cursor: help;
}

/* Stylish black hover — body-level, never clipped by panels/tables */
.cc-reason-tooltip {
  position: fixed;
  z-index: 400;
  max-width: min(420px, calc(100vw - 20px));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 12px;
  background: #0c0e10;
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.38),
    0 2px 0 rgba(255, 255, 255, 0.04) inset;
  color: #f3f4f5;
  font-size: 12.5px;
  font-weight: 550;
  line-height: 1.45;
  letter-spacing: 0.01em;
  white-space: pre-wrap;
  word-break: break-word;
  pointer-events: none;
}

.cc-reason-tooltip[hidden] {
  display: none !important;
}

/* Edge list: no decorative frame — table sits on the page surface */
.edge-list-surface {
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.edge-list-surface .table-wrap {
  overflow: visible;
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius);
  background: #fff;
}

.edge-list-surface .edge-fleet-table {
  width: 100%;
}

.edge-list-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  margin-top: 8px;
  color: var(--cc-muted);
  font-size: 12px;
}

.status-badge::before {
  width: 7px;
  height: 7px;
}

.status-badge.good {
  color: var(--cc-success);
}

.status-badge.warn {
  color: var(--cc-warning);
}

.status-badge.bad {
  color: var(--cc-danger);
}

/* Forms and secondary navigation */

.stack-form {
  gap: 13px;
}

.stack-form label,
.stack-form .check-group,
.filter-panel label {
  gap: 6px;
  color: var(--cc-text-soft);
  font-size: 11.5px;
  font-weight: 620;
}

.network-test-advanced {
  overflow: clip;
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius);
  background: var(--cc-surface-subtle);
}

.network-test-advanced > summary {
  position: relative;
  display: flex;
  min-height: 52px;
  align-items: center;
  cursor: pointer;
  list-style: none;
  padding: 9px 40px 9px 12px;
  color: var(--cc-text-soft);
}

.network-test-advanced > summary::-webkit-details-marker {
  display: none;
}

.network-test-advanced > summary::after {
  position: absolute;
  right: 15px;
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  border-right: 1.5px solid var(--cc-muted);
  border-bottom: 1.5px solid var(--cc-muted);
  content: "";
  transition: transform 150ms ease;
}

.network-test-advanced[open] > summary::after {
  transform: rotate(225deg) translate(-2px, -2px);
}

.network-test-advanced > summary:hover,
.network-test-advanced > summary:focus-visible {
  background: #f1f7f7;
  color: var(--cc-text);
}

.network-test-advanced > summary span {
  display: grid;
  gap: 2px;
}

.network-test-advanced > summary strong {
  font-size: 12px;
  font-weight: 680;
}

.network-test-advanced > summary small {
  color: var(--cc-muted);
  font-size: 10.5px;
  font-weight: 500;
}

.network-test-advanced-body {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--cc-border);
  background: #fff;
  padding: 13px;
}

.network-test-advanced-body textarea {
  min-height: 112px;
  font-size: 11px;
}

.check-list {
  gap: 5px;
  border-color: var(--cc-border);
  border-radius: var(--cc-radius-sm);
  background: var(--cc-surface-subtle);
  padding: 9px;
}

.check-row {
  color: var(--cc-text) !important;
  font-weight: 520 !important;
}

.selection-bar,
.filter-panel {
  border-color: var(--cc-border);
  border-radius: var(--cc-radius);
  background: #fff;
}

.log-layout {
  gap: 12px;
}

.log-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -8px 0 2px;
}

.log-nav a {
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--cc-muted);
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 620;
  text-decoration: none;
}

.log-nav a:hover {
  background: var(--cc-surface-subtle);
  color: var(--cc-text);
}

.log-nav a.active {
  border-color: #a9d7d9;
  background: var(--cc-accent-soft);
  color: var(--cc-accent-hover);
}

/* Dialogs and transient feedback */

.login-panel {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(circle at 18% 12%, rgba(42, 176, 183, 0.2), transparent 30%),
    linear-gradient(145deg, #0d2229 0%, #15343c 52%, #0b1c22 100%);
}

.login-panel::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  content: "";
}

.login-card {
  width: min(440px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--cc-radius-lg);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
  padding: 28px;
}

.login-card .login-brand {
  border-bottom: 1px solid var(--cc-border);
  margin-bottom: 20px;
  padding: 0 0 20px;
}

.login-card .brand-mark {
  border: 0;
  border-radius: 9px;
  background: var(--cc-sidebar);
  color: #74ddd9;
}

.login-brand h1 {
  color: var(--cc-text);
  font-size: 18px;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.login-card label {
  color: var(--cc-text-soft);
  font-size: 12px;
}

.modal-backdrop,
.device-sheet-backdrop {
  background: rgba(6, 20, 25, 0.58);
  backdrop-filter: blur(4px);
}

body.device-sheet-open {
  overflow: hidden;
  overscroll-behavior: none;
}

.modal-card,
.device-sheet {
  border-color: var(--cc-border);
  border-radius: var(--cc-radius-lg);
  box-shadow: 0 24px 70px rgba(6, 20, 25, 0.24);
}

.toast {
  border-color: var(--cc-border);
  border-radius: var(--cc-radius);
  box-shadow: var(--cc-shadow-md);
  color: var(--cc-text);
}

/* Device workspace: retain the left-tree ownership model. */

.device-detail-support {
  display: contents;
}

.device-overview-data-details {
  grid-column: 1 / -1;
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius);
  background: #fff;
  box-shadow: var(--cc-shadow-sm);
}

.device-overview-data-details > summary {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  color: var(--cc-text-soft);
  cursor: pointer;
  list-style: none;
}

.device-overview-data-details > summary::-webkit-details-marker {
  display: none;
}

.device-overview-data-details > summary > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.device-overview-data-details > summary svg {
  width: 15px;
  height: 15px;
}

.device-overview-data-details > summary small {
  color: var(--cc-muted);
  font-size: 11px;
}

.device-overview-data-details[open] > summary {
  border-bottom: 1px solid var(--cc-border);
}

.device-overview-data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
}

[data-device-live-fragment].device-dimmed #network,
[data-device-live-fragment].device-dimmed #tools,
[data-device-live-fragment].device-dimmed #clients,
[data-device-live-fragment].device-dimmed .connection-trace-banner,
[data-device-live-fragment].device-dimmed .cyber-info-grid {
  opacity: 1;
  filter: none;
}

.device-workspace-shell {
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
}

/*
 * Device focus rail — same visual language as the main app sidebar.
 * On device pages the primary sidebar is hidden, so this rail is the nav.
 */
.device-tool-tree {
  top: 82px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 240px;
  max-height: calc(100dvh - 100px);
  overflow: visible;
  border: 0;
  border-radius: var(--cc-radius);
  background:
    radial-gradient(circle at 12% 4%, rgba(35, 184, 190, 0.12), transparent 24%),
    linear-gradient(180deg, var(--cc-sidebar), var(--cc-sidebar-deep));
  box-shadow: var(--cc-shadow-md);
  color: var(--cc-sidebar-text);
  padding: 8px;
  scrollbar-color: rgba(216, 231, 234, 0.22) transparent;
}

.device-tool-tree-head {
  gap: 4px;
  border-bottom: 1px solid rgba(216, 231, 234, 0.1);
  padding: 2px 2px 6px;
}

.device-tool-tree-head strong {
  color: #fff;
  font-size: 13px;
  font-weight: 680;
}

.device-tool-tree-head small {
  color: var(--cc-sidebar-muted);
  font-size: 11px;
}

.device-tree-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.device-tree-head-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.device-tree-head-identity {
  min-width: 0;
  margin-top: 2px;
  padding: 0 2px;
}

.device-tree-head-title-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.device-tree-head-identity h1 {
  margin: 0;
  min-width: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 720;
  letter-spacing: -0.01em;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-tree-head-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin-top: 3px;
  min-width: 0;
}

.device-tree-head-state {
  color: var(--cc-sidebar-muted);
  font-size: 11px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Status light beside the name — blinks on RX; history opens on hover to the right */
.device-live-activity-wrap {
  position: relative;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

.device-live-activity {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: help;
  line-height: 0;
}

.device-live-dot {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #617a80;
  box-shadow: 0 0 0 0 rgba(50, 201, 149, 0);
}

/* Steady reachability color; RX pulse still overlays via .is-rx */
.device-live-activity.is-healthy .device-live-dot,
.device-live-activity.is-live .device-live-dot,
.device-live-activity.is-heartbeat .device-live-dot {
  background: #32c995;
}

.device-live-activity.is-degraded .device-live-dot,
.device-live-activity.is-reconnecting .device-live-dot,
.device-live-activity.is-recovering .device-live-dot {
  background: #f0b429;
  box-shadow: 0 0 0 4px rgba(240, 180, 41, 0.28);
}

.device-live-activity.is-offline .device-live-dot {
  background: #f0456a;
  box-shadow: 0 0 0 4px rgba(240, 69, 106, 0.28);
}

/* RX flash should not repaint degraded/offline dots green */
.device-live-activity.is-healthy.is-rx .device-live-dot,
.device-live-activity.is-live.is-rx .device-live-dot,
.device-live-activity.is-heartbeat.is-rx .device-live-dot {
  animation: device-live-rx 0.85s ease-out;
}

.device-live-activity.is-degraded.is-rx .device-live-dot,
.device-live-activity.is-reconnecting.is-rx .device-live-dot,
.device-live-activity.is-recovering.is-rx .device-live-dot {
  animation: device-live-rx-warn 0.85s ease-out;
}

.device-live-activity.is-offline.is-rx .device-live-dot {
  animation: device-live-rx-bad 0.85s ease-out;
}

.device-tree-head-state.is-healthy,
.device-tree-head-state.is-live,
.device-tree-head-state.is-heartbeat {
  color: #8fd9b8;
}

.device-tree-head-state.is-degraded,
.device-tree-head-state.is-reconnecting,
.device-tree-head-state.is-recovering {
  color: #e0b35a;
}

.device-tree-head-state.is-offline {
  color: #e48a9a;
}

.device-live-activity-tooltip-status {
  display: grid;
  gap: 2px;
  margin: 0 0 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(216, 231, 234, 0.1);
}

.device-live-activity-tooltip-status strong {
  color: #f4ffff;
  font-size: 12px;
  font-weight: 680;
}

.device-live-activity-tooltip-status small {
  color: var(--cc-sidebar-muted);
  font-size: 10.5px;
  line-height: 1.35;
  white-space: normal;
}

.device-live-activity:hover,
.device-live-activity:focus-visible {
  outline: 0;
}

.device-live-activity:focus-visible .device-live-dot,
.device-live-activity-wrap:focus-within .device-live-dot {
  box-shadow: 0 0 0 3px rgba(99, 223, 217, 0.35);
}

.device-live-activity-tooltip {
  position: absolute;
  z-index: 60;
  top: -6px;
  left: calc(100% + 10px);
  display: block;
  width: min(228px, 70vw);
  max-height: 220px;
  overflow: auto;
  border: 1px solid rgba(216, 231, 234, 0.16);
  border-radius: 8px;
  background: linear-gradient(180deg, #14333b, #0d2228);
  box-shadow: 0 12px 28px rgba(5, 16, 20, 0.5);
  color: #d8e7ea;
  padding: 8px 9px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-4px) scale(0.98);
  transition: opacity 120ms ease, visibility 120ms ease, transform 120ms ease;
  text-align: left;
  white-space: normal;
  line-height: 1.3;
}

.device-live-activity-wrap:hover .device-live-activity-tooltip,
.device-live-activity-wrap:focus-within .device-live-activity-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(0) scale(1);
}

.device-live-activity-tooltip-head {
  display: block;
  margin-bottom: 5px;
  color: #8ce4e0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.device-live-activity-history {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.device-live-activity-history li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  min-width: 0;
  color: #c5d8dc;
  font-size: 11px;
  line-height: 1.3;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.device-live-activity-history li.is-empty {
  grid-template-columns: 1fr;
  color: #8facb2;
  font-style: italic;
  font-weight: 500;
}

.device-live-activity-history time {
  color: #7f9aa1;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.device-live-activity-history span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-tree-mobile-toggle {
  display: none;
}

/* Compact action toolbar — four controls share one row */
.device-tree-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
  margin-top: 2px;
  border-top: 1px solid rgba(216, 231, 234, 0.1);
  padding-top: 4px;
}

.device-rail-action {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 100%;
  min-width: 0;
  min-height: 30px;
  margin: 0;
  padding: 3px 1px 2px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  color: #b9cdd1;
  cursor: pointer;
  font-family: inherit;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.05;
  text-align: center;
  transition: color 140ms ease, background 140ms ease;
}

.device-rail-action svg {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  margin: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.88;
}

.device-rail-action-label {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-rail-action:hover,
.device-rail-action:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  outline: 0;
}

.device-rail-action:focus-visible {
  outline: 2px solid rgba(99, 223, 217, 0.38);
  outline-offset: 1px;
}

.device-rail-action:hover svg,
.device-rail-action:focus-visible svg {
  opacity: 1;
  color: #79e1dd;
}

.device-rail-action:disabled,
.device-rail-action[aria-disabled="true"] {
  opacity: 0.42;
  cursor: not-allowed;
}

.device-rail-action:disabled:hover,
.device-rail-action[aria-disabled="true"]:hover {
  background: rgba(255, 255, 255, 0.03);
  color: #b9cdd1;
}

.device-rail-action.is-danger {
  color: #c9a0a8;
}

.device-rail-action.is-danger:hover,
.device-rail-action.is-danger:focus-visible {
  background: rgba(199, 55, 83, 0.16);
  color: #ffc9d2;
}

.device-rail-action.is-danger:hover svg,
.device-rail-action.is-danger:focus-visible svg {
  color: #ff9aab;
  opacity: 1;
}

.device-focus-exit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(216, 231, 234, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #c9dadd;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}

.device-focus-exit-icon {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0.85;
}

.device-focus-exit:hover,
.device-focus-exit:focus-visible {
  border-color: rgba(216, 231, 234, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  outline: 0;
}

.device-focus-exit:focus-visible {
  outline: 2px solid rgba(99, 223, 217, 0.38);
  outline-offset: 1px;
}

.device-tree-body {
  gap: 2px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-top: 6px;
  scrollbar-color: rgba(216, 231, 234, 0.22) transparent;
}

.device-tree-group {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.device-tree-group summary,
.device-tree-group--nested summary {
  min-height: 38px;
  border-radius: 8px;
  padding: 0 10px;
  color: #b9cdd1;
  font-size: 13px;
  font-weight: 560;
  transition: color 140ms ease, background 140ms ease;
}

.device-tree-group summary:hover,
.device-tree-group summary:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  outline: 0;
}

.device-tree-group summary:focus-visible {
  outline: 2px solid rgba(99, 223, 217, 0.38);
  outline-offset: 1px;
}

.device-tree-summary-copy strong {
  color: inherit;
  font-size: 12.5px;
  font-weight: 560;
}

.device-tree-summary-copy small {
  color: var(--cc-sidebar-muted);
  font-size: 10.5px;
}

.device-tree-summary-copy small:empty {
  display: none;
}

.device-tree-expander {
  color: #83a8ae;
  opacity: 0.8;
}

.device-tree-panel-inner,
.device-tree-group--nested .device-tree-panel-inner {
  margin: 2px 0 4px 16px;
  border-left: 1px solid rgba(216, 231, 234, 0.12);
  border-top: 0;
  padding: 0 0 0 6px;
}

.device-tree-group--nested .device-tree-panel-inner {
  margin-left: 12px;
}

.device-tree-leaf {
  min-height: 34px;
  border-left: 0;
  border-radius: 8px;
  padding: 6px 10px;
  color: #9fb7bc;
  font-size: 12.5px;
  transition: color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.device-tree-leaf small {
  color: #7f9aa1;
}

.device-tree-leaf:hover,
.device-tree-leaf:focus-visible {
  border-left-color: transparent;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  outline: 0;
}

.device-tree-leaf:focus-visible {
  outline: 2px solid rgba(99, 223, 217, 0.38);
  outline-offset: 1px;
}

.device-tree-leaf.active {
  border-left-color: transparent;
  background: rgba(65, 199, 200, 0.15);
  box-shadow: inset 3px 0 0 #56d7d3;
  color: #f4ffff;
}

.device-tree-leaf.active small {
  color: #9fd9d6;
}

.device-tree-leaf.active svg {
  color: #79e1dd;
  opacity: 1;
}

.device-tool-tree .tree-dot {
  box-shadow: 0 0 0 2px rgba(11, 28, 34, 0.55);
}

.device-tool-tree .tree-dot.good {
  background: #32c995;
}

.device-tool-tree .tree-dot.warn {
  background: #e0a43a;
}

.device-tool-tree .tree-dot.bad {
  background: #e45d76;
}

.goodcloud-device-hero,
.goodcloud-info-card,
.goodcloud-stat-panel {
  background: #fff;
}

.goodcloud-device-title h1 {
  font-size: 27px;
  font-weight: 700;
}

.goodcloud-device-tabs {
  border-bottom-color: var(--cc-border);
}

.goodcloud-device-tabs a {
  color: var(--cc-muted);
  font-weight: 600;
}

.goodcloud-device-tabs a.active,
.goodcloud-device-tabs a[aria-current] {
  color: var(--cc-accent-hover);
}

/* Edge server offering workspace */

.edge-detail-summary {
  display: grid;
  gap: 10px;
  border-color: var(--cc-border);
  border-radius: var(--cc-radius-lg);
  padding: 13px 14px;
  background: #fff;
  box-shadow: var(--cc-shadow-sm);
}

.edge-detail-identity {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.edge-detail-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #9bd0d3;
  border-radius: 10px;
  background: #effafa;
  color: var(--cc-accent-hover);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.edge-detail-mark svg {
  width: 19px;
  height: 19px;
}

.edge-detail-title {
  min-width: 0;
}

.edge-detail-title h1 {
  color: var(--cc-text);
  font-size: clamp(20px, 1.8vw, 24px);
  font-weight: 720;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.edge-detail-title p {
  margin-top: 2px;
  color: var(--cc-muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 10.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edge-detail-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  border: 1px solid var(--cc-border-strong);
  border-radius: 999px;
  padding: 0 8px;
  background: #fff;
  color: var(--cc-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: capitalize;
}

.edge-detail-status i,
.edge-capability-badge i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #9aa9ae;
}

.edge-detail-status.is-online {
  border-color: #a5deca;
  background: #f1fcf8;
  color: #117555;
}

.edge-detail-status.is-online i,
.edge-capability-badge.is-available i {
  background: var(--cc-success);
  box-shadow: 0 0 0 3px rgba(20, 143, 103, 0.11);
}

.edge-detail-status.is-stale {
  border-color: #ead49a;
  background: #fffaf0;
  color: #886516;
}

.edge-detail-status.is-stale i {
  background: var(--cc-warning);
  box-shadow: 0 0 0 3px rgba(203, 145, 29, 0.11);
}

.edge-detail-status.is-offline {
  border-color: #ecc1c8;
  background: #fff7f8;
  color: var(--cc-danger);
}

.edge-detail-status.is-degraded {
  border-color: #ead49a;
  background: #fffaf0;
  color: #886516;
}

.edge-detail-status.is-degraded i {
  background: var(--cc-warning);
  box-shadow: 0 0 0 3px rgba(203, 145, 29, 0.11);
}

.edge-detail-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 0;
}

.edge-detail-facts > div {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  min-height: 0;
  border-left: 1px solid var(--cc-border);
  padding: 0 10px;
}

.edge-detail-facts > div:first-child {
  border-left: 0;
  padding-left: 0;
}

.edge-detail-facts dt {
  color: var(--cc-muted);
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.edge-detail-facts dd {
  margin-top: 0;
  color: var(--cc-text);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edge-detail-facts > div.is-warning dt,
.edge-detail-facts > div.is-warning dd {
  color: var(--cc-warning);
}

.edge-detail-alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.edge-detail-alert {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 28px;
  border: 1px solid #ead49a;
  border-radius: 999px;
  padding: 4px 10px;
  background: #fffaf0;
  color: #886516;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

.edge-detail-alert b {
  color: #6f5210;
  font-weight: 740;
}

.edge-detail-workspace {
  border-color: var(--cc-border);
  border-radius: var(--cc-radius-lg);
  padding: 0;
  background: #fff;
  box-shadow: var(--cc-shadow-sm);
  overflow: hidden;
}

/* Service console: rail + main workspace */
.edge-service-console-shell {
  overflow: visible;
}

.edge-service-console {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  min-height: 420px;
  min-width: 0;
  transition: grid-template-columns 140ms ease;
}

.edge-service-console.is-rail-collapsed {
  grid-template-columns: 56px minmax(0, 1fr);
}

.edge-console-rail {
  display: grid;
  align-content: start;
  gap: 8px;
  border-right: 1px solid var(--cc-border);
  background: var(--cc-surface-subtle);
  padding: 10px 8px 12px;
  min-width: 0;
}

.edge-console-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 30px;
  padding: 2px 2px 4px;
}

.edge-console-rail-title {
  color: var(--cc-text);
  font-size: 11px;
  font-weight: 740;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Same chevron control as primary nav, tuned for light rail */
.edge-console-rail-head .sidebar-rail-toggle {
  color: #5a7077;
}

.edge-console-rail-head .sidebar-rail-toggle:hover {
  border-color: var(--cc-border);
  background: #fff;
  color: #123038;
}

.edge-service-console.is-rail-collapsed .edge-console-rail {
  padding: 10px 6px 12px;
  justify-items: center;
}

.edge-service-console.is-rail-collapsed .edge-console-rail-head {
  justify-content: center;
  width: 100%;
  gap: 2px;
}

.edge-service-console.is-rail-collapsed .edge-console-rail-title {
  display: none;
}

.edge-service-console.is-rail-collapsed .edge-console-rail-empty {
  display: none;
}

.edge-service-console.is-rail-collapsed .edge-console-nav {
  width: 100%;
  justify-items: center;
}

.edge-service-console.is-rail-collapsed .edge-console-nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  min-height: 40px;
  margin: 0 auto;
  padding: 0;
  box-shadow: none;
}

.edge-service-console.is-rail-collapsed .edge-console-nav-item.is-selected,
.edge-service-console.is-rail-collapsed .edge-console-nav-item.is-active {
  box-shadow: none;
  border-color: #9bd0d3;
  background: #fff;
}

.edge-service-console.is-rail-collapsed .edge-console-nav-copy {
  display: none;
}

.edge-service-console.is-rail-collapsed .sidebar-rail-toggle-icon {
  transform: scaleX(-1);
}

.edge-console-panel-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.edge-console-rail-empty {
  margin: 0;
  padding: 8px;
  color: #8d641b;
  font-size: 11.5px;
  line-height: 1.35;
}

.edge-console-nav {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.edge-console-nav-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  width: 100%;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 9px;
  background: transparent;
  color: var(--cc-text-soft);
  cursor: pointer;
  text-align: left;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.edge-console-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #c5d4d8;
  background: #eef3f5;
  color: #4d626a;
  flex: 0 0 auto;
  line-height: 0;
  overflow: hidden;
  /* Glyph shape = which service. Color below = run state only. */
}

/* Kill global `button svg { margin-right: 6px }` from style.css — it un-centers rail icons. */
.edge-console-nav-icon svg,
button.edge-console-nav-item svg,
.edge-console-panel-heading .edge-console-nav-icon svg {
  display: block;
  width: 16px;
  height: 16px;
  margin: 0 !important;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Status colors (same semantics as the old green/amber dots). */
.edge-console-nav-item.is-running .edge-console-nav-icon,
.edge-console-nav-icon.is-running {
  background: #e5f6ea;
  border-color: #8dcf9f;
  color: #176b34;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.18);
}

.edge-console-nav-item.is-attention .edge-console-nav-icon,
.edge-console-nav-icon.is-attention {
  background: #fff7e6;
  border-color: #e2bf6a;
  color: #8a5a0b;
  box-shadow: 0 0 0 1px rgba(234, 179, 8, 0.22);
}

.edge-console-nav-item.is-stopped .edge-console-nav-icon,
.edge-console-nav-item.is-idle .edge-console-nav-icon,
.edge-console-nav-icon.is-stopped,
.edge-console-nav-icon.is-idle {
  background: #eef3f5;
  border-color: #c5d4d8;
  color: #6a7f86;
  opacity: 0.88;
}

.edge-console-nav-item.is-selected .edge-console-nav-icon,
.edge-console-nav-item.is-active .edge-console-nav-icon {
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.4);
}

.edge-console-panel-heading .edge-console-nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.edge-console-panel-heading .edge-console-nav-icon svg {
  width: 15px;
  height: 15px;
}

.edge-console-nav-item:hover,
.edge-console-nav-item:focus-visible {
  border-color: var(--cc-border);
  background: #fff;
  color: var(--cc-text);
}

.edge-console-nav-item:focus-visible {
  outline: 2px solid var(--cc-accent-ring);
  outline-offset: 1px;
}

.edge-console-nav-item.is-selected,
.edge-console-nav-item.is-active {
  border-color: #9bd0d3;
  background: #fff;
  box-shadow: inset 3px 0 0 var(--cc-accent);
  color: var(--cc-text);
}

.edge-console-nav-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.edge-console-nav-copy b {
  color: inherit;
  font-size: 12.5px;
  font-weight: 680;
  line-height: 1.2;
}

.edge-console-nav-copy small {
  color: var(--cc-muted);
  font-size: 10.5px;
  font-weight: 560;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edge-console-nav-state {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 999px;
  background: #9aa9ae;
  box-shadow: 0 0 0 3px rgba(154, 169, 174, 0.12);
}

.edge-console-nav-state.is-running,
.edge-console-state-pill.is-running {
  background: var(--cc-success);
  box-shadow: 0 0 0 3px rgba(8, 127, 91, 0.12);
}

.edge-console-nav-state.is-attention,
.edge-console-state-pill.is-attention {
  background: var(--cc-warning);
  box-shadow: 0 0 0 3px rgba(148, 96, 8, 0.12);
}

.edge-console-nav-state.is-stopped,
.edge-console-nav-state.is-idle,
.edge-console-state-pill.is-stopped,
.edge-console-state-pill.is-idle {
  background: #9aa9ae;
}

.edge-console-main {
  min-width: 0;
  background: #fff;
}

.edge-console-panel {
  display: grid;
  gap: 0;
  min-width: 0;
  padding: 0 !important;
}

.edge-console-panel[hidden] {
  display: none !important;
}

.edge-console-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--cc-border);
  padding: 12px 14px;
  background: linear-gradient(180deg, #fbfcfc, #fff);
}

.edge-console-panel-title {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.edge-console-panel-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.edge-console-panel-heading .edge-console-nav-state {
  margin-top: 0;
}

.edge-console-panel-heading h2 {
  margin: 0;
  color: var(--cc-text);
  font-size: 16px;
  font-weight: 720;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.edge-console-panel-title p {
  margin: 0;
  color: var(--cc-muted);
  font-size: 12px;
  line-height: 1.3;
}

.edge-console-state-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  background: #eef2f3;
  color: var(--cc-text-soft);
  font-size: 10.5px;
  font-weight: 720;
}

.edge-console-state-pill.is-running {
  background: #e8f8f2;
  color: #117555;
}

.edge-console-state-pill.is-attention {
  background: #fff6e8;
  color: #8a5a0b;
}

.edge-console-state-pill.is-stopped,
.edge-console-state-pill.is-idle {
  background: #eef2f3;
  color: #5d7077;
}

.edge-console-panel-power {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--cc-border);
  border-radius: 999px;
  padding: 2px 8px 2px 10px;
  background: #fff;
}

.edge-console-panel-power .edge-service-switch {
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  gap: 8px;
  min-height: 28px;
}

.edge-console-panel-power .edge-service-switch b {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  clip-path: none;
  color: var(--cc-text-soft);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.edge-console-panel-body {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px 14px 14px;
}

.edge-console-activity-alert {
  display: grid;
  gap: 3px;
  border: 1px solid #ead49a;
  border-radius: 8px;
  padding: 9px 11px;
  background: #fffaf0;
  color: #6f5210;
}

.edge-console-activity-alert strong {
  font-size: 12px;
  font-weight: 720;
}

.edge-console-activity-alert span,
.edge-console-activity-alert code {
  font-size: 11.5px;
  line-height: 1.35;
}

.edge-console-activity-alert code {
  display: block;
  overflow: hidden;
  color: #886516;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edge-console-mqtt-fold {
  border: 1px solid var(--cc-border);
  border-radius: 8px;
  background: var(--cc-surface-subtle);
  overflow: clip;
}

.edge-console-mqtt-fold > summary {
  cursor: pointer;
  list-style: none;
  min-height: 34px;
  padding: 8px 11px;
  color: var(--cc-text-soft);
  font-size: 12px;
  font-weight: 650;
}

.edge-console-mqtt-fold > summary::-webkit-details-marker {
  display: none;
}

.edge-console-mqtt-fold[open] > summary {
  border-bottom: 1px solid var(--cc-border);
  background: #fff;
}

.edge-console-mqtt-fold .edge-ops-event-grid {
  padding: 8px;
}

/* MQTT Explorer (hierarchical topic tree + value pane) */
.edge-mqtt-tree.mqtt-explorer {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.mqtt-ex-shell {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(0, 1.35fr);
  gap: 0;
  min-height: 420px;
  border: 1px solid var(--cc-border-strong);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 0 rgba(16, 38, 45, 0.04);
}

.mqtt-ex-sidebar {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  min-width: 0;
  border-right: 1px solid var(--cc-border);
  background: #f4f8f9;
}

.mqtt-ex-sidebar-head {
  display: grid;
  gap: 2px;
  border-bottom: 1px solid var(--cc-border);
  padding: 6px 10px;
  background: #eaf1f3;
  font-size: 11px;
}

.mqtt-ex-sidebar-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.mqtt-ex-sidebar-title strong {
  flex: 0 0 auto;
  font-size: 11.5px;
  font-weight: 760;
}

.mqtt-ex-status-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9aaeb4;
}

.mqtt-ex-status-dot.is-good {
  background: #1f9d4b;
  box-shadow: 0 0 0 2px rgba(31, 157, 75, 0.18);
}

.mqtt-ex-status-dot.is-bad {
  background: #c0392b;
  box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.16);
}

.mqtt-ex-status-dot.is-noise {
  background: #c9971d;
  box-shadow: 0 0 0 2px rgba(203, 145, 29, 0.18);
}

.mqtt-ex-status-compact {
  min-width: 0;
  overflow: hidden;
  color: var(--cc-muted);
  font-size: 10.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mqtt-ex-endpoint-compact {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #4d6a71;
  font-size: 10px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mqtt-ex-tree {
  min-height: 220px;
  max-height: min(58vh, 560px);
  overflow: auto;
  padding: 4px 0 8px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.mqtt-ex-node {
  min-width: 0;
}

.mqtt-ex-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 2px;
  align-items: center;
  min-height: 28px;
  padding: 1px 8px 1px calc(8px + (var(--depth, 0) * 14px));
}

.mqtt-ex-node.is-selected > .mqtt-ex-row {
  background: #d9eef2;
  box-shadow: inset 3px 0 0 #1f7a86;
}

.mqtt-ex-row:hover {
  background: #e7f2f4;
}

.mqtt-ex-row.mqtt-ex-flashing {
  background-color: rgba(14, 165, 233, 0.72);
  transition: background-color 180ms ease-out;
}

.mqtt-ex-twist {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 26px;
  border: 0;
  border-radius: 4px;
  padding: 0;
  background: transparent;
  color: #4d6a71;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}

.mqtt-ex-twist:hover {
  background: rgba(16, 38, 45, 0.08);
  color: #123038;
}

.mqtt-ex-twist.is-leaf {
  width: 18px;
  color: #9db0b5;
  cursor: default;
}

.mqtt-ex-twist.is-leaf::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.mqtt-ex-label {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
  border: 0;
  padding: 3px 4px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.mqtt-ex-name {
  flex: 0 1 auto;
  overflow: hidden;
  color: #16333a;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mqtt-ex-node.is-folder > .mqtt-ex-row .mqtt-ex-name {
  font-weight: 740;
}

.mqtt-ex-count {
  display: inline-flex;
  align-items: center;
  min-height: 16px;
  border-radius: 999px;
  padding: 0 5px;
  background: #dfe9ec;
  color: #35555c;
  font-size: 10px;
  font-weight: 740;
}

.mqtt-ex-preview {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: #6a838a;
  font-size: 10.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mqtt-ex-children.is-hidden,
.mqtt-ex-children[hidden] {
  display: none;
}

.mqtt-ex-clients-fold,
.mqtt-ex-errors-fold {
  border-top: 1px solid var(--cc-border);
  background: #eef4f6;
}

.mqtt-ex-clients-fold > summary,
.mqtt-ex-errors-fold > summary {
  cursor: pointer;
  list-style: none;
  padding: 8px 12px;
  color: #35555c;
  font-size: 11.5px;
  font-weight: 700;
}

.mqtt-ex-clients-fold > summary::-webkit-details-marker,
.mqtt-ex-errors-fold > summary::-webkit-details-marker {
  display: none;
}

.mqtt-ex-client-list {
  max-height: 160px;
  overflow: auto;
  padding: 0 8px 8px;
}

.mqtt-ex-detail {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  max-height: min(78vh, 820px);
  overflow: auto;
  padding: 14px 16px 18px;
  background: #fbfcfc;
}

.mqtt-ex-empty-detail {
  border: 1px dashed #c9d7db;
  border-radius: 10px;
  padding: 18px;
  background: #f3f7f8;
  color: var(--cc-muted);
}

.mqtt-ex-empty-detail strong {
  display: block;
  margin-bottom: 6px;
  color: var(--cc-text);
  font-size: 14px;
}

.mqtt-ex-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.mqtt-ex-detail-kicker {
  display: block;
  color: var(--cc-muted);
  font-size: 10px;
  font-weight: 740;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.mqtt-ex-detail-topic {
  margin: 2px 0 0;
  color: #123038;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 15px;
  font-weight: 720;
  line-height: 1.3;
  word-break: break-all;
}

.mqtt-ex-detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mqtt-ex-detail-meta {
  color: #4d6a71;
  font-size: 11px;
  font-weight: 600;
}

.mqtt-ex-value-panel,
.mqtt-ex-history-panel,
.mqtt-ex-publish {
  border: 1px solid #e3ecee;
  border-radius: 10px;
  background: #fff;
}

.mqtt-ex-value-panel > header,
.mqtt-ex-history-panel > header,
.mqtt-ex-publish > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #e8eef0;
  padding: 8px 12px;
  font-size: 12px;
}

.mqtt-ex-value-panel > header span,
.mqtt-ex-history-panel > header span,
.mqtt-ex-publish > header span {
  color: var(--cc-muted);
  font-size: 11px;
}

.mqtt-ex-value-body {
  max-height: min(42vh, 360px);
  margin: 0;
  border-radius: 0 0 10px 10px;
}

.mqtt-ex-history-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
  padding: 8px;
}

.mqtt-ex-history-row {
  border: 1px solid #d5e1e4;
  border-radius: 8px;
  padding: 8px;
  background: #f7fafb;
}

.mqtt-ex-history-row.is-latest {
  border-color: #7eb8c2;
  background: #eef7f9;
}

.mqtt-ex-history-row.is-source-operator {
  border-color: #a8c0e8;
  background: #f3f7ff;
}

.mqtt-ex-history-head {
  margin-bottom: 6px;
}

.mqtt-ex-history-head small {
  color: #3d555c;
  font-size: 11px;
  font-weight: 600;
}

.mqtt-ex-history-body {
  margin: 0;
  max-height: 160px;
  overflow: auto;
  border: 1px solid #1a333a;
  border-radius: 6px;
  padding: 8px 10px;
  background: #10262d;
  color: #e6f2f4;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  tab-size: 2;
}

.edge-mqtt-publish-panel textarea {
  width: 100%;
  min-height: 72px;
  border: 1px solid var(--cc-border-strong);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  resize: vertical;
}

.mqtt-ex-publish {
  padding-bottom: 4px;
}

.mqtt-ex-publish .edge-mqtt-publish-form {
  padding: 10px 12px 0;
}

.mqtt-ex-publish .edge-inline-status {
  margin: 4px 12px 10px;
}

.edge-mqtt-qos,
.edge-mqtt-retain,
.edge-mqtt-source,
.edge-mqtt-kind {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  border-radius: 999px;
  padding: 0 6px;
  background: #e8f4f5;
  color: #14565c;
  font-size: 10px;
  font-weight: 740;
}

.edge-mqtt-retain {
  background: #fff4e5;
  color: #8a5a0b;
}

.edge-mqtt-source.is-operator {
  background: #e8f0ff;
  color: #1d4f91;
}

.edge-mqtt-source.is-device,
.edge-mqtt-source.is-client {
  background: #e9f7ee;
  color: #1f6b3a;
}

.edge-mqtt-kind {
  background: #f1eef8;
  color: #4b3f72;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edge-mqtt-message-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.edge-mqtt-message-body {
  margin: 0;
  max-height: 220px;
  overflow: auto;
  border-radius: 6px;
  padding: 8px;
  background: #10262d;
  color: #d8e7ea;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

.edge-mqtt-client-list,
.edge-mqtt-error-list {
  display: grid;
  gap: 5px;
  min-width: 0;
  max-height: 360px;
  overflow: auto;
}

.edge-mqtt-client-row {
  display: grid;
  gap: 6px;
  border: 1px solid #e8eef0;
  border-radius: 8px;
  padding: 8px;
  background: #fbfcfc;
}

.edge-mqtt-client-row.is-disconnected {
  opacity: 0.72;
}

.edge-mqtt-client-main {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.edge-mqtt-client-main strong {
  display: block;
  color: var(--cc-text);
  font-size: 12.5px;
}

.edge-mqtt-client-main small {
  display: block;
  color: var(--cc-muted);
  font-size: 10.5px;
}

.edge-mqtt-client-main small.is-warn {
  color: #8a5a0b;
}

.edge-mqtt-error-row {
  display: grid;
  gap: 2px;
  border-top: 1px solid var(--cc-border);
  padding: 7px 8px;
}

.edge-mqtt-error-row strong {
  font-size: 12px;
}

.edge-mqtt-error-row small {
  color: var(--cc-muted);
  font-size: 10px;
}

.edge-mqtt-error-row code {
  border: 1px solid var(--cc-border);
  border-radius: 999px;
  padding: 2px 7px;
  background: #fff;
  color: #3d555c;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 10px;
}

@media (max-width: 1100px) {
  .mqtt-ex-shell {
    grid-template-columns: minmax(240px, 0.9fr) minmax(0, 1.2fr);
  }

}

@media (max-width: 860px) {
  .mqtt-ex-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .mqtt-ex-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--cc-border);
  }

  .mqtt-ex-tree {
    max-height: 320px;
  }

  .mqtt-ex-detail {
    max-height: none;
  }
}

@media (max-width: 980px) {
  .edge-service-console {
    grid-template-columns: 1fr;
  }

  .edge-console-rail {
    border-right: 0;
    border-bottom: 1px solid var(--cc-border);
    padding-bottom: 8px;
  }

  .edge-console-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .edge-console-nav-item {
    flex: 0 0 auto;
    width: min(200px, 72vw);
  }
}

/* Light-theme edge list chips + attachment meters (override dark legacy style.css) */
.edge-service-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.edge-service-chip-row span,
.edge-service-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid var(--cc-border);
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--cc-surface-subtle);
  color: var(--cc-muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.edge-service-chip-row span.active,
.edge-service-chip.is-on {
  border-color: #a5deca;
  background: #f1fcf8;
  color: #117555;
}

.edge-service-chip.is-off {
  border-color: var(--cc-border);
  background: #fff;
  color: #6b8088;
}

.edge-service-chip-empty {
  color: var(--cc-muted);
  font-size: 11.5px;
}

.edge-table .edge-attachment-pill,
.edge-attachment-pill {
  min-height: 28px;
  border: 1px solid var(--cc-border);
  border-radius: 999px;
  background: var(--cc-surface-subtle);
  color: var(--cc-text-soft);
  box-shadow: none;
}

.edge-attachment-pill.active {
  border-color: #a5deca;
  background: #f1fcf8;
  color: #117555;
}

.edge-attachment-meter b {
  color: inherit;
}

.edge-attachment-meter small {
  color: inherit;
  opacity: 0.78;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 650;
}

/* Edge devices popover floats above the clipped table once JS positions it */
.edge-attachment-menu .menu-card.floating-menu-card {
  width: min(300px, calc(100vw - 24px));
  min-width: 240px;
  max-height: min(360px, calc(100vh - 24px));
  border: 1px solid var(--cc-border-strong);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--cc-shadow-md);
  color: var(--cc-text);
}

.edge-attachment-card-top {
  border-bottom-color: var(--cc-border);
}

.edge-attachment-card-top strong {
  color: var(--cc-text);
  font-weight: 720;
}

.edge-attachment-card-top span {
  color: var(--cc-muted);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 620;
}

.edge-attached-device {
  color: var(--cc-text);
}

.edge-attached-device:hover,
.edge-attached-device:focus-visible {
  background: var(--cc-accent-soft);
}

.edge-attached-device strong {
  color: var(--cc-text);
}

.edge-attached-device small {
  color: var(--cc-muted);
}

.edge-attachment-empty {
  color: var(--cc-muted);
}

.edge-servers-header .edge-status-select select {
  min-height: 40px;
  min-width: 120px;
  border: 1px solid var(--cc-border);
  border-radius: 9px;
  background: var(--cc-surface-subtle);
  color: var(--cc-text);
  padding: 0 12px;
  font-size: 13px;
}

.edge-detail-utilitybar {
  margin-bottom: 10px;
}

.edge-offering-compatibility {
  flex: 0 0 auto;
  padding: 0 8px;
  color: #8d641b;
  font-size: 9.5px;
  font-weight: 650;
  white-space: nowrap;
}

.edge-offering-workspace {
  border-top: 1px solid var(--cc-border);
}

.edge-offering-navigation {
  display: flex;
  align-items: stretch;
  gap: 8px;
  border-bottom: 1px solid var(--cc-border);
  padding: 7px 8px 0;
  background: var(--cc-surface-subtle);
}

.edge-offering-tablist {
  display: flex;
  flex: 1 1 auto;
  align-items: stretch;
  gap: 5px;
  min-width: 0;
  overflow-x: auto;
  scroll-padding-inline: 1px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.edge-offering-tablist::-webkit-scrollbar {
  display: none;
}

.edge-offering-tab-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  flex: 0 0 auto;
  align-items: center;
  min-width: 118px;
  max-width: 168px;
  min-height: 43px;
  border: 1px solid var(--cc-border);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #f4f7f8;
  scroll-snap-align: start;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.edge-offering-tab-item.is-activity {
  grid-template-columns: minmax(0, 1fr);
  min-width: 92px;
  max-width: 120px;
}

.edge-offering-tab-item.is-selected {
  border-color: var(--cc-border-strong);
  background: #fff;
  box-shadow: inset 0 2px 0 var(--cc-accent);
}

.edge-offering-tab-item[data-pending="true"] {
  opacity: 0.68;
}

.edge-offering-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
  min-width: 0;
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 7px 0 0 0;
  padding: 0 8px;
  background: transparent;
  color: var(--cc-muted);
  cursor: pointer;
  text-align: left;
}

.edge-offering-tab > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
}

.edge-offering-tab svg {
  width: 15px;
  height: 15px;
}

.edge-offering-tab b {
  color: inherit;
  font-size: 10.5px;
  font-weight: 680;
  line-height: 1.15;
  white-space: nowrap;
}

.edge-offering-tab:hover,
.edge-offering-tab:focus-visible {
  background: rgba(230, 245, 245, 0.72);
  color: var(--cc-accent-hover);
}

.edge-offering-tab:focus-visible {
  outline: 2px solid var(--cc-focus);
  outline-offset: -2px;
}

.edge-offering-tab.is-active {
  background: transparent;
  color: var(--cc-accent-hover);
  box-shadow: none;
}

.edge-offering-tab-control {
  display: flex;
  align-items: center;
  padding-right: 7px;
}

.edge-offering-tab-control .edge-service-switch {
  position: relative;
  display: grid;
  width: 36px;
  min-width: 36px;
  min-height: 34px;
  place-items: center;
  gap: 0;
  cursor: pointer;
}

.edge-offering-tab-control .edge-service-switch input {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  pointer-events: auto;
}

.edge-offering-tab-control .edge-service-switch input:disabled {
  cursor: not-allowed;
}

.edge-offering-tab-control .edge-service-switch span {
  width: 32px;
  height: 18px;
  pointer-events: none;
}

.edge-offering-tab-control .edge-service-switch b,
.edge-offering-tab-control .edge-service-switch-reason {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.edge-offering-tab-count {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--cc-border);
  border-radius: 999px;
  margin-right: 8px;
  background: #fff;
  color: var(--cc-text-soft);
  font-size: 10px;
  font-weight: 750;
}

.edge-offering-panels {
  min-width: 0;
}

.edge-offering-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 8px;
}

.edge-offering-panel[hidden] {
  display: none;
}

.edge-offering-settings,
.edge-offering-activity {
  display: grid;
  gap: 0;
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

/* Collapsed server-config disclosure keeps peer/listener lists primary */
.edge-ops-config {
  min-width: 0;
  border: 1px solid var(--cc-border);
  border-radius: 8px;
  background: var(--cc-surface-subtle);
  overflow: clip;
}

.edge-ops-config-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 14px;
  gap: 8px;
  align-items: center;
  min-height: 32px;
  padding: 5px 10px;
  color: var(--cc-text-soft);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.edge-ops-config-summary::-webkit-details-marker {
  display: none;
}

.edge-ops-config-label {
  color: var(--cc-text);
  font-size: 11px;
  font-weight: 720;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.edge-ops-config-preview {
  min-width: 0;
  overflow: hidden;
  color: var(--cc-muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 10.5px;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edge-ops-config-chevron {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--cc-muted);
  border-bottom: 1.5px solid var(--cc-muted);
  justify-self: end;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform 140ms ease;
}

.edge-ops-config[open] .edge-ops-config-chevron {
  transform: rotate(225deg) translate(-1px, -1px);
}

.edge-ops-config-summary:hover,
.edge-ops-config-summary:focus-visible {
  background: #eef5f6;
  color: var(--cc-text);
}

.edge-ops-config-summary:focus-visible {
  outline: 2px solid var(--cc-accent-ring);
  outline-offset: -2px;
}

.edge-ops-config > .edge-ops-form,
.edge-ops-config > .edge-offering-form {
  border-top: 1px solid var(--cc-border);
  padding: 8px;
  background: #fff;
}

.edge-offering-form,
.edge-ops-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: end;
}

.edge-offering-panel .edge-control-fields,
.edge-ops-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 6px;
}

.edge-offering-panel .edge-control-fields label,
.edge-offering-panel .edge-control-fields label:only-child,
.edge-ops-fields label {
  display: grid;
  grid-column: auto;
  gap: 3px;
  align-content: start;
  min-width: 0;
  color: var(--cc-text-soft);
  font-size: 10px;
  font-weight: 620;
  text-transform: none;
}

.edge-offering-panel .edge-control-fields label > span,
.edge-ops-fields label > span,
.edge-ops-field > span {
  color: #50666d;
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.edge-offering-panel .edge-control-fields input,
.edge-offering-panel .edge-control-fields select,
.edge-ops-fields input,
.edge-ops-fields select,
.edge-ops-field input,
.edge-ops-field select {
  min-height: 30px;
  border: 1px solid var(--cc-border-strong);
  border-radius: 6px;
  padding: 4px 8px;
  background: #fff;
  color: var(--cc-text);
  font-size: 12px;
}

.edge-offering-panel .edge-control-fields .edge-checkbox-field {
  display: flex;
  align-items: center;
  align-self: end;
  gap: 6px;
  min-height: 30px;
  border: 1px solid var(--cc-border-strong);
  border-radius: 6px;
  padding: 4px 8px;
  background: #fff;
}

.edge-offering-panel .edge-control-fields .edge-checkbox-field input[type="checkbox"] {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  min-height: 14px;
  margin: 0;
  accent-color: var(--cc-accent);
}

.edge-offering-panel .edge-control-fields label .edge-field-help,
.edge-ops-help {
  display: none;
  grid-column: auto;
  min-height: 0;
  color: var(--cc-muted);
  font-size: 9px;
  font-weight: 530;
  line-height: 1.3;
  text-transform: none;
}

.edge-offering-panel .edge-control-fields label .edge-field-help.is-error,
.edge-ops-help.is-error {
  display: block;
  color: var(--cc-danger);
}

.edge-offering-panel .edge-control-actions,
.edge-ops-actions {
  display: flex;
  align-items: stretch;
  gap: 5px;
  min-width: 0;
}

.edge-offering-panel .edge-control-actions .button,
.edge-ops-actions .button,
.edge-ops-toolbar .button,
.edge-ops-row .button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 11.5px;
  text-transform: none;
}

.edge-offering-panel .edge-control-actions .button.primary {
  border-color: var(--accent-strong);
  background: var(--accent);
  color: #fff;
}

.edge-offering-panel .edge-control-actions .button.primary:hover:not(:disabled),
.edge-offering-panel .edge-control-actions .button.primary:focus-visible {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: #fff;
}

.edge-offering-section-grid,
.edge-ops-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.edge-offering-panel .edge-service-peer-panel,
.edge-offering-inventory,
.edge-ops-panel {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin-top: 0;
  border: 1px solid var(--cc-border);
  border-radius: 8px;
  padding: 7px 8px;
  background: #fff;
}

.edge-offering-panel .edge-service-peer-panel header,
.edge-ops-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 22px;
  padding-bottom: 2px;
}

.edge-offering-panel .edge-service-peer-panel header strong,
.edge-ops-panel header strong {
  color: var(--cc-text-soft);
  font-size: 10px;
  font-weight: 740;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.edge-offering-panel .edge-service-peer-panel header > span,
.edge-ops-panel header > span {
  min-width: 18px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--cc-muted);
  font-size: 11px;
  font-weight: 700;
  text-align: right;
}

.edge-offering-panel .empty,
.edge-ops-empty {
  margin: 0;
  padding: 6px 2px;
  color: var(--cc-muted);
  font-size: 11px;
}

.edge-offering-panel .edge-inline-status {
  margin: 0;
  font-size: 10px;
  line-height: 1.3;
}

.edge-offering-panel .edge-inline-status:empty {
  display: none;
}

.edge-offering-panel .edge-manual-wg-panel .edge-control-fields,
.edge-offering-panel .edge-manual-wg-panel .edge-control-actions {
  margin-top: 0;
}

.edge-offering-full {
  width: 100%;
}

.edge-offering-inventory .table-wrap {
  max-height: 320px;
}

/* Dense ops toolbars, peer rows, listeners */

.edge-ops-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: end;
  gap: 6px;
  min-width: 0;
  padding-top: 2px;
}

.edge-ops-toolbar.is-wrap {
  flex-wrap: wrap;
}

.edge-ops-field {
  display: grid;
  gap: 3px;
  min-width: 0;
  flex: 0 1 148px;
}

.edge-ops-field.grow {
  flex: 1 1 160px;
}

.edge-ops-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border: 1px solid var(--cc-border);
  border-radius: 6px;
  padding: 0 8px;
  background: var(--cc-surface-subtle);
  color: var(--cc-text-soft);
  font-size: 11px;
  font-weight: 620;
  white-space: nowrap;
}

.edge-ops-check input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--cc-accent);
}

.edge-service-peer-list {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.edge-offering-panel .edge-service-peer-row,
.edge-ops-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  border: 1px solid #e8eef0;
  border-radius: 6px;
  padding: 5px 7px;
  background: #fbfcfc;
  box-shadow: none;
}

.edge-offering-panel .edge-service-peer-row:hover,
.edge-ops-row:hover {
  border-color: #c6d8db;
  background: #f5fafb;
  box-shadow: none;
  transform: none;
}

/* Rows may be either: [main-link, action] or [icon, copy, actions] */
.edge-offering-panel .edge-service-peer-main,
.edge-ops-row .edge-service-peer-main {
  display: grid;
  grid-column: 1;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.edge-ops-row > .edge-peer-status-icon {
  grid-column: 1;
  grid-row: 1;
}

.edge-ops-row > .edge-peer-copy {
  grid-column: 1;
  min-width: 0;
  padding-left: 24px;
}

.edge-ops-row:has(> .edge-peer-status-icon) > .edge-peer-copy {
  grid-column: 1;
}

.edge-ops-row:has(> .edge-peer-status-icon):not(:has(.edge-service-peer-main)) {
  grid-template-columns: 16px minmax(0, 1fr) auto;
}

.edge-ops-row:has(> .edge-peer-status-icon):not(:has(.edge-service-peer-main)) > .edge-peer-copy {
  padding-left: 0;
  grid-column: 2;
}

.edge-ops-row:has(> .edge-peer-status-icon):not(:has(.edge-service-peer-main)) > .edge-ops-row-actions {
  grid-column: 3;
}

.edge-offering-panel .edge-service-peer-row > .edge-peer-status-icon,
.edge-offering-panel .edge-service-peer-main > .edge-peer-status-icon,
.edge-ops-row .edge-peer-status-icon {
  width: 16px;
  height: 16px;
  color: #95a4aa;
}

.edge-offering-panel .edge-peer-status-icon::before,
.edge-ops-row .edge-peer-status-icon::before {
  width: 8px;
  height: 8px;
  box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 16%, transparent);
}

.edge-offering-panel .edge-service-peer-row.is-handshake-active .edge-peer-status-icon,
.edge-ops-row.is-handshake-active .edge-peer-status-icon {
  color: #16a06f;
}

.edge-offering-panel .edge-service-peer-row.is-handshake-idle .edge-peer-status-icon,
.edge-ops-row.is-handshake-idle .edge-peer-status-icon {
  color: #95a4aa;
}

.edge-peer-copy {
  min-width: 0;
}

.edge-peer-copy strong,
.edge-peer-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edge-peer-copy strong {
  color: var(--cc-text);
  font-size: 12px;
  font-weight: 680;
  line-height: 1.15;
}

.edge-peer-copy small {
  margin-top: 1px;
  color: var(--cc-muted);
  font-size: 10px;
  line-height: 1.2;
}

.edge-ops-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.edge-offering-panel .edge-service-peer-row > [data-edge-wireguard-action="detach"],
.edge-offering-panel .edge-service-peer-row > [data-edge-ipsec-action="leave"] {
  grid-column: auto;
  justify-self: end;
}

.edge-ops-listen-list {
  display: grid;
  gap: 3px;
  max-height: 280px;
  overflow: auto;
}

.edge-ops-listen-row {
  display: grid;
  grid-template-columns: 52px 44px minmax(0, 1.4fr) minmax(56px, 0.7fr) minmax(64px, 0.7fr);
  gap: 6px;
  align-items: center;
  min-height: 28px;
  border: 1px solid #e8eef0;
  border-radius: 5px;
  padding: 3px 7px;
  background: #fbfcfc;
  font-size: 11px;
}

.edge-ops-listen-row b {
  color: var(--cc-text);
  font-variant-numeric: tabular-nums;
  font-weight: 720;
}

.edge-ops-proto {
  color: var(--cc-accent-hover);
  font-size: 10px;
  font-weight: 740;
  letter-spacing: 0.03em;
}

.edge-ops-service,
.edge-ops-listen-row small,
.edge-ops-listen-row em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--cc-text-soft);
  font-style: normal;
}

.edge-ops-listen-row em {
  color: var(--cc-muted);
  text-align: right;
}

.edge-event-grid,
.edge-ops-event-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.edge-event-grid .edge-event-row,
.edge-ops-event-grid .edge-event-row {
  display: grid;
  grid-template-columns: minmax(64px, 0.55fr) minmax(90px, 1fr) auto 16px;
  gap: 5px;
  min-width: 0;
  min-height: 28px;
  margin: 0;
  border: 1px solid #e8eef0;
  border-radius: 5px;
  padding: 3px 6px;
  background: #fbfcfc;
  align-items: center;
  font-size: 11px;
}

.edge-event-grid .edge-event-row details {
  position: relative;
}

.edge-event-grid .edge-event-row summary {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 4px;
  color: var(--cc-muted);
  cursor: pointer;
  list-style: none;
}

.edge-event-grid .edge-event-row summary::-webkit-details-marker {
  display: none;
}

.edge-event-grid .edge-event-row summary:hover,
.edge-event-grid .edge-event-row summary:focus-visible {
  background: var(--cc-surface-subtle);
  color: var(--cc-text);
}

.edge-event-grid .edge-event-row details[open] pre {
  position: absolute;
  right: 0;
  z-index: 5;
  width: min(520px, calc(100vw - 64px));
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--cc-border-strong);
  border-radius: var(--cc-radius-sm);
  padding: 10px;
  background: #fff;
  box-shadow: var(--cc-shadow-md);
}

.edge-service-chip-empty {
  color: var(--cc-muted);
  font-size: 10px;
  white-space: nowrap;
}

/* Compact operational surfaces */

.sidebar .nav {
  grid-template-columns: minmax(0, 1fr);
}

.sidebar .nav > * {
  min-width: 0;
  grid-column: 1;
}

.route-loading {
  display: flex;
  min-height: 240px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--cc-muted);
}

.route-loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--cc-border-strong);
  border-top-color: var(--cc-accent);
  border-radius: 50%;
  animation: route-loading-spin 700ms linear infinite;
}

@keyframes route-loading-spin {
  to { transform: rotate(360deg); }
}

.device-tool-tree-head h1 {
  margin: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 720;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.device-utility-page {
  display: grid;
  gap: 12px;
}

#device-operations-workspace > [hidden] {
  display: none !important;
}

.operations-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--cc-border);
  padding-bottom: 8px;
}

.operations-subnav a {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--cc-muted);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.operations-subnav a:hover,
.operations-subnav a.active {
  border-color: #a9d7d9;
  background: var(--cc-accent-soft);
  color: var(--cc-accent-hover);
}

.utility-availability-note {
  margin: 0;
  border-left: 3px solid var(--cc-warning);
  border-radius: var(--cc-radius-sm);
  padding: 8px 10px;
  background: #fff8e8;
  color: #72561b;
  font-size: 12px;
}

.terminal-job-fallback {
  display: grid;
  gap: 12px;
}

.wifi-inactive-radios {
  grid-column: 1 / -1;
  overflow: clip;
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius-sm);
  background: var(--cc-surface-subtle);
}

.wireless-survey-grid > :only-child {
  grid-column: 1 / -1;
}

.wifi-inactive-radios > summary {
  min-height: 40px;
  cursor: pointer;
  padding: 10px 12px;
  color: var(--cc-text-soft);
  font-size: 12px;
  font-weight: 650;
}

.wifi-inactive-radios[open] > summary {
  border-bottom: 1px solid var(--cc-border);
}

.wifi-inactive-radio-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
}

.scan-history-workspace-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.36fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.scan-history-index,
.scan-history-result-panel {
  min-width: 0;
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius);
  background: #fff;
}

.scan-history-index {
  overflow: clip;
}

.scan-history-index .wifi-history-rows-full,
.scan-history-index .bt-history-rows-full {
  max-height: 620px;
  overflow-y: auto;
}

.scan-history-index [data-progressive-row][hidden] {
  display: none !important;
}

.scan-history-result-panel {
  padding: 12px;
}

.scan-failure-state {
  border-left: 3px solid var(--cc-danger);
  border-radius: var(--cc-radius-sm);
  padding: 10px 12px;
  background: #fff4f5;
  color: var(--cc-text-soft);
}

.scan-failure-state strong {
  color: var(--cc-danger);
}

.scan-failure-state p {
  margin: 4px 0 0;
  white-space: pre-wrap;
}

.diagnostic-empty-state {
  display: grid;
  min-height: 150px;
  place-content: center;
  gap: 4px;
  border: 1px dashed var(--cc-border-strong);
  border-radius: var(--cc-radius);
  padding: 20px;
  color: var(--cc-muted);
  text-align: center;
  background: var(--cc-surface-subtle);
}

.diagnostic-empty-state strong {
  color: var(--cc-text);
}

.scan-history-row.selected,
.bt-history-row.selected {
  background: var(--cc-accent-soft);
  box-shadow: inset 3px 0 0 var(--cc-accent);
}

.bt-scan-controls,
.wifi-scan-controls,
.device-page-title {
  min-width: 0;
}

.bt-scan-controls,
.wifi-scan-controls {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cell-at-advanced {
  margin-top: 14px;
  overflow: clip;
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius);
  background: var(--cc-surface-subtle);
}

.cell-at-advanced > summary,
.notification-rules-disclosure > summary {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  padding: 10px 12px;
  color: var(--cc-text-soft);
}

.cell-at-advanced-body {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--cc-border);
  padding: 12px;
}

.notification-rules-disclosure {
  padding: 0 !important;
  overflow: clip;
}

.notification-rules-disclosure > summary span {
  color: var(--cc-muted);
  font-size: 11px;
}

.notification-rules-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.36fr) minmax(0, 1fr);
  gap: 16px;
  border-top: 1px solid var(--cc-border);
  padding: 14px;
}

.template-target-picker {
  margin: -4px 0 12px;
  border-bottom: 1px solid var(--cc-border);
  padding-bottom: 10px;
}

.template-target-picker fieldset {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  border: 0;
  padding: 0;
}

.template-target-picker legend {
  float: left;
  margin-right: 8px;
  color: var(--cc-text-soft);
  font-size: 11px;
  font-weight: 650;
}

.template-target-picker .check-list {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-wrap: wrap;
  gap: 6px;
}

.template-target-picker .check-row {
  min-height: 34px;
  border: 1px solid var(--cc-border);
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--cc-surface-subtle);
}

.edge-list-toolbar .search-box {
  flex: 1 1 260px;
}

.toolbar-select select {
  min-width: 128px;
}

.network-edge-readiness {
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 10px;
  border-left-width: 3px;
  border-radius: var(--cc-radius-sm);
  padding: 6px 9px;
  box-shadow: none;
}

.network-edge-readiness strong {
  flex: 0 1 auto;
  font-size: 12px;
}

.network-edge-readiness > span:not(.status-badge) {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  color: var(--cc-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.network-edge-readiness .button {
  min-height: 30px;
  margin-left: auto;
}

.network-test-device-preview {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  border-left-width: 3px;
  padding: 8px;
}

.network-test-device-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.network-test-device-line small {
  min-width: 0;
  flex: 1;
  text-align: right;
}

.network-test-choice-grid {
  grid-column: auto;
}

.network-test-choice {
  min-height: 42px;
  padding: 5px 7px;
}

.network-target-preset-grid {
  display: flex;
  flex-wrap: wrap;
}

.network-target-preset.button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  text-align: center;
}

.network-test-advanced > summary {
  min-height: 44px;
}

.log-layout {
  grid-template-columns: 1fr;
}

.log-nav {
  margin-top: -4px;
}

/* Responsive shell */

@container (max-width: 1200px) {
  .device-fleet-table :is(.device-col-mac, .device-col-serial),
  .edge-fleet-table :is(.edge-col-ip, .edge-col-version) {
    display: none;
  }
}

@container (max-width: 980px) {
  .device-fleet-table :is(.device-col-model, .device-col-uptime) {
    display: none;
  }
}

@container (max-width: 850px) {
  .network-test-history-table :is(.col-phase, .col-down, .col-up, .col-latency, .col-iperf) {
    display: none;
  }
}

@media (max-width: 1180px) {
  .view {
    padding-right: 22px;
    padding-left: 22px;
  }

  .workspace-topbar {
    padding-right: 20px;
    padding-left: 20px;
  }

  .device-workspace-shell {
    grid-template-columns: 224px minmax(0, 1fr);
    gap: 14px;
  }

  .device-tool-tree {
    width: 224px;
  }

}

@media (max-width: 980px) {
  body.mobile-nav-open {
    overflow: hidden;
  }

  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 120;
    display: grid;
    width: min(292px, calc(100vw - 48px));
    height: 100dvh;
    transform: translateX(-104%);
    box-shadow: 18px 0 54px rgba(5, 18, 23, 0.24);
    transition: transform 210ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .app-shell.mobile-nav-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-scrim {
    position: fixed;
    z-index: 110;
    inset: 0;
    display: block;
    border: 0;
    background: rgba(7, 22, 27, 0.46);
    opacity: 0;
    padding: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .app-shell.mobile-nav-open .sidebar-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .workspace-topbar {
    position: sticky;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 9px;
    padding: 10px 14px;
  }

  .device-list-mode .workspace-topbar,
  .edge-list-mode .workspace-topbar,
  .edge-focus-mode .workspace-topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .device-list-mode .notification-button,
  .edge-list-mode .notification-button,
  .edge-focus-mode .notification-button {
    grid-column: 3;
  }

  .mobile-nav-toggle {
    display: inline-grid;
    width: 40px;
    height: 40px;
    place-content: center;
    gap: 4px;
    border: 1px solid var(--cc-border);
    border-radius: 9px;
    background: #fff;
    color: var(--cc-text-soft);
    padding: 0;
  }

  .mobile-nav-toggle span {
    display: block;
    width: 16px;
    height: 1.5px;
    border-radius: 2px;
    background: currentColor;
  }

  .topbar-stats {
    display: none;
  }

  .topbar-search {
    width: 100%;
    max-width: none;
  }

  .device-focus-mode .mobile-nav-toggle {
    display: none;
  }

  .device-focus-mode .workspace-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .device-workspace-shell {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .device-tool-tree {
    position: static;
    width: 100%;
    max-height: none;
  }

  .device-tool-tree-head {
    align-items: center;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 10px;
    border-bottom: 0;
    padding: 5px;
  }

  .device-tool-tree-head > strong,
  .device-tool-tree-head > small {
    grid-column: 1;
  }

  .device-tree-head-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
  }

  .device-tree-head-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
  }

  .device-focus-exit,
  .device-tree-mobile-toggle {
    min-height: 34px;
    margin: 0;
    white-space: nowrap;
  }

  .device-tree-mobile-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid rgba(216, 231, 234, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #c9dadd;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 600;
  }

  .device-tree-mobile-toggle:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
  }

  .device-tree-mobile-toggle svg {
    width: 13px;
    height: 13px;
    margin: 0;
    transition: transform 160ms ease;
  }

  .device-tree-root.mobile-tree-open .device-tree-mobile-toggle svg {
    transform: rotate(180deg);
  }

  /* Nav body collapses; global actions stay visible (sole home for Settings/Refresh/Reboot). */
  .device-tree-root:not(.mobile-tree-open) .device-tree-body {
    display: none;
  }

  .device-tree-root .device-tree-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    grid-column: 1 / -1;
    margin-top: 8px;
  }

  .device-tree-root.mobile-tree-open .device-tree-body {
    margin-top: 4px;
    border-top: 1px solid rgba(216, 231, 234, 0.1);
    padding-top: 8px;
  }
}

@media (max-width: 700px) {
  .view,
  .workspace-topbar {
    padding-right: 12px;
    padding-left: 12px;
  }

  .view {
    padding-top: 18px;
    padding-bottom: 40px;
  }

  .page-head,
  .devices-header,
  .device-titlebar,
  .device-utilitybar {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .page-head {
    margin-bottom: 12px;
  }

  h1,
  .devices-header h1 {
    font-size: 24px;
  }

  .page-head .button-row,
  .devices-header-actions {
    justify-content: flex-start;
  }

  .page-head .button-row .button,
  .devices-header-actions .button {
    flex: 1 1 auto;
  }

  .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-cell {
    min-height: 98px;
    padding: 14px;
  }

  .summary-cell strong {
    font-size: 24px;
  }

  .console-grid {
    gap: 12px;
  }

  .console-grid > .console-panel:not(.table-panel),
  .dashboard-fleet-grid > .console-panel:not(.table-panel),
  .dashboard-secondary-grid > .console-panel:not(.table-panel) {
    padding: 15px;
  }

  .toolbar.tight {
    align-items: stretch;
  }

  .toolbar.tight input[type="search"],
  .toolbar.tight .button {
    width: 100%;
  }

  .progressive-table-footer {
    align-items: stretch;
    flex-direction: column;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .progressive-table-footer .button {
    width: 100%;
    margin-left: 0;
  }

  .inline-form {
    align-items: stretch;
    flex-direction: column;
  }

  .login-card {
    padding: 22px;
  }

  .goodcloud-device-hero {
    padding: 14px;
  }

  .device-tree-root.mobile-tree-open .device-tree-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .device-fleet-table :is(.device-col-capabilities, .device-col-model, .device-col-ip, .device-col-seen),
  .edge-fleet-table :is(.edge-col-host, .edge-col-services, .edge-col-seen),
  .network-test-history-table :is(.col-created, .col-profile, .col-phase, .col-down, .col-up, .col-latency, .col-iperf),
  .device-diagnostic-history-table :is(.col-created, .col-profile, .col-phase, .col-down, .col-up, .col-latency, .col-iperf),
  .command-history-table .col-created,
  .audit-log-table :is(.col-kind, .col-status),
  .alert-log-table .col-trigger,
  .device-client-table :is(.col-mac, .col-interface) {
    display: none;
  }

  .device-fleet-table .device-col-name,
  .edge-fleet-table .edge-col-name,
  .priority-table :is(.col-device, .col-content),
  .device-client-table .col-name {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .device-fleet-table .device-col-name,
  .edge-fleet-table .edge-col-name {
    width: 42%;
  }

  .priority-table th,
  .priority-table td,
  .device-fleet-table th,
  .device-fleet-table td,
  .edge-fleet-table th,
  .edge-fleet-table td {
    padding-right: 8px;
    padding-left: 8px;
  }

  .network-test-history-table .table-action-row {
    display: grid;
    gap: 6px;
  }
}

@media (max-width: 460px) {
  .workspace-topbar {
    gap: 7px;
  }

  .mobile-nav-toggle,
  .notification-button {
    width: 38px;
    height: 38px;
    min-height: 38px;
  }

  .topbar-search {
    min-height: 38px;
    padding: 0 10px;
  }

  .topbar-search input {
    font-size: 12px;
  }

  .summary-strip {
    grid-template-columns: 1fr;
  }

  .device-tool-tree-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .device-tree-head-top {
    width: 100%;
  }

  .device-tree-head-controls {
    margin-top: 0;
  }

  .summary-cell {
    min-height: 90px;
  }

  .devices-header-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .devices-header-actions .search-box {
    grid-column: 1 / -1;
    width: 100%;
  }

  .devices-header-actions .button:last-child:nth-child(even) {
    grid-column: 1 / -1;
  }

  th,
  td {
    padding: 10px 11px;
  }

  .log-nav {
    flex-wrap: nowrap;
    margin-right: -12px;
    margin-left: -12px;
    overflow-x: auto;
    padding: 0 12px 4px;
    scrollbar-width: none;
  }

  .log-nav::-webkit-scrollbar {
    display: none;
  }

  .log-nav a {
    flex: none;
  }

  .alert-log-table .col-created {
    display: none;
  }
}

@media (max-width: 1240px) {
  .edge-offering-section-grid,
  .edge-ops-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .edge-detail-utilitybar {
    align-items: center;
    flex-direction: row;
    gap: 8px;
  }

  .edge-detail-utilitybar .button-row {
    flex-wrap: nowrap;
    gap: 5px;
    margin-left: auto;
  }

  .edge-detail-utilitybar .button {
    min-height: 32px;
    padding-right: 9px;
    padding-left: 9px;
  }

  .edge-detail-summary {
    padding: 10px;
  }

  .edge-detail-facts > div,
  .edge-detail-facts > div:nth-child(4) {
    border-top: 0;
    border-left: 1px solid var(--cc-border);
    padding: 0 7px;
  }

  .edge-detail-facts > div:first-child {
    border-left: 0;
    padding-left: 0;
  }

  .edge-offering-navigation {
    padding-right: 6px;
    padding-left: 6px;
  }

  .edge-offering-panel {
    gap: 7px;
    padding: 7px;
  }

  .edge-offering-settings,
  .edge-offering-activity {
    padding: 0;
  }

  .edge-offering-form,
  .edge-ops-form {
    grid-template-columns: 1fr;
  }

  .edge-offering-panel .edge-control-fields,
  .edge-ops-fields {
    grid-template-columns: 1fr 1fr;
  }

  .edge-offering-panel .edge-control-actions,
  .edge-ops-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .edge-ops-toolbar {
    flex-wrap: wrap;
  }

  .edge-ops-field,
  .edge-ops-field.grow {
    flex: 1 1 calc(50% - 6px);
  }

  .edge-offering-panel .edge-service-peer-row,
  .edge-ops-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .edge-offering-panel .edge-service-peer-main {
    grid-column: 1;
    grid-template-columns: 16px minmax(0, 1fr);
  }

  .edge-offering-panel .edge-service-peer-row > [data-edge-ipsec-action="leave"],
  .edge-offering-panel .edge-service-peer-row > [data-edge-wireguard-action="detach"],
  .edge-ops-row-actions {
    grid-column: 2;
    justify-self: end;
  }

  .edge-ops-listen-row {
    grid-template-columns: 44px 40px minmax(0, 1fr) minmax(52px, auto);
  }

  .edge-ops-listen-row small {
    display: none;
  }

  .edge-event-grid,
  .edge-ops-event-grid {
    grid-template-columns: 1fr;
  }

  .edge-event-grid .edge-event-row,
  .edge-ops-event-grid .edge-event-row {
    grid-template-columns: minmax(58px, 0.5fr) minmax(0, 1fr) 18px;
  }

  .edge-event-grid .edge-event-row time,
  .edge-ops-event-grid .edge-event-row time {
    display: none;
  }
}

@media (max-width: 460px) {
  .edge-detail-mark {
    width: 38px;
    height: 38px;
    border-radius: 9px;
  }

  .edge-detail-title {
    max-width: none;
  }

  .edge-detail-title h1 {
    font-size: 19px;
  }

  .edge-detail-status {
    width: auto;
  }

  .edge-offering-tab {
    min-width: 0;
    padding-right: 8px;
    padding-left: 8px;
  }

  .edge-offering-panel .edge-control-actions {
    display: flex;
    width: auto;
  }

  .edge-offering-panel .edge-control-actions .button {
    width: auto;
  }
}

@media (max-width: 980px) {
  .sidebar .nav,
  .sidebar .nav-tree-panel-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar .nav > *,
  .sidebar .nav-tree-panel-inner > * {
    width: 100%;
    min-width: 0;
    grid-column: 1;
  }

  .device-tool-tree-head > h1,
  .device-tool-tree-head > small {
    grid-column: 1;
  }

  .device-overview-data-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .network-test-layout,
  .notification-rules-layout,
  .scan-history-workspace-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .test-runner {
    position: static;
  }

  .wifi-inactive-radio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .page-head {
    gap: 9px;
  }

  .page-head .button-row .button,
  .devices-header-actions .button {
    min-height: 40px;
    flex: 0 1 auto;
  }

  .button:not(.icon-button),
  input:not([type="checkbox"]):not([type="radio"]),
  select {
    min-height: 40px;
  }

  .summary-cell {
    min-height: 82px;
    padding: 11px;
  }

  .summary-cell strong {
    font-size: 21px;
  }

  .device-page-title {
    align-items: stretch;
    flex-direction: column;
    gap: 9px;
  }

  .bt-scan-controls,
  .wifi-scan-controls {
    justify-content: flex-start;
  }

  .network-edge-readiness {
    align-items: center;
    flex-wrap: wrap;
  }

  .network-edge-readiness > span:not(.status-badge) {
    flex-basis: calc(100% - 110px);
  }

  .network-edge-readiness .button {
    margin-left: 0;
  }

  .network-test-device-line {
    flex-wrap: wrap;
  }

  .network-test-device-line small {
    flex-basis: 100%;
    text-align: left;
  }

  .network-test-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .edge-list-toolbar {
    align-items: stretch;
  }

  .edge-list-toolbar .search-box {
    flex-basis: 100%;
  }

  .toolbar-select,
  .toolbar-select select {
    flex: 1 1 auto;
    width: 100%;
  }

  .template-target-picker fieldset,
  .template-target-picker .check-list {
    align-items: stretch;
    flex-direction: column;
  }

  .template-target-picker legend {
    float: none;
  }

  .template-target-picker .check-row {
    border-radius: var(--cc-radius-sm);
  }

  .log-nav {
    flex-wrap: wrap;
    margin-right: 0;
    margin-left: 0;
    overflow: visible;
    padding: 0;
  }

  .log-nav a {
    min-height: 40px;
    flex: 1 1 auto;
    justify-content: center;
  }

  .toolbar.tight input[type="search"] {
    height: 40px;
    min-height: 40px;
    flex: 0 0 auto;
  }

  .wifi-inactive-radio-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .scan-history-index .wifi-history-rows-full,
  .scan-history-index .bt-history-rows-full {
    max-height: 460px;
  }

  :is(
    .agent-upgrade-table,
    .agent-upgrade-jobs-table,
    .recent-alerts-table,
    .alert-rules-table,
    .templates-table,
    .site-network-table,
    .command-history-table,
    .audit-log-table
  ) {
    display: block;
    width: 100%;
    min-width: 0;
  }

  :is(
    .agent-upgrade-table,
    .agent-upgrade-jobs-table,
    .recent-alerts-table,
    .alert-rules-table,
    .templates-table,
    .site-network-table,
    .command-history-table,
    .audit-log-table
  ) thead {
    display: none;
  }

  :is(
    .agent-upgrade-table,
    .agent-upgrade-jobs-table,
    .recent-alerts-table,
    .alert-rules-table,
    .templates-table,
    .site-network-table,
    .command-history-table,
    .audit-log-table
  ) tbody {
    display: grid;
    gap: 9px;
    padding: 9px;
  }

  :is(
    .agent-upgrade-table,
    .agent-upgrade-jobs-table,
    .recent-alerts-table,
    .alert-rules-table,
    .templates-table,
    .site-network-table,
    .command-history-table,
    .audit-log-table
  ) tr {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius-sm);
    background: #fff;
  }

  :is(
    .agent-upgrade-table,
    .agent-upgrade-jobs-table,
    .recent-alerts-table,
    .alert-rules-table,
    .templates-table,
    .site-network-table,
    .command-history-table,
    .audit-log-table
  ) tr[hidden] {
    display: none !important;
  }

  :is(
    .agent-upgrade-table,
    .agent-upgrade-jobs-table,
    .recent-alerts-table,
    .alert-rules-table,
    .templates-table,
    .site-network-table,
    .command-history-table,
    .audit-log-table
  ) td {
    position: static !important;
    display: grid !important;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 9px;
    align-items: start;
    min-width: 0;
    border-bottom: 1px solid var(--cc-border);
    padding: 8px 10px;
    background: #fff !important;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  :is(
    .agent-upgrade-table,
    .agent-upgrade-jobs-table,
    .recent-alerts-table,
    .alert-rules-table,
    .templates-table,
    .site-network-table,
    .command-history-table,
    .audit-log-table
  ) td:last-child {
    border-bottom: 0;
  }

  :is(
    .agent-upgrade-table,
    .agent-upgrade-jobs-table,
    .recent-alerts-table,
    .alert-rules-table,
    .templates-table,
    .site-network-table,
    .command-history-table,
    .audit-log-table
  ) td::before {
    color: var(--cc-muted);
    font-size: 10px;
    font-weight: 720;
    letter-spacing: 0.035em;
    text-transform: uppercase;
  }

  :is(.agent-upgrade-table, .agent-upgrade-jobs-table, .recent-alerts-table, .alert-rules-table, .templates-table, .site-network-table, .command-history-table, .audit-log-table) .empty-cell {
    display: block !important;
  }

  :is(.agent-upgrade-table, .agent-upgrade-jobs-table, .recent-alerts-table, .alert-rules-table, .templates-table, .site-network-table, .command-history-table, .audit-log-table) td[colspan] {
    display: block !important;
  }

  :is(.agent-upgrade-table, .agent-upgrade-jobs-table, .recent-alerts-table, .alert-rules-table, .templates-table, .site-network-table, .command-history-table, .audit-log-table) .empty-cell::before {
    display: none;
  }

  :is(.agent-upgrade-table, .agent-upgrade-jobs-table, .recent-alerts-table, .alert-rules-table, .templates-table, .site-network-table, .command-history-table, .audit-log-table) td[colspan]::before {
    display: none;
  }

  .agent-upgrade-table td:nth-child(1)::before { content: "Device"; }
  .agent-upgrade-table td:nth-child(2)::before { content: "Current"; }
  .agent-upgrade-table td:nth-child(3)::before { content: "Target"; }
  .agent-upgrade-table td:nth-child(4)::before { content: "Arch"; }
  .agent-upgrade-table td:nth-child(5)::before { content: "State"; }
  .agent-upgrade-table td:nth-child(6)::before { content: "Reason"; }
  .agent-upgrade-table td:nth-child(7)::before { content: "Action"; }
  .agent-upgrade-jobs-table td:nth-child(1)::before { content: "Created"; }
  .agent-upgrade-jobs-table td:nth-child(2)::before { content: "Device"; }
  .agent-upgrade-jobs-table td:nth-child(3)::before { content: "Target"; }
  .agent-upgrade-jobs-table td:nth-child(4)::before { content: "Status"; }
  .agent-upgrade-jobs-table td:nth-child(5)::before { content: "Command"; }
  .recent-alerts-table td:nth-child(1)::before { content: "Time"; }
  .recent-alerts-table td:nth-child(2)::before { content: "Severity"; }
  .recent-alerts-table td:nth-child(3)::before { content: "Device"; }
  .recent-alerts-table td:nth-child(4)::before { content: "Trigger"; }
  .recent-alerts-table td:nth-child(5)::before { content: "Message"; }
  .recent-alerts-table td:nth-child(6)::before { content: "Payload"; }
  .alert-rules-table td:nth-child(1)::before { content: "Name"; }
  .alert-rules-table td:nth-child(2)::before { content: "Status"; }
  .alert-rules-table td:nth-child(3)::before { content: "Trigger"; }
  .alert-rules-table td:nth-child(4)::before { content: "Severity"; }
  .alert-rules-table td:nth-child(5)::before { content: "Scope"; }
  .alert-rules-table td:nth-child(6)::before { content: "Action"; }
  .alert-rules-table td:nth-child(7)::before { content: "Updated"; }
  .alert-rules-table td:nth-child(8)::before { content: "Controls"; }
  .templates-table td:nth-child(1)::before { content: "Updated"; }
  .templates-table td:nth-child(2)::before { content: "Name"; }
  .templates-table td:nth-child(3)::before { content: "Description"; }
  .templates-table td:nth-child(4)::before { content: "Body"; }
  .templates-table td:nth-child(5)::before { content: "Apply"; }
  .site-network-table td:nth-child(1)::before { content: "Created"; }
  .site-network-table td:nth-child(2)::before { content: "Name"; }
  .site-network-table td:nth-child(3)::before { content: "Main"; }
  .site-network-table td:nth-child(4)::before { content: "CIDR"; }
  .site-network-table td:nth-child(5)::before { content: "Nodes"; }
  .site-network-table td:nth-child(6)::before { content: "Policy"; }
  .site-network-table td:nth-child(7)::before { content: "Configs"; }
  .command-history-table td:nth-child(1)::before { content: "Created"; }
  .command-history-table td:nth-child(2)::before { content: "Device"; }
  .command-history-table td:nth-child(3)::before { content: "Type"; }
  .command-history-table td:nth-child(4)::before { content: "Status"; }
  .command-history-table td:nth-child(5)::before { content: "Payload"; }
  .audit-log-table td:nth-child(1)::before { content: "Created"; }
  .audit-log-table td:nth-child(2)::before { content: "Type"; }
  .audit-log-table td:nth-child(3)::before { content: "Device"; }
  .audit-log-table td:nth-child(4)::before { content: "Activity"; }
  .audit-log-table td:nth-child(5)::before { content: "Status"; }
  .audit-log-table td:nth-child(6)::before { content: "Details"; }
}

@media (max-width: 460px) {
  .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .device-tool-tree-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .device-tool-tree-head > h1,
  .device-tool-tree-head > small {
    grid-column: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .sidebar-scrim,
  .skip-link,
  .button,
  .action-menu summary,
  tbody tr,
  .edge-offering-tab-item {
    transition: none;
  }

  .route-loading-spinner {
    animation: none;
  }
}
