.kb-h1 { margin-top: 16px; font-weight: bold; }
.kb-sub { margin-bottom: 8px; }
.kb-tool { background: #f7f9fb; border: 1px solid #dde3ea; border-radius: 12px; padding: 16px 12px; margin: 16px 0; }
.kb-mobile { background: #fff4e5; border: 1px solid #f0c27b; border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.kb-switch { display: flex; justify-content: center; gap: 8px; margin-bottom: 8px; }
.kb-sw { border: 1px solid #9aa7b4; background: #fff; border-radius: 999px; padding: 4px 16px; font-size: 14px; }
.kb-sw.is-active { background: #2b5f8a; border-color: #2b5f8a; color: #fff; }
.kb-hint { text-align: center; font-size: 14px; color: #555; margin-bottom: 8px; }

/* --u（1キー分の幅px）は kbd-ui.js が盤面の幅から計算して入れる */
.kb-board { --u: 32px; width: 100%; overflow: hidden; user-select: none; }
.kb-row { display: flex; justify-content: center; height: calc(var(--u) * 0.95); margin-bottom: calc(var(--u) * 0.08); }
.kb-key, .kb-gap { flex: 0 0 auto; box-sizing: border-box; }
.kb-key {
  display: flex; align-items: center; justify-content: center;
  margin-right: calc(var(--u) * 0.06);
  border: 1px solid #b9c3cd; border-radius: calc(var(--u) * 0.12);
  background: #fff; color: #333;
  font-size: calc(var(--u) * 0.3); line-height: 1.1; text-align: center; white-space: nowrap; overflow: hidden;
  position: relative; transition: background-color .08s;
}
.kb-key.is-tested { background: #cfe8ff; border-color: #7fb2de; }
.kb-key.is-down { background: #2b7bd0; border-color: #1d5a9c; color: #fff; }
.kb-key.is-chatter { box-shadow: inset 0 0 0 2px #d93a3a; }
.kb-key.is-na { background: #eceff2; color: #9aa3ac; border-style: dashed; }
.kb-key.is-na.is-tested { background: #cfe8ff; border-color: #7fb2de; color: #333; }
.kb-key.is-na.is-down { background: #2b7bd0; border-color: #1d5a9c; color: #fff; }
.kb-key .kb-cnt { position: absolute; top: 0; right: 2px; font-size: calc(var(--u) * 0.22); color: #d93a3a; font-weight: bold; }

.kb-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 12px 0 8px; }
.kb-stats > div { background: #fff; border: 1px solid #dde3ea; border-radius: 8px; padding: 6px 10px; text-align: center; }
.kb-label { display: block; font-size: 12px; color: #6b7c88; }
.kb-val { display: block; font-size: 20px; font-weight: bold; }
.kb-last { font-size: 14px; font-family: Menlo, Consolas, monospace; word-break: break-all; }
.kb-done { text-align: center; color: #1f7a3a; font-weight: bold; }
.kb-legend { text-align: center; font-size: 12px; }
.kb-legend .kb-sample { display: inline-flex; width: auto; padding: 2px 8px; margin: 2px; font-size: 12px; }
.kb-section-h { font-size: 1.2rem; font-weight: bold; margin-top: 24px; border-left: 4px solid #2b5f8a; padding-left: 8px; }
.kb-desc { line-height: 1.8; }
.kb-table { font-size: 14px; }

.kb-key.is-two { white-space: pre; font-size: calc(var(--u) * 0.24); line-height: 1.05; }
.kb-hint[hidden] { display: none; }
