* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 106px minmax(0, 1fr) 174px;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  overflow: hidden;
}

button {
  font: inherit;
  color: inherit;
}

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  flex-direction: column;
  padding: 0;
  background: var(--panel);
  box-shadow: 0 1px 0 var(--border);
  z-index: 5;
  min-height: 0;
}
.topbar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  flex: none;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  order: 1;
  margin-left: auto;
}
.brand-mark {
  width: 16px;
  height: 16px;
  color: var(--brand);
  flex: none;
}
.brand-text {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  line-height: 1;
}
.brand-text strong {
  font-size: 11.5px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.topo-name {
  font-size: 10.5px;
  color: var(--ink-soft);
  border: 0;
  background: transparent;
  padding: 0;
  width: 118px;
  min-width: 0;
}
.topo-name:focus {
  outline: none;
  color: var(--brand-ink);
}

/* ---------- menu bar ---------- */

.menubar {
  display: flex;
  align-items: center;
  gap: 1px;
  flex: 1;
  order: 0;
  height: 22px;
  min-width: 0;
}
.menu {
  position: relative;
}
.menu-title {
  border: 0;
  background: transparent;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}
.menu-title:hover,
.menu:focus-within .menu-title {
  background: var(--panel-alt);
  color: var(--ink);
}
.menu-panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 220px;
  padding: 5px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 60;
}
.menu:focus-within .menu-panel {
  display: block;
}
.menu-item {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 6px 9px;
  border-radius: 6px;
  text-align: left;
  font-size: 12.5px;
  color: var(--ink-soft);
  cursor: pointer;
}
.menu-item:hover,
.menu-item:focus {
  background: var(--brand-soft);
  color: var(--brand-ink);
  outline: none;
}
.menu-item:disabled {
  color: var(--ink-faint);
  background: transparent;
  cursor: default;
}
/* Toggle commands (role=menuitemcheckbox) show a check mark like PT's Options menu. */
.menu-item[role="menuitemcheckbox"] {
  padding-left: 22px;
  position: relative;
}
.menu-item[aria-checked="true"]::before {
  content: "\2713";
  position: absolute;
  left: 7px;
}
.menu-sep {
  display: block;
  height: 1px;
  margin: 4px 6px;
  background: var(--border);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 41px;
  /* 1px border + 1px + 37px buttons + 2px = 41px, so nothing overflows into a scrollbar. */
  padding: 1px 8px 2px;
  flex: none;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  min-width: 0;
  border-top: 1px solid var(--border);
  scrollbar-width: thin;
}
.toolbar .btn {
  width: 37px;
  min-width: 37px;
  height: 37px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  white-space: nowrap;
  position: relative;
}
.tool-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
}
.tool-icon svg {
  width: 20px;
  height: 20px;
}
.tool-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.toolbar-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
  flex: none;
}
/* Clone-only tools after PT's set: fill the stretch area before Contents and
   wrap what does not fit onto a clipped second row (moved to the More menu). */
.toolbar-extras {
  flex: 1 1 0;
  min-width: 0;
  height: 37px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: flex-start;
  gap: 3px;
  overflow: hidden;
}
.toolbar-extras > * {
  flex: none;
}
.toolbar-extras .toolbar-sep {
  margin: 8px 2px 9px;
}
.toolbar-extras .is-overflowed {
  visibility: hidden;
}
.toolbar-more {
  flex: none;
}
.toolbar-more[hidden] {
  display: none;
}
.toolbar-more .menu-panel {
  position: fixed;
  left: auto;
  /* Under the More button, which sits just left of Contents at the right end. */
  top: 66px;
  right: 44px;
  max-height: 70vh;
  overflow-y: auto;
}
.toolbar-more .menu-item.is-in-bar,
.toolbar-more .menu-sep.is-in-bar {
  display: none;
}
.toolbar-more-btn {
  font-size: 15px;
}
.toolbar-spacer {
  flex: 1;
  min-width: 8px;
}
.mode-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 43px;
  /* 1px border + 1px + 39px tools + 2px = 43px. */
  padding: 1px 8px 2px;
  flex: none;
  border-top: 1px solid var(--border);
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
}
.mode-tool {
  width: 39px;
  height: 39px;
  padding: 0;
  display: grid;
  place-items: center;
  position: relative;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.mode-tool .tool-icon {
  width: 22px;
  height: 22px;
}
.mode-tool .tool-icon svg {
  width: 22px;
  height: 22px;
}
.mode-tool:hover {
  border-color: var(--border-strong);
  color: var(--ink);
  background: var(--panel-alt);
}
.mode-tool.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.mode-tool-sep {
  width: 1px;
  height: 22px;
  background: var(--border);
  margin: 0 4px;
  flex: none;
}

.btn {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--ink-soft);
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.12s,
    border-color 0.12s,
    color 0.12s;
}
.btn:hover {
  background: var(--panel-alt);
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}
.btn-ghost {
  border-color: transparent;
  background: transparent;
}
.btn-ghost:hover {
  background: var(--panel-alt);
  border-color: var(--border);
}

.mode-badge {
  margin-left: 6px;
  order: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 7px;
  white-space: nowrap;
  flex: none;
}
.mode-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.14);
}

/* ---------- workspace ---------- */

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  position: relative;
}

.palette {
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 4px 10px 2px;
  display: grid;
  grid-template-columns: 308px minmax(0, 1fr);
  grid-template-rows: 43px 22px 43px 20px;
  grid-template-areas:
    "cats-top models"
    "search models"
    "cats-bottom models"
    "cats-bottom label";
  column-gap: 10px;
  row-gap: 2px;
  min-height: 0;
  overflow: hidden;
}

.palette-search {
  grid-area: search;
  width: 285px;
  max-width: 100%;
  height: 22px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--panel-alt);
  color: var(--ink);
  font: inherit;
  font-size: 11px;
}
.palette-search:focus {
  outline: 2px solid var(--brand);
  outline-offset: -1px;
}

#palette-devices {
  display: contents;
}

.palette-categories {
  display: grid;
  grid-template-rows: 43px;
  grid-auto-flow: column;
  grid-auto-columns: 43px;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  min-height: 0;
}
.palette-cats-top {
  grid-area: cats-top;
}
.palette-cats-bottom {
  grid-area: cats-bottom;
  align-self: start;
}

.palette-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 43px;
  height: 43px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-alt);
  font-size: 8.5px;
  font-weight: 600;
  line-height: 1.05;
  text-align: center;
  color: var(--ink-soft);
  overflow: hidden;
  cursor: pointer;
}
.palette-chip-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--ink-soft);
  flex: none;
}
.palette-chip-icon svg {
  width: 22px;
  height: 22px;
}
.palette-chip-label {
  max-width: 40px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 7px;
  line-height: 1;
}
.palette-chip:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}
.palette-chip:hover .palette-chip-icon {
  color: var(--ink);
}
.palette-chip.is-active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-ink);
}
.palette-chip.is-active .palette-chip-icon {
  color: var(--brand-ink);
}

.palette-models {
  grid-area: models;
  display: grid;
  grid-template-columns: repeat(auto-fill, 45px);
  grid-auto-rows: 45px;
  gap: 5px;
  overflow-y: auto;
  min-height: 0;
  align-content: flex-start;
}

.palette-selection-label {
  grid-area: label;
  display: flex;
  align-items: center;
  height: 20px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10.5px;
  color: var(--ink-faint);
}

.palette-model {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink-soft);
  cursor: pointer;
  padding: 2px;
}
.palette-model:hover {
  border-color: var(--border-strong);
  background: var(--panel-alt);
  color: var(--ink);
}
.palette-model .palette-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
}
.palette-model .palette-icon svg {
  width: 30px;
  height: 30px;
}
.palette-model-label {
  display: none;
}

.palette > .palette-group {
  display: none;
}
.palette > .palette-group h2 {
  margin: 0 0 2px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-faint);
  position: sticky;
  top: 0;
  background: var(--panel);
  padding: 2px 0;
}

.palette-empty {
  padding: 4px 6px;
  font-size: 12px;
  color: var(--ink-faint);
}

.palette-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition:
    background 0.12s,
    border-color 0.12s;
}
.palette-item:hover {
  background: var(--panel-alt);
  border-color: var(--border);
}
.palette-item.is-active {
  background: var(--brand-soft);
  border-color: #c7d2fe;
  box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.12);
}
.palette-icon {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  color: var(--brand-ink);
}
.palette-icon svg {
  width: 30px;
  height: 30px;
}
.palette-label {
  display: flex;
  flex-direction: column;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.25;
}
.palette-label small {
  font-weight: 500;
  font-size: 10.5px;
  color: var(--ink-faint);
}

.palette-item {
  padding: 4px 6px;
  gap: 6px;
  border-radius: 8px;
}
.palette-icon {
  width: 24px;
  height: 24px;
}
.palette-icon svg {
  width: 22px;
  height: 22px;
}
.palette-label {
  font-size: 11px;
}
.palette-label small {
  font-size: 9.5px;
}

.palette-hint {
  display: none;
}
.palette-hint strong {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin-bottom: 4px;
}
.palette-hint ol {
  margin: 0;
  padding-left: 16px;
  line-height: 1.55;
}

/* ---------- canvas ---------- */

/* PT stacks a 36 px Logical/Physical frame (m_PLFrame) above the workspace: the two
   mode switches, then the logical toolbar (xy label left; cluster name, Back, New
   Cluster, Move Object, Set Background Image and Environment right) or, in physical
   mode, the physical location bar. The stage takes the rest of the column. */
