/* The entire legend is a shallow square key, held in a stationary switch well. */
.machine-site .panel-command:is(a, button) {
  --key-face: var(--cabinet-frame, #d1ccc1);
  --key-legend: var(--ink);
  --key-well: #57534e;
  --key-top: #f5f1e6;
  --key-bottom: #98948b;
  position: relative;
  isolation: isolate;
  min-height: 38px;
  padding: 6px 14px 8px;
  border: 1px solid var(--key-well);
  border-radius: 1px;
  color: var(--key-legend);
  background: var(--key-well);
  box-shadow: 0 1px 0 #f1ede425;
  font: 600 .74rem/1.15 "Barlow", "Segoe UI", sans-serif;
  letter-spacing: .04em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.machine-site .panel-command::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 2px;
  background: var(--key-face);
  border-radius: 1px;
  box-shadow: inset 1px 1px var(--key-top), inset -1px -1px var(--key-bottom);
  pointer-events: none;
  transition: transform 115ms cubic-bezier(.2,.85,.3,1), background-color 115ms;
}

.machine-site .panel-command::after { content: none; }

.machine-site .panel-command:is([data-video-toggle], [data-copy-email], [data-diagnostic-start]) {
  --key-face: #494743;
  --key-legend: #f1eee4;
  --key-top: #79766d;
  --key-bottom: #33312e;
  --key-well: #2d2b29;
}

@media (hover: hover) {
  .machine-site .panel-command:enabled:hover::before,
  .machine-site a.panel-command:hover::before { transform: translateY(-1px); }
  .machine-site .panel-command:is(a,button):hover {
    --key-face: #5c5953;
    --key-legend: #fffaf0;
    --key-top: #929087;
    --key-bottom: #3d3a36;
  }
}

.machine-site .panel-command:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--paper);
}

.machine-site .panel-command:not(.skip-link):active {
  padding-block: 8px 6px;
  transform: none;
}

.machine-site .panel-command:is(a,button):active::before {
  transform: translateY(2px);
  box-shadow: inset 1px 1px var(--key-bottom), inset -1px -1px var(--key-top);
  transition-duration: 45ms;
}

