.screen .art > #pack-eyes {
  position: absolute;
  z-index: 3;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  touch-action: none;
  cursor: pointer;
}
.screen .art > #cycle-avatar {
  position: absolute;
  z-index: 3;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}
.screen .art > :is(#cycle-avatar,#pack-eyes) {
  -webkit-tap-highlight-color: transparent;
}
.screen .art > :is(#cycle-avatar,#pack-eyes):focus-visible {
  outline: 2px solid #efefec;
  outline-offset: -4px;
}
.screen .art > #cycle-avatar:disabled { cursor: default; }

:root {
  --voice-inset: calc(10px + env(safe-area-inset-bottom, 0px));
  --voice-clearance: var(--voice-inset);
  scroll-padding-bottom: var(--voice-clearance);
}

:root[data-recognition-source="local"] {
  --voice-clearance: calc(var(--voice-inset) + 56px);
}

.voice-control {
  position: fixed;
  z-index: 120;
  inset: auto 0 var(--voice-inset);
  display: grid;
  justify-items: center;
  pointer-events: none;
}

.first-use-actions {
  display: none;
}
@media (min-width: 601px) {
  .first-use-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-block: 0 14px;
  }
}
.first-use-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding-inline: 16px;
  border: 1px solid currentColor;
  background: #171717;
  color: #f2f0ed;
  font: inherit;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}
.first-use-action:hover {
  background: #f2f0ed;
  color: #171717;
}
.first-use-action:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -5px;
}
#empty-immersion {
  z-index: 4;
  display: grid;
  justify-items: center;
  gap: 12px;
  max-width: min(26ch, calc(100% - 36px));
  color: #f2f0ed;
  text-align: center;
}
#empty-immersion p { margin: 0; text-wrap: balance; }

.extension-import input { max-width: 100%; }
.extension-example {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 18px;
}
.extension-example > a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: .18em;
}
.extension-example > button { min-height: 44px; }
.extension-example { margin-top: 12px; }
.extension-status {
  margin: 8px 0 0;
  color: inherit;
  overflow-wrap: anywhere;
}
.extension-status:empty { margin: 0; }
.role-row > div:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.role-row .role-actions {
  justify-content: flex-end;
  gap: 8px;
}
.print-sheet #library .role-actions .extension-delete {
  border: 1px solid var(--accent);
  color: var(--accent-text);
  background: transparent;
}
.print-sheet #library .role-actions .extension-delete:hover:enabled,
.print-sheet #settings .extension-delete:hover:enabled {
  border-color: var(--accent);
  color: var(--accent-text);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