.canvas-wrap {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.pl-frame {
  flex: none;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 2px 0 0;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 6;
}
.mode-chips {
  display: flex;
  gap: 2px;
  flex: none;
  height: 100%;
  align-items: center;
}
.mode-chip {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.mode-chip:hover {
  color: var(--ink);
  background: var(--panel-alt);
}
.mode-chip.is-active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-ink);
}
.pl-spacer {
  flex: 1;
  min-width: 8px;
}
.pl-btn {
  height: 32px;
  min-width: 36px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  flex: none;
  position: relative;
}
.pl-btn .tool-icon svg {
  width: 18px;
  height: 18px;
}
.pl-btn:hover:not(:disabled) {
  background: var(--panel-alt);
  border-color: var(--border);
  color: var(--ink);
}
.pl-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.pl-btn[aria-pressed="true"] {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-ink);
}
.pl-btn .tool-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
#stage {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: block;
  touch-action: none;
  cursor: default;
  /* Dragging on the canvas (pan, marquee, moving devices or notes) must not select label or note text. */
  -webkit-user-select: none;
  user-select: none;
}
/* While a canvas drag runs, the pointer may cross panels; nothing on the page is selectable meanwhile. */
body.is-canvas-dragging {
  -webkit-user-select: none;
  user-select: none;
}
#stage.is-placing {
  cursor: copy;
}
#stage.is-connecting {
  cursor: crosshair;
}
#stage.is-deleting {
  cursor: not-allowed;
}
#stage.is-inspecting {
  cursor: help;
}
#stage.is-resizing {
  cursor: nwse-resize;
}
#stage.is-inspecting .device,
#stage.is-inspecting .link-hit {
  cursor: help;
}
#stage.is-resizing .device {
  cursor: nwse-resize;
}
#stage.is-resizing .device .device-body {
  transition: transform 80ms linear;
}
#stage.is-panning {
  cursor: grabbing;
}
#stage.is-marquee {
  cursor: crosshair;
}
.marquee {
  fill: rgba(37, 99, 235, 0.08);
  stroke: #2563eb;
  stroke-width: 1;
  stroke-dasharray: 5 3;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.minimap {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 220px;
  height: 140px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.minimap svg {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}
.minimap .mm-device {
  fill: var(--brand);
}
.minimap .mm-link {
  stroke: var(--border-strong);
  stroke-width: 1;
}
.minimap .mm-viewport {
  fill: rgba(37, 99, 235, 0.08);
  stroke: var(--brand);
  stroke-width: 1;
}

.canvas-hint {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.82);
  color: #e2e8f0;
  font-size: 11.5px;
  padding: 6px 12px;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.canvas-hint.is-visible {
  opacity: 1;
}

/* ---------- device quick info ---------- */

.quick-info {
  position: fixed;
  z-index: 80;
  max-width: 430px;
  max-height: 70vh;
  overflow: auto;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--ink);
  font-size: 11px;
  line-height: 1.35;
  box-shadow: var(--shadow-md, 0 8px 22px rgba(15, 23, 42, 0.18));
  pointer-events: none;
}
.quick-info[hidden] {
  display: none;
}
.quick-info .quick-info-card {
  min-width: 210px;
}
.quick-info .quick-info-fields {
  margin: 0;
}
.quick-info .quick-info-row {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px;
}
.quick-info .quick-info-row dt {
  font-weight: 600;
  white-space: nowrap;
}
.quick-info .quick-info-row dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
.quick-info .quick-info-extras {
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid var(--border);
}
.quick-info table {
  width: 100%;
  margin-top: 6px;
  border-collapse: collapse;
  font-size: 10px;
}
.quick-info th,
.quick-info td {
  padding: 2px 4px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.quick-info th {
  font-weight: 600;
  color: var(--ink-soft);
}
.quick-info tbody tr:last-child td {
  border-bottom: 0;
}
.quick-info .is-message p {
  margin: 0;
  font-weight: 600;
  color: var(--ink-soft);
}
.quick-info .quick-info-remote {
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px solid var(--border);
}

/* ---------- workspace list view ---------- */

#stage[hidden] {
  display: none;
}
.canvas-wrap.is-list .minimap,
.canvas-wrap.is-list .canvas-hint,
.canvas-wrap.is-list .zoom-controls {
  display: none;
}

.workspace-list {
  position: absolute;
  inset: 36px 0 0 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
}
.workspace-list[hidden] {
  display: none;
}
/* The inspector is an overlay, so keep the list tables clear of it. */
.workspace:has(.inspector.is-open) .workspace-list {
  right: 384px;
}
.workspace-list-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.workspace-list-title h2 {
  margin: 0;
  font-size: 15px;
  color: var(--ink);
}
.workspace-list-summary {
  margin: 3px 0 0;
  color: var(--ink-faint);
  font-size: 11.5px;
}
.workspace-list-search {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
}
.workspace-list-search input {
  width: min(280px, 42vw);
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  font-size: 12px;
}
.workspace-list-search input:focus {
  outline: 2px solid var(--brand-soft);
  outline-offset: 1px;
}
.workspace-list-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px 18px 24px;
}
.workspace-list-section {
  margin-bottom: 22px;
}
.workspace-list-section:last-child {
  margin-bottom: 0;
}
.workspace-list-section-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 7px;
}
.workspace-list-section-head h3 {
  margin: 0;
  font-size: 12.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.workspace-list-count {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--panel-alt);
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 600;
  text-align: center;
}
.workspace-list-table {
  width: 100%;
  min-width: 620px;
  table-layout: fixed;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  font-size: 12px;
}
.workspace-list-device-table th:nth-child(1) {
  width: 22%;
}
.workspace-list-device-table th:nth-child(2) {
  width: 16%;
}
.workspace-list-device-table th:nth-child(3) {
  width: 16%;
}
.workspace-list-device-table th:nth-child(4) {
  width: 22%;
}
.workspace-list-device-table th:nth-child(5) {
  width: 8%;
}
.workspace-list-device-table th:nth-child(6) {
  width: 16%;
}
.workspace-list-link-table th:nth-child(1) {
  width: 32%;
}
.workspace-list-link-table th:nth-child(2) {
  width: 32%;
}
.workspace-list-link-table th:nth-child(3) {
  width: 20%;
}
.workspace-list-link-table th:nth-child(4) {
  width: 16%;
}
.workspace-list-table th {
  padding: 7px 11px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-alt);
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.workspace-list-table td {
  padding: 8px 11px;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  vertical-align: middle;
}
.workspace-list-table tbody tr:last-child td {
  border-bottom: 0;
}
.workspace-list-row {
  cursor: pointer;
}
.workspace-list-row:hover {
  background: var(--panel-alt);
}
.workspace-list-row:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}
.workspace-list-row.is-selected {
  background: var(--brand-soft);
}
.workspace-list-primary {
  display: flex;
  align-items: center;
  gap: 7px;
}
.workspace-list-name {
  font-weight: 600;
}
.workspace-list-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.workspace-list-muted {
  color: var(--ink-faint);
  font-size: 11px;
}
.workspace-list-tag {
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--panel-alt);
  color: var(--ink-soft);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.workspace-list-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-faint);
}
.workspace-list-dot[data-state="up"] {
  background: #16a34a;
}
.workspace-list-dot[data-state="down"] {
  background: #dc2626;
}
.workspace-list-dot[data-state="degraded"] {
  background: #d97706;
}
.workspace-list-dot[data-state="hidden"] {
  background: #94a3b8;
}
.workspace-list-dot[data-state="locked"] {
  background: #7c3aed;
}
.workspace-list-status {
  font-weight: 600;
  color: var(--ink-soft);
}
.workspace-list-status[data-state="up"] {
  color: #15803d;
}
.workspace-list-status[data-state="down"] {
  color: #b91c1c;
}
.workspace-list-status[data-state="degraded"] {
  color: #b45309;
}
.workspace-list-status[data-state="hidden"] {
  color: var(--ink-faint);
}
.workspace-list-status[data-state="locked"] {
  color: #6d28d9;
}
.workspace-list-empty {
  margin: 9px 0 0;
  padding: 12px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  color: var(--ink-faint);
  font-size: 11.5px;
  text-align: center;
}

.zoom-controls {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 9px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.zoom-btn {
  width: 32px;
  height: 30px;
  border: 0;
  background: var(--panel);
  color: var(--ink-soft);
  font-size: 15px;
  cursor: pointer;
}
.zoom-btn + .zoom-btn {
  border-top: 1px solid var(--border);
}
.zoom-btn:hover {
  background: var(--panel-alt);
  color: var(--ink);
}

/* ---------- activity instructions panel ---------- */

.activity-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  width: min(340px, calc(100% - 32px));
  max-height: calc(100% - 96px);
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.activity-panel.is-docked {
  left: 16px;
  right: auto;
}
.activity-panel.is-on-top {
  position: fixed;
  z-index: 70;
  top: 72px;
  right: 400px;
}
.activity-panel.is-on-top.is-docked {
  left: 240px;
  right: auto;
}

.activity-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 12px;
}
.activity-panel-head .link-btn {
  color: var(--brand-ink);
}

.activity-panel-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-alt);
  color: var(--ink-soft);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.activity-panel-status .is-expired {
  color: var(--err);
  font-weight: 600;
}

.activity-panel-body {
  flex: 1;
  min-height: 72px;
  padding: 10px 12px;
  overflow-y: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink);
}
.activity-panel-body:empty::before {
  content: "No instructions for this activity.";
  color: var(--ink-faint);
  font-style: italic;
}
.activity-panel-body.is-tree {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11.5px;
}

.activity-panel-report {
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: var(--panel-alt);
  font-size: 11.5px;
  line-height: 1.45;
  max-height: 150px;
  overflow-y: auto;
}
.activity-panel-report .activity-result {
  display: flex;
  gap: 6px;
  padding: 1px 0;
}
.activity-panel-report .activity-result.pass {
  color: var(--ok);
}
.activity-panel-report .activity-result.fail {
  color: var(--err);
}
.activity-panel-report .activity-result.override {
  color: var(--warn);
}

.activity-panel-foot {
  border-top: 1px solid var(--border);
  padding: 6px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--panel);
}
.activity-panel-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.activity-panel-page {
  font-size: 10.5px;
  color: var(--ink-faint);
}
.activity-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.activity-panel .btn {
  padding: 3px 7px;
  font-size: 11px;
}
.activity-panel .btn.is-active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-ink);
}

/* SVG */

.link-hit {
  stroke: transparent;
  stroke-width: 14;
  fill: none;
  cursor: pointer;
}
/* Cable lines: the clone's own lighter style, kept by choice over PT's 2 px black / red serial lines. Every wired
   cable is a soft grey line (serial keeps PT's midpoint jog as its shape); a down link is a dashed light red line. */
