.rack-device .device-identity-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin: 0 22px;
  padding: 12px 0;
  border-bottom: 2px solid var(--purps-rule, #65777c);
}
.rack-device .device-label-field {
  display: flex;
  flex: 1 1 220px;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: var(--purps-secondary, #bdcfcd);
  font-size: 10px;
}
:root #shell .rack-device .device-label-field input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
  border: 2px solid #baa989;
  border-radius: 0;
  background: #f0e3c6;
  color: #2b2530;
  box-shadow: inset 2px 2px #fff8e5, inset -2px -2px #c1ad89;
  font: 12px/1.5 var(--purps-display, Silkscreen, monospace);
  text-overflow: ellipsis;
  caret-color: #2b2530;
}
.rack-device .device-label-field svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}
:root #shell .rack-device .device-label-field input:hover { border-color: #fff0d3; }
:root #shell .rack-device .device-label-field input:focus-visible {
  outline: 3px solid #ffdf98;
  outline-offset: 3px;
}
.rack-device .device-label-field input::selection { background: #d2a1fa; color: #24172e; }
.rack-device .device-output {
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
  gap: 10px;
  max-width: 100%;
}
.rack-device .device-output-caption {
  color: var(--purps-secondary, #bdcfcd);
  font-size: 10px;
}
.rack-device .device-output-routes {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
.rack-device .device-output-lcd {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 114px;
  max-width: 220px;
  padding: 7px 10px;
  border: 2px solid #586c60;
  background: #0d1c17;
  color: #b8f1bf;
  box-shadow: inset 2px 2px #050b09, 1px 1px #ffffff22;
  font-variant-numeric: tabular-nums;
}
.rack-device .device-output-lcd strong { font-size: 14px; font-weight: 400; line-height: 1.2; }
.rack-device .device-output-lcd > span {
  color: #a3cdb5;
  font-size: 10px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.rack-device .device-output-lcd[data-route-state="unpatched"] { color: #f8d59c; background: #211b12; border-color: #847353; }
.rack-device .device-output-lcd[data-route-state="unpatched"] > span { color: #d6c6a8; }
.rack-device .device-output-lcd[data-route-state="control"] { color: #cfc3e2; background: #1c1724; border-color: #786a8b; }
.rack-device .device-output-lcd[data-route-state="control"] > span { color: #c5b9d6; }
@container hardware (max-width: 520px) {
  .rack-device .device-identity-strip { margin-inline: 18px; gap: 12px; }
  .rack-device .device-label-field { flex-basis: 100%; }
  .rack-device .device-output { flex-basis: 100%; align-items: flex-start; }
  .rack-device .device-output-caption { padding-top: 10px; }
  .rack-device .device-output-lcd { min-width: 100px; max-width: 100%; }
}

.device-replacement-dialog {
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 3px solid #9674b0;
  border-radius: 0;
  background: #202527;
  color: #f5efe6;
  font-family: Silkscreen, monospace;
  box-shadow: 5px 6px 0 #080a10;
}
.device-replacement-dialog::backdrop {
  background: #090b0dcc;
}
.device-replacement-dialog header,
.device-replacement-dialog footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-bottom: 2px solid #656d70;
}
.device-replacement-dialog header {
  background: #281336;
}
.device-replacement-dialog h2 {
  flex: 1;
  font-size: 17px;
  line-height: 1.5;
  margin: 0;
}
.device-replacement-dialog .device-replacement-body {
  padding: 16px;
  overflow: auto;
}
.device-replacement-dialog label {
  display: grid;
  gap: 8px;
  color: #f5efe6;
  font-size: 12px;
}
.device-replacement-dialog select {
  width: 100%;
  margin: 0 0 10px;
  white-space: normal;
}
.device-replacement-dialog p,
.device-replacement-dialog li {
  font-size: 12px;
  line-height: 1.8;
}
.device-replacement-dialog .device-replacement-hint {
  color: #b7c1c3;
  font-size: 11px;
}
.device-replacement-dialog .device-replacement-error,
.device-replacement-dialog [data-replacement-error] {
  color: #ffb6bc;
}
.device-replacement-dialog footer {
  justify-content: flex-end;
  border-bottom: 0;
  border-top: 2px solid #656d70;
  flex-wrap: wrap;
}
.device-replacement-dialog button,
.device-replacement-dialog select {
  border: 2px solid #8c909b;
  background: #252834;
  color: #eee7f4;
  border-radius: 0;
  font: inherit;
  min-height: 38px;
  padding: 8px;
  box-shadow:
    inset 0 2px #ffffff1a,
    inset 0 -3px #00000055;
}
.device-replacement-dialog button:hover {
  background: #3b3549;
}
.device-replacement-dialog .device-replacement-apply {
  background: #9bd7be;
  color: #11271c;
}
.device-replacement-dialog button:disabled {
  opacity: 1;
  color: #b7c1c3;
  background: #303638;
  border-style: dashed;
  cursor: default;
}
.device-replacement-dialog :focus-visible {
  outline: 3px solid #ffdf98;
  outline-offset: 3px;
}
.device-replacement-dialog select {
  background: #11131c;
}
.device-replacement-dialog .icon {
  width: 18px;
  height: 18px;
}