.print-sheet .device-pair {
  box-sizing: border-box;
  width: min(29rem, calc(100% - 36px));
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 0;
  background: transparent;
  color: #efefec;
}
.device-pair::backdrop { background: rgb(0 0 0 / .76); }
.device-pair form {
  display: grid;
  gap: 8px;
  padding: clamp(24px, 6vw, 36px);
  background: #080808;
  clip-path: polygon(16px 0,100% 0,100% calc(100% - 18px),calc(100% - 18px) 100%,0 100%,0 16px);
}
.device-pair-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid #64645e;
}
.device-pair-heading::before {
  content: '';
  width: 32px;
  height: 3px;
  margin-bottom: 4px;
  background: var(--accent);
}
.device-pair h2 { margin: 0; color: inherit; font: 1.5rem/1.2 var(--display); }
.device-pair p { margin: 0; font-size: .9375rem; line-height: 1.55; }
.device-pair label { font-size: .9375rem; }
.print-sheet .device-pair input {
  box-sizing: border-box;
  width: 100%;
  min-height: 46px;
  margin: 0 0 6px;
  padding: 8px 12px;
  border: 1px solid #777770;
  border-radius: 0;
  background: #141413;
  color: #efefec;
  font-size: 1rem;
}
.print-sheet .device-pair input[aria-invalid="true"] { border-color: var(--accent); }
.device-pair-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.print-sheet .device-pair-actions button { min-height: 44px; margin: 0; color: #efefec; }
.print-sheet .device-pair-actions button[type="submit"]:enabled {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink,#111);
}

.print-sheet .role-picker .role-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #777770;
  background: #0b0b0a;
  color: #efefec;
  text-align: left;
  font-size: .875rem;
}
.role-picker-trigger > span { min-width: 0; overflow-wrap: anywhere; }
.role-picker-trigger > svg { flex: none; }
.print-sheet .role-picker-trigger[aria-expanded="true"] { border-color: var(--accent); }
.role-picker-trigger[aria-expanded="true"] > svg { transform: rotate(-90deg); }
.print-sheet .role-picker-trigger:focus-visible { outline: 2px solid #efefec; outline-offset: -4px; }
.print-sheet .role-picker-trigger:disabled { border-color: #53534f; color: #b3b3ac; }
.role-options {
  position: fixed;
  z-index: 125;
  box-sizing: border-box;
  padding: 3px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #777770;
  background: #080808;
  color: #efefec;
  font-size: .875rem;
  line-height: 1.4;
}
.role-options [role="option"] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  box-sizing: border-box;
  padding: 8px 10px;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.role-options [role="option"] + [role="option"] { border-top: 1px solid #363631; }
.role-options [aria-selected="true"]::after {
  content: '';
  flex: 0 0 6px;
  height: 6px;
  background: var(--accent);
}
.role-options [data-active] { outline: 1px solid #84847b; outline-offset: -1px; }
@media (hover:hover) {
  .role-options [role="option"]:hover { background: #252523; }
}
.voice-control .voice-hold {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 4px 12px rgb(0 0 0 / .3);
  touch-action: none;
  user-select: none;
  -webkit-touch-callout: none;
  pointer-events: auto;
}

.voice-control .voice-hold svg {
  width: 21px;
  height: 21px;
}

.voice-control .voice-hold[aria-pressed=true] {
  box-shadow: 0 2px 6px rgb(0 0 0 / .34);
}

@media (hover: hover) and (pointer: fine) {
  .voice-control .voice-hold:hover {
    background: var(--opposite);
    color: #111;
    color: contrast-color(var(--opposite));
  }
}

.voice-control .voice-hold:focus-visible {
  outline: 2px solid #111;
  outline-offset: 4px;
}

.print-sheet .pairing-controls button:focus-visible {
  outline: 2px solid #efefec;
  outline-offset: 3px;
}

#voice-status {
  position: absolute;
  z-index: 4;
  inset: auto max(16px, var(--die-step)) 8px;
  width: fit-content;
  margin: 0 auto;
  color: #efefec;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  overflow-wrap: anywhere;
  pointer-events: none;
}
#voice-status:not(:empty) {
  padding: 4px 8px;
  background: #0b0b0a;
}

.voice-control[hidden],
.microphone-diagnostics[hidden],
html.settings-open .voice-control,
html.secondary-open .voice-control,
#pack-eyes[hidden] {
  display: none;
}

.print-sheet .pairing-controls {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0 12px;
  margin: 0;
  color: #bdbdb5;
  font-size: 11px;
}

.print-sheet #paired-device {
  margin-inline-end: auto;
  overflow-wrap: anywhere;
}

.print-sheet .pairing-controls button {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: none;
  color: #efefec;
  box-shadow: none;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.print-sheet .pairing-controls button:disabled {
  color: #8d8d84;
  opacity: 1;
  text-decoration: none;
  cursor: default;
}

.console-module > .led-single {
  position: relative;
}

/* Keep the dial's space when its status occupies the same area. */
.led-single:has(> .device-control-status:not(.sr-only)) > .led-control {
  visibility: hidden;
}
.device-control-status:not(.sr-only) {
  position: absolute;
  inset: 0 0 auto;
  min-block-size: var(--led-single-dial-size);
  display: grid;
  place-content: center;
  max-inline-size: 24ch;
  margin: 0 auto;
  color: #dfdfd6;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.microphone-diagnostics {
  display: grid;
  justify-items: start;
  gap: 6px;
  margin-top: 10px;
}

#voice-mic-check {
  min-height: 44px;
}

#voice-mic-check-status {
  margin: 0;
}
