/* The station's on-screen keyboard: a button at the bottom edge slides up finger-sized keys over the page or its open dialog. */
:root {
  --touch-keyboard-height: 0px;
}

.touch-keyboard[hidden],
.touch-keyboard [hidden] {
  display: none;
}

.touch-keyboard-handle,
.touch-keyboard-panel {
  position: fixed;
  z-index: 2147483000;
  font-family: var(--font-sans);
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

.touch-keyboard-handle {
  left: 50%;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 22px 0 18px;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-raised) 94%, transparent);
  color: var(--color-silver-100);
  font-size: 1rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgb(0 0 0 / 45%);
  transform: translateX(-50%);
  cursor: pointer;
}

.touch-keyboard-handle svg {
  color: var(--color-silver-400);
}

.touch-keyboard-panel {
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--color-line);
  background: var(--color-surface);
  box-shadow: 0 -18px 40px rgb(0 0 0 / 45%);
  animation: touch-keyboard-up .18s ease-out;
}

@keyframes touch-keyboard-up {
  from {
    transform: translateY(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .touch-keyboard-panel {
    animation: none;
  }
}

.touch-keyboard-hint {
  margin: 0 auto 10px;
  color: var(--color-caution);
  font-size: .95rem;
  text-align: center;
}

.touch-keyboard-keys {
  display: grid;
  gap: 8px;
  max-width: 1480px;
  margin: 0 auto;
}

.touch-keyboard-row {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.touch-keyboard-key {
  flex: 1 1 0;
  max-width: 112px;
  min-height: 62px;
  padding: 0 6px;
  border: 1px solid var(--color-line);
  border-radius: 10px;
  background: var(--color-raised);
  color: var(--color-paper);
  font: inherit;
  font-size: 1.35rem;
  font-weight: 500;
  cursor: pointer;
}

.touch-keyboard-key:active {
  border-color: var(--color-silver-600);
  background: var(--color-well);
}

.touch-keyboard-key.is-wide {
  flex-grow: 1.6;
  max-width: 180px;
  color: var(--color-silver-200);
  font-size: 1rem;
  font-weight: 600;
}

.touch-keyboard-key[data-key="shift"],
.touch-keyboard-key[data-key="backspace"],
.touch-keyboard-key[data-key="enter"] {
  font-size: 1.45rem;
}

.touch-keyboard-key[data-key="space"] {
  flex-grow: 5;
  max-width: none;
  font-size: 1rem;
  color: var(--color-silver-300);
}

.touch-keyboard-key[data-key="enter"] {
  border-color: var(--color-paper);
  background: var(--color-paper);
  color: var(--color-ink);
}

.touch-keyboard-key[aria-pressed="true"] {
  border-color: var(--color-silver-400);
  color: var(--color-paper);
}

.touch-keyboard-key.is-locked {
  background: var(--color-silver-200);
  color: var(--color-ink);
}

html.touch-keyboard-open body {
  padding-bottom: var(--touch-keyboard-height);
}

html.touch-keyboard-open dialog:modal {
  margin-top: 12px;
  margin-bottom: auto;
  max-height: calc(100dvh - var(--touch-keyboard-height) - 24px);
}