.link-line {
  stroke: #94a3b8;
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.link-line.is-selected {
  stroke: var(--brand);
  stroke-width: 3.5;
}
.link-line.is-down {
  stroke: #f87171;
  stroke-dasharray: 6 5;
}
.link-line.is-degraded {
  stroke: #f59e0b;
  stroke-dasharray: 3 3;
}
/* Link lights: round bullets in the clone's lighter green and red with a white rim, instead of PT's triangles. The
   meaning and timing follow PT (help/default/connectionsLinks.htm): green up (blinks with activity at PT's pace),
   red down, amber STP-blocked port, black console cable. */
.link-light {
  stroke: #ffffff;
  stroke-width: 1;
  pointer-events: none;
  fill: #22c55e;
}
.link-light.is-up.is-active {
  fill: #15803d;
}
.link-light.is-blocked {
  fill: #f59e0b;
}
.link-light.is-down {
  fill: #ef4444;
}
.link-light.is-console {
  fill: #111827;
}
.hide-link-lights .link-light {
  display: none;
}
.link-line.is-wireless {
  stroke: #0ea5e9;
  stroke-dasharray: 2 6;
  stroke-width: 3;
}
/* Wireless links carry no lights, so the line itself shows a down association. */
.link-line.is-wireless.is-down {
  stroke: #f87171;
}
.link-pulse {
  stroke: var(--brand);
  stroke-width: 3.5;
  fill: none;
  opacity: 0.9;
}

.device {
  cursor: pointer;
}
.device .device-body {
  filter: url(#soft-shadow);
}
.device .device-hit {
  fill: transparent;
}
.device.is-hidden {
  opacity: 0.35;
}
.device.is-locked .device-frame {
  stroke-dasharray: 4 3;
  opacity: 0.9;
}
.device.is-locked .device-label::after {
  content: " [locked]";
  fill: #b45309;
}
.btn.is-active {
  border-color: var(--brand);
  color: var(--brand-ink);
  background: var(--brand-soft);
}
.notes-input {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  font-family: var(--sans);
}

.device .device-label {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  fill: var(--ink);
  text-anchor: middle;
  pointer-events: none;
}
.device .device-sub {
  font-family: var(--mono);
  font-size: 9.5px;
  fill: var(--ink-faint);
  text-anchor: middle;
  pointer-events: none;
}
.device.is-selected .device-frame {
  stroke: var(--brand);
  stroke-width: 2.5;
}
.device.is-target .device-frame {
  stroke: var(--warn);
  stroke-width: 2.5;
  stroke-dasharray: 4 3;
}
.device .status-dot {
  stroke: #fff;
  stroke-width: 1.5;
}
.device .port-dot {
  fill: #cbd5e1;
  stroke: #fff;
  stroke-width: 1;
}
.device .port-dot.is-used {
  fill: var(--brand);
}
.device .port-dot.is-up {
  fill: var(--ok);
}

.physical-container.is-selected rect {
  stroke: var(--brand);
  stroke-width: 3;
}
.physical-container.is-current rect {
  stroke-dasharray: 7 4;
  stroke-width: 2.5;
}
.physical-container.is-drop-target rect {
  stroke: var(--warn);
  stroke-width: 3;
  stroke-dasharray: 4 3;
}
.physical-label {
  font: 700 12px var(--sans);
  fill: var(--ink-soft);
  pointer-events: none;
}
.physical-bar {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 6px;
}
.physical-bar[hidden] {
  display: none;
}
.physical-bar-location {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
}
.physical-device {
  cursor: grab;
}
.physical-device:active {
  cursor: grabbing;
}

.physical-cable {
  stroke: #64748b;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  pointer-events: none;
}
.physical-cable.is-fiber {
  stroke: #0ea5e9;
}
.physical-cable.is-serial {
  stroke: #7c3aed;
}
.physical-cable.is-console {
  stroke: #0f766e;
  stroke-dasharray: 5 3;
}
.physical-cable.is-wireless {
  stroke: #0ea5e9;
  stroke-dasharray: 2 6;
}
.physical-cable.is-down {
  stroke: #f87171;
  stroke-dasharray: 6 5;
}
.physical-cable.is-degraded {
  stroke: #f59e0b;
  stroke-dasharray: 3 3;
}
.physical-cable.is-selected {
  stroke: var(--brand);
  stroke-width: 3.5;
}
.physical-cable-hit {
  stroke: transparent;
  stroke-width: 14;
  fill: none;
  pointer-events: stroke;
  cursor: pointer;
}
.physical-cable-plug {
  fill: #fff;
  stroke: #475569;
  stroke-width: 1.5;
  pointer-events: none;
}
.cable-peg {
  fill: #fff;
  stroke: #64748b;
  stroke-width: 1.5;
  cursor: crosshair;
}
.cable-peg:hover {
  fill: var(--brand-soft);
  stroke: var(--brand);
  stroke-width: 2;
}
.cable-peg.is-pending {
  fill: var(--warn);
  stroke: #b45309;
  stroke-width: 2;
}

.packet-dot {
  fill: var(--brand);
  stroke: #fff;
  stroke-width: 2;
  filter: drop-shadow(0 0 6px rgba(79, 70, 229, 0.8));
}

/* ---------- inspector ---------- */

.inspector {
  position: absolute;
  top: 0;
  right: 0;
  width: 384px;
  max-width: min(384px, 92vw);
  height: 100%;
  background: var(--panel);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  visibility: hidden;
  transform: translateX(100%);
  transition:
    transform 0.18s ease,
    visibility 0.18s ease;
  box-shadow: var(--shadow-md);
  z-index: 20;
}

.inspector.is-open {
  visibility: visible;
  transform: translateX(0);
}

.inspector-empty {
  margin: auto;
  text-align: center;
  color: var(--ink-faint);
  padding: 28px;
  max-width: 280px;
}
.inspector-empty svg {
  width: 52px;
  height: 52px;
  color: var(--border-strong);
  margin-bottom: 10px;
}
.inspector-empty p {
  margin: 4px 0;
  font-size: 12.5px;
  line-height: 1.5;
}
.inspector-empty strong {
  color: var(--ink-soft);
}

.inspector-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.inspector-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border);
}
.inspector-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--brand-ink);
  background: var(--brand-soft);
  border-radius: 9px;
  flex: none;
}
.inspector-icon svg {
  width: 24px;
  height: 24px;
}
.inspector-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.name-input {
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 2px 4px;
  width: 100%;
  background: transparent;
}
.name-input:hover {
  border-color: var(--border);
}
.name-input:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
}
.device-meta {
  font-size: 11px;
  color: var(--ink-faint);
  padding-left: 5px;
}

.inspector-summary {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  min-height: 0;
}
.inspector-summary .kv {
  margin: 0 0 10px;
}
.inspector.is-inspect .name-input {
  background: var(--panel-alt);
}
.inspect-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.inspect-table th,
.inspect-table td {
  text-align: left;
  padding: 4px 6px;
  border-bottom: 1px solid var(--border);
}
.inspect-table th {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}
.inspect-table td:nth-child(3),
.inspect-table td:nth-child(4) {
  font-family: var(--mono);
  font-size: 10px;
}
.inspector-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px 12px;
  border-top: 1px solid var(--border);
}
.inspector-actions .btn-primary {
  flex: 1;
}

/* Device windows: the reference opens a 700x680 modeless dialog per device
 * ("Manage Device Dialogs", "Show Device Dialog Taskbar"). Every device keeps
 * its own window, tab, drag position and stacking order. The taskbar lists the
 * open dialogs along the bottom edge of the workspace. */
.device-taskbar {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 36px);
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
}
.device-taskbar-title {
  flex: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.device-taskbar-list {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
}
.device-taskbar-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  height: 24px;
  padding: 0 3px 0 7px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--panel-alt);
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
}
.device-taskbar-item.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.device-taskbar-label {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.device-taskbar-close {
  border: 0;
  background: transparent;
  border-radius: 4px;
  width: 16px;
  height: 16px;
  padding: 0;
  font: 700 9px var(--mono);
  color: inherit;
  cursor: pointer;
}
.device-taskbar-close:hover {
  background: rgba(15, 23, 42, 0.12);
}
.device-window {
  position: fixed;
  z-index: 45;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(700px, calc(100vw - 32px));
  height: min(680px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.device-window[hidden] {
  display: none;
}
.device-window.is-dragged {
  transform: none;
}
.device-window.is-active {
  border-color: var(--brand);
}
.device-window.is-always-on-top {
  z-index: 70;
}
.device-window-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-alt);
  cursor: move;
  user-select: none;
  flex: none;
}
.device-window-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  flex: none;
}
.device-window-icon svg {
  width: 18px;
  height: 18px;
}
.device-window-title {
  font-size: 13px;
}
.device-window-meta {
  flex: 1;
  font-size: 11px;
  color: var(--ink-faint);
}
.device-window-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.device-window .tabs {
  flex: none;
  padding: 0 10px;
}
.device-window .tab {
  padding: 9px 13px 10px;
}
.device-window .tab-panel {
  padding: 14px;
}
.device-window [data-win-id="panel-cli"] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.device-window [data-win-id="panel-cli"] .terminal {
  flex: 1;
  height: auto;
  min-height: 0;
}
.device-window .tabs {
  overflow-x: auto;
}
.device-window-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 6px 12px;
  border-top: 1px solid var(--border);
  background: var(--panel-alt);
}
.device-window-foot[hidden] {
  display: none;
}
.device-window-foot .toggle {
  margin: 0;
}
.device-window-foot-note {
  flex: 1;
  font-size: 10.5px;
  color: var(--ink-faint);
}

.desktop-shell {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
  min-height: 100%;
}
.desktop-apps {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.desktop-app {
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  padding: 8px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-alt);
  color: var(--ink-soft);
  font: 600 11.5px var(--sans);
  cursor: pointer;
}
.desktop-app:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}
.desktop-app.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.desktop-app-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--panel);
  border: 1px solid var(--border);
  font: 700 9.5px var(--mono);
  color: var(--brand-ink);
  flex: none;
}
.desktop-view {
  min-width: 0;
}
.desktop-pane {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.desktop-url {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.desktop-url input {
  flex: 1;
  padding: 7px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  font: 12.5px var(--mono);
  background: #fff;
  color: var(--ink);
}
.desktop-web-status {
  font-size: 11px;
  color: var(--ink-faint);
  margin-bottom: 8px;
}
.desktop-web-body {
  margin: 0;
  padding: 12px;
  min-height: 220px;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-alt);
  font: 12px/1.5 var(--sans);
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.desktop-term {
  background: #0b1220;
  border-radius: 9px;
  padding: 10px 12px;
  height: 420px;
  overflow-y: auto;
  font: 12px/1.5 var(--mono);
  color: #d7e0ef;
  cursor: text;
}
.desktop-wifi-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.desktop-wifi-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 90px auto;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-alt);
}
.desktop-wifi-row .note {
  margin: 0;
}

/* MIB Browser (WorkstationMIBBrowser.ui, WorkstationAdvancedMib.ui and
 * WorkstationMIBSet.ui). The reference keeps Address/Advanced on the left,
 * OID on the right and Operations/GO on the second row. */
/* Netflow Collector desktop app (BaseNetflowCollector.ui, WorkstationNetflowPieChart.cpp) */
.netflow-collector {
  gap: 8px;
}
.netflow-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 4px 4px 0 0;
  background: var(--panel-alt);
}
.netflow-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
.netflow-close {
  width: 22px;
  height: 20px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--panel);
  color: var(--ink);
  font: 600 11px/1 var(--sans);
  cursor: pointer;
}
.netflow-close:hover {
  border-color: var(--border-strong);
  background: var(--panel-alt);
}
.netflow-service {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 2px 4px;
}
.netflow-service-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
}
.netflow-radio {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
}
.netflow-radio input {
  accent-color: var(--brand);
}
.netflow-pie-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  min-height: 240px;
}
.netflow-pie-panel {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
}
.netflow-pie {
  display: block;
  width: 160px;
  height: 160px;
  margin: 0 auto;
}
.netflow-pie-empty {
  fill: var(--panel-alt);
  stroke: var(--border);
  stroke-width: 1;
}
.netflow-slice {
  cursor: pointer;
  stroke: var(--panel);
  stroke-width: 1;
}
.netflow-slice:hover {
  opacity: 0.86;
}
.netflow-legend {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 170px;
  overflow: auto;
}
.netflow-legend-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  padding: 2px 4px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--ink);
  font: 11px/1.35 var(--mono);
  text-align: left;
  cursor: pointer;
}
.netflow-legend-row:hover {
  background: var(--panel-alt);
}
.netflow-legend-row.is-selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.netflow-swatch {
  width: 10px;
  height: 10px;
  border: 1px solid var(--border);
  border-radius: 2px;
}
.netflow-legend-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.netflow-legend-qty {
  font-weight: 600;
  color: var(--ink-soft);
}
.netflow-flow-info {
  min-height: 220px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font: 11.5px/1.5 var(--mono);
  white-space: pre-wrap;
  overflow: auto;
}
.netflow-empty {
  padding: 8px;
  text-align: center;
  font-size: 11px;
  color: var(--ink-faint);
}

