/* Environment preview HUD: a compact telemetry layer over the 2D work surface. */
body.tech-workspace .canvas-area { position: relative; }

body.tech-workspace .environment-hud {
  position: absolute;
  z-index: 5;
  top: 61px;
  right: 18px;
  width: min(344px, calc(100% - 36px));
  padding: 11px;
  color: #dceee9;
  background: rgba(15, 23, 24, .93);
  border: 1px solid #395653;
  border-radius: 7px;
  box-shadow: 0 14px 30px rgba(8, 21, 22, .24), inset 0 0 0 1px rgba(98, 214, 196, .05);
  backdrop-filter: blur(8px);
}

body.tech-workspace .environment-hud-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

body.tech-workspace .environment-hud-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

body.tech-workspace .environment-hud-title > svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  color: var(--tech-cyan);
  stroke-width: 1.7;
}

body.tech-workspace .environment-hud-title div {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

body.tech-workspace .environment-hud-title span {
  overflow: hidden;
  color: #eff8f4;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.tech-workspace .environment-hud-title small {
  flex: 0 0 auto;
  color: #78b8ad;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 9px;
  letter-spacing: .08em;
}

body.tech-workspace .environment-hud-segmented {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
  padding: 2px;
  overflow-x: auto;
  border: 1px solid #304745;
  border-radius: 5px;
  background: #182627;
  scrollbar-width: thin;
}

body.tech-workspace .environment-hud-segmented button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 25px;
  padding: 0 7px;
  color: #8ea9a3;
  background: transparent;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  font: 600 10px/1 "Segoe UI", "Microsoft YaHei", sans-serif;
  white-space: nowrap;
}

body.tech-workspace .environment-hud-segmented button:hover {
  color: #e8f7f2;
  background: #213536;
}

body.tech-workspace .environment-hud-segmented button.active {
  color: #09201e;
  background: var(--tech-cyan);
  box-shadow: 0 0 12px rgba(98, 214, 196, .2);
}

body.tech-workspace .environment-hud-segmented button:focus-visible {
  outline: 2px solid var(--tech-amber);
  outline-offset: 1px;
}

body.tech-workspace .environment-hud-segmented svg {
  width: 13px;
  height: 13px;
  stroke-width: 1.8;
}

body.tech-workspace .environment-hud-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

body.tech-workspace .environment-hud-stat {
  display: flex;
  min-width: 0;
  min-height: 61px;
  flex-direction: column;
  justify-content: center;
  padding: 7px 8px;
  border: 1px solid #2f4544;
  border-radius: 4px;
  background: #182526;
}

body.tech-workspace .environment-hud-stat > span {
  color: #7e9993;
  font-size: 9px;
  letter-spacing: .04em;
  white-space: nowrap;
}

body.tech-workspace .environment-hud-stat > strong {
  margin-top: 3px;
  overflow: hidden;
  color: #eff8f4;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 14px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.tech-workspace .environment-hud-stat > em {
  margin-top: 3px;
  overflow: hidden;
  color: #8ba19c;
  font-size: 9px;
  font-style: normal;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.tech-workspace .environment-hud-stat[data-state="ready"] > strong { color: var(--tech-cyan); }
body.tech-workspace .environment-hud-stat[data-state="running"] > strong { color: var(--tech-amber); }
body.tech-workspace .environment-hud-stat[data-state="error"] > strong { color: var(--tech-coral); }
body.tech-workspace .environment-hud-stat[data-state="missing"] > strong { color: #a9b7b3; }

body.tech-workspace .environment-hud-signal {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  margin-top: 8px;
  padding: 7px 8px;
  color: #a9c0ba;
  border-top: 1px solid #2b4140;
  font-size: 9px;
  line-height: 1.35;
}

body.tech-workspace .environment-hud-signal-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--tech-cyan);
  box-shadow: 0 0 9px rgba(98, 214, 196, .65);
}

body.tech-workspace .environment-hud-signal[data-state="running"] .environment-hud-signal-dot {
  background: var(--tech-amber);
  box-shadow: 0 0 9px rgba(224, 174, 85, .65);
}

body.tech-workspace .environment-hud-signal[data-state="error"] .environment-hud-signal-dot {
  background: var(--tech-coral);
  box-shadow: 0 0 9px rgba(201, 117, 98, .65);
}

body.tech-workspace .environment-hud-signal > span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.tech-workspace .environment-hud-environment-counts {
  margin-left: auto;
  color: #87aca4;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: nowrap;
}

@media (max-width: 900px) {
  body.tech-workspace .environment-hud {
    top: 60px;
    right: 12px;
    width: min(316px, calc(100% - 24px));
  }
}

@media (max-width: 720px) {
  body.tech-workspace .environment-hud {
    position: fixed;
    top: auto;
    right: 8px;
    bottom: 39px;
    left: 8px;
    width: auto;
    max-height: 154px;
    overflow: auto;
    padding: 9px;
    scrollbar-width: thin;
  }

  body.tech-workspace .environment-hud-topline {
    align-items: flex-start;
  }

  body.tech-workspace .environment-hud-segmented {
    max-width: 57%;
  }

  body.tech-workspace .environment-hud-stats {
    grid-template-columns: repeat(3, minmax(108px, 1fr));
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  body.tech-workspace .environment-hud-signal {
    min-width: 316px;
  }
}

@media (max-width: 390px) {
  body.tech-workspace .environment-hud-title div {
    align-items: flex-start;
    flex-direction: column;
    gap: 1px;
  }

  body.tech-workspace .environment-hud-segmented {
    max-width: 64%;
  }

  body.tech-workspace .environment-hud-segmented button {
    padding: 0 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.tech-workspace .environment-hud-signal-dot { box-shadow: none; }
}
