/* YourTechTool — keyboard tester styles. Loaded only by keyboard-tester.php, after site.css and tool-page.css.
   Moved from the original inline <style>; page-wide and chrome rules were removed (now shared). */
:root {
  --key: #171e28;
  --key2: #202a37;
  --active: #176d61;
  --tested: #153e39;
}
.intro-hero {
  text-align: center;
  padding: 64px 0 26px;
}
.intro-hero h1 {
  font-size: clamp(38px, 6vw, 68px);
  line-height: 0.98;
  letter-spacing: -0.055em;
  margin: 18px 0 12px;
}
.subtitle {
  max-width: 720px;
  margin: auto;
  color: var(--muted);
  line-height: 1.65;
  font-size: 16px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 24px 0 12px;
}
.stat strong {
  display: block;
  margin-top: 5px;
  font-size: 23px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.progress {
  height: 7px;
  background: #121922;
  border: 1px solid #202a35;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 18px;
}
.progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  transition: width 0.2s ease;
}
.panel {
  background: rgba(13, 18, 26, 0.94);
  border: 1px solid #26313e;
  border-radius: 18px;
  box-shadow: 0 22px 70px var(--shadow);
  overflow: hidden;
}
.monitor {
  height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 17px;
  border-bottom: 1px solid #222d39;
}
.live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 13px var(--accent);
  animation: blink 1.6s infinite;
}
.stream {
  min-width: 0;
  flex: 1;
  color: #cbd5e1;
  font:
    12px ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.monitor small {
  color: #7f8b9b;
  white-space: nowrap;
}
.keyboard-shell {
  padding: 22px 20px 16px;
}
.keyboard {
  width: 100%;
  max-width: 1160px;
  margin: auto;
  padding: 18px;
  background: linear-gradient(145deg, #151b23, #0c1117);
  border: 1px solid #303b48;
  border-radius: 14px;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.035),
    0 18px 40px rgba(0, 0, 0, 0.25);
}
.row {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  align-items: stretch;
}
.row:last-child {
  margin-bottom: 0;
}
.key {
  --w: 1;
  flex: var(--w) 1 0;
  min-width: 0;
  height: clamp(38px, 4.3vw, 55px);
  position: relative;
  border: 1px solid #303b48;
  border-radius: 7px;
  background: linear-gradient(145deg, var(--key2), var(--key));
  color: #dce3eb;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.035),
    0 3px 0 #080b0f;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition:
    transform 0.055s,
    background 0.12s,
    border-color 0.12s,
    box-shadow 0.12s;
  font-size: clamp(9px, 1vw, 12px);
  font-weight: 750;
}
.key:hover {
  border-color: #526274;
}
.key.tested {
  background: linear-gradient(145deg, #19453f, #122e2b);
  border-color: #286b60;
}
.key.active {
  transform: translateY(3px);
  background: linear-gradient(145deg, #198475, #135b58);
  border-color: #4de1c0;
  box-shadow:
    0 0 18px rgba(56, 214, 162, 0.18),
    0 1px 0 #080b0f;
}
.key .hint {
  position: absolute;
  top: 4px;
  left: 6px;
  color: #8b97a8;
  font-size: 8px;
  font-weight: 650;
}
.key .label {
  pointer-events: none;
}
.row-main .key:nth-child(1) {
  --w: 1.55;
}
.row-main .key:nth-last-child(1) {
  --w: 1.55;
}
.row-home .key:nth-child(1) {
  --w: 1.8;
}
.row-home .key:nth-last-child(1) {
  --w: 1.9;
}
.row-shift .key:nth-child(1),
.row-shift .key:nth-last-child(1) {
  --w: 2.3;
}
.row-bottom .ctrl,
.row-bottom .win,
.row-bottom .alt {
  --w: 1.45;
}
.row-bottom .space {
  --w: 6.5;
}
.row-bottom .menu {
  --w: 1.45;
}
.row-fn .key {
  height: clamp(31px, 3.1vw, 42px);
  font-size: clamp(8px, 0.9vw, 10px);
}
.row-fn .spacer {
  flex: 1 1 0;
  min-width: 0;
}
.nav-cluster {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr 1fr;
  gap: 6px;
  flex: 1.45 1 0;
}
.nav-cluster .key {
  height: auto;
}
.nav-cluster .up {
  grid-column: 2;
}
.nav-cluster .left {
  grid-column: 1;
  grid-row: 2;
}
.nav-cluster .down {
  grid-column: 2;
  grid-row: 2;
}
.nav-cluster .right {
  grid-column: 3;
  grid-row: 2;
}
.main-flex {
  display: flex;
  gap: 6px;
}
.main-flex .main-keys {
  flex: 10 1 0;
  min-width: 0;
}
.right-cluster {
  flex: 1.45 1 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.right-row {
  display: flex;
  gap: 6px;
  flex: 1;
}
.right-row .key {
  height: auto;
}
.key.tall {
  min-height: 100%;
}
.legend {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 14px 15px 2px;
  color: #748093;
  font-size: 11px;
}
.legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.legend i {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  border: 1px solid #465465;
}
.legend .t {
  background: #19453f;
  border-color: #286b60;
}
.legend .a {
  background: #198475;
  border-color: #4de1c0;
}
.bottom {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 12px;
  margin: 14px 0 28px;
}
.card {
  background: rgba(13, 18, 26, 0.94);
  border: 1px solid #26313e;
  border-radius: 15px;
  padding: 18px;
}
.card-title {
  display: flex;
  justify-content: space-between;
  color: #7f8b9b;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.latency {
  font-size: 38px;
  font-weight: 850;
  letter-spacing: -0.04em;
  margin: 7px 0;
}
.latency small {
  font-size: 13px;
  color: #758193;
  font-weight: 600;
}
.track {
  height: 9px;
  background: #121a23;
  border-radius: 99px;
  overflow: hidden;
}
.track span {
  display: block;
  width: 3%;
  height: 100%;
  background: var(--accent);
  transition: width 0.2s;
}
.activity {
  height: 42px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  margin-top: 12px;
  overflow: hidden;
}
.activity i {
  width: 5px;
  min-height: 3px;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
  opacity: 0.75;
}
.card p {
  color: #818d9d;
  font-size: 13px;
  line-height: 1.55;
  margin: 11px 0 14px;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
main button {
  border: 1px solid #2d3947;
  border-radius: 9px;
  background: #151e29;
  color: #e7edf5;
  padding: 9px 13px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
main button:hover {
  background: #1b2735;
  border-color: #4b5c70;
}
main button.primary {
  background: #174f47;
  border-color: #286b60;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 900px) {
  .monitor small {
    display: none;
  }
  .keyboard-shell {
    padding: 14px 10px;
  }
  .keyboard {
    padding: 12px;
    min-width: 820px;
  }
}
@media (max-width: 560px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat strong {
    font-size: 20px;
  }
  .keyboard-shell {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .keyboard {
    margin: 0;
    min-width: 820px;
  }
  .monitor {
    padding: 0 12px;
  }
  .monitor b {
    font-size: 11px;
  }
  .stream {
    font-size: 10px;
  }
  .card {
    padding: 15px;
  }
}
/* changed: replaces inline style attributes */
.row-fn .key[data-code="Escape"] {
  --w: 1.4;
}
.lock-status {
  margin: 10px 0 0;
  font-size: 11.5px;
  color: #8b97a8;
}
.note-small {
  font-size: 12px;
  color: #8b97a8;
  margin: 10px 0 0;
}
/* mouse/touch preview: lighter than a real, counted press */
.key.preview {
  transform: translateY(3px);
  border-color: #55bfff;
  background: linear-gradient(145deg, #1a3a56, #142a40);
}