.mib-browser {
  position: relative;
}
.mib-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.mib-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: end;
}
.mib-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.mib-field label,
.mib-ops-cell label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
}
.mib-field input,
.mib-ops-cell select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: 12px var(--mono);
}
.mib-advanced-cell {
  display: flex;
}
.mib-advanced-cell .btn {
  flex: 1;
}
.mib-ops-cell {
  display: grid;
  grid-template-columns: auto minmax(90px, 1fr) auto;
  align-items: center;
  gap: 8px;
}
.mib-ops-cell label {
  white-space: nowrap;
}
.mib-ops-cell select {
  font-family: var(--sans);
}
.mib-ops-cell .btn {
  white-space: nowrap;
}
.mib-workspace {
  display: grid;
  grid-template-columns: minmax(200px, 40%) minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}
.mib-tree-panel,
.mib-result-panel,
.mib-details {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
  overflow: hidden;
}
.mib-panel-title {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-alt);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
}
.mib-tree {
  height: 320px;
  overflow: auto;
  padding: 4px 2px;
  font: 11.5px/1.5 var(--mono);
}
.mib-node-row {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 1px 6px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}
.mib-node-row:hover {
  background: var(--panel-alt);
}
.mib-node-row.is-selected {
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.mib-caret {
  display: inline-block;
  width: 9px;
  flex: none;
  color: var(--ink-faint);
}
.mib-node-label {
  overflow: hidden;
  text-overflow: ellipsis;
}
.mib-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.mib-result-scroll {
  height: 180px;
  overflow: auto;
}
.mib-result-table {
  width: 100%;
  border-collapse: collapse;
  font: 11.5px/1.4 var(--mono);
}
.mib-result-table th,
.mib-result-table td {
  padding: 5px 8px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.mib-result-table th {
  position: sticky;
  top: 0;
  background: var(--panel);
  color: var(--ink-soft);
  font: 600 11px var(--sans);
}
.mib-result-table td:nth-child(1) {
  width: 42%;
  overflow-wrap: anywhere;
}
.mib-result-table td:nth-child(2) {
  width: 38%;
  overflow-wrap: anywhere;
}
.mib-result-table td:nth-child(3) {
  width: 20%;
}
.mib-details table {
  width: 100%;
  border-collapse: collapse;
  font: 11.5px/1.6 var(--mono);
}
.mib-details th,
.mib-details td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.mib-details tr:last-child th,
.mib-details tr:last-child td {
  border-bottom: 0;
}
.mib-details th {
  width: 32%;
  font: 600 11px var(--sans);
  color: var(--ink-soft);
}
.mib-dialog {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(15, 23, 42, 0.32);
  z-index: 20;
}
.mib-dialog-card {
  width: min(360px, 100%);
  max-height: 100%;
  overflow: auto;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow-md);
}
.mib-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-alt);
  font-size: 12px;
  font-weight: 600;
}
.mib-dialog-body {
  padding: 12px;
}
.mib-dialog-body .field:last-child {
  margin-bottom: 0;
}
.mib-dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}
.mib-dialog-foot .btn {
  min-width: 76px;
}
.mib-message {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

.desktop-editor-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.desktop-editor-toolbar select,
.desktop-editor-toolbar input {
  padding: 5px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: 11.5px var(--mono);
}
.desktop-editor-toolbar select {
  max-width: 190px;
}
.desktop-editor-toolbar input {
  width: 150px;
}
#dt-file-text {
  width: 100%;
  min-height: 300px;
  max-height: 380px;
  padding: 10px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-alt);
  color: var(--ink);
  font: 12px/1.5 var(--mono);
}
#dt-file-text:focus {
  outline: none;
  border-color: var(--brand);
}

.email-app {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100%;
}
.email-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.email-folders {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.email-folder {
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-alt);
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
}
.email-folder.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.email-badge {
  display: inline-block;
  margin-left: 2px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 9px;
}
.email-toolbar-actions {
  display: flex;
  gap: 6px;
}
.email-body {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 8px;
  flex: 1;
  min-height: 0;
}
.email-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 360px;
  padding: 5px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-alt);
}
.email-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 5px 6px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}
.email-item:hover {
  border-color: var(--border);
  background: var(--panel);
}
.email-item.is-active {
  border-color: var(--brand);
  background: var(--panel);
}
.email-item.is-unread .email-subject {
  color: var(--ink);
  font-weight: 700;
}
.email-from {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-soft);
}
.email-subject {
  font-size: 10.5px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.email-time {
  font-size: 9px;
  color: var(--ink-faint);
}
.email-reader {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}
.email-reader-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.email-reader-head .note {
  margin: 0;
}
.email-reader-body {
  flex: 1;
  max-height: 220px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink);
  font: 12px/1.45 var(--sans);
}
.email-compose {
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-alt);
}
.email-compose .field-row,
.email-compose .field {
  margin-bottom: 6px;
}
.email-attach-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.physical-shell {
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr);
  gap: 14px;
  min-height: 100%;
}
.physical-side {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.physical-side-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-faint);
  margin-top: 4px;
}
.physical-side-title:first-child {
  margin-top: 0;
}
.physical-module-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 210px;
  overflow-y: auto;
}
.physical-module {
  text-align: left;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-alt);
  color: var(--ink-soft);
  font: 600 10.5px var(--mono);
  cursor: pointer;
}
.physical-module:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}
.physical-module.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.physical-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.physical-view-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.physical-view-head > span {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}
.physical-zoom-buttons {
  display: flex;
  gap: 4px;
}
.physical-zoom-buttons .btn {
  padding: 3px 8px;
  font-size: 10.5px;
}
.physical-viewport {
  display: grid;
  place-items: center;
  height: 292px;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-alt);
}
.physical-chassis {
  width: 100%;
  max-width: 520px;
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--panel);
  transform-origin: center;
  transition: transform 0.12s ease;
}
.physical-chassis-title {
  margin-bottom: 10px;
  text-align: center;
  font: 600 11px var(--mono);
  color: var(--ink-soft);
}
.physical-bays {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.physical-bay-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.physical-sub-bays {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 6px;
  margin-left: 10px;
  padding-left: 8px;
  border-left: 1px dashed var(--border-strong);
}
.physical-sub-bays .physical-bay {
  min-height: 48px;
}
.physical-sub-bays .physical-bay-group[data-bay-depth="2"] {
  margin-left: 8px;
}
.physical-bay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 62px;
  padding: 6px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  background: var(--panel-alt);
  cursor: pointer;
}
.physical-bay:hover {
  border-color: var(--brand);
}
.physical-bay.is-filled {
  border-style: solid;
  border-color: var(--brand);
  background: var(--brand-soft);
}
.physical-bay.is-selected {
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.16);
}
.physical-bay-slot {
  font: 600 10px var(--mono);
  color: var(--ink-faint);
}
.physical-bay-module {
  font-size: 10.5px;
  color: var(--ink-soft);
  text-align: center;
}
.physical-power {
  justify-content: center;
}
.physical-desc {
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-alt);
  font-size: 11.5px;
  color: var(--ink-soft);
}
.physical-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.physical-actions .note {
  margin: 0;
}

.programming-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100%;
}
.programming-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.programming-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.programming-field input,
.programming-field select {
  padding: 5px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: 11.5px var(--mono);
}
.programming-field input {
  width: 132px;
}
.programming-spacer {
  flex: 1;
}
.programming-main {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 10px;
  flex: 1;
  min-height: 0;
}
.programming-editor {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.programming-editor-head,
.programming-console-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}
.programming-editor-head .note {
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
.programming-editor textarea {
  flex: 1;
  width: 100%;
  min-height: 260px;
  padding: 10px;
  resize: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0b1220;
  color: #d7e0ef;
  font: 12px/1.5 var(--mono);
}
.programming-editor textarea:focus {
  outline: none;
  border-color: var(--brand);
}
.programming-console {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.programming-console pre {
  flex: 1;
  min-height: 180px;
  max-height: 360px;
  margin: 0;
  padding: 10px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-alt);
  color: var(--ink);
  font: 11.5px/1.5 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.programming-status {
  margin-top: 6px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-faint);
}
.programming-status[data-status="running"] {
  color: var(--ok);
}
.programming-status[data-status="stopped"] {
  color: var(--warn);
}
.programming-status[data-status="error"] {
  color: var(--err);
}

.visual-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}
.visual-phase {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-alt);
}
.visual-phase-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}
.visual-phase-head strong {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}
.visual-add {
  display: flex;
  gap: 4px;
}
.visual-add select {
  max-width: 112px;
  padding: 3px 5px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font: 10px var(--mono);
}
.visual-add .btn {
  padding: 3px 7px;
  font-size: 10px;
}
.visual-blocks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
}
.visual-block {
  padding: 6px 7px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
}
.visual-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-soft);
}
.visual-block-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.visual-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 9.5px;
  color: var(--ink-faint);
}
.visual-field input,
.visual-field select {
  width: 72px;
  padding: 3px 5px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font: 10.5px var(--mono);
}
.visual-field input[data-visual-field="text"] {
  width: 130px;
}
.visual-blocks .note {
  margin: 0;
  font-size: 10.5px;
}

.icon-btn {
  border: 0;
  background: transparent;
  color: var(--ink-faint);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.icon-btn:hover {
  background: var(--panel-alt);
  color: var(--ink);
}

.tabs {
  display: flex;
  gap: 2px;
  padding: 8px 10px 0;
  border-bottom: 1px solid var(--border);
}
.tab {
  border: 0;
  background: transparent;
  padding: 7px 12px 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-faint);
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.tab:hover {
  color: var(--ink-soft);
}
.tab.is-active {
  color: var(--brand-ink);
  border-bottom-color: var(--brand);
}

.tab-panel {
  padding: 14px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  flex: 1;
}
.tab-panel[hidden] {
  display: none;
}

.field {
  margin-bottom: 11px;
}
.field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.field input,
.field select {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  font: 12.5px var(--mono);
  color: var(--ink);
  background: #fff;
}
.field textarea {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  font: 11.5px var(--mono);
  color: var(--ink);
  background: #fff;
  resize: vertical;
}
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-faint);
  margin: 16px 0 8px;
}
.section-title:first-child {
  margin-top: 0;
}

