#sbg-hmi-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1200;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: #101828;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.28);
  font: 700 13px/1 "Inter", "Segoe UI", Arial, sans-serif;
  cursor: pointer;
}

#sbg-hmi-launcher:hover {
  background: #1d2939;
  transform: translateY(-1px);
}

#sbg-hmi-launcher:disabled {
  pointer-events: none;
}

#sbg-hmi-launcher span:first-child {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #12b76a;
  box-shadow: 0 0 0 4px rgba(18, 183, 106, 0.18);
}

#sbg-hmi-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: none;
  align-items: stretch;
  justify-content: center;
  padding: 18px;
  background: rgba(16, 24, 40, 0.72);
  backdrop-filter: blur(4px);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
}

#sbg-hmi-overlay[data-open="true"] {
  display: flex;
}

.sbg-hmi-shell {
  width: min(1500px, 100%);
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(16, 24, 40, 0.35);
}

.sbg-hmi-header {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 22px;
  color: #fff;
  background: #101828;
}

.sbg-hmi-brand {
  min-width: 0;
}

.sbg-hmi-brand small {
  display: block;
  margin-bottom: 4px;
  color: #98a2b3;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.sbg-hmi-brand strong {
  display: block;
  overflow: hidden;
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sbg-hmi-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sbg-hmi-readonly {
  padding: 7px 10px;
  border: 1px solid rgba(18, 183, 106, 0.35);
  border-radius: 999px;
  color: #6ce9a6;
  background: rgba(18, 183, 106, 0.12);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.sbg-hmi-icon-button,
.sbg-hmi-refresh {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  color: #344054;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}

.sbg-hmi-header .sbg-hmi-icon-button {
  width: 38px;
  min-height: 38px;
  padding: 0;
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  font-size: 20px;
}

.sbg-hmi-layout {
  height: calc(100% - 70px);
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
}

.sbg-hmi-sidebar {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e4e7ec;
  background: #f9fafb;
}

.sbg-hmi-search-wrap {
  padding: 16px;
  border-bottom: 1px solid #e4e7ec;
}

.sbg-hmi-search {
  width: 100%;
  height: 40px;
  box-sizing: border-box;
  padding: 0 12px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  outline: none;
  color: #101828;
  background: #fff;
  font-size: 13px;
}

.sbg-hmi-search:focus {
  border-color: #175cd3;
  box-shadow: 0 0 0 3px rgba(23, 92, 211, 0.12);
}

.sbg-hmi-tree-scroll {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 10px;
}

.sbg-hmi-tree,
.sbg-hmi-tree ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sbg-hmi-tree ul {
  margin-left: 16px;
  border-left: 1px solid #e4e7ec;
  padding-left: 7px;
}

.sbg-hmi-tree-row {
  min-height: 35px;
  display: flex;
  align-items: center;
  gap: 3px;
  margin: 2px 0;
}

.sbg-hmi-tree-toggle {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 0;
  color: #667085;
  background: transparent;
  cursor: pointer;
}

.sbg-hmi-tree-toggle[data-expanded="true"] {
  transform: rotate(90deg);
}

.sbg-hmi-tree-link {
  min-width: 0;
  flex: 1;
  padding: 8px 9px;
  border: 0;
  border-radius: 7px;
  overflow: hidden;
  color: #344054;
  background: transparent;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  font-size: 12px;
}

.sbg-hmi-tree-link:hover {
  color: #175cd3;
  background: #eff8ff;
}

.sbg-hmi-tree-link[data-selected="true"] {
  color: #1849a9;
  background: #d1e9ff;
  font-weight: 800;
}

.sbg-hmi-tree-number {
  margin-right: 6px;
  color: #667085;
  font-variant-numeric: tabular-nums;
}

.sbg-hmi-main {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 24px;
  background: #f5f7fa;
}

.sbg-hmi-content {
  max-width: 1100px;
  margin: 0 auto;
}

.sbg-hmi-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  color: #667085;
  font-size: 11px;
}

.sbg-hmi-breadcrumbs button {
  padding: 0;
  border: 0;
  color: #175cd3;
  background: transparent;
  cursor: pointer;
}

.sbg-hmi-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.sbg-hmi-title-row h2 {
  margin: 0;
  color: #101828;
  font-size: 25px;
  line-height: 1.25;
}

.sbg-hmi-title-row p {
  margin: 6px 0 0;
  color: #667085;
  font-size: 12px;
}

.sbg-hmi-status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 18px;
  padding: 13px 16px;
  border: 1px solid #b2ddff;
  border-radius: 10px;
  background: #eff8ff;
}

.sbg-hmi-status-line .sbg-hmi-segment {
  color: #1849a9;
}

.sbg-hmi-child-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.sbg-hmi-child-card {
  min-height: 74px;
  padding: 13px 14px;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  color: #344054;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.sbg-hmi-child-card:hover {
  border-color: #84adff;
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.06);
}

