/* Lesbare Gerätefront trotz globaler Button-Regeln */
.kst-page-verbraucher .kst-breaker {
  color: #111827 !important;
  border: 1px solid rgba(255,255,255,.48) !important;
  border-top: 4px solid var(--breaker-accent) !important;
  background: linear-gradient(145deg, #ffffff, #dce5f0 68%, #b8c4d4) !important;
  opacity: 1 !important;
}

.kst-page-verbraucher .kst-breaker:hover,
.kst-page-verbraucher .kst-breaker:focus-visible,
.kst-page-verbraucher .kst-breaker.is-active {
  color: #0f172a !important;
  border-color: var(--breaker-accent) !important;
  background: linear-gradient(145deg, #ffffff, #e5edf7 68%, #c4cfdd) !important;
}

.kst-page-verbraucher .kst-breaker-top,
.kst-page-verbraucher .kst-breaker-top b,
.kst-page-verbraucher .kst-breaker-top em,
.kst-page-verbraucher .kst-breaker-name {
  color: #172033 !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

.kst-page-verbraucher .kst-breaker-top em {
  color: #475569 !important;
}

/* Steckdosen sind neutral, bis ein Stromkreis gewählt wurde */
#grundriss .kst-socket-halo {
  r: 15px;
  fill: rgba(7, 12, 20, .92);
  stroke: #8ba0b9;
  stroke-width: 1.8;
}

#grundriss .kst-socket-badge {
  opacity: 0;
  pointer-events: none;
}

#grundriss .icon.kst-circuit-match .kst-socket-halo {
  fill: color-mix(in srgb, var(--circuit-color) 24%, #07101a);
  stroke: var(--circuit-color);
  stroke-width: 4;
}

#grundriss .icon.kst-circuit-match .kst-socket-badge {
  opacity: 1;
}

#grundriss .icon.selected:not(.kst-circuit-match) .kst-socket-halo {
  stroke: #ffffff;
  stroke-width: 3;
}

.kst-circuit-status {
  flex-wrap: wrap;
}

.kst-circuit-status b {
  color: var(--kst-cyan);
}

.kst-circuit-status button {
  width: 28px !important;
  min-height: 28px !important;
  margin-left: auto;
  padding: 0 !important;
  border-radius: 50% !important;
}

/* Verbraucher-Workflow */
.kst-page-verbraucher #sidebar {
  padding-bottom: 24px !important;
}

.kst-page-verbraucher #sidebar > button,
.kst-page-verbraucher .kst-export-consumers {
  position: static !important;
  bottom: auto !important;
}

.kst-new-consumer {
  width: 100%;
  min-height: 48px;
  margin: 0 0 16px !important;
  border-color: rgba(99,230,255,.45) !important;
  color: #061017 !important;
  background: linear-gradient(135deg, var(--kst-cyan), #8ff1ff) !important;
  font-weight: 850 !important;
}

.kst-position-button {
  width: 100%;
  min-height: 44px;
  margin: 14px 0 4px !important;
  border-color: rgba(184,156,255,.45) !important;
  color: #eee8ff !important;
  background: rgba(159,122,234,.13) !important;
}

.kst-page-verbraucher #xInput,
.kst-page-verbraucher #yInput {
  display: inline-block;
  width: calc(50% - 4px) !important;
  color: #b9c8da !important;
  background: rgba(255,255,255,.035) !important;
}

.kst-page-verbraucher label[for="xInput"],
.kst-page-verbraucher label[for="yInput"] {
  display: none;
}

.kst-page-verbraucher button[onclick="addVerbraucher()"] {
  width: 100%;
  min-height: 48px;
  margin: 18px 0 0 !important;
  border-color: rgba(103,243,189,.5) !important;
  color: #06150f !important;
  background: linear-gradient(135deg, #67f3bd, #8af7d0) !important;
  font-weight: 850 !important;
}

.kst-page-verbraucher button[onclick="addVerbraucher()"].is-editing {
  border-color: rgba(245, 158, 11, .5) !important;
  background: linear-gradient(135deg, #fbbf24, #f59e0b) !important;
}

.kst-placement-banner {
  position: relative;
  z-index: 7;
  margin: 10px 0 -3px;
  padding: 11px 14px;
  border: 1px solid rgba(245,158,11,.5);
  border-radius: 11px;
  color: #fff5d6;
  background: rgba(120, 72, 5, .9);
  box-shadow: 0 10px 30px rgba(0,0,0,.34);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.kst-placement-banner[hidden] {
  display: none !important;
}

body.kst-placement-mode #grundriss {
  cursor: crosshair !important;
  outline: 2px solid #f59e0b;
  outline-offset: 3px;
}

.kst-page-verbraucher #detailsOutput {
  min-height: 0 !important;
  margin: 16px 0 0 !important;
  padding: 14px !important;
  overflow: visible !important;
}

.kst-consumer-detail small {
  color: var(--kst-cyan);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.kst-consumer-detail h4 {
  margin: 4px 0 12px;
  color: var(--kst-text);
  font-size: 17px;
}

.kst-consumer-detail dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.kst-consumer-detail dl > div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
}

.kst-consumer-detail dt {
  color: var(--kst-muted);
}

.kst-consumer-detail dd {
  margin: 0;
  color: #dbe8f8;
  font-weight: 700;
}

.kst-consumer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.kst-consumer-actions button {
  width: 100% !important;
  min-height: 42px !important;
  margin: 0 !important;
}

.kst-consumer-actions button[data-action="delete"] {
  border-color: rgba(251,113,133,.42) !important;
  color: #ffdbe1 !important;
  background: rgba(127,29,29,.22) !important;
}

.kst-export-consumers {
  width: 100% !important;
  min-height: 44px;
  margin: 16px 0 0 !important;
}

@media (pointer: coarse) and (max-width: 1180px) {
  .kst-page-verbraucher #sidebar {
    padding-bottom: calc(30px + var(--kst-safe-bottom)) !important;
  }

  .kst-page-verbraucher #detailsOutput {
    margin-bottom: 0 !important;
  }

  .kst-new-consumer,
  .kst-position-button,
  .kst-consumer-actions button,
  .kst-export-consumers {
    min-height: 50px !important;
  }
}