.iface-card,
.route-row,
.vlan-row {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  margin-bottom: 8px;
  background: var(--panel-alt);
}
.iface-card.is-down {
  opacity: 0.62;
}
.iface-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.iface-name {
  font: 600 11.5px var(--mono);
  color: var(--ink);
}
.iface-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.iface-card.is-down .iface-badge {
  background: #fee2e2;
  color: #991b1b;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}
.toggle input {
  accent-color: var(--brand);
}

.grid-line {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 6px;
}
.grid-line input {
  width: 100%;
}

.port-select {
  padding: 3px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  font: 11px var(--mono);
  color: var(--ink);
}

.add-row {
  display: flex;
  gap: 6px;
}
.add-row input {
  flex: 1;
}

.btn-primary {
  background: var(--brand);
  border: 1px solid var(--brand);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:hover {
  background: var(--brand-ink);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: default;
}
.btn-danger {
  background: #fff;
  border: 1px solid #fecaca;
  color: var(--err);
}
.btn-danger:hover {
  background: #fef2f2;
}

.btn-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.btn-row .btn {
  flex: 1;
}

.note {
  font-size: 11px;
  color: var(--ink-faint);
  line-height: 1.5;
  margin-top: 10px;
}

.kv {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 6px 10px;
  font-size: 12px;
}
.kv dt {
  color: var(--ink-faint);
}
.kv dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  overflow-wrap: anywhere;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font: 11px var(--mono);
}
table.data th,
table.data td {
  text-align: left;
  padding: 4px 6px;
  border-bottom: 1px solid var(--border);
}
table.data th {
  color: var(--ink-faint);
  font-weight: 600;
}

/* terminal */

.terminal {
  background: #0b1220;
  border-radius: 9px;
  padding: 10px 12px;
  height: calc(100% - 46px);
  min-height: 260px;
  overflow-y: auto;
  font: var(--terminal-font-size, 12px)/1.5 var(--mono);
  color: #d7e0ef;
  cursor: text;
}
.hide-link-lights .device .status-dot {
  display: none;
}
.terminal-out {
  margin: 0;
  font: inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.terminal-line {
  display: flex;
  align-items: baseline;
}
.terminal-prompt {
  color: #7dd3fc;
  white-space: pre;
}
.terminal-input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  color: #f8fafc;
  font: inherit;
  caret-color: #7dd3fc;
  padding: 0 0 0 2px;
}
.terminal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 10.5px;
  color: var(--ink-faint);
  margin-top: 7px;
}
.terminal-foot code {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 3px;
  font-size: 10px;
}
.link-btn {
  border: 0;
  background: transparent;
  color: var(--brand-ink);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
}

/* ---------- bottom dock ---------- */

.bottom-area {
  display: grid;
  grid-template-rows: 34px minmax(0, 1fr);
  min-height: 0;
}

.timebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: var(--panel);
  border-top: 1px solid var(--border);
}

.timebar-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
}

.timebar-spacer {
  flex: 1;
}
.timebar-mode {
  font-size: 11.5px;
  color: var(--ink-soft);
}
.time-mode-btn {
  border: 1px solid var(--border);
  background: var(--panel-alt);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}
.time-mode-btn:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}
.time-mode-btn.is-active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-ink);
}
.time-mode-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.bottom-dock {
  display: grid;
  grid-template-columns: minmax(280px, 35.3%) minmax(0, 1fr);
  min-height: 0;
  border-top: 1px solid var(--border);
}

/* ---------- log ---------- */

.logbar {
  background: #0b1220;
  color: #cbd5e1;
  border-left: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.logbar.is-collapsed .log-list {
  display: none;
}
.logbar-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-bottom: 1px solid #16213a;
  flex: none;
}
.logbar-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #94a3b8;
}
.logbar-count {
  font-size: 10.5px;
  color: #64748b;
}
.logbar-actions {
  margin-left: auto;
}
.logbar .icon-btn {
  color: #94a3b8;
}
.logbar .icon-btn:hover {
  background: #16213a;
  color: #e2e8f0;
}

.log-tab {
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 6px;
  cursor: pointer;
}
.log-tab:hover {
  color: #e2e8f0;
}
.log-tab.is-active {
  background: #16213a;
  color: #e2e8f0;
}

.sim-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  flex: 1;
}
.sim-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-bottom: 1px solid #16213a;
}
.sim-controls input {
  flex: 1;
  max-width: 360px;
  background: #0b1220;
  border: 1px solid #1e293b;
  color: #cbd5e1;
  border-radius: 6px;
  padding: 4px 8px;
  font: 11px var(--mono);
}
.sim-table-wrap {
  overflow: auto;
  padding: 0 14px 8px;
}
.sim-table {
  color: #cbd5e1;
}
.sim-table th {
  color: #64748b;
  position: sticky;
  top: 0;
  background: #0b1220;
}
.sim-table td {
  border-bottom: 1px solid #16213a;
}
.sim-table tbody tr {
  cursor: pointer;
}
.sim-table tbody tr:hover {
  background: #16213a;
}
.sim-table tbody tr.is-current {
  background: #1e293b;
  box-shadow: inset 3px 0 0 #f59e0b;
}
.sim-time {
  font: 11px var(--mono);
  color: #cbd5e1;
  white-space: nowrap;
  min-width: 120px;
}
.device.is-pdu .device-frame {
  stroke: #f59e0b;
  stroke-width: 3;
  animation: pduPulse 0.9s ease-in-out infinite alternate;
}
@keyframes pduPulse {
  from {
    filter: drop-shadow(0 0 0 rgba(245, 158, 11, 0));
  }
  to {
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.9));
  }
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
}
.modal-card {
  background: var(--panel);
  border-radius: 12px;
  width: min(580px, 92vw);
  max-height: 86vh;
  overflow: auto;
  padding: 16px;
  box-shadow: var(--shadow-md);
}
.gui-app-frame {
  width: 100%;
  height: 60vh;
  border: 1px solid var(--line, #cbd5e1);
  border-radius: 6px;
  background: #fff;
}
.physical-locations-card {
  width: min(440px, 92vw);
}
.physical-locations-card .btn-row {
  justify-content: flex-end;
}
.physical-current-location {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}
.physical-location-tree {
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 52vh;
  overflow: auto;
  background: var(--panel-alt);
}
.physical-location-head,
.physical-location-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  align-items: center;
  gap: 8px;
  padding: 3px 8px;
  font-size: 12px;
}
.physical-location-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  color: var(--ink-soft);
}
.physical-location-row {
  cursor: default;
  border-bottom: 1px solid transparent;
}
.physical-location-row:hover {
  background: var(--panel);
}
.physical-location-row.is-selected {
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.physical-location-row.is-drop-target {
  outline: 2px dashed var(--warn);
  outline-offset: -2px;
}
.physical-location-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.physical-location-type {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-soft);
}
.physical-alert-card {
  width: min(420px, 92vw);
}
.physical-alert-card p {
  margin: 0 0 12px;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
/* Device Template Manager (BaseDeviceTemplateManager.ui: Select and Edit
   group boxes, Template/Description rows, 4x4 category check boxes and the
   Update / Remove / Add / Cancel button order). */
.modal-card.template-manager {
  width: min(660px, 94vw);
  max-width: none;
  padding: 0;
  overflow: hidden;
}
.template-manager .modal-head {
  margin: 0;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.template-manager-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px 14px;
}
.template-group {
  margin: 0;
  padding: 8px 12px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
}
.template-group legend {
  padding: 0 5px;
  font-size: 12px;
  color: var(--ink);
}
.template-select-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.template-hint {
  margin: 0;
  width: 204px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink-soft);
}
.template-select-row .btn {
  margin-left: auto;
  min-width: 94px;
}
.template-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--ink);
}
.template-row select,
.template-row input {
  width: 100%;
  min-width: 0;
  height: 24px;
  padding: 2px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  font: 12px var(--mono);
  color: var(--ink);
  background: #fff;
}
.template-row select:focus,
.template-row input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
}
.template-categories {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(4, auto);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 14px;
  margin: 12px 0 4px;
}
.template-category {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink);
  white-space: nowrap;
}
.template-category input {
  width: 13px;
  height: 13px;
  margin: 0;
}
.template-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.template-actions .btn {
  min-width: 82px;
}
.template-actions .btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.template-status {
  min-height: 16px;
  margin: 0;
  font-size: 11px;
  color: var(--ink-faint);
}
.template-status.is-error {
  color: var(--danger, #b91c1c);
}

.modal-card.activity-wizard {
  width: min(1289px, 96vw);
  max-width: none;
  height: min(830px, 92vh);
  max-height: none;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.activity-wizard .modal-head {
  margin: 0;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex: none;
}
.activity-wizard-body {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  flex: 1;
  min-height: 0;
}
.activity-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 8px;
  background: var(--panel-alt);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.activity-nav-item {
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 7px;
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}
.activity-nav-item:hover {
  background: var(--panel);
  color: var(--ink);
}
.activity-nav-item.is-active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-ink);
}
.activity-pages {
  padding: 16px 18px;
  overflow-y: auto;
  min-height: 0;
}
.activity-page {
  display: none;
}
.activity-page.is-active {
  display: block;
}
.activity-page .form-grid label:last-child {
  grid-column: 1 / -1;
}
.activity-page textarea {
  width: 100%;
}

