/* Keyboard-shortcuts overlay for the reader (js/reader_keys.js).
   Scoped to .reader-keys so it touches nothing else. Follows the token layer
   (css/tokens.css): no hex literals, no letter-spacing (gate 67: a tracked Han
   label opens a gap inside a word), and it honours reduced motion and forced
   colours. */

.reader-keys {
  position: fixed;
  inset: 0;
  z-index: 95;                 /* above the page, just under the command palette (90+) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--pad-l, 16px);
  background: color-mix(in srgb, var(--canvas, #000) 62%, transparent);
}

.reader-keys__box {
  width: min(28rem, 100%);
  max-height: calc(100vh - 2 * var(--pad-l, 16px));
  overflow: auto;
  padding: var(--pad-b, 20px) var(--pad-r, 20px);
  background: var(--paper, #fff);
  color: var(--ink, #111);
  border: 1px solid var(--rule-strong, rgba(0, 0, 0, 0.18));
  border-radius: var(--r-lg, 14px);
  box-shadow: 0 24px 64px -24px rgba(0, 0, 0, 0.5);
}

.reader-keys__title {
  margin: 0 0 12px;
  font-family: var(--font-ui, system-ui, sans-serif);
  font-size: var(--fs-sub, 1.05rem);
  color: var(--ink, #111);
}

.reader-keys__list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  margin: 0 0 16px;
}

.reader-keys__key {
  margin: 0;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: var(--fs-small, 0.9rem);
  font-weight: 600;
  color: var(--ink, #111);        /* the keycaps are the point; never the faint ink */
  white-space: nowrap;
}

.reader-keys__what {
  margin: 0;
  font-size: var(--fs-small, 0.9rem);
  color: var(--ink, #111);
}

.reader-keys__close {
  min-height: 44px;            /* the tap target, every width */
  min-width: 44px;
  padding: 0 16px;
  font: inherit;
  color: var(--accent-ink, #fff);
  background: var(--accent, #1a73e8);
  border: 0;
  border-radius: var(--r-md, 10px);
  cursor: pointer;
}

.reader-keys__close:focus-visible {
  outline: 2px solid var(--focus, #1a73e8);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .reader-keys { transition: none; }
}

@media (forced-colors: active) {
  .reader-keys { background: Canvas; }
  .reader-keys__box { border-color: CanvasText; }
}

@media (max-width: 480px) {
  .reader-keys { align-items: flex-end; }
  .reader-keys__box { width: 100%; border-radius: var(--r-lg, 14px) var(--r-lg, 14px) 0 0; }
}
