/* The keyboards page rides on mousepads.css (body carries both classes); this is what differs. */

.keyboards-page .options.keyboard-layout-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.keyboard-layout-options > .option { min-height: 104px; }
.keyboard-layout-options small { display: block; width: 100%; }
.keyboard-diagram {
  display: grid; grid-template-columns: auto auto auto; grid-template-rows: 4px 15px;
  gap: 2px; padding: 3px; margin-bottom: 4px; max-width: 100%; align-items: stretch;
  border: 1px solid currentColor; border-radius: 4px; color: var(--ink);
}
.keyboard-diagram > span {
  border-radius: 1px;
  background: repeating-linear-gradient(90deg, transparent 0 3px, var(--tile) 3px 4px),
    repeating-linear-gradient(0deg, currentColor 0 2px, var(--tile) 2px 4px);
  opacity: .63;
}
.keyboard-diagram-function { grid-column: 1; grid-row: 1; }
.keyboard-diagram-typing { grid-column: 1; grid-row: 2; width: 32px; }
.keyboard-diagram-navigation { grid-column: 2; grid-row: 2; width: 9px; }
.keyboard-diagram-numpad { grid-column: 3; grid-row: 1 / 3; width: 12px; }
[data-value="40"] .keyboard-diagram { grid-template-rows: 0 11px; }
[data-value="40"] .keyboard-diagram-typing { width: 24px; }
[data-value="60"] .keyboard-diagram, [data-value="65"] .keyboard-diagram { grid-template-rows: 0 15px; }
:is([data-value="tkl"], [data-value="full"]) .keyboard-diagram-navigation { margin-left: 3px; }
[data-value="full"] .keyboard-diagram-numpad { margin-left: 3px; }
@media (min-width: 701px) {
  .keyboards-page .questionnaire:has(.keyboard-layout-options) { width: min(1080px, calc(100vw - 64px)); }
}
@media (min-width: 1120px) {
  .keyboards-page .options.keyboard-layout-options { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .keyboards-page .options.keyboard-layout-options {
    margin: 0; padding: 2px; overflow: visible; mask-image: none; animation: none; gap: 6px;
  }
  .keyboard-layout-options > .option { min-width: 0; padding: 8px 4px; }
  .keyboard-layout-options small { line-height: 1.3; }
}

/* The scene draws each render cropped to its middle band: the board sits across the middle of a
   square, and showing the whole square hung each name under a block of white well below its board.
   120px of the 190px square keeps every board whole, angled shots included (the tallest is about
   0.58 of the square). keyboard-view.js places the shells knowing this. */
.keyboards-page .mouse img { width: 190px; height: 120px; object-fit: cover; }
/* The name follows the board, not the band: pulled up by the white under the board (half the band
   less half the board, --tall from keyboard-view.js), leaving 10px. */
.keyboards-page .mouse .caption { margin-top: calc(var(--tall, .58) * 95px - 50px); position: relative; z-index: 1; }
/* That pull-up lays the name over the band's white foot. A hovered shell lifts its image with a
   transform (style.css), which paints the image above the name, and its white then hid the name
   (Patryk, 2026-10-05); the name is lifted onto its own layer above the image. */
/* scene.js places a node by the point (95,111), the middle of the 190px square it was written for, and
   scales it round its own centre. A node is a button, which centres its content in its 222px: with a
   120px band and a name of varying height the board moved with the name, and two boards of a pair
   landed at different heights. Content from the top and the origin pinned to that point put every
   board where keyboard-view.js aims it. */
.keyboards-page .mouse { display: flex; flex-direction: column; justify-content: flex-start; align-items: center; transform-origin: 95px 111px; }
