:root {
  color-scheme: light dark;
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  --text: #111827;
  --muted: #6b7280;
  --muted-strong: #6b7280;
  --heading: #374151;
  --accent: #0f766e;
  --accent-emphasis: #0f766e;
  --accent-soft: rgba(15,118,110,.12);
  --border: #d6dae1;
  --card-border: var(--border);
  --surface-page: #f6f7f9;
  --surface-panel: #fff;
  --surface-card: rgba(255,255,255,.55);
  --surface-subtle: rgba(107,114,128,.06);
  --surface-muted: rgba(107,114,128,.08);
  --surface-code: rgba(17,24,39,.06);
  --surface-info: rgba(59,130,246,.07);
  --surface-success: rgba(16,185,129,.10);
  --warning-border: #d97706;
  --warning-surface: #fffbeb;
  --warning-text: #92400e;
  --notice-border: #94a3b8;
  --notice-surface: #f8fafc;
  --notice-text: #475569;
  --danger-surface: #fef2f2;
  --danger-text: #991b1b;
  --panel-bg: var(--surface-panel);
  --space-section: 16px;
  --space-panel: 12px;
  --space-compact: 8px;
  --space-micro: 6px;
}
body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text);
}
main {
  max-width: 520px;
  margin: 0 auto;
  padding: 28px 18px;
}
h1 {
  font-size: 24px;
  margin: 0 0 18px;
}
form {
  display: grid;
  gap: 12px;
}
label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--heading);
}
.port-search-link {
  display: flex;
  align-items: center;
  gap: var(--space-micro);
  min-width: 0;
  white-space: nowrap;
}
.port-search-link code {
  flex: 0 0 auto;
}
.port-search-icon-button {
  flex: 0 0 auto;
  background: transparent;
  color: var(--heading);
  transition: background-color 120ms ease, color 120ms ease;
}
.port-search-icon-button:is(:hover:not(:disabled), :focus-visible) {
  background: var(--accent-soft);
  color: var(--accent-emphasis);
}
input,
select {
  box-sizing: border-box;
  font: inherit;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-panel);
  color: var(--text);
}
select {
  min-height: 44px;
}
select[multiple] {
  min-height: 156px;
  padding: 6px;
}
select[multiple] option {
  padding: 8px 10px;
  border-radius: 5px;
}
select[multiple] option:checked {
  background: #0f766e linear-gradient(0deg, #0f766e 0%, #0f766e 100%);
  color: white;
}
input::placeholder {
  color: rgba(107, 114, 128, 0.42);
}
input:focus::placeholder {
  color: transparent;
}
button {
  font: inherit;
  padding: 12px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  cursor: pointer;
}
button:disabled {
  opacity: .6;
  cursor: default;
}
:where(
  .ui-stack-compact, .mac-result[data-tone="ok"], .stb-actions, .customer-chooser, .customer-search-panel,
  .customer-search-result, .customer-list, .service-account, .terminal-list,
  .port-customer-list, .port-list, .port-customer-item, .port-item, .selected-node-port-result,
  .node-work-actions, .node-work-active-ports, .node-work-switch,
  .node-work-check-result, .equipment-summary, .port-service-cards,
  .port-readonly-detail
) {
  display: grid;
  gap: var(--space-compact);
}
:where(
  .ui-stack-micro, .mac-form, .status-lines, .status-stack, .port-warning-list,
  .port-graph, .service-choice-list, .port-mini-list, .port-config-history
) {
  display: grid;
  gap: var(--space-micro);
}
:where(
  .ui-surface, .customer-item, .terminal-item, .port-customer-item, .port-item,
  .service-account, .bm-session-item, .bm-service
) {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-subtle);
}
.ui-dump {
  max-height: 260px;
  overflow: auto;
  margin: var(--code-margin, var(--space-compact) 0 var(--space-panel));
  padding: 8px;
  border-radius: 6px;
  background: var(--surface-code);
  color: var(--heading);
  white-space: pre-wrap;
  word-break: break-word;
  font: 12px ui-monospace, SFMono-Regular, Consolas, monospace;
}
.port-readonly-detail > .ui-dump {
  min-height: 268px;
  max-height: none;
}
:is(
  .ui-action-row, .bm-service-change-actions, .bm-radius-controls
) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-compact);
}
.ui-button {
  width: 100%;
  min-height: 44px;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}
