#rr-test-toggle, #rr-test-panel {
  position: absolute;
  left: calc(12px + env(safe-area-inset-left, 0px));
  z-index: 12;
  box-sizing: border-box;
  font: 700 14px/1.4 system-ui, "Microsoft YaHei", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
#rr-test-panel *, #rr-test-panel *::before, #rr-test-panel *::after { box-sizing: border-box; }
#rr-test-toggle[hidden], #rr-test-panel[hidden] { display: none; }
#rr-test-toggle {
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  background: rgb(24 36 49 / 10%);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .12s;
}
#rr-test-toggle:active { transform: scale(.94); }
#rr-test-panel {
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  width: min(344px, calc(100% - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  max-height: calc(100% - 84px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #91bad0 #fff9e8;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 24px;
  background: #fff9e8;
  color: #28394b;
  box-shadow: 0 5px 0 rgb(28 45 62 / 16%), 0 12px 32px rgb(0 0 0 / 24%);
  transform-origin: bottom left;
  animation: rr-panel-in .18s ease-out;
}
#rr-test-panel .rr-test-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 12px 14px 16px;
  border-bottom: 2px solid #c6e3ed;
  background: linear-gradient(#e1f5ff, #c6eaff);
}
#rr-test-panel h2 { margin: 0; font-size: 21px; line-height: 1.35; }
#rr-test-panel .rr-test-header p { margin: 3px 0 0; font-size: 12px; font-weight: 600; color: #567085; }
#rr-test-panel .rr-test-content { display: grid; gap: 10px; padding: 12px; }
#rr-test-panel button, #rr-test-panel input {
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 9px 8px;
  border: 1px solid #b7d3e0;
  border-radius: 16px;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
}
#rr-test-panel button {
  color: #29445b;
  background: linear-gradient(#f4fbff, #e0f0fa);
  box-shadow: 0 3px 0 #b3ccdb, inset 0 1px 0 #fff;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .12s, box-shadow .12s, filter .12s;
}
#rr-test-panel button:active:not(:disabled) { transform: translateY(2px) scale(.97); box-shadow: 0 1px 0 #a6bfcc; }
#rr-test-panel button:disabled {
  color: #929ca7;
  border-color: #d4dce0;
  background: #e9edef;
  box-shadow: 0 2px 0 #d4dce0;
  cursor: default;
}
#rr-test-panel .rr-test-close {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0 0 3px;
  border: 2px solid white;
  border-radius: 50%;
  color: white;
  background: #f96953;
  box-shadow: 0 2px 0 #c84939;
  font-size: 32px;
  line-height: 1;
}
#rr-test-panel output {
  display: block;
  padding: 7px 5px;
  border-radius: 12px;
  background: #edf0e5;
  color: #5c6e75;
  text-align: center;
  font-size: 12px;
}
#rr-test-panel .rr-test-start { min-height: 68px; border-radius: 19px; }
#rr-test-panel .rr-test-start:not(:disabled) {
  color: #fff;
  border-color: #309e27;
  background: linear-gradient(#80e51c, #45c811);
  box-shadow: 0 3px 0 #309d26, inset 0 2px 0 rgb(255 255 255 / 45%);
  text-shadow: 0 1px 1px #29741c;
}
#rr-test-panel .rr-test-start strong, #rr-test-panel .rr-test-start small { display: block; }
#rr-test-panel .rr-test-start strong { font-size: 19px; }
#rr-test-panel .rr-test-start small { margin-top: 3px; font-size: 12px; font-weight: 500; }
#rr-test-panel .rr-test-stop:not(:disabled) { background: #fff0e7; border-color: #e6b99d; color: #a0522f; box-shadow: 0 3px 0 #dbb395; }
#rr-test-panel .rr-test-levels { display: grid; gap: 10px; padding: 2px 0 4px; }
#rr-test-panel label { color: #718396; font-size: 12px; }
#rr-test-panel .rr-test-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
#rr-test-panel form.rr-test-row { grid-template-columns: 1.35fr 1fr; }
#rr-test-panel input {
  width: 100%;
  color: #263f57;
  background: #fff;
  box-shadow: inset 0 2px 4px rgb(34 68 94 / 8%);
  text-align: center;
  font-size: 18px;
}
#rr-test-panel input:disabled { color: #929ca7; background: #eef0f0; }
#rr-test-panel input::-webkit-inner-spin-button, #rr-test-panel input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
#rr-test-panel .rr-test-jump:not(:disabled) { color: #fff; border-color: #1687bc; background: linear-gradient(#3ebfea, #159ed3); box-shadow: 0 3px 0 #167faf; text-shadow: 0 1px 1px #26718a; }
#rr-test-panel .rr-test-footer { padding-top: 8px; border-top: 1px solid #e6dfc9; }
#rr-test-panel .rr-test-footer button { font-size: 13px; }
#rr-test-panel [data-command="reset"]:not(:disabled) { color: #8e641b; background: #fff0c4; border-color: #e7c979; box-shadow: 0 3px 0 #d9c084; }
#rr-test-panel :focus-visible, #rr-test-toggle:focus-visible { outline: 3px solid #218bc4; outline-offset: 2px; }
@media (hover: hover) {
  #rr-test-panel button:hover:not(:disabled) { filter: brightness(1.04); }
}
@keyframes rr-panel-in { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  #rr-test-panel { animation: none; }
  #rr-test-panel button, #rr-test-toggle { transition: none; }
}

#rr-test-panel .rr-test-tools { border-top: 1px solid #e6dfc9; padding-top: 8px; }
#rr-test-panel .rr-test-tools summary {
  padding: 8px 4px;
  color: #29445b;
  cursor: pointer;
  touch-action: manipulation;
}
#rr-test-panel .rr-test-tools-body { display: grid; gap: 8px; min-width: 0; margin: 6px 0 0; padding: 0; border: 0; }
#rr-test-panel .rr-test-tools-coins, #rr-test-panel .rr-test-tools-world { text-align: center; }
#rr-test-panel .rr-test-world { display: grid; grid-template-columns: 44px 1fr 44px; gap: 8px; align-items: center; }
#rr-test-panel .rr-test-tools-hint { margin: 4px 0 8px; color: #5c6e75; font-size: 12px; }
