/* ==========================================================================
   MacBook Keyboard Matrix — Apple Hardware Aesthetic & Tactile Polish
   ========================================================================== */

.kb-container {
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface-3) 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  margin-top: 20px;
  overflow-x: auto;
  user-select: none;
}

.kb-frame {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 780px;
  max-width: 1000px;
  margin: 0 auto;
}

.kb-row {
  display: flex;
  gap: 6px;
  justify-content: space-between;
}

.kb-key {
  background: var(--surface-1);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  border-radius: 7px;
  height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.08s var(--ease-apple);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.08);
  padding: 2px 6px;
  white-space: pre-line;
  position: relative;
}

.kb-key:hover {
  background: var(--surface-hover);
}

.kb-key.active {
  background: #ffcc00 !important;
  color: #000000 !important;
  border-color: #e6b800 !important;
  transform: translateY(3px);
  box-shadow: 0 0 0 transparent !important;
}

.kb-key.tested {
  background: #34c759 !important;
  color: #ffffff !important;
  border-color: #28a745 !important;
  box-shadow: 0 3px 0 rgba(40, 167, 69, 0.45);
}

.kb-key.special-touchid {
  background: #1c1c1e !important;
  color: #888888 !important;
  border: 2px solid #38383c !important;
  border-radius: 50% / 18px;
}

.kb-key.special-touchid.tested {
  border-color: #34c759 !important;
  color: #34c759 !important;
}

/* Split arrows */
.kb-split-vertical {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 48px;
}

.kb-split-half {
  height: 22px !important;
  font-size: 10px !important;
  padding: 0 !important;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15) !important;
}

.kb-split-half.active {
  transform: translateY(2px) !important;
  box-shadow: none !important;
}

.kb-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 18px;
  padding: 0 4px;
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  background: var(--surface-2);
  font-size: 13.5px;
  color: var(--text-color);
  border: 1px solid var(--border-color);
  font-weight: 500;
}

.stat-badge.success {
  background: var(--success-light);
  color: var(--success);
  border-color: var(--success);
  font-weight: 700;
}

/* Tricky Keys Verification Checklist */
.tricky-keys-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.tricky-key-item {
  background: var(--surface-1);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}