.preferences-card {
  width: min(1016px, 96vw);
  max-width: none;
  height: min(719px, 92vh);
  max-height: none;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.preferences-card .modal-head {
  margin: 0;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex: none;
}
.preferences-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
/* Reference window: a QTabWidget strip at the top of the dialog. */
.preferences-nav {
  display: flex;
  gap: 2px;
  padding: 6px 12px 0;
  background: var(--panel-alt);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  overflow-y: hidden;
  flex: none;
}
.preferences-nav-item {
  text-align: left;
  border: 1px solid transparent;
  border-bottom: 0;
  background: transparent;
  border-radius: 7px 7px 0 0;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
}
.preferences-nav-item:hover {
  background: var(--panel);
  color: var(--ink);
}
.preferences-nav-item.is-active {
  background: var(--panel);
  border-color: var(--border);
  color: var(--brand-ink);
  margin-bottom: -1px;
  padding-bottom: 9px;
}
.preferences-pages {
  padding: 16px 22px;
  overflow-y: auto;
  min-height: 0;
  flex: 1;
}
.preferences-page {
  display: none;
}
.preferences-page.is-active {
  display: block;
}
.preferences-group {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 14px 14px;
  margin: 0 0 14px;
  min-width: 0;
}
.preferences-group legend {
  padding: 0 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-soft);
}
.preferences-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
}
.preferences-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.preferences-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  max-width: 240px;
}
.preferences-field select,
.preferences-field input {
  padding: 5px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  font: 11.5px var(--mono);
  color: var(--ink);
}
.preferences-field input[type="range"] {
  padding: 0;
  accent-color: var(--brand);
}
.preferences-password-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.preferences-field-wide {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  max-width: none;
  width: 100%;
}
.preferences-field-wide > span {
  min-width: 68px;
}
.preferences-field-wide > input {
  flex: 1;
  min-width: 0;
}
.preferences-row-end {
  justify-content: flex-end;
}
.preferences-lock-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 24px;
}
.preferences-folder-row {
  flex-wrap: nowrap;
}
.preferences-folder-row > input {
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  font: 11.5px var(--mono);
  color: var(--ink);
}
.preferences-error {
  color: #b91c1c;
}
.preferences-output {
  font: 600 11.5px var(--mono);
  color: var(--ink);
  min-width: 44px;
}
.preferences-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  background: var(--panel);
  flex: none;
}
.preferences-foot .note {
  margin-right: auto;
}
.preferences-card {
  position: relative;
}
.preferences-card.is-locked .preferences-body,
.preferences-card.is-locked .preferences-foot {
  pointer-events: none;
  opacity: 0.55;
}
.preferences-unlock {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.35);
  z-index: 5;
}
.preferences-unlock-card {
  width: min(360px, 90%);
  padding: 18px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28);
}
.preferences-unlock-card > input {
  width: 100%;
  margin-top: 6px;
  padding: 6px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font: 12px var(--mono);
}
.preferences-unlock-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.preferences-image-list {
  min-height: 90px;
  display: flex;
  align-items: center;
  padding: 10px;
  border: 1px dashed var(--border-strong);
  border-radius: 7px;
  background: var(--panel-alt);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
}
.form-grid input,
.form-grid select {
  padding: 6px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font: 12px var(--mono);
  background: #fff;
}
.pdu-layers {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 6px 10px;
  font-size: 12px;
}
.pdu-layers dt {
  color: var(--ink-faint);
  font-weight: 600;
}
.pdu-layers dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 11.5px;
}
.pdu-headers {
  display: grid;
  gap: 2px;
}
.pdu-header-layer {
  display: inline-block;
  min-width: 62px;
  color: var(--accent, #4f46e5);
  font-weight: 600;
}

.log-list {
  overflow-y: auto;
  padding: 6px 14px 10px;
  font: 11.5px/1.6 var(--mono);
  flex: 1;
  min-height: 0;
}
.log-entry {
  display: flex;
  gap: 8px;
  padding: 1px 0;
}
.log-entry .t {
  color: #475569;
  flex: none;
}
.log-entry .tag {
  flex: none;
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0 5px;
  border-radius: 3px;
  background: #1e293b;
  color: #94a3b8;
  line-height: 1.5;
}
.log-entry.ok .tag {
  background: rgba(22, 163, 74, 0.16);
  color: #4ade80;
}
.log-entry.err .tag {
  background: rgba(220, 38, 38, 0.16);
  color: #f87171;
}
.log-entry.info .tag {
  background: rgba(2, 132, 199, 0.16);
  color: #38bdf8;
}
.log-entry.warn .tag {
  background: rgba(217, 119, 6, 0.16);
  color: #fbbf24;
}
.log-entry .m {
  color: #cbd5e1;
  overflow-wrap: anywhere;
}
.log-empty {
  color: #475569;
  font-style: italic;
}

/* ---------- time bar status ---------- */

.timebar-status {
  min-width: 0;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10.5px;
  color: var(--ink-faint);
}
.timebar-counts,
.timebar-zoom {
  font-size: 10.5px;
  color: var(--ink-faint);
  white-space: nowrap;
}
.timebar-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
  flex: none;
}
.timebar .status-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10.5px;
  color: var(--ink-faint);
}
.timebar .status-item[hidden] {
  display: none;
}
.timebar .status-selection {
  color: var(--ink);
}
.timebar .status-connection[data-state="pending"] {
  color: #38bdf8;
}
.timebar .status-connection[data-state="down"] {
  color: #fbbf24;
}
.timebar .status-connection[data-state="degraded"] {
  color: #fb923c;
}
.timebar .status-save[data-state="saved"] {
  color: var(--ok);
}
.timebar .status-save[data-state="error"] {
  color: var(--err);
}
.timebar .status-save[data-state="idle"] {
  color: var(--ink-faint);
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 46px;
  transform: translate(-50%, 12px);
  background: #0f172a;
  color: #e2e8f0;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.18s,
    transform 0.18s;
  z-index: 50;
}
.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast.err {
  background: #7f1d1d;
}
.toast.ok {
  background: #14532d;
}

/* ---------- script runner ---------- */

.script-source,
.script-output {
  width: 100%;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-alt);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
}
.script-output {
  min-height: 120px;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
}

/* ---------- canvas annotations ---------- */

.annotation {
  cursor: pointer;
}
.annotation .annotation-shape {
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Notes: black text on a white card (PT paints a light grey one; the clone keeps white by user choice), the frame
   appears on hover/selection only. */
.annotation .annotation-note-card {
  fill: #ffffff;
  stroke: transparent;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.annotation:hover .annotation-note-card,
.annotation.is-selected .annotation-note-card {
  stroke: #64748b;
}
.annotation .annotation-text {
  fill: #000000;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 400;
  pointer-events: none;
  white-space: pre;
}
.annotation .annotation-hit {
  fill: transparent;
  stroke: transparent;
  stroke-width: 14;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.annotation.is-selected .annotation-shape,
.annotation.is-selected .annotation-note-card {
  stroke-dasharray: 5 3;
}
.annotation-selection {
  fill: none;
  stroke: var(--brand);
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
  pointer-events: none;
  vector-effect: non-scaling-stroke;
}
.annotation-preview {
  fill: none;
  stroke: var(--brand);
  stroke-width: 2;
  stroke-dasharray: 6 4;
  pointer-events: none;
  vector-effect: non-scaling-stroke;
}
.annotation-draft {
  pointer-events: none;
}
.annotation-editor {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.annotation-editor[hidden] {
  display: none;
}
.annotation-hint {
  margin: 0;
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.45;
}
#stage.is-annotating {
  cursor: crosshair;
}
#stage.is-annotating .annotation {
  cursor: crosshair;
}

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .brand {
    min-width: 150px;
  }
  .mode-badge {
    display: none;
  }
  .bottom-dock {
    grid-template-columns: minmax(300px, 40%) minmax(0, 1fr);
  }
  .palette {
    grid-template-columns: 240px minmax(0, 1fr);
  }
  .palette-search {
    width: 100%;
  }
  .timebar-status {
    display: none;
  }
  .timebar .status-connection {
    display: none;
  }
}

@media (max-width: 900px) {
  body {
    grid-template-rows: auto minmax(0, 1fr) 174px;
  }
  .topbar {
    height: auto;
  }
  .topbar-row {
    flex-wrap: wrap;
    height: auto;
    padding: 4px 8px;
    row-gap: 2px;
  }
  .brand {
    min-width: 0;
  }
  .menubar {
    order: 2;
    width: 100%;
    flex-wrap: wrap;
    height: auto;
  }
  .toolbar {
    overflow-x: auto;
  }
  .mode-badge {
    display: none;
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .mode-chip {
    height: 30px;
    padding: 0 9px;
    font-size: 10.5px;
  }
  .timebar {
    gap: 5px;
    padding: 0 8px;
  }
  .timebar .status-selection {
    display: none;
  }
  .inspector {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(92vw, 380px);
    z-index: 40;
    box-shadow: var(--shadow-md);
  }
  .inspector:not(.is-open) {
    display: none;
  }
}

/* ------------------------------------------------------------------ */
/* Environment Dialog                                                  */
/* ------------------------------------------------------------------ */

.environment-card {
  width: min(1000px, 96vw);
  max-width: none;
  height: min(760px, 94vh);
  max-height: none;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.environment-card .modal-head {
  margin: 0;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  flex: none;
}
.environment-title {
  font-size: 13px;
}
.environment-body {
  padding: 10px 14px 14px;
  overflow: auto;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.environment-location-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.environment-location {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
}
.environment-location select {
  min-width: 220px;
  padding: 4px 8px;
  font-size: 15px;
  font-weight: 700;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: #fff;
}
.environment-time-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11.5px;
  font-weight: 600;
}
.environment-time-row strong {
  font: 700 11.5px var(--mono);
}
.environment-timescale {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11.5px;
  font-weight: 600;
}
.environment-timescale input {
  width: 58px;
}
.environment-timescale select {
  max-width: 112px;
}
.environment-timescale-note {
  color: var(--ink-soft);
  font-weight: 500;
}
.environment-tabs {
  display: flex;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 6px 6px 0 0;
  padding: 4px 4px 0;
  background: var(--panel-alt);
}
.environment-tab {
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
  background: transparent;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}
.environment-tab.is-active {
  background: var(--panel);
  border-color: var(--border);
  color: var(--brand-ink);
  margin-bottom: -1px;
  padding-bottom: 6px;
}
.environment-graph-panel,
.environment-chart-panel {
  border: 1px solid var(--border);
  border-radius: 0 6px 6px 6px;
  padding: 8px;
  background: #fff;
}
.environment-chart-panel {
  border-radius: 6px;
}
.environment-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}
.environment-zoom-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--ink-soft);
  margin: 4px 0;
}
.environment-zoom {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}
.environment-zoom.is-active {
  background: #dbeafe;
  color: #1d4ed8;
}
.environment-chart-svg,
.environment-graph-svg {
  display: block;
  width: 100%;
  height: auto;
}
.environment-grid-line {
  stroke: #e2e8f0;
  stroke-width: 1;
}
.environment-axis-label {
  font: 9px var(--mono);
  fill: var(--ink-soft);
}
.environment-axis-title {
  font: 10px var(--mono);
  fill: var(--ink-soft);
}
.environment-series-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 4px 0 0;
  font-size: 10.5px;
  color: var(--ink-soft);
}
.environment-series-key {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.environment-series-key i {
  width: 16px;
  height: 2px;
  display: inline-block;
}
.environment-view-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
}
.environment-hint {
  color: var(--ink-soft);
  margin-right: auto;
}
.environment-filter {
  min-width: 180px;
  padding: 3px 7px;
}
.environment-empty {
  color: var(--ink-soft);
  font-size: 11.5px;
  padding: 10px;
}
.environment-tree {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 28px;
  font-size: 11px;
  align-items: start;
}
.environment-tree-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.environment-category-name {
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 5px;
}
.environment-caret {
  color: var(--ink-soft);
  font-size: 9px;
}
.environment-value-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 1px 4px 1px 18px;
  text-align: left;
  font: 10.5px var(--mono);
  color: var(--ink);
  cursor: pointer;
  border-radius: 3px;
}
.environment-value-row:hover {
  background: var(--panel-alt);
}
.environment-value-row.is-selected {
  background: #dbeafe;
}
.environment-value-reading {
  color: var(--ink);
  white-space: nowrap;
}
.environment-graph {
  display: flex;
  flex-direction: column;
}
.environment-legend {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 1px 10px;
  padding: 6px 2px 0;
  font-size: 10.5px;
}
.environment-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  padding: 1px 2px;
  font: 10.5px var(--mono);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.environment-legend-item i {
  width: 13px;
  height: 10px;
  display: inline-block;
}
.environment-legend-item.is-hidden {
  color: #94a3b8;
}
.environment-snap-row {
  display: flex;
  gap: 24px;
  padding: 6px 2px 0;
  font-size: 11px;
  font-weight: 600;
}
.environment-advanced {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.environment-advanced-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
  font-weight: 600;
}
.environment-advanced-toolbar input {
  width: 84px;
}
.environment-advanced-meta {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 11px;
}
.environment-notes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 600;
}
.environment-notes textarea {
  width: 360px;
  max-width: 100%;
  resize: vertical;
}
.environment-advanced-table-wrap {
  border: 1px solid var(--border);
  border-radius: 5px;
  overflow: auto;
  max-height: 280px;
}
.environment-advanced-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
}
.environment-advanced-table th,
.environment-advanced-table td {
  padding: 3px 5px;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  white-space: nowrap;
}
.environment-advanced-table th {
  position: sticky;
  top: 0;
  background: var(--panel-alt);
  font-weight: 700;
  z-index: 1;
}
.environment-advanced-table tr.is-active {
  background: #eff6ff;
}
.environment-number {
  width: 76px;
  padding: 1px 3px;
  font: 10.5px var(--mono);
}
.environment-display-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
  font-weight: 600;
}
.environment-tool-sep {
  color: var(--border-strong);
}
.environment-always-on-top {
  font-size: 10.5px;
  color: var(--ink-soft);
}
.environment-notes-view {
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 8px;
  font-size: 11px;
  background: var(--panel-alt);
}
.environment-custom-card {
  width: min(560px, 92vw);
  padding: 0;
  overflow: hidden;
}
.environment-custom-card .modal-head {
  margin: 0;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.environment-custom-body {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 7px 12px;
  align-items: center;
  padding: 12px;
  font-size: 11px;
}
.environment-custom-body label {
  display: contents;
}
.environment-custom-body input,
.environment-custom-body select {
  padding: 3px 6px;
}
.environment-custom-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 9px 12px;
  border-top: 1px solid var(--border);
}
.environment-card.is-always-on-top {
  z-index: 120;
}
.modal.is-always-on-top {
  z-index: 120;
}
.environment-things {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.environment-things-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
}
.environment-things-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
}
.environment-things-table th,
.environment-things-table td {
  padding: 2px 5px;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  vertical-align: top;
}
.environment-things-table tr.is-inactive {
  color: var(--ink-soft);
}