.sbg-hmi-child-card small {
  display: block;
  margin-bottom: 5px;
  color: #667085;
  font-size: 10px;
  font-weight: 800;
}

.sbg-hmi-child-card strong {
  color: #101828;
  font-size: 13px;
}

.sbg-hmi-data-list {
  display: grid;
  gap: 8px;
}

.sbg-hmi-data-row {
  min-height: 47px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 10px 14px;
  border: 1px solid #eaecf0;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}

.sbg-hmi-segment {
  color: #475467;
  font-size: 13px;
}

.sbg-hmi-segment[data-kind="value"] {
  margin-left: auto;
  color: #101828;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  font-weight: 800;
}

.sbg-hmi-controller-editable::after {
  content: "controller setting";
  margin-left: 7px;
  padding: 3px 6px;
  border-radius: 999px;
  color: #b54708;
  background: #fffaeb;
  font: 700 9px/1 "Inter", "Segoe UI", Arial, sans-serif;
  text-transform: uppercase;
}

.sbg-hmi-empty,
.sbg-hmi-loading,
.sbg-hmi-error {
  padding: 28px;
  border: 1px dashed #d0d5dd;
  border-radius: 12px;
  color: #667085;
  background: #fff;
  text-align: center;
  font-size: 13px;
}

.sbg-hmi-error {
  border-color: #fecdca;
  color: #b42318;
  background: #fef3f2;
}

.sbg-hmi-inline-warning {
  margin-bottom: 12px;
  padding: 11px 13px;
  border: 1px solid #fedf89;
  border-radius: 9px;
  color: #93370d;
  background: #fffaeb;
  font-size: 12px;
}

.sbg-hmi-visually-hidden {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.sbg-hmi-icon-button:focus-visible,
.sbg-hmi-refresh:focus-visible,
.sbg-hmi-tree-toggle:focus-visible,
.sbg-hmi-tree-link:focus-visible,
.sbg-hmi-child-card:focus-visible,
#sbg-hmi-launcher:focus-visible {
  outline: 3px solid rgba(83, 177, 253, 0.65);
  outline-offset: 2px;
}

.sbg-hmi-report-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  background: #fff;
  font-size: 12px;
}

.sbg-hmi-report-table th,
.sbg-hmi-report-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eaecf0;
  color: #344054;
  text-align: left;
  vertical-align: top;
}

.sbg-hmi-report-table th {
  color: #667085;
  background: #f9fafb;
  font-size: 10px;
  text-transform: uppercase;
}

@media (max-width: 850px) {
  #sbg-hmi-overlay {
    padding: 0;
  }

  .sbg-hmi-shell {
    border-radius: 0;
  }

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

  .sbg-hmi-sidebar {
    max-height: 42%;
    border-right: 0;
    border-bottom: 1px solid #e4e7ec;
  }

  .sbg-hmi-main {
    padding: 16px;
  }

  .sbg-hmi-readonly {
    display: none;
  }

  .sbg-hmi-segment[data-kind="value"] {
    margin-left: 0;
  }

  .sbg-hmi-tree-row {
    min-height: 44px;
  }

  .sbg-hmi-tree-toggle {
    width: 44px;
    height: 44px;
  }

  .sbg-hmi-tree-link {
    min-height: 44px;
  }
}