:is(
  .ui-button--inline, .ui-action-row .ui-button, .bm-service-change-actions .ui-button,
  .bm-radius-controls .ui-button, .bm-session-item .ui-button,
  .node-work-session-list .ui-button, .terminal-item .ui-button
) {
  width: auto;
}
:is(.ui-button--danger, .ui-button[data-variant="danger"]) {
  background: #b91c1c;
}
:is(.ui-button--secondary, .ui-button--destructive, .ui-button[data-variant="secondary"], .ui-button[data-variant="destructive"]) {
  background: #374151;
}
:is(.ui-button--destructive, .ui-button[data-variant="destructive"]):is(:hover:not(:disabled), :focus-visible) {
  background: #1f2937;
}
.ui-button--icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
}
.fluent-icon {
  display: block;
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.panel {
  display: grid;
  gap: var(--space-panel);
  margin-top: var(--space-section);
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-panel);
}
.session-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-panel);
  margin-top: var(--space-section);
}
.session-grid .panel {
  margin-top: 0;
}
.session-panel {
  min-width: 0;
  align-content: start;
}
.session-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-compact);
}
.session-actions .ui-button {
  width: 100%;
  min-width: 0;
}
:where(.muted, [data-tone="muted"]) {
  color: var(--muted);
  font-size: 13px;
}
[hidden] {
  display: none !important;
}
[data-tone="ok"] {
  color: #047857;
}
[data-tone="bad"] {
  color: #b91c1c;
}
.row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-panel);
}
.skeleton-line {
  position: relative;
  overflow: hidden;
  background: var(--surface-muted);
}
.skeleton-line span {
  display: block;
  width: 100%;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(107,114,128,.10);
}
.skeleton-line span::after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(107,114,128,.22), transparent);
  transform: translateX(-100%);
  animation: status-skeleton 1.5s ease-in-out infinite;
}
@keyframes status-skeleton {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}
.status-line {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-sizing: border-box;
  height: 32px;
  min-height: 32px;
  max-height: 32px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--surface-muted);
  line-height: 20px;
}
.status-text {
  position: relative;
  display: inline-block;
  min-width: 0;
}
.status-text-shimmer {
  position: absolute;
  inset: 0;
  visibility: hidden;
  pointer-events: none;
  color: transparent;
  -webkit-text-fill-color: transparent;
  background: linear-gradient(105deg, transparent 0%, transparent 42%, var(--status-text-highlight) 50%, transparent 58%, transparent 100%);
  background-size: 300% 100%;
  background-position: 100% 0;
  background-repeat: no-repeat;
  background-clip: text;
  -webkit-background-clip: text;
}
.status-lines[data-refreshing="true"] .status-text-shimmer {
  visibility: visible;
  animation: status-refresh-shimmer 1.5s ease-in-out 1;
}
@keyframes status-refresh-shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}
.status-line[data-tone="ok"] {
  --status-text-color: #047857;
  --status-text-highlight: hsl(160 94% 45%);
  color: var(--status-text-color);
  background: rgba(4,120,87,.10);
}
.status-line[data-tone="bad"] {
  --status-text-color: #b91c1c;
  --status-text-highlight: hsl(0 74% 62%);
  color: var(--status-text-color);
  background: rgba(185,28,28,.10);
}
.status-action {
  flex: 0 0 auto;
  height: 24px;
  min-height: 24px;
  max-height: 24px;
  padding: 0 9px;
  font-size: 12px;
  line-height: 1.1;
}
.action-notification {
  min-height: 20px;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px var(--notice-border);
  background: var(--notice-surface);
  color: var(--notice-text);
  font-size: 16px;
  line-height: 20px;
}
.action-notification[data-tone="bad"] {
  box-shadow: inset 0 0 0 1px #b91c1c;
  background: var(--danger-surface);
  color: var(--danger-text);
}
.mac-label {
  font-size: 13px;
}
.search-panel-heading {
  align-items: baseline;
}
.panel-heading-hint {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}
.searchbar {
  position: relative;
}
.compact-port-form .searchbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-compact);
  align-items: center;
}
.mac-input {
  width: 100%;
  box-sizing: border-box;
  padding-right: 52px;
}
.searchbar:has(.search-placeholder-with-paste) .mac-input {
  padding-right: 88px;
}
.search-placeholder-with-paste {
  position: absolute;
  top: 50%;
  left: 13px;
  right: 82px;
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  color: rgba(107, 114, 128, 0.42);
  pointer-events: none;
  transform: translateY(-50%);
}
.search-placeholder-with-paste span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.searchbar:has(.search-placeholder-with-paste) .mac-input::placeholder {
  color: transparent;
}
.mac-input:is(:focus, :not(:placeholder-shown)) + .search-placeholder-with-paste {
  display: none;
}
.search-submit {
  position: absolute;
  top: 50%;
  right: 7px;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--heading);
  transform: translateY(-50%);
  transition: background-color 120ms ease, color 120ms ease;
}
.search-submit:is(:hover, :focus-visible) {
  background: var(--accent-soft);
  color: var(--accent-emphasis);
}
.search-submit:disabled {
  background: rgba(107,114,128,.10);
  cursor: default;
}
.search-submit.search-input-paste {
  position: static;
  flex: 0 0 auto;
  color: inherit;
  pointer-events: auto;
  transform: none;
}
.search-submit.search-input-clear {
  right: 42px;
}
.mac-input:placeholder-shown ~ .search-input-clear {
  display: none;
}
.mac-result {
  min-height: 18px;
  min-width: 0;
}
.stb-details {
  display: grid;
  gap: var(--space-micro);
  margin: 0;
}
.stb-details div {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: var(--space-compact);
}
.stb-details dt {
  color: var(--muted);
}
.stb-details dd {
  margin: 0;
  min-width: 0;
}
.stb-section-title {
  margin-top: 0;
  color: var(--heading);
  font-weight: 600;
}
.warning-message {
  padding: 10px 12px;
  border: 1px solid var(--warning-border);
  border-radius: 8px;
  background: var(--warning-surface);
  color: var(--warning-text);
  font-weight: 600;
  white-space: normal;
}
.stb-action-result {
  min-height: 18px;
}
.stb-replacement-summary,
.stb-replacement-actions {
  display: grid;
  gap: var(--space-compact);
}
.stb-replacement-device,
.stb-replacement-target-info {
  display: grid;
  gap: 4px;
}
.stb-replacement-device small,
.stb-replacement-outcome {
  overflow-wrap: anywhere;
}
.stb-replacement-target-info small,
.stb-replacement-device small {
  color: var(--muted);
}
.stb-replacement-outcome {
  min-height: 18px;
}
.customer-chooser {
  margin-top: 12px;
}
.customer-search-panel {
  margin-top: 8px;
}
.customer-item {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text);
  text-align: left;
}
.customer-item span,
.terminal-info,
.service-choice small {
  overflow-wrap: anywhere;
}
.terminal-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.port-item-title {
  font-size: 16px;
  line-height: 1.25;
}
.port-identity {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-bg);
}
.port-moss-link-wrap {
  min-width: 0;
}
.port-moss-link {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--heading);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.port-moss-link:is(:hover, :focus-visible) {
  color: var(--heading);
}
.port-graph img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  background: #fff;
}
.node-work-actions {
  grid-template-columns: minmax(0, 1fr);
}
.node-work-session-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-micro);
}
.node-work-node-title {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
}
.node-work-switch-title {
  color: var(--muted);
  font-weight: 600;
}
.node-work-port-grid,
.node-work-problem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(54px, 54px));
  gap: var(--space-micro);
}
.node-work-port {
  width: 54px;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--border);
  border-radius: 6px;
  display: grid;
  place-items: center;
  padding: 4px;
  text-align: center;
  font-weight: 700;
  box-sizing: border-box;
}
.node-work-port[data-tone="ok"] {
  background: rgba(16,185,129,.10);
  border-color: rgba(16,185,129,.35);
  color: #047857;
}
.node-work-port.problem {
  align-content: center;
  gap: 2px;
  line-height: 1.15;
}
.node-work-port.problem span {
  font-size: 11px;
  font-weight: 600;
}
.node-work-port.problem[data-tone="bad"] {
  background: rgba(220,38,38,.12);
  border-color: rgba(220,38,38,.55);
  color: #991b1b;
}
.node-work-port.problem[data-tone="warning"] {
  background: rgba(245,158,11,.16);
  border-color: rgba(217,119,6,.55);
  color: #92400e;
}
.node-work-empty-result {
  border: 1px solid rgba(16,185,129,.35);
  background: rgba(16,185,129,.10);
  color: #047857;
  padding: 10px 12px;
  border-radius: 6px;
  font-weight: 600;
}
.equipment-info-card,
.port-service-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  background: var(--surface-card);
  font-size: 13px;
  line-height: 1.4;
}
.equipment-info-head,
.port-service-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-info);
  border-bottom: 1px solid var(--card-border);
}
.equipment-info-head > div {
  display: grid;
  min-width: 0;
  gap: var(--space-micro);
}
.equipment-info-head strong,
.port-service-card-head strong {
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}
.equipment-info-head span:not(.equipment-type-badge) {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.equipment-type-badge,
.port-service-status {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}
.equipment-type-badge {
  color: #1d4ed8;
  background: rgba(59,130,246,.13);
  text-transform: uppercase;
}
.equipment-info-grid,
.port-service-details {
  display: grid;
  grid-template-columns: var(--detail-columns, minmax(0, 1fr));
  margin: 0;
}
.equipment-info-grid {
  --detail-columns: repeat(2, minmax(0, 1fr));
}
.equipment-info-grid > div,
.port-service-details > div {
  min-width: 0;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
}
.equipment-info-grid > div:nth-last-child(-n + 2),
.port-service-details > div:last-child {
  border-bottom: 0;
}
.equipment-info-grid dt,
.port-service-details dt {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}
.equipment-info-grid dd,
.port-service-details dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.4;
}
.equipment-info-grid .equipment-info-date {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.equipment-info-grid .equipment-info-date dt {
  margin-bottom: 0;
  white-space: nowrap;
}
.equipment-info-grid .equipment-info-date dd {
  white-space: nowrap;
  text-align: right;
}
.port-service-details > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.port-service-details dt {
  flex: 0 0 auto;
  margin-bottom: 0;
  white-space: nowrap;
}
.port-service-details dd {
  min-width: 0;
}
.port-service-card-head {
  align-items: center;
  background: var(--surface-success);
}
.port-service-status[data-tone="ok"] {
  color: #047857;
  background: rgba(16,185,129,.14);
}
.port-service-status[data-tone="warning"] {
  color: #92400e;
  background: rgba(245,158,11,.16);
}
.port-service-card.fallback pre {
  margin: 0;
  padding: 12px 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.4;
}
@media (max-width: 600px) {
  .equipment-info-grid {
    --detail-columns: minmax(0, 1fr);
  }
  .equipment-info-grid > div {
    grid-column: 1;
    border-bottom: 1px solid var(--border);
  }
  .equipment-info-grid > div:last-child {
    border-bottom: 0;
  }
}
.service-choice-list label {
  display: block;
  padding: 8px;
  border-radius: 6px;
  background: var(--surface-muted);
  overflow-wrap: anywhere;
}
.bm-session-item {
  background: var(--panel-bg);
}
.bm-group-child + .bm-group-child {
  padding-top: var(--space-panel);
  border-top: 1px solid var(--border);
}
.bm-service-extras summary {
  color: var(--muted);
}
.bm-service-extras .bm-service + .bm-service {
  margin-top: var(--space-compact);
}
.bm-service-change {
  border-top: 1px solid var(--border);
  padding-top: var(--space-compact);
}
.bm-service-change > summary {
  width: max-content;
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
}
.bm-service-change-actions {
  margin-top: var(--space-compact);
}
.bm-radius-controls {
  flex-wrap: nowrap;
}
.bm-radius-controls .ui-button,
.bm-service-change-actions .ui-button {
  min-height: 44px;
  padding: 7px 8px;
  white-space: nowrap;
  font-size: 13px;
}
.bm-radius-controls .ui-button {
  flex: 1;
}
.bm-radius-controls [aria-pressed=false] {
  background: #374151;
}
.bm-service-change-editor {
  margin-top: var(--space-compact);
}
.bm-service-change-field > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.bm-service-change-field input,
.bm-service-change-field select {
  width: 100%;
  min-width: 0;
}
.bm-password-row dd,
.bm-password-inline-editor {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-micro);
}
.bm-password-inline-editor {
  flex: 1 1 0;
  width: 100%;
  flex-wrap: nowrap;
}
.bm-password-current,
.bm-password-old {
  flex: 0 0 auto;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.bm-password-old {
  color: var(--muted);
}
.bm-password-new {
  flex: 0 1 96px;
  min-width: 72px;
  width: 96px;
  height: 28px;
  padding: 4px 8px;
  border-radius: 6px;
  font: 600 13px ui-monospace, SFMono-Regular, Consolas, monospace;
}
.bm-password-comment {
  flex: 1 1 110px;
  min-width: 76px;
  height: 28px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 13px;
}
.bm-password-icon-button {
  flex: 0 0 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}
.bm-password-icon-button[data-variant="success"] {
  --icon-color: #047857;
}
.bm-password-icon-button[data-variant="danger-icon"] {
  --icon-color: #b91c1c;
}
.bm-password-icon-button:hover:not(:disabled),
.bm-password-icon-button:focus-visible {
  background: rgba(15,118,110,.14);
  color: var(--icon-color, #0f766e);
}
.bm-password-icon-button .fluent-icon {
  width: 100%;
  height: 100%;
}
.bm-password-error {
  flex-basis: 100%;
  font-size: 12px;
}
.bm-promised-payment-editor {
  min-width: 0;
  margin-top: var(--space-compact);
}
.bm-promised-payment-editor:empty {
  display: none;
}
.bm-account-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-compact);
}
.bm-promised-payment-form {
  min-width: 0;
}
.bm-domain-result + .bm-domain-result {
  margin-top: var(--space-panel);
  padding-top: var(--space-panel);
  border-top: 2px solid var(--border);
}
.bm-agreement-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-compact);
}
.bm-domain-inline {
  flex: 0 0 auto;
  max-width: 45%;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bm-result-section {
  display: grid;
  gap: var(--space-panel);
  margin-top: var(--space-section);
}

.bm-search-choice .ui-action-row {
  flex-wrap: wrap;
}

.bm-search-choice {
  margin-top: var(--space-micro);
}

.bm-search-choice-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-micro);
}
.bm-result-card {
  margin-top: 0;
  padding: 14px;
  border: 1px solid #d6dae1;
  border-radius: 8px;
}
.bm-flat-list .bm-result-card {
  background: var(--panel-bg);
  border-color: var(--border);
}
.bm-divider {
  display: block;
  height: 1px;
  margin: 0;
  background: var(--border);
}
.bm-radius-summary .stb-details.compact div {
  grid-template-columns: 140px minmax(0, 1fr);
}
.bm-table-wrap,
.ui-data-table-wrap {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  scrollbar-color: #64748b rgba(107,114,128,.16);
}
:where(
  .port-item, .selected-node-port-result, .port-readonly-detail, .port-actions,
  .equipment-action-result, .equipment-action-markdown-group
) > * {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}
:where(
  .equipment-action-result, .equipment-action-markdown-group,
  .port-actions, .port-readonly-detail
) {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.bm-table-wrap {
  max-height: 360px;
  overflow: auto;
}
.bm-table-wrap::-webkit-scrollbar,
.ui-data-table-wrap::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
.bm-table-wrap::-webkit-scrollbar-track,
.ui-data-table-wrap::-webkit-scrollbar-track {
  background: rgba(107,114,128,.16);
}
.bm-table-wrap::-webkit-scrollbar-thumb,
.ui-data-table-wrap::-webkit-scrollbar-thumb {
  min-width: 48px;
  border: 3px solid transparent;
  border-radius: 999px;
  background: #64748b;
  background-clip: padding-box;
}
.bm-table-wrap::-webkit-scrollbar-thumb:hover,
.ui-data-table-wrap::-webkit-scrollbar-thumb:hover {
  background: #475569;
}
.bm-table-wrap::-webkit-scrollbar-corner,
.ui-data-table-wrap::-webkit-scrollbar-corner {
  background: rgba(107,114,128,.16);
}
.ui-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.ui-data-table th,
.ui-data-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.ui-data-table th {
  position: sticky;
  top: 0;
  background: var(--panel-bg);
  z-index: 1;
}
.ui-data-table tbody tr:last-child td {
  border-bottom: 0;
}
.port-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-compact);
  margin-block: var(--space-compact);
}
.port-actions,
.port-services {
  display: grid;
  gap: var(--space-panel);
  margin-block: var(--space-panel);
}
.ui-scroll-x {
  overflow-x: auto;
  overflow-y: visible;
}
.equipment-port-state-table {
  width: max-content;
  min-width: 100%;
  font: 12px ui-monospace, SFMono-Regular, Consolas, monospace;
}
.equipment-actions {
  min-width: 0;
  max-width: 100%;
}
.node-equipment-result {
  min-width: 0;
  max-width: 100%;
}
.equipment-action-format-warning {
  margin-bottom: 8px;
}
.equipment-action-partial-warning {
  margin: 8px;
}
.equipment-action-markdown-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 8px;
  border-bottom: 1px solid var(--border);
  font: 12px ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: normal;
}
.equipment-action-markdown-group + .equipment-action-markdown-group {
  border-top: 8px solid var(--panel-bg);
}
.equipment-action-markdown-group-title {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  white-space: normal;
}
.equipment-action-table-controls {
  display: flex;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid var(--border);
}
.equipment-action-table-controls .ui-button {
  width: auto;
  padding: 6px 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: inherit;
  font-size: 12px;
}
.equipment-action-table-controls .ui-button[aria-pressed="true"] {
  background: #0f766e;
  color: white;
}
:where(.ui-dump, .equipment-action-result):empty {
  display: none;
}
.port-mini-list div {
  display: grid;
  gap: 2px;
  padding: 8px;
  border-radius: 6px;
  background: var(--surface-muted);
}
.port-mini-list small {
  color: var(--muted-strong);
}
.port-mini-list .bm-stb-mac-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: var(--space-compact);
}
.port-mac-history-table-wrap {
  box-sizing: border-box;
  justify-self: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}