/* ------------------------------------------------------------------ */
/* Thing device window: Config and Thing Editor                        */
/* ------------------------------------------------------------------ */
.thing-config,
.thing-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11px;
}
.thing-config-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.thing-config-head .section-title {
  margin: 0;
}
.thing-specifications {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10.5px;
}
.thing-editor-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.thing-editor-tab {
  border: 1px solid var(--border);
  border-bottom: none;
  background: var(--panel-alt);
  color: var(--ink-soft);
  padding: 5px 14px;
  border-radius: 5px 5px 0 0;
  font-size: 11px;
  cursor: pointer;
}
.thing-editor-tab.is-active {
  background: var(--panel);
  color: var(--ink);
  font-weight: 700;
}
.thing-editor {
  min-height: 0;
}
.thing-editor-body {
  flex: 1;
  min-height: 280px;
  overflow: auto;
}
.thing-properties {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.thing-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.thing-name-row label {
  min-width: 42px;
  color: var(--ink-soft);
}
.thing-name-row input {
  flex: 1;
}
.thing-property-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.thing-property-component {
  border-top: 1px solid var(--border);
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.thing-property-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 10px;
  align-items: start;
}
.thing-property-images {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.thing-property-component .thing-name-row .btn {
  flex: none;
}
.thing-component-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 300px;
  overflow: auto;
}
.thing-component-row {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 5px;
  padding: 3px 5px;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
  font-size: 11px;
}
.thing-component-row:hover {
  background: var(--panel-alt);
}
.thing-component-row.is-selected {
  border-color: var(--accent, #2563eb);
  background: #eff6ff;
}
.thing-component-row img {
  width: 34px;
  height: 26px;
  object-fit: contain;
}
.thing-subcomponent-head {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.thing-subcomponent-head .field {
  flex: 1;
  margin: 0;
}
.thing-image-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.thing-image-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 4px;
  background: var(--panel-alt);
  cursor: pointer;
}
.thing-image-chip.is-selected {
  border-color: var(--accent, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}
.thing-image-chip img {
  width: 54px;
  height: 40px;
  object-fit: contain;
}
.thing-image-add {
  display: flex;
  align-items: center;
  gap: 6px;
}
.thing-image-add select {
  flex: 1;
}
.thing-groupbox {
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 6px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.thing-group-title {
  font-weight: 700;
  color: var(--ink-soft);
}
.thing-radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.thing-radio-row label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.thing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 10px;
  align-items: start;
}
.thing-layout-scene {
  min-height: 240px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: linear-gradient(180deg, #f8fafc, #eef2f7);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.thing-layout-scene svg {
  width: 280px;
  height: 230px;
}
.thing-layout-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.thing-layout-controls .note {
  margin-top: 4px;
}
.thing-rules-table td {
  vertical-align: middle;
}
.thing-rules-table select {
  min-width: 92px;
}
.thing-rules-table tr.is-selected {
  background: #eff6ff;
}
.thing-rule-index {
  width: 28px;
  color: var(--ink-soft);
  text-align: right;
}
.thing-rule-image-cell {
  white-space: nowrap;
}
.thing-rule-image {
  width: 22px;
  height: 18px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 4px;
}
.thing-rule-value {
  display: flex;
  align-items: center;
  gap: 4px;
}
.thing-rule-value input {
  width: 58px;
}
.thing-custom-text {
  pointer-events: none;
}
.thing-component {
  cursor: pointer;
}
.thing-component.is-selected image {
  filter: drop-shadow(0 0 2px #2563eb) drop-shadow(0 0 3px #2563eb);
}
.thing-model image {
  image-rendering: auto;
}

/* ---------- Cisco IP Communicator desktop app ---------- */
.ipcomm-shell {
  position: relative;
  min-height: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
}
.ipcomm-shell.is-always-on-top {
  box-shadow: var(--shadow-md);
}
.ipcomm-window {
  max-width: 640px;
  border: 1px solid #243f9a;
  border-radius: 4px;
  overflow: hidden;
  background: #f1f1f1;
}
.ipcomm-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 6px;
  background: #0000cc;
  color: #fff;
  font: 600 12px var(--sans);
}
.ipcomm-close {
  width: 24px;
  height: 18px;
  border: 1px solid #b9c6f2;
  border-radius: 2px;
  background: #e9edf8;
  color: #16225e;
  font: 700 10px var(--sans);
  line-height: 1;
  cursor: pointer;
}
.ipcomm-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: #fff;
}
.ipcomm-phone {
  position: relative;
  width: 342px;
  margin: 0 auto;
  padding-left: 4px;
}
.ipcomm-phone-top {
  position: relative;
  padding: 10px 14px 14px;
  border: 1px solid #7d7d7d;
  border-radius: 30px 30px 16px 16px;
  background: linear-gradient(180deg, #f0f0f0 0%, #d6d6d6 34%, #a9a9a9 70%, #8d8d8d 100%);
  box-shadow:
    inset 0 1px 0 #fff,
    0 2px 5px rgba(0, 0, 0, 0.28);
}
.ipcomm-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.ipcomm-logo {
  color: #2f3d4d;
  font: 700 15px var(--sans);
  letter-spacing: 0.02em;
}
.ipcomm-menu-buttons {
  display: flex;
  gap: 5px;
  padding-top: 2px;
}
.ipcomm-menu-button {
  width: 15px;
  height: 7px;
  padding: 0;
  border: 1px solid #4c4c4c;
  border-radius: 1px;
  background: linear-gradient(#f3f3f3, #9a9a9a);
  cursor: pointer;
}
.ipcomm-menu-button.is-active {
  background: #cfe6ff;
}
.ipcomm-menu-button:disabled {
  cursor: default;
  opacity: 0.7;
}
.ipcomm-brand {
  margin: 1px 2px 6px 0;
  text-align: right;
  color: #4d4d4d;
  font: 700 7px var(--sans);
  letter-spacing: 0.08em;
}
.ipcomm-screen-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
}
.ipcomm-display {
  flex: 1;
  min-width: 0;
  height: 140px;
  padding: 3px;
  border: 3px solid #2b2b2b;
  border-radius: 4px;
  background: #000;
  display: flex;
  flex-direction: column;
}
.ipcomm-display-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 1px;
  color: #eaf5ff;
  font: 8px var(--mono);
  text-shadow: 0 0 2px #9fd6ff;
}
.ipcomm-display-main {
  position: relative;
  flex: 1;
  overflow: hidden;
  border: 1px solid #06121c;
  background: #0b1720;
  color: #eaf5ff;
}
.ipcomm-wallpaper {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 22% 20%, rgba(226, 241, 214, 0.55), transparent 34%),
    radial-gradient(ellipse at 82% 16%, rgba(198, 218, 232, 0.45), transparent 30%),
    linear-gradient(163deg, #233b2c 0%, #476149 22%, #8d9b7e 38%, #d6d0b8 52%, #667a5e 66%, #2c4534 84%, #17251c 100%);
}
.ipcomm-wallpaper::after {
  content: "";
  position: absolute;
  inset: 44% 0 0;
  background:
    linear-gradient(154deg, transparent 0 38%, rgba(244, 239, 218, 0.55) 39% 44%, transparent 45%),
    linear-gradient(24deg, transparent 0 55%, rgba(36, 55, 41, 0.45) 56% 63%, transparent 64%);
  opacity: 0.7;
}
.ipcomm-display-title {
  padding: 2px 3px 1px;
  color: #eaf5ff;
  font: 600 9px var(--sans);
  border-bottom: 1px solid rgba(234, 245, 255, 0.28);
}
.ipcomm-display-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.ipcomm-display-table th,
.ipcomm-display-table td {
  padding: 1px 3px;
  border-bottom: 1px solid rgba(234, 245, 255, 0.16);
  color: #eaf5ff;
  font: 8px var(--sans);
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ipcomm-display-table th:first-child,
.ipcomm-display-table td:first-child {
  width: 24%;
}
.ipcomm-display-table tr.is-selected td {
  background: rgba(126, 196, 232, 0.35);
}
.ipcomm-display-empty {
  color: #b9d7e8;
  text-align: center !important;
}
.ipcomm-display-hint,
.ipcomm-display-number,
.ipcomm-display-status {
  padding: 1px 4px;
  text-align: center;
}
.ipcomm-display-hint {
  min-height: 11px;
  color: #b9d7e8;
  font: 8px var(--sans);
}
.ipcomm-display-number {
  color: #f2fbff;
  font: 600 16px var(--mono);
  letter-spacing: 0.04em;
}
.ipcomm-display-status {
  min-height: 12px;
  color: #eaf5ff;
  font: 8.5px var(--sans);
}
.ipcomm-display-softkeys {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  margin-top: 2px;
}
.ipcomm-softkey-label {
  display: block;
  min-height: 13px;
  padding: 1px 2px;
  border-radius: 2px;
  background: #7cc4e8;
  color: #0b2540;
  font: 600 7.5px var(--sans);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
}
.ipcomm-softkey-label.is-empty {
  background: transparent;
}
.ipcomm-linekeys {
  display: grid;
  grid-template-columns: repeat(2, 17px);
  grid-auto-rows: 17px;
  align-content: center;
  gap: 7px 4px;
  padding: 2px 0;
}
.ipcomm-linekey {
  width: 17px;
  height: 17px;
  padding: 0;
  border: 1px solid #5a5a5a;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #c7c7c7 40%, #6b6b6b 100%);
  cursor: pointer;
}
.ipcomm-physical-softkeys {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  margin: 7px 3px 0;
}
.ipcomm-softkey {
  height: 10px;
  padding: 0;
  border: 1px solid #6d6d6d;
  border-radius: 5px;
  background: linear-gradient(#f4f4f4, #9c9c9c);
  cursor: pointer;
}
.ipcomm-softkey:disabled {
  cursor: default;
  opacity: 0.6;
}
.ipcomm-lower {
  position: relative;
  margin: -8px -8px 0;
  padding: 18px 14px 16px;
  border-radius: 14px 14px 26px 26px;
  background: linear-gradient(180deg, #333 0%, #1a1a1a 40%, #090909 100%);
  box-shadow:
    inset 0 1px 0 #555,
    0 3px 6px rgba(0, 0, 0, 0.35);
  display: grid;
  grid-template-columns: 140px 80px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.ipcomm-lower::after {
  content: "";
  position: absolute;
  left: 184px;
  top: 38px;
  bottom: 26px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}
.ipcomm-keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px 6px;
}
.ipcomm-key {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1.16;
  padding: 0;
  border: 1px solid #4a4a4a;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, #f4f4f4, #cfcfcf 38%, #7d7d7d 72%, #4f4f4f 100%);
  color: #1b1b1b;
  cursor: pointer;
}
.ipcomm-key:active {
  transform: translateY(1px);
}
.ipcomm-key-digit {
  font: 700 14px var(--sans);
  line-height: 1;
}
.ipcomm-key-letters {
  min-height: 7px;
  font: 700 5.5px var(--sans);
  letter-spacing: 0.04em;
}
.ipcomm-navcol {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}
.ipcomm-nav {
  position: relative;
  width: 70px;
  height: 70px;
  padding: 0;
  border: 1px solid #5c5c5c;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, #f7f7f7, #c9c9c9 38%, #777 72%, #3d3d3d 100%);
  cursor: pointer;
}
.ipcomm-nav::before,
.ipcomm-nav::after {
  content: "";
  position: absolute;
  border: 4px solid transparent;
  left: 50%;
  top: 50%;
}
.ipcomm-nav::before {
  margin-left: -4px;
  margin-top: -25px;
  border-bottom-color: #f7f7f7;
}
.ipcomm-nav::after {
  margin-left: -4px;
  margin-top: 9px;
  border-top-color: #f7f7f7;
}
.ipcomm-nav-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border: 1px solid #6d6d6d;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, #fff, #c3c3c3 52%, #7d7d7d 100%);
}
.ipcomm-nav-extra {
  width: 40px;
  height: 19px;
  padding: 0;
  border: 1px solid #5a5a5a;
  border-radius: 10px;
  background: linear-gradient(#454545, #1d1d1d);
  color: #d8d8d8;
  font: 700 8px var(--mono);
  cursor: pointer;
}
.ipcomm-rightcol {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "msg dir"
    "set svc"
    "help help"
    "vol vol"
    "bottom bottom";
  gap: 5px 4px;
  align-items: center;
  justify-items: center;
}
.ipcomm-feature {
  width: 38px;
  height: 25px;
  padding: 0;
  border: 1px solid #555;
  border-radius: 11px;
  background: linear-gradient(#4a4a4a, #1f1f1f);
  color: #dcdcdc;
  font: 700 7px var(--mono);
  cursor: pointer;
}
.ipcomm-feature[data-ipcomm-feature="messages"] {
  grid-area: msg;
}
.ipcomm-feature[data-ipcomm-feature="directories"] {
  grid-area: dir;
}
.ipcomm-feature[data-ipcomm-feature="settings"] {
  grid-area: set;
}
.ipcomm-feature[data-ipcomm-feature="services"].ipcomm-feature {
  grid-area: svc;
}
.ipcomm-help {
  grid-area: help;
  width: 23px;
  height: 23px;
  padding: 0;
  border: 1px solid #15536b;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, #8dd6ef, #2d8bb0 52%, #175870 100%);
  color: #fff;
  font: 700 12px var(--sans);
  cursor: pointer;
}
.ipcomm-volume {
  grid-area: vol;
  width: 112px;
  height: 11px;
  margin-top: 2px;
  border: 1px solid #555;
  border-radius: 6px;
  background: linear-gradient(#f0f0f0, #a9a9a9 50%, #737373 100%);
  cursor: pointer;
}
.ipcomm-volume span {
  display: block;
  width: 5px;
  height: 9px;
  margin-left: 52px;
  background: #6b6b6b;
}
.ipcomm-bottom-row {
  grid-area: bottom;
  display: flex;
  gap: 13px;
  justify-content: center;
  margin-top: 3px;
}
.ipcomm-round {
  width: 25px;
  height: 25px;
  padding: 0;
  border: 1px solid #5c5c5c;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, #fff, #c4c4c4 44%, #6c6c6c 100%);
  color: #333;
  font: 700 7px var(--sans);
  cursor: pointer;
}
.ipcomm-volume-side {
  position: absolute;
  left: -5px;
  top: 178px;
  width: 10px;
  height: 58px;
  padding: 0;
  border: 1px solid #555;
  border-radius: 5px;
  background: linear-gradient(90deg, #555, #cfcfcf 45%, #5f5f5f);
  cursor: pointer;
}
.ipcomm-top {
  margin: 0;
}
.ipcomm-appmenu {
  position: absolute;
  z-index: 5;
  top: 64px;
  left: 232px;
  min-width: 224px;
  padding: 3px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--panel);
  box-shadow: var(--shadow-md);
}
.ipcomm-appmenu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 5px 8px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--ink);
  font: 12px var(--sans);
  text-align: left;
  cursor: pointer;
}
.ipcomm-appmenu button:hover {
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.ipcomm-menu-check {
  width: 12px;
  color: var(--brand-ink);
  text-align: center;
}
.ipcomm-dialog {
  position: absolute;
  z-index: 6;
  top: 54px;
  left: 50%;
  width: min(420px, calc(100% - 40px));
  transform: translateX(-50%);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: var(--shadow-md);
}
.ipcomm-dialog-title {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  background: #0000cc;
  color: #fff;
  font: 600 12px var(--sans);
}
.ipcomm-tabs {
  display: flex;
  gap: 2px;
  padding: 6px 8px 0;
  border-bottom: 1px solid var(--border);
}
.ipcomm-tab {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  background: var(--panel-alt);
  color: var(--ink-soft);
  font: 600 11px var(--sans);
  cursor: pointer;
}
.ipcomm-tab.is-active {
  background: var(--panel);
  color: var(--brand-ink);
  border-color: var(--brand);
}
.ipcomm-dialog-body {
  padding: 10px;
}
.ipcomm-pane[hidden] {
  display: none;
}
.ipcomm-pref-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ipcomm-pref-title {
  font: 700 11px var(--sans);
  color: var(--ink-soft);
}
.ipcomm-radio {
  display: flex;
  align-items: center;
  gap: 5px;
  font: 11.5px var(--sans);
  color: var(--ink);
}
.ipcomm-pref-field {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}
.ipcomm-pref-field label {
  font: 11.5px var(--sans);
  color: var(--ink);
}
.ipcomm-pref-field input,
.ipcomm-pref-field select {
  min-width: 0;
  padding: 4px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font: 11.5px var(--sans);
}
.ipcomm-pref-field input:disabled,
.ipcomm-pref-field select:disabled {
  background: var(--panel-alt);
  color: var(--ink-faint);
}
.ipcomm-dialog-error {
  padding: 4px 2px 0;
  color: #b3261e;
  font: 11px var(--sans);
}
.ipcomm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 10px 10px;
  border-top: 1px solid var(--border);
}
/* Device File Manager (FILE_MANAGER / CDeviceFileManager) */
.file-manager {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.file-manager-path {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 4px 0 8px;
  font-size: 12px;
}
.file-manager-path span:first-child {
  font-weight: 600;
}
.file-manager-volumes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 8px;
}
.file-manager-capacity {
  font-size: 11px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
}
.file-manager-table {
  width: 100%;
}
.file-manager-table th,
.file-manager-table td {
  padding: 3px 6px;
}
.file-manager-table tr.is-selected {
  background: #eff6ff;
}
.file-manager-name {
  text-align: left;
  font-weight: 500;
}
.file-manager .note.is-error {
  color: #b91c1c;
}
.file-editor-card {
  width: min(720px, 92vw);
}
.file-editor-meta {
  min-height: 18px;
  font-size: 12px;
  color: var(--ink-soft);
}
.file-editor-source {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}
.firmware-upgrade-card {
  width: min(520px, 92vw);
}
.firmware-tree-root {
  font-weight: 600;
  margin: 4px 0;
}
.firmware-file-tree {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--line);
  padding: 6px;
}
.firmware-file {
  text-align: left;
}
.firmware-file.is-selected {
  background: #eff6ff;
}
/* Internet Access Policy (CBaseAccessRestrictions). */
.subtabs {
  display: flex;
  gap: 2px;
  margin: 2px 0 8px;
  border-bottom: 1px solid var(--border);
}
.subtab {
  padding: 5px 10px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-faint);
}
.subtab.is-active {
  color: var(--brand-ink);
  background: var(--panel);
  border-color: var(--border);
}
.access-subcaption {
  margin-top: 0;
}
.access-unavailable {
  font-weight: 600;
  color: var(--ink-soft);
}
.access-policy-head {
  grid-template-columns: 1.1fr 1fr 1fr;
  align-items: end;
}
.access-head-button {
  margin-bottom: 11px;
}
.access-head-button .btn {
  width: 100%;
}
.access-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.access-inline > label:first-child {
  margin: 0;
}
.access-edit-row {
  align-items: center;
}
.access-edit-row .note {
  margin: 0;
}
.access-schedule-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 10px;
}
.access-days {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.access-days > label:first-child {
  margin: 0;
}
.access-times {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
.access-times select {
  width: auto;
}
/* URL/Keyword 1 and 3 share the first row, 2 and 4 the second, matching
   BaseAccessRestrictions.ui line order (URL 1, URL 3, URL 2, URL 4). */
.access-list-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  gap: 0 10px;
}
.access-apps {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: end;
}
.access-app-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.access-app-col label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
}
.access-app-col select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px;
  background: var(--panel);
  color: var(--ink);
}
.access-app-buttons {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 2px;
}
.access-app-buttons .btn {
  min-width: 44px;
}
.access-list-card {
  width: min(760px, 94vw);
}
.access-list-table input {
  width: 100%;
  padding: 3px 5px;
  font-size: 11px;
}
.access-range-cell {
  white-space: nowrap;
}
.access-range-cell input {
  width: 110px;
  display: inline-block;
}

.logical-bar {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 1px;
}
.logical-bar[hidden] {
  display: none;
}
.logical-coords {
  font-size: 11px;
  color: var(--muted, #64748b);
  min-width: 130px;
  padding-left: 6px;
  white-space: nowrap;
}
.logical-cluster-name {
  width: min(240px, 20vw);
  height: 18px;
  font-size: 11.5px;
  padding: 0 4px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--panel);
  color: var(--ink);
}
.logical-cluster-name[readonly] {
  background: var(--panel-alt);
  color: var(--ink-soft);
}
.logical-tile {
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--ink-soft);
  padding: 0 4px;
  white-space: nowrap;
}
.cluster-node {
  cursor: pointer;
}

.pdu-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1px solid var(--border, #888);
  vertical-align: middle;
}
.user-pdu-panel .pdu-ok {
  color: #2f855a;
}
.user-pdu-panel .pdu-fail {
  color: #c53030;
}
