/* Keyboard shortcuts help — native <dialog> opened with .showModal(). */
.shortcuts-dialog {
  border: 0.0625rem solid var(--border-color);
  border-radius: 0.75em;
  background: var(--bg-color);
  color: var(--fg-color);
  box-shadow: 0 0.5em 2em rgba(0, 0, 0, 0.2);
  padding: 1.5em;
  width: auto;
  min-width: 22em;
  max-width: min(25em, 90vw);
}

.shortcuts-dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(0.25rem);
}

.shortcuts-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 1em;

  h2 {
    font-size: 1.25em;
    font-weight: 900;
    margin: 0;
  }
}

.shortcuts-dialog-close {
  background: none;
  border: none;
  padding: 0;
  fill: var(--mid-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s ease-out all;

  svg {
    width: 2em;
    height: 2em;
  }

  &:hover {
    fill: var(--fg-color);
  }

  &:focus {
    outline: none;
  }
}

.shortcuts-list {
  width: 100%;
  margin: 0;
  border-collapse: collapse;

  tr {
    border-bottom: 0.0625rem solid var(--border-color);
  }
  tr:last-of-type {
    border-bottom: none;
  }
  td {
    padding: 0.25em 0;
  }
  .keys {
    text-align: center;
  }
}

/* Separators between keys ("/" for alternatives, "+" for combos) read as
   plain text, not as keys themselves. */
.shortcuts-sep {
  color: var(--mid-color);
  font-size: 0.75em;
}

.shortcuts-list kbd {
  display: inline-block;
  min-width: 0.75em;
  text-align: center;
  font-family: inherit;
  font-size: 0.75em;
  padding: 0.125em 0.5em;
  border: 0.0625rem solid var(--border-color);
  border-radius: 0.25em;
  color: var(--fg-color);
  position: relative;
  bottom: 0.125em;
}
