/*
 * УЗО и дифавтоматы. Размеры рычагов собраны в одном месте и совпадают
 * с геометрией автоматов из breaker.css.
 */
.device-card[data-appearance="protection"] {
  --protection-shell-height: 112px;
  --protection-handle-top: 51px;
  --protection-handle-height: 39px;
  --protection-handle-width: 62%;
  --protection-bridge-top: 76px;
  --protection-bridge-height: 17px;
  --protection-bridge-inset: 5px;
  --protection-indicator-top: 96px;
  --protection-indicator-height: 8px;
}

.device-card[data-appearance="protection"] .device-shell {
  height: var(--protection-shell-height);
  border-color: #7c8187;
  background:
    linear-gradient(90deg, rgba(57,62,69,.34), transparent 8%, transparent 88%, rgba(48,54,61,.3)),
    linear-gradient(#f4f4f2 0 11%, #d5d7d8 12% 14%, #f8f8f5 15% 83%, #d0d2d3 84% 88%, #ececea 89% 100%);
  box-shadow:
    0 4px 7px rgba(23,32,51,.28),
    0 1px 0 white inset,
    7px 0 9px rgba(34,40,48,.1) inset,
    -7px 0 9px rgba(34,40,48,.1) inset;
}

.device-card[data-appearance="protection"] .device-shell::before,
.device-card[data-appearance="protection"] .device-shell::after { display: none; }

.device-card[data-appearance="protection"] .device-pole-seams {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  grid-template-columns: repeat(var(--pole-count), minmax(0, 1fr));
  pointer-events: none;
}

.device-pole-seams i {
  min-width: 0;
  border-right: 1px solid rgba(73,79,87,.3);
  box-shadow: 1px 0 rgba(255,255,255,.65);
}
.device-pole-seams i:last-child { border-right: 0; box-shadow: none; }

.device-card[data-appearance="protection"] .device-lever-bank {
  position: absolute;
  top: var(--protection-handle-top);
  right: 0;
  left: 0;
  z-index: 1;
  height: var(--protection-handle-height);
  display: grid;
  grid-template-columns: repeat(var(--pole-count), minmax(0, 1fr));
}

.device-card[data-appearance="protection"] .device-lever-bank i {
  width: var(--protection-handle-width);
  min-width: 8px;
  justify-self: center;
  border: 1px solid #052f54;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(90deg, #073f75, #258bd4 24%, #0861a8 58%, #032d54);
  box-shadow: 0 5px 8px rgba(0,38,76,.45), 0 7px 0 #043866, 0 10px 5px rgba(0,0,0,.24);
}

.device-card[data-appearance="protection"] .device-type-code {
  top: 16px;
  left: 7px;
  max-width: calc(100% - 22px);
  color: #34373b;
  font-size: 7px;
  letter-spacing: .02em;
}

.device-card[data-appearance="protection"] .device-pole-mark {
  position: absolute;
  top: 28px;
  right: 6px;
  display: block;
  color: #2e3135;
  font-size: 7px;
  font-style: normal;
  font-weight: 900;
}

.device-card[data-appearance="protection"] .device-lever-bar {
  position: absolute;
  top: var(--protection-bridge-top);
  right: var(--protection-bridge-inset);
  left: var(--protection-bridge-inset);
  z-index: 2;
  height: var(--protection-bridge-height);
  display: block;
  border: 1px solid #05335b;
  border-radius: 2px;
  background: linear-gradient(#3998db 0 14%, #0861a8 22% 65%, #267fbd 78%, #043967 100%);
  box-shadow: 0 4px 6px rgba(0,0,0,.52), 0 1px rgba(255,255,255,.25) inset;
}

.device-card[data-appearance="protection"] .device-state-window {
  position: absolute;
  top: var(--protection-indicator-top);
  right: 0;
  left: 0;
  height: var(--protection-indicator-height);
  display: grid;
  grid-template-columns: repeat(var(--pole-count), minmax(0, 1fr));
}

.device-card[data-appearance="protection"] .device-state-window i {
  width: 46%;
  min-width: 6px;
  justify-self: center;
  border: 1px solid #8b8f8e;
  background: linear-gradient(90deg, #08761a, #28bd37 48%, #0a7118);
  box-shadow: 0 1px 3px rgba(0,0,0,.34) inset;
}
