/* Device-1 TAC: Status-LEDs links (~25 %), Detailbereiche rechts (~75 %) */

.nw-tac-d1 {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  align-items: stretch;
  min-height: 12rem;
  border: 1px solid var(--border, #d9dee3);
  border-radius: var(--radius, 6px);
  background: var(--bg-card, #fff);
  overflow: hidden;
}

.nw-tac-d1__status {
  flex: 1 1 22%;
  min-width: 13.5rem;
  max-width: 100%;
  padding: 0.75rem 0.85rem;
  border-right: 1px solid var(--border, #d9dee3);
  background: var(--bg-page, #f2f5f7);
}

.nw-tac-d1__status-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #5c5c5c);
  margin: 0 0 0.55rem;
}

.nw-tac-d1__main {
  flex: 3 1 65%;
  min-width: 0;
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.nw-tac-d1__block {
  border: 1px solid var(--border, #d9dee3);
  border-radius: var(--radius, 6px);
  padding: 0.65rem 0.75rem;
  background: var(--bg-card, #fff);
}

.nw-tac-d1__block h3 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text, #1a1a1a);
}

.nw-tac-d1__block-body {
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text, #1a1a1a);
}

.nw-tac-d1__muted {
  color: var(--text-muted, #5c5c5c);
  font-size: 0.86rem;
  margin: 0;
}

.nw-tac-d1__step {
  margin: 0.2rem 0;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--info-list-row-border, #f0f0f0);
  font-size: 0.84rem;
}

.nw-tac-d1__step:last-child {
  border-bottom: none;
}

/* Stufe C: ISE Session-Auswahl + Detail (JSON) */
.nw-tac-d1__stage-c-select {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0.35rem 0 0.5rem;
  padding: 0.35rem 0.45rem;
  font-size: 0.88rem;
  border-radius: var(--radius, 6px);
  border: 1px solid var(--border, #d9dee3);
  background: var(--bg-card, #fff);
  box-sizing: border-box;
}

.nw-tac-d1__stage-c-detail {
  margin: 0;
  padding: 0.5rem 0.55rem;
  font-size: 0.78rem;
  line-height: 1.35;
  max-height: 22rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: var(--radius, 6px);
  border: 1px solid var(--border, #d9dee3);
  background: var(--bg-page, #f8f9fa);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.nw-tac-d1__step-k {
  font-weight: 600;
  margin-right: 0.35rem;
}

/* LED-Zeilen */
.nw-led {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0 0 0.5rem;
  padding: 0.4rem 0.45rem;
  border-radius: var(--radius, 6px);
  border: 1px solid transparent;
  font-size: 0.82rem;
  line-height: 1.35;
}

.nw-led:last-child {
  margin-bottom: 0;
}

.nw-led__dot {
  flex-shrink: 0;
  width: 0.65rem;
  height: 0.65rem;
  margin-top: 0.2rem;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.nw-led__text {
  min-width: 0;
  flex: 1;
}

.nw-led__label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted, #5c5c5c);
  margin-bottom: 0.08rem;
}

.nw-led__value {
  display: block;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
}

.nw-led--pending {
  background: rgba(234, 179, 8, 0.14);
  border-color: rgba(234, 179, 8, 0.35);
}

.nw-led--pending .nw-led__dot {
  background: #fde68a;
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.35);
}

.nw-led--pending .nw-led__value {
  color: var(--text-muted, #5c5c5c);
  font-style: italic;
}

.nw-led--ok {
  background: rgba(46, 133, 64, 0.12);
  border-color: rgba(46, 133, 64, 0.35);
}

.nw-led--ok .nw-led__dot {
  background: #4ade80;
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.45);
}

.nw-led--ok .nw-led__value {
  color: var(--success, #2e8540);
  font-weight: 600;
}

.nw-led--na {
  background: rgba(192, 57, 43, 0.08);
  border-color: rgba(192, 57, 43, 0.35);
}

.nw-led--na .nw-led__dot {
  background: #f87171;
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.35);
}

.nw-led--na .nw-led__value {
  color: var(--danger, #c0392b);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.nw-led--off {
  opacity: 0.55;
  background: var(--bg-card, #fff);
  border-color: var(--border, #d9dee3);
}

.nw-led--off .nw-led__dot {
  background: var(--donut-track, #e0e8ec);
}

html[data-theme="dark"] .nw-led--pending {
  background: rgba(234, 179, 8, 0.12);
}

html[data-theme="dark"] .nw-led--ok {
  background: rgba(92, 173, 107, 0.12);
}

html[data-theme="dark"] .nw-led--na {
  background: rgba(229, 115, 115, 0.1);
}

@media (max-width: 720px) {
  .nw-tac-d1__status {
    flex: 1 1 100%;
    border-right: none;
    border-bottom: 1px solid var(--border, #d9dee3);
  }
}

/* Stufe A · separates Debug-Fenster (dialog) */
.nw-tac-stage-a-debug {
  max-width: min(96vw, 52rem);
  width: 100%;
  padding: 0;
  border: 1px solid var(--border, #d9dee3);
  border-radius: var(--radius, 8px);
  background: var(--bg-card, #fff);
  color: var(--text, #1a1a1a);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
}

.nw-tac-stage-a-debug::backdrop {
  background: rgba(0, 0, 0, 0.38);
}

.nw-tac-stage-a-debug__inner {
  padding: 0.85rem 1rem 1rem;
}

.nw-tac-stage-a-debug__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.nw-tac-stage-a-debug__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.nw-tac-stage-a-debug__hint {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
}

.nw-tac-stage-a-debug__body {
  margin: 0;
  max-height: min(70vh, 28rem);
  overflow: auto;
  font-size: 0.78rem;
  line-height: 1.45;
  padding: 0.55rem 0.65rem;
  background: var(--bg-page, #f2f5f7);
  border: 1px solid var(--border, #d9dee3);
  border-radius: var(--radius, 6px);
  white-space: pre-wrap;
  word-break: break-word;
}
