.btn-rack__btn icon, .btn-rack > form icon {
  font-family: Roboto, sans-serif;
  font-weight: 300;
}

.btn-rack__btn, .btn-rack > form {
  box-shadow: inset 0 1px 3px -2px #737373, inset 0 -4px 8px -3px hsl(from var(--c-body-gradient) h s calc(l + 3)/.8), 0 1px 3px 0 #0003;
}

:where(html.light) .btn-rack__btn {
  box-shadow: inset 0 3px 3px -2px #fff6, inset 0 -4px 8px -3px hsl(from var(--c-body-gradient) h s calc(l + 5)/.8), 0 1px 3px 0 #0000002e;
}

:where(html.light) .btn-rack > form {
  box-shadow: inset 0 3px 3px -2px #fff6, inset 0 -4px 8px -3px hsl(from var(--c-body-gradient) h s calc(l + 5)/.8), 0 1px 3px 0 #0000002e;
}

.btn-rack__btn, .btn-rack > form {
  background: linear-gradient(to bottom, var(--c-metal-top), var(--c-metal-bottom));
  text-shadow: .5px .5px 0 rgb(from var(--c-dimmer) r g b/calc(alpha * .8)) !important;
}

.btn-rack__btn:hover:not(.disabled, :disabled, [disabled]), .btn-rack > form:hover:not(.disabled, :disabled, [disabled]) {
  box-shadow: inset 0 1px 3px -2px var(--c-border-light), inset 0 -5px 16px -3px hsl(from var(--c-body-gradient) h s calc(l + 5)/.8), 0 2px 4px 0 #0000003d;
}

:where(html.light) .btn-rack__btn:hover:not(.disabled, :disabled, [disabled]) {
  box-shadow: inset 0 4px 3px -2px #fff6, inset 0 -5px 8 16px -3px hsl(from var(--c-body-gradient) h s calc(l + 7)/.8), 0 2px 4px 0 #00000036;
}

:where(html.light) .btn-rack > form:hover:not(.disabled, :disabled, [disabled]) {
  box-shadow: inset 0 4px 3px -2px #fff6, inset 0 -5px 8 16px -3px hsl(from var(--c-body-gradient) h s calc(l + 7)/.8), 0 2px 4px 0 #00000036;
}

.btn-rack__btn:hover:not(.disabled, :disabled, [disabled]), .btn-rack > form:hover:not(.disabled, :disabled, [disabled]) {
  background: linear-gradient(to bottom, var(--c-metal-top-hover), var(--c-metal-bottom-hover));
}

:where(html.transp) .btn-rack__btn:hover:not(.disabled, :disabled, [disabled]) {
  box-shadow: inset 0 1px 3px -2px var(--c-border-light), inset 0 -5px 16px -3px hsl(from var(--c-body-gradient) h s calc(l + 5)/.8), 0 2px 4px 0 #00000026;
}

:where(html.transp) .btn-rack > form:hover:not(.disabled, :disabled, [disabled]) {
  box-shadow: inset 0 1px 3px -2px var(--c-border-light), inset 0 -5px 16px -3px hsl(from var(--c-body-gradient) h s calc(l + 5)/.8), 0 2px 4px 0 #00000026;
}

:where(html.light) :where(html.transp) .btn-rack__btn:hover:not(.disabled, :disabled, [disabled]) {
  box-shadow: inset 0 4px 3px -2px #fff6, inset 0 -5px 8 16px -3px hsl(from var(--c-body-gradient) h s calc(l + 7)/.8), 0 2px 4px 0 #0000001f;
}

:where(html.light) :where(html.transp) .btn-rack > form:hover:not(.disabled, :disabled, [disabled]) {
  box-shadow: inset 0 4px 3px -2px #fff6, inset 0 -5px 8 16px -3px hsl(from var(--c-body-gradient) h s calc(l + 7)/.8), 0 2px 4px 0 #0000001f;
}

.voice-choices .active, .btn-rack__btn.active {
  box-shadow: inset 0 3px 5px #0000001f !important;
}

:where(html.light) .voice-choices .active {
  box-shadow: inset 0 3px 5px #00000014 !important;
}

.voice-choices :where(html.light) .active {
  box-shadow: inset 0 3px 5px #00000014 !important;
}

:where(html.light) .btn-rack__btn.active {
  box-shadow: inset 0 3px 5px #00000014 !important;
}

.btn-rack__btn.active {
  background: var(--c-secondary);
  color: #fff;
  text-shadow: 0 1px 2px #111b !important;
}

@media (hover: hover) {
  .btn-rack__btn.active:not(.disabled):hover {
    background: hsl(from var(--c-secondary) h s calc(l + 5));
  }
}

.voice-choices .active {
  background: var(--c-primary);
  color: #fff;
  text-shadow: 0 1px 1px #000 !important;
}

:where(html.transp) #voice-settings:before {
  content: "";
  z-index: -1;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

#voice-settings {
  box-shadow: -1px 5px 6px #0000004d;
}

.voice-setting select {
  text-overflow: ellipsis;
  overflow: hidden;
}

.voice-setting, #voice-status, #voice-status-row, .btn-rack__btn, .btn-rack > form {
  flex-flow: row;
  align-items: center;
  display: flex;
}

.voice-choices {
  flex-flow: wrap;
  justify-content: space-between;
  align-items: center;
  display: flex;
}

#voice-settings {
  flex-flow: column;
  display: flex;
}