.machine-site .skip-link.panel-command { position: fixed; }
.machine-site :is(.skip-link, .machine-button, .service-key, .field-dossier .panel-command, .photo-console__archive-link) {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.machine-site .hero-copy__actions { gap: 5px; }
.machine-site .identity-terminal__controls .panel-command {
  min-height: 44px;
  padding-inline: 6px;
  font-size: .69rem;
}
.machine-site .field-dossier__toolbar .panel-command { align-self: center; }
.machine-site .panel-command:disabled { opacity: .65; cursor: wait; }

/* The section keys latch into fixed switch housings. Their lower windows carry the legends. */
.control-bank__keys {
  gap: 7px;
  padding: 2px;
  background: #161615;
  box-shadow: inset 1px 1px #0e0e0d, 0 1px #615f5b;
}
.control-bank .control-key,
.control-bank:has(.is-requested) .control-key.is-active:not(.is-requested) {
  --face-top: #494845;
  --face-bottom: #2b2a29;
  --window: #b0ada4;
  --window-type: #2b2a29;
  padding: 0;
  border: 1px solid #161615;
  border-radius: 3px;
  background: #161615;
  transform: none;
  box-shadow: 0 0 0 1px #706e69, inset 0 0 0 2px #3e3d3a;
}
.control-key__face {
  position: absolute;
  inset: 2px 3px 4px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: stretch;
  align-items: center;
  border: 1px solid #494845;
  border-radius: 2px 2px 3px 3px;
  color: #e5e2d7;
  background: linear-gradient(105deg, var(--face-top), var(--face-bottom) 80%);
  box-shadow: inset 1px 1px #a09e966b, inset -1px -1px #161615, 0 3px #0e0e0d;
  pointer-events: none;
  transition: transform 155ms cubic-bezier(.2,.88,.35,1.2), box-shadow 120ms;
}
.control-key__face .control-icon { justify-self: center; color: inherit; }
.control-key__face .control-key__label {
  display: grid;
  place-items: center;
  text-align: center;
  margin: 0 2px 2px;
  padding: 2px 0;
  border-top: 1px solid #242423;
  color: var(--window-type);
  background: var(--window);
  font-size: .54rem;
  font-weight: 700;
  letter-spacing: .07em;
  line-height: 1;
}
.control-key__face .control-key__lamp {
  top: 4px;
  right: 4px;
  width: 9px;
  height: 4px;
  border: 1px solid #1e1d1c;
  border-radius: 1px;
  background: #807e77;
  box-shadow: 0 1px #c0bdb355;
}
.control-key:is(.is-active, .is-requested) {
  --face-top: #54534f;
  --face-bottom: #343331;
  --window: #c0bdb3;
}
.control-key:is(.is-active, .is-requested, :active) .control-key__face {
  transform: translateY(2px);
  box-shadow: inset 1px 1px #161615, inset -1px -1px #807e77, 0 1px #161615;
}
.control-bank:has(.is-requested) .control-key.is-active:not(.is-requested) .control-key__face { transform: none; }
.control-key:is(.is-active, .is-requested) .control-key__face .control-key__lamp {
  background: var(--lamp-ready);
  box-shadow: 0 0 3px #baac8850;
}
.control-bank .control-key::after {
  border: 1px solid #494845;
  background: repeating-linear-gradient(90deg, #a09e96 0 2px, #c0bdb3 2px 3px, #706e69 3px 4px);
}
.control-bank .control-key:focus-visible { outline: 2px solid #d9d6cb; outline-offset: 2px; }

.rack-rocker > span:last-child {
  flex: 1;
  text-align: center;
}

.field-record { text-align: center; }
.field-record__id { justify-content: center; }
.field-record strong { align-self: center; text-wrap: balance; }

.photo-console__categories button {
  display: grid;
  place-items: center;
  text-align: center;
}

/* Local CRT adjustments. The knob and its native range share one hit area. */
.identity-terminal__membrane {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-self: center;
}
.identity-terminal__membrane button {
  position: relative;
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 36px;
  padding: 4px 1px;
  border: 2px solid #3e3d3a;
  border-radius: 2px;
  color: #eceae0;
  background: #494845;
  box-shadow: inset 1px 1px #908e87, inset -1px -2px #242423;
  font: 600 .55rem/1 var(--ui-type);
  text-transform: uppercase;
  cursor: pointer;
}
.identity-terminal__membrane button::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 50%;
  width: 12px;
  height: 3px;
  transform: translateX(-50%);
  background: #1e1d1c;
}
.identity-terminal__membrane button[aria-pressed="true"] { box-shadow: inset 1px 2px #242423, inset -1px -1px #807e77; }
.identity-terminal__membrane button[aria-pressed="true"]::before { background: #cecbc1; }
.identity-terminal__membrane button:active { translate: 0 1px; }
.identity-terminal__dial {
  position: relative;
  justify-self: center;
  min-width: 48px;
  min-height: 50px;
  cursor: ew-resize;
}
.identity-terminal__dial input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; }
.identity-terminal__dial i { transform: rotate(var(--dial-angle, 0deg)); }
.identity-terminal__dial i::after { transform: translateX(-50%); }
.identity-terminal__dial small { font-size: .5rem; white-space: nowrap; }
.identity-terminal__dial:has(:focus-visible) i,
.identity-terminal__membrane button:focus-visible { outline: 2px solid #343331; outline-offset: 3px; }
.identity-terminal__screen > img { filter: grayscale(1) invert(var(--polarity, 0)) contrast(1.12) brightness(var(--gain, 1)); }
.identity-terminal__screen > canvas { filter: brightness(var(--gain, 1)); }
.identity-terminal__screen.is-inverted > canvas { filter: grayscale(1) invert(1) brightness(var(--gain, 1)); }
.identity-terminal__screen.is-inverted { --polarity: 1; background-color: #cecbc1; }
.identity-terminal__screen.raster-off :is(.identity-terminal__scan, .identity-terminal__static) { display: none; }

@media (max-width: 900px), (max-width: 1024px) and (max-height: 520px) and (pointer: coarse) {
  .control-bank__keys { gap: 5px; }
  .machine-site .panel-command:is(a, button) { min-height: 42px; }
  .identity-terminal__membrane button { min-height: 42px; }
  .control-key__face .control-key__label { font-size: .49rem; padding-block: 2px; }
}

@media (max-width: 420px) {
  .machine-site .machine-button--social.panel-command { padding-inline: 10px; font-size: .73rem; }
}
@media (prefers-reduced-motion: reduce) {
  .identity-terminal__screen:not(.raster-off) .identity-terminal__scan {
    display: block;
    animation: none;
    opacity: .46;
  }
}
@media (forced-colors: active) {
  .control-key.is-active .control-key__face, .identity-terminal__membrane button[aria-pressed="true"] { border: 2px solid Highlight; }
  .machine-site .panel-command:is(a, button), .control-key__face, .identity-terminal__dial i { border: 1px solid ButtonText; }
  .panel-command::before, .panel-command::after { border: 1px solid ButtonText; }
}
