/* Composable services. Status text is always visible; color is extra. */

.svc-region {
  padding: 0 12px 12px;
  cursor: default;
  /* The region hangs in the card and can overlap a neighbour. Ignore hits
     on the box itself so only real controls (children) take the pointer. */
  pointer-events: none;
}

.svc-region > * {
  pointer-events: auto;
}

/* Absolute cards already position; restating it keeps z-index in a stacking context. */
.pc-card:hover,
.pc-card:focus-within {
  position: absolute;
  z-index: 50;
}

.svc-add-hint {
  display: inline-block;
  margin: 0 0 8px;
  padding: 4px 10px;
  border: 1px dashed var(--muted, #a3a3a3);
  border-radius: 8px;
  color: var(--muted, #a3a3a3);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  cursor: default;
}

@media (forced-colors: active) {
  .svc-add-hint {
    color: CanvasText;
  }
}

td.services-col {
  min-width: 14rem;
  vertical-align: top;
}

.svc-add-btn,
.svc-dialog button,
.svc-add-form button {
  color: var(--text, #f0f0f0);
  background: var(--bg, #0a0a0a);
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 8px;
  padding: 4px 10px;
  font: inherit;
  cursor: pointer;
}

.svc-add-btn {
  margin: 0 0 8px;
}

.svc-graph {
  position: relative;
  display: grid;
  gap: 8px;
}

.svc-edges {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.svc-edges path {
  fill: none;
  stroke: var(--accent, #5b8cff);
  stroke-width: 1.5;
}

.svc-node {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: calc(var(--svc-depth, 0) * 16px);
  padding: 8px 10px;
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 8px;
  background: var(--bg, #0a0a0a);
  color: var(--text, #f0f0f0);
}

.svc-icon {
  font-weight: 700;
}

.svc-name {
  font-weight: 600;
}

.svc-dep,
.svc-error {
  flex-basis: 100%;
  color: var(--text, #f0f0f0);
  font-size: 12px;
}

.svc-status {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.svc-status[data-status="healthy"] {
  color: #052e16;
  background: #bbf7d0;
}

.svc-status[data-status="failed"] {
  color: #450a0a;
  background: #fecaca;
}

.svc-status[data-status="installing"] {
  color: #1c1917;
  background: #fde68a;
}

.svc-status[data-status="queued"] {
  color: #0f172a;
  background: #e2e8f0;
}

.svc-port {
  color: #5b8cff;
  text-decoration: underline;
}

:root[data-theme="light"] .svc-port {
  color: #1e3a8a;
}

.svc-dialog {
  color: var(--text, #f0f0f0);
  background: var(--bg, #0a0a0a);
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 12px;
  padding: 16px;
  max-width: 28rem;
}

.svc-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.svc-dialog h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.svc-dialog label,
#launchServices label,
.svc-add-form label {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin: 6px 0;
  color: var(--text, #f0f0f0);
}

.svc-dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

.svc-agent-list {
  margin: 0 0 8px;
  padding-left: 1.1rem;
}

.svc-add-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.svc-add-form select {
  color: var(--text, #f0f0f0);
  background: var(--bg, #0a0a0a);
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 8px;
  padding: 4px 8px;
  font: inherit;
}