.btn-rack__btn:first-child:last-child, .btn-rack > form:first-child:last-child, .btn-rack, #voice-status-row {
  border-radius: var(---ui-roundness, 7px);
}

.btn-rack__btn:first-child, .btn-rack > form:first-child {
  border-radius: 0;
  border-start-start-radius: var(---ui-roundness, 7px);
  border-end-start-radius: var(---ui-roundness, 7px);
}

.btn-rack__btn:last-child, .btn-rack > form:last-child {
  border-radius: 0;
  border-start-end-radius: var(---ui-roundness, 7px);
  border-end-end-radius: var(---ui-roundness, 7px);
}

#voice-settings:before, #voice-settings {
  border-radius: 0 0 var(---ui-roundness, 7px) var(---ui-roundness, 7px);
}

#voice-status-row {
  box-shadow: 0 2px 2px #00000014, 0 3px 1px -2px #0000002e, 0 1px 5px #0000001a;
}

:where(html.transp) #voice-status-row {
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.btn-rack {
  -webkit-user-select: none;
  user-select: none;
  border: 1px solid var(--c-border);
  border-top: 0;
  align-items: center;
  display: inline-flex;
}

.btn-rack .btn-rack {
  border: none;
}

.btn-rack__btn, .btn-rack > form {
  text-align: center;
  cursor: pointer;
  border-inline-end: 1px solid var(--c-border);
  color: var(--c-font);
  white-space: nowrap;
  justify-content: center;
  line-height: 2rem;
}

.btn-rack__btn:hover, .btn-rack > form:hover {
  color: var(--c-font);
}

.btn-rack__btn:last-child, .btn-rack > form:last-child {
  border: 0;
}

.btn-rack__btn icon, .btn-rack > form icon {
  letter-spacing: -1px;
}

.btn-rack > form {
  overflow: hidden;
}

.btn-rack > form .btn-rack__btn {
  box-shadow: none;
  border: 0;
  border-radius: 0 !important;
}

.btn-rack__btn {
  padding: 0 .6em;
}

.btn-rack__btn.active {
  color: #fff;
}

.btn-rack__btn[disabled] {
  opacity: .7;
  cursor: not-allowed;
}

#voice-bar {
  -webkit-user-select: none;
  user-select: none;
  grid-area: voice;
  position: relative;
}

#voice-status-row {
  background: var(--c-bg-box);
  align-items: stretch;
  padding-inline-end: 6px;
  font-size: 1rem;
}

#voice-bar.puz #voice-status-row {
  background: var(--c-bg-zebra);
}

#voice-bar.coords #voice-status-row button#voice-help-button {
  display: none;
}

#voice-status-row:has( + #voice-settings) {
  border-radius: 0;
}

#voice-status-row > button {
  color: var(--c-font-dim);
  padding: 0 6px;
  font-size: 16px;
}

#voice-status-row > button:before {
  vertical-align: sub;
}

#voice-status-row > button:hover {
  color: var(--c-font);
}

#voice-status-row.flash {
  animation: .2s flash;
}

@keyframes flash {
  0% {
    background-color: var(--c-bg-zebra2);
  }

  50% {
    background-color: #c338;
  }

  100% {
    background-color: var(--c-bg-zebra2);
  }
}

#voice-status {
  flex: auto;
}

button#microphone-button {
  margin: 4px;
  background-color: #0000;
  border: 1px solid #0000;
  border-radius: 4px;
  width: 42px;
  height: 30px;
  margin-inline-end: 8px;
}

:where(html.light) button#microphone-button:hover {
  background-color: var(--c-font-dimmer);
}

button#microphone-button.push-to-talk {
  border-color: var(--c-primary);
}

button#microphone-button.listening {
  color: var(--c-primary);
  animation: 2s infinite pulse-listening;
}

button#microphone-button.listening:hover {
  color: var(--c-link-hover);
}

button#microphone-button.error {
  color: var(--c-bad);
}

@keyframes pulse-listening {
  0% {
    border-color: #0000;
  }

  50% {
    border-color: var(--c-primary);
  }

  100% {
    border-color: #0000;
  }
}

#voice-settings-button.active {
  color: #fff;
  background-color: var(--c-primary);
}

#voice-settings-button.active:hover:before {
  color: #fff;
  opacity: .8;
}

#voice-settings {
  border-top: 2px solid var(--c-primary);
  z-index: 4;
  background: var(--c-bg-high);
  gap: 1.25em;
  width: 100%;
  padding: 1.25em 1.5em;
  position: absolute;
}

.voice-setting {
  white-space: nowrap;
}

.voice-setting input[type="range"] {
  cursor: pointer;
  flex: 1 4 auto;
  width: 100%;
  height: 1.6em;
  margin: 0 1ch;
  padding: 0;
}

.voice-setting select {
  flex: 1 4 auto;
  min-width: 0;
  margin-inline-start: 1ch;
  padding: 4px;
}

.voice-setting .range_value {
  text-align: left;
  direction: ltr;
  flex: 0 0 15%;
}

.voice-setting kbd {
  margin: 3px 0 0;
  font-size: 90%;
}

.voice-choices {
  gap: 1em;
}

.voice-choices .active:not(.disabled):hover {
  background: color-mix(in oklab, var(--c-primary) 80%, white);
}

.voice-choices__device {
  flex-flow: row;
}

.voice-choices__device select {
  flex: 1;
  width: 0;
}
