.rally-ui #app .dm-testdrive {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 50px;
  padding: 2px 9px;
  border: 6px solid transparent;
  border-image: var(--rl-teal-frame) 32 fill stretch;
  background: none;
  color: var(--rl-cream);
  font: 800 15px/1.15 Arial, sans-serif;
  text-align: left;
  text-size-adjust: none;
  -webkit-text-size-adjust: none;
}
.dm-testdrive > svg { flex: 0 0 24px; color: #f9dc96; }
.dm-testdrive > span { display: grid; min-width: 0; gap: 1px; }
.dm-testdrive small { font-size: 12px; font-weight: 700; color: #e7d8ac; }
.dm-testdrive:active { transform: translateY(2px); }
.dm-testdrive:focus-visible { outline: 2px solid #fff2b0; outline-offset: 2px; }

.testdrive-hud { display: none; }
.is-test-drive :is(.hud-coins, #hud-room, .items) { display: none !important; }
.is-test-drive .hud-pause { align-self: flex-start; }
.is-test-drive .testdrive-hud {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  flex: 1;
  min-width: 0;
  gap: 4px 6px;
  font: 700 13px/1.1 Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  text-size-adjust: none;
  -webkit-text-size-adjust: none;
  pointer-events: none;
}
.testdrive-hud-plate {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  flex-wrap: wrap;
  gap: 2px 8px;
  min-height: 42px;
  padding: 2px 5px;
  border: 6px solid transparent;
  border-image: var(--rl-slate-frame) 32 fill stretch;
  color: var(--rl-cream);
  text-align: center;
}
.testdrive-hud-plate b { white-space: nowrap; font-size: 15px; }
.testdrive-hud-plate.has-replay { border-image-source: var(--rl-teal-frame); }
.rally-ui .testdrive-progress {
  grid-column: 1 / -1;
  height: 24px;
  margin: 0 15px 0 9px;
}
.testdrive-progress .dot { display: block; left: 0; }
.testdrive-progress .dot.me { top: 35%; }
.testdrive-progress .testdrive-ghost-dot {
  top: 85%;
  z-index: 3;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-color: #173b48;
  background: #6af6ef;
}
.testdrive-progress [hidden] { display: none; }
.testdrive-hud-plate:first-child > span::before,
.testdrive-hud-plate.has-replay > span::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-radius: 50%;
  background: #ff3b2f;
}
.testdrive-hud-plate.has-replay > span::before { background: #6af6ef; }

.rally-ui #app .testdrive-panel {
  width: min(520px, calc(100% - 20px));
  max-width: none;
  padding: 12px 14px;
  gap: 8px;
  color: var(--rl-cream);
  text-size-adjust: none;
  -webkit-text-size-adjust: none;
}
.testdrive-panel .panel-title { padding-inline: 25px; }
.testdrive-intro-copy, .testdrive-result-summary {
  font-size: 15px;
  line-height: 1.3;
  text-align: center;
  overflow-wrap: anywhere;
}
.testdrive-intro-copy p + p { margin-top: 6px; }
#testdrive-ok { min-width: 104px; min-height: 44px; align-self: center; }
.testdrive-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; text-align: center; }
.testdrive-results > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: center;
  gap: 5px;
  padding: 5px 7px;
  border: 5px solid transparent;
  border-image: var(--rl-teal-frame) 32 fill stretch;
  font-variant-numeric: tabular-nums;
}
.testdrive-results > div:last-child { border-image-source: var(--rl-slate-frame); }
.testdrive-results dt { grid-column: 1 / -1; font-size: 13px; }
.testdrive-results dd { font-size: 17px; font-weight: 800; }
.testdrive-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.rally-ui #app .testdrive-actions > button {
  min-width: 0;
  min-height: 44px;
  padding: 4px 5px;
  font-size: 13px;
  line-height: 1.1;
  white-space: normal;
  justify-content: center;
}
@media (max-width: 545px) and (orientation: landscape) {
  .testdrive-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
