.home-panel--main .home-test-mode-button {
  position: absolute;
  left: 37%;
  top: 32.7%;
  width: 26%;
  height: 4.4%;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff4bd;
  font-family: "Noto Serif TC", "Microsoft JhengHei", serif;
  font-size: clamp(10px, 1.2vw, 16px);
  font-weight: 900;
  letter-spacing: .16em;
  text-decoration: underline;
  text-underline-offset: .25em;
  cursor: pointer;
}

.home-panel--main .home-test-mode-button:hover,
.home-panel--main .home-test-mode-button:focus-visible {
  color: #fff;
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.test-lab {
  margin: 0 0 12px;
  border: 2px solid #5e738a;
  border-radius: 12px;
  background: #111a24;
  color: #edf5ff;
  overflow: hidden;
}

.test-lab[hidden] { display: none !important; }

.test-lab__header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: center;
  padding: 12px;
  background: #1c2a38;
  border-bottom: 1px solid #506277;
}

.test-lab__header strong,
.test-lab__header small { display: block; }
.test-lab__header strong { font-size: 1rem; }
.test-lab__header small { margin-top: 3px; color: #b9cadc; line-height: 1.4; }

.test-lab button,
.test-lab select,
.test-lab input {
  min-height: 34px;
  border: 1px solid #71869a;
  border-radius: 7px;
  background: #f7fbff;
  color: #172331;
  font: inherit;
}

.test-lab button {
  padding: 6px 10px;
  font-weight: 800;
  cursor: pointer;
}

.test-lab button:hover,
.test-lab button:focus-visible { border-color: #e9c766; outline: 2px solid #e9c766; outline-offset: 1px; }
.test-lab button:disabled { cursor: not-allowed; opacity: .48; }

.test-lab__exit { background: #622d32 !important; color: #fff !important; border-color: #b36c72 !important; }

.test-lab__tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  padding: 8px;
  background: #182431;
}

.test-lab__tabs button { min-width: 0; padding-inline: 4px; }
.test-lab__tabs button[aria-selected="true"] { background: #345675; color: #fff; border-color: #9fc5e8; }

.test-lab__body {
  max-height: min(58vh, 680px);
  overflow: auto;
  padding: 10px;
  scrollbar-gutter: stable;
}

.test-lab__pane[hidden] { display: none !important; }

.test-lab__section {
  margin: 0 0 10px;
  padding: 10px;
  border: 1px solid #455a6d;
  border-radius: 9px;
  background: #192633;
}

.test-lab__section h3 { margin: 0 0 8px; font-size: .98rem; }
.test-lab__section p { margin: 6px 0; line-height: 1.45; }
.test-lab__muted { color: #b9cadc; font-size: .82rem; }
.test-lab__skill { padding: 8px; border-left: 4px solid #d6b75a; background: #253443; color: #f5f0d9; }

.test-lab__row {
  display: grid;
  grid-template-columns: minmax(88px, .9fr) minmax(0, 1.4fr);
  gap: 6px 9px;
  align-items: center;
  margin: 6px 0;
}

.test-lab__row > label,
.test-lab__field > label { color: #d7e3ef; font-size: .82rem; font-weight: 700; }

.test-lab__row select,
.test-lab__row input,
.test-lab__field select,
.test-lab__field input { width: 100%; min-width: 0; padding: 5px 7px; }

.test-lab__actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.test-lab__actions button[data-primary] { background: #2c6683; border-color: #7fbbd7; color: #fff; }

.test-lab__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.test-lab__field { min-width: 0; }

.test-lab__stats {
  width: 100%;
  border-collapse: collapse;
  font-size: .78rem;
}

.test-lab__stats th,
.test-lab__stats td { padding: 5px 4px; border-bottom: 1px solid #405365; text-align: left; vertical-align: top; }
.test-lab__stats th { color: #ffe79a; }

.test-lab__list-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 82px auto;
  gap: 6px;
  align-items: center;
  margin: 5px 0;
}

.test-lab__list-row--special { grid-template-columns: minmax(0, 1.2fr) 82px auto; }
.test-lab__remove { background: #4f3034 !important; color: #fff !important; }
.test-lab__status { padding: 8px; background: #243647; color: #d9ebf7; border-radius: 7px; line-height: 1.5; }

body.is-test-mode #currentMapLabel::after { content: "・測試"; color: #ffe079; }

@media (max-width: 780px) {
  .test-lab__body { max-height: none; }
  .test-lab__grid { grid-template-columns: 1fr; }
  .test-lab__row { grid-template-columns: 1fr; }
  .test-lab__tabs button { font-size: .78rem; }
}