.port-mac-history-table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
}
.port-mac-history-table th:nth-child(1) {
  width: 148px;
}
.port-mac-history-table th:nth-child(3) {
  width: 41px;
}
.port-mac-history-table td {
  white-space: nowrap;
}
.port-mac-history-mac {
  display: inline-flex;
  align-items: center;
  gap: var(--space-compact);
}
.bm-stb-mac-row > strong,
.bm-stb-mac-row > span {
  grid-column: 1;
}
.bm-stb-mac-row .bm-password-icon-button {
  grid-column: 2;
  grid-row: 1 / span 2;
}
:where(.ui-disclosure, .equipment-spoiler),
.port-config-spoiler {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-compact);
  min-width: 0;
  max-width: 100%;
  color: var(--text);
}
.port-readonly-detail {
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  max-width: 100%;
}
:where(
  .ui-disclosure-summary, .ui-disclosure > summary, .equipment-spoiler > summary,
  .port-config-spoiler > summary, .bm-service-extras summary
) {
  cursor: pointer;
}
.terminal-info {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.terminal-info small {
  color: var(--muted-strong);
}
.terminal-item .ui-button {
  width: auto;
  white-space: nowrap;
}
.stb-details.compact {
  gap: 4px;
}
.stb-details.compact div {
  grid-template-columns: 92px minmax(0, 1fr);
}
.service-account-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}
.service-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px 0;
  color: inherit;
}
.service-choice input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  padding: 0;
}
.service-choice span {
  display: grid;
  gap: 3px;
}
.service-choice small {
  color: var(--muted);
}
code {
  word-break: break-word;
}
@media (max-width: 440px) {
  .service-account-head {
    grid-template-columns: 1fr;
  }
  .session-grid {
    grid-template-columns: 1fr;
  }
  .terminal-item {
    grid-template-columns: 1fr;
  }
  .terminal-item .ui-button {
    width: 100%;
  }
}
@media (prefers-color-scheme: dark) {
  :root {
    --text: #e5e7eb;
    --muted: #9ca3af;
    --muted-strong: #cbd5e1;
    --heading: #d1d5db;
    --accent-emphasis: #5eead4;
    --accent-soft: rgba(20,184,166,.16);
    --border: #374151;
    --card-border: #4b5563;
    --surface-page: #111827;
    --surface-panel: #1f2937;
    --surface-card: #111827;
    --surface-subtle: rgba(156,163,175,.08);
    --surface-muted: rgba(156,163,175,.12);
    --surface-code: rgba(255,255,255,.06);
    --surface-info: rgba(59,130,246,.14);
    --surface-success: rgba(16,185,129,.12);
    --warning-surface: #451a03;
    --warning-text: #fde68a;
    --notice-border: #64748b;
    --notice-surface: rgba(148,163,184,.10);
    --notice-text: #cbd5e1;
    --danger-surface: #450a0a;
    --danger-text: #fecaca;
  }
  select[multiple] option:checked {
    background: #0d9488 linear-gradient(0deg, #0d9488 0%, #0d9488 100%);
  }
  .equipment-type-badge {
    color: #bfdbfe;
    background: rgba(59,130,246,.24);
  }
  .port-service-status[data-tone="ok"] {
    color: #a7f3d0;
    background: rgba(16,185,129,.22);
  }
  .port-service-status[data-tone="warning"] {
    color: #fde68a;
    background: rgba(245,158,11,.22);
  }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton-line span::after {
    animation: none;
  }
  .status-lines[data-refreshing="true"] .status-text-shimmer {
    visibility: hidden;
    animation: none;
  }
}
.port-transfer { margin-block: var(--space-compact); min-width: 0; }
.port-transfer-fields { border: 0; padding: 0; margin: 0; min-width: 0; grid-template-columns: minmax(0, 1fr); }
.port-transfer :is(form, label, input, select, .ui-stack-micro, .ui-stack-compact) { min-width: 0; max-width: 100%; box-sizing: border-box; }
.port-transfer-toggle { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-micro); }
.port-transfer-hint { grid-column: 1 / -1; overflow-wrap: anywhere; }
.port-transfer-switch { appearance: none; width: 38px; height: 22px; border-radius: 12px; background: #64748b; position: relative; cursor: pointer; }
.port-transfer-switch::after { content: ''; position: absolute; width: 16px; height: 16px; top: 3px; left: 3px; border-radius: 50%; background: white; }
.port-transfer-switch:checked { background: #087e5a; }
.port-transfer-switch:checked::after { left: 19px; }
.port-transfer-switch:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.port-transfer-switch:disabled { opacity: .55; cursor: default; }
