#test {
  scroll-margin-top: 92px;
}

.test-section {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: var(--page-card-gap) 0 calc(var(--page-card-gap) + var(--records-card-overlap));
}

.test-panel {
  --click-stack-pad: clamp(18px, 3vw, 30px);
  --click-area-min-height: 300px;
  --duration-toolbar-height: 34px;
  --duration-toolbar-gap: 18px;
  --click-stack-height: clamp(430px, 46vw, 560px);
  position: relative;
  overflow: hidden;
  display: grid;
  gap: clamp(18px, 2.6vw, 26px);
  padding: clamp(18px, 3.2vw, 36px);
  background: #ffffff;
  border-radius: 24px;
}

.test-panel > * {
  position: relative;
  z-index: 1;
}

.test-panel:fullscreen {
  --click-stack-pad: clamp(26px, 4vh, 54px);
  --click-area-min-height: max(520px, min(62vh, 640px));
  --duration-toolbar-gap: clamp(22px, 3vh, 34px);
  --click-stack-height: min(76vh, 760px);
  width: 100vw;
  min-height: 100vh;
  margin: 0;
  padding: clamp(26px, 5vh, 64px) clamp(38px, 5vw, 76px);
  border-radius: 0;
  overflow: auto;
}

.test-panel:fullscreen .tester-workspace {
  min-height: calc(100vh - (clamp(26px, 5vh, 64px) * 2));
  align-items: center;
}

.test-panel:fullscreen .click-stack {
  grid-template-rows: minmax(520px, 1fr) auto;
}

.test-panel:fullscreen .click-area {
  min-height: min(62vh, 640px);
}

.test-panel:fullscreen .click-area-title {
  font-size: clamp(3.5rem, 5.2vw, 6.1rem);
}

.test-panel:fullscreen .click-area-icon {
  width: clamp(118px, 8vw, 150px);
  height: clamp(118px, 8vw, 150px);
}

.test-panel:fullscreen .side-panel {
  min-height: var(--click-stack-height);
}

.test-panel:fullscreen .stat-card {
  padding: clamp(18px, 2vw, 26px);
}

.test-panel:fullscreen .stat-value {
  font-size: clamp(2.1rem, 3.2vw, 3.4rem);
}

.test-panel.is-app-fullscreen {
  --click-stack-pad: clamp(26px, 4vh, 54px);
  --click-area-min-height: max(520px, min(62dvh, 640px));
  --duration-toolbar-gap: clamp(22px, 3vh, 34px);
  --click-stack-height: min(76dvh, 760px);
  position: fixed;
  inset: 0;
  z-index: 1000;
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  margin: 0;
  padding: clamp(20px, 5vh, 56px) clamp(18px, 5vw, 76px);
  border-radius: 0;
  overflow: auto;
  background: #ffffff;
}

.test-panel.is-app-fullscreen .tester-workspace {
  min-height: calc(100dvh - (clamp(20px, 5vh, 56px) * 2));
  align-items: center;
}

.test-panel.is-app-fullscreen .click-stack {
  grid-template-rows: minmax(520px, 1fr) auto;
}

.test-panel.is-app-fullscreen .click-area {
  min-height: min(62dvh, 640px);
}

.test-panel.is-app-fullscreen .click-area-title {
  font-size: clamp(3.5rem, 5.2vw, 6.1rem);
}

.test-panel.is-app-fullscreen .click-area-icon {
  width: clamp(118px, 8vw, 150px);
  height: clamp(118px, 8vw, 150px);
}

.test-panel.is-app-fullscreen .side-panel {
  min-height: var(--click-stack-height);
}

.test-panel.is-app-fullscreen .stat-card {
  padding: clamp(18px, 2vw, 26px);
}

.test-panel.is-app-fullscreen .stat-value {
  font-size: clamp(2.1rem, 3.2vw, 3.4rem);
}

.tester-workspace {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(220px, 3fr);
  gap: clamp(18px, 3vw, 30px);
  align-items: stretch;
}

.side-panel {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  align-content: start;
  min-height: 0;
  height: max(
    var(--click-stack-height),
    calc(
      var(--click-area-min-height) +
      var(--click-stack-pad) +
      var(--click-stack-pad) +
      var(--duration-toolbar-gap) +
      var(--duration-toolbar-height)
    )
  );
  padding-top: var(--click-stack-pad);
  padding-bottom: calc(var(--click-stack-pad) + var(--duration-toolbar-gap) + var(--duration-toolbar-height));
}

.click-stack {
  display: grid;
  grid-template-rows: minmax(300px, 1fr) auto;
  gap: var(--duration-toolbar-gap);
  align-content: stretch;
  min-height: var(--click-stack-height);
  padding: var(--click-stack-pad);
  background: transparent;
  border-radius: 22px;
  box-shadow: none;
}

.time-toolbar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  justify-content: stretch;
  align-self: start;
  gap: clamp(8px, 1.4vw, 16px);
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.time-btn {
  position: relative;
  min-width: 0;
  min-height: 34px;
  height: 34px;
  padding: 0 4px 6px;
  color: #64736f;
  background: transparent;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  cursor: pointer;
  font-weight: 800;
  line-height: 1;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.time-btn::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 18px;
  height: 2px;
  background: transparent;
  border-radius: 999px;
  transform: translateX(-50%) scaleX(0.65);
  transition: transform 160ms ease, background-color 160ms ease;
}

.time-btn:hover {
  color: #172a3b;
  background: rgba(238, 247, 255, 0.72);
}

.time-btn.active {
  color: #172a3b;
  background: transparent;
  box-shadow: none;
}

.time-btn.active::after {
  background: rgba(107, 101, 220, 0.56);
  transform: translateX(-50%) scaleX(1);
}

.click-area-shell {
  position: relative;
  min-height: 0;
  height: 100%;
}

.click-area {
  --click-area-surface: #f8fafc;
  --pace-hue: 205;
  --pace-accent-hue: 190;
  --pace-spark-hue: 215;
  --pace-saturation: 70%;
  --pace-lightness: 94%;
  --pace-duration: 1400ms;
  --pace-low-opacity: 0.1;
  --pace-high-opacity: 0.2;
  --pace-origin-x: 50%;
  --pace-origin-y: 50%;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  contain: paint;
  clip-path: inset(0 round 20px);
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 0;
  width: 100%;
  height: 100%;
  padding: clamp(28px, 5vw, 56px);
  color: var(--text);
  background: var(--click-area-surface);
  border: none;
  border-radius: 20px;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 10px 22px rgba(42, 90, 145, 0.05);
  transition: transform 120ms ease, border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.click-area::before {
  content: none;
}

.click-area::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: clamp(24px, 4vw, 36px);
  width: min(220px, 42%);
  height: 3px;
  background: linear-gradient(90deg, transparent, #5d9cec 20%, #6b65dc 52%, #ed7c96 80%, transparent);
  border-radius: 999px;
  z-index: 1;
  opacity: 0.32;
  pointer-events: none;
  transform: translateX(-50%);
}

.test-panel:not(.is-challenge-mode) .click-area[data-state="ready"]::after {
  animation: classicClickTrack 2.8s ease-in-out infinite;
}

.click-area:hover {
  background: var(--click-area-surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 14px 28px rgba(42, 90, 145, 0.07);
}

.click-area:active,
.click-area.is-pressing {
  transform: scale(0.988);
}

.click-area:focus {
  outline: none;
}

.click-area:focus-visible,
.time-btn:focus-visible,
.tool-btn:focus-visible {
  outline: 3px solid rgba(107, 101, 220, 0.25);
  outline-offset: 3px;
}

.click-area-title {
  position: relative;
  z-index: 3;
  display: block;
  font-size: clamp(2.05rem, 4.7vw, 3.9rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  color: #172a3b;
  transition: opacity 140ms ease, transform 140ms ease;
}

.test-panel:not(.is-challenge-mode) .click-area-title {
  font-size: clamp(2.2rem, 5vw, 4.15rem);
  font-weight: 900;
  letter-spacing: 0.06em;
}

.click-area-icon {
  position: relative;
  z-index: 3;
  display: grid;
  place-items: center;
  width: clamp(92px, 8vw, 118px);
  height: clamp(92px, 8vw, 118px);
  margin-bottom: 2px;
  color: #172a3b;
  opacity: 0.96;
  transition: opacity 140ms ease, transform 140ms ease;
}

.click-area-icon svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  fill: none;
  overflow: visible;
  stroke: currentColor;
  stroke-width: 1.95;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.click-source-icon {
  filter: drop-shadow(0 5px 12px rgba(23, 42, 59, 0.12));
}

.click-area-subtitle {
  position: relative;
  z-index: 3;
  display: block;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
  transition: opacity 140ms ease, transform 140ms ease;
}

.click-area:hover .click-area-icon,
.click-area:hover .click-area-title,
.click-area:hover .click-area-subtitle {
  transform: translateY(-3px) scale(1.02);
}

.test-panel:not(.is-challenge-mode) .click-area:hover .click-area-icon {
  transform: translateY(-5px) rotate(-3deg) scale(1.04);
}

.click-area[data-state="running"] {
  background: var(--click-area-surface);
}

.test-panel:not(.is-challenge-mode) .click-area[data-state="running"] {
  background: var(--click-area-surface);
}

body .test-panel .click-area[data-state="running"] {
  --click-area-surface:
    radial-gradient(
      circle at var(--pace-origin-x) var(--pace-origin-y),
      hsl(var(--pace-spark-hue) var(--pace-saturation) 96% / 0.9) 0%,
      transparent 42%
    ),
    radial-gradient(
      circle at calc(100% - var(--pace-origin-x)) calc(100% - var(--pace-origin-y)),
      hsl(var(--pace-accent-hue) var(--pace-saturation) 95% / 0.64) 0%,
      transparent 54%
    ),
    linear-gradient(
      135deg,
      hsl(var(--pace-hue) var(--pace-saturation) var(--pace-lightness)) 0%,
      hsl(var(--pace-spark-hue) calc(var(--pace-saturation) - 8%) calc(var(--pace-lightness) + 1%)) 46%,
      hsl(var(--pace-accent-hue) var(--pace-saturation) calc(var(--pace-lightness) + 2%)) 100%
    );
  background: var(--click-area-surface);
}

body .test-panel .click-area[data-state="running"]:hover {
  background: var(--click-area-surface);
}

body .test-panel .click-area[data-state="running"]::before {
  content: "";
  position: absolute;
  inset: -12%;
  z-index: 0;
  border-radius: inherit;
  background: conic-gradient(
    from 215deg at var(--pace-origin-x) var(--pace-origin-y),
    hsl(var(--pace-hue) 90% 68% / 0.58),
    hsl(var(--pace-spark-hue) 82% 66% / 0.48),
    hsl(var(--pace-accent-hue) 88% 70% / 0.54),
    hsl(var(--pace-hue) 90% 68% / 0.58)
  );
  opacity: var(--pace-low-opacity);
  pointer-events: none;
  transform: scale(0.96);
  transform-origin: var(--pace-origin-x) var(--pace-origin-y);
  animation: clickPaceRhythm var(--pace-duration) ease-in-out infinite;
}

.click-area[data-state="running"] .click-area-icon,
.click-area[data-state="running"] .click-area-title,
.click-area[data-state="running"] .click-area-subtitle {
  opacity: 0;
  transform: translateY(4px) scale(0.98);
}

.click-live-readout {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: clamp(24px, 5vw, 52px);
  color: #172a3b;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.94);
  transition: opacity 180ms ease-out, transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.click-area[data-state="running"] .click-live-readout {
  opacity: 1;
  transform: scale(1);
}

.click-live-count {
  display: block;
  min-width: 3ch;
  font-size: clamp(5.75rem, 18vw, 12rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.07em;
  line-height: 0.78;
  text-align: center;
  text-indent: -0.07em;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.55), 0 14px 34px rgba(23, 42, 59, 0.12);
  transform-origin: center;
}

.click-area[data-state="finished"] {
  color: #5b625e;
  background: var(--click-area-surface);
  cursor: default;
}

.click-effect {
  position: absolute;
  left: var(--click-x);
  top: var(--click-y);
  z-index: 2;
  display: block;
  width: var(--ripple-size);
  height: var(--ripple-size);
  pointer-events: none;
  border-radius: 50%;
  background:
    radial-gradient(circle, hsl(var(--pace-accent-hue) 86% 70% / 0.04) 0 34%, hsl(var(--pace-accent-hue) 86% 70% / 0.2) 35% 43%, transparent 44%),
    radial-gradient(circle, hsl(var(--pace-spark-hue) 88% 64% / 0.22) 0 42%, transparent 63%);
  box-shadow: inset 0 0 0 2px hsl(var(--pace-hue) 86% 60% / 0.2);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0);
  transform-origin: center;
  animation: areaRipple 700ms ease-out forwards;
}

@keyframes areaRipple {
  0% {
    opacity: 0.74;
    transform: translate(-50%, -50%) scale(0.08);
  }

  35% {
    opacity: 0.52;
  }

  70% {
    opacity: 0.25;
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes clickPaceRhythm {
  0%,
  100% {
    opacity: var(--pace-low-opacity);
    transform: scale(0.96);
  }

  50% {
    opacity: var(--pace-high-opacity);
    transform: scale(1.04);
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(3, auto);
  gap: clamp(24px, 3vw, 32px);
  align-content: space-between;
  align-self: start;
  height: 100%;
  margin-top: 0;
}

.tool-controls {
  position: absolute;
  right: clamp(12px, 2vw, 20px);
  bottom: clamp(12px, 2vw, 20px);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 0;
}

.tool-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: #66746f;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: none;
  transition: color 180ms ease, opacity 180ms ease, transform 180ms ease;
}

.tool-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.35;
}

.tool-btn:hover {
  color: #172a3b;
  background: transparent;
  transform: translateY(-1px) scale(1.03);
  box-shadow: none;
}

.tool-btn.is-on {
  color: #514bc5;
  background: transparent;
  box-shadow: none;
}

.tool-btn.is-off {
  color: #66746f;
  background: transparent;
}

@media (hover: hover) and (pointer: fine) {
  .tool-controls {
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transform: translateY(6px);
      transition: opacity 180ms ease-out, transform 180ms ease-out, visibility 0s linear 180ms;
    }

  .click-area-shell:hover .tool-controls,
  .click-area-shell:has(:focus-visible) .tool-controls {
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
      transform: translateY(0);
      transition-delay: 0s;
    }

  .tool-controls .tool-btn {
      opacity: 0.62;
      box-shadow: none;
    }

  .tool-controls .tool-btn:hover,
  .tool-controls .tool-btn:focus-visible {
      opacity: 1;
    }

  .tool-controls .tool-btn.is-on {
      color: #6963cf;
      background: transparent;
      box-shadow: none;
    }
}

@media (hover: none), (pointer: coarse) {
  .tool-btn {
      width: 44px;
      height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
  .tool-controls,
  .tool-btn {
      transition: none;
    }

  .click-area,
  .click-live-readout {
    transition: none;
  }

  body .test-panel .click-area[data-state="running"]::before {
    animation: none;
    opacity: var(--pace-low-opacity);
    transform: none;
  }

  .click-effect {
    display: none;
  }
}

.stat-card {
  --stat-accent: #6b65dc;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 14px;
  min-height: 0;
  padding: 15px 18px;
  background: transparent;
  border: 0;
  border-radius: 18px 16px 20px 15px;
  box-shadow: none;
  text-align: left;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.stat-card-time {
  --stat-accent: #6b65dc;
}

.stat-card-cps {
  --stat-accent: #5d9cec;
}

.stat-card-clicks {
  --stat-accent: #9a73cf;
}

@keyframes classicClickTrack {
  0%,
  100% {
    opacity: 0.24;
    transform: translateX(-50%) scaleX(0.72);
  }

  50% {
    opacity: 0.58;
    transform: translateX(-50%) scaleX(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .test-panel:not(.is-challenge-mode) .click-area[data-state="ready"]::after {
    animation: none;
  }

}

.test-panel:not(.is-challenge-mode) .stat-card-time {
  order: 1;
}

.test-panel:not(.is-challenge-mode) .stat-card-clicks {
  order: 2;
}

.test-panel:not(.is-challenge-mode) .stat-card-cps {
  order: 3;
}

.stat-card::before {
  content: none;
}

@media (hover: hover) and (pointer: fine) {
  .test-panel:not(.is-challenge-mode) .stat-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(35, 55, 72, 0.05);
  }
}

@media (prefers-reduced-motion: reduce) {
  .stat-card {
    transition: none;
  }
}

.stat-meta {
  position: relative;
  z-index: 1;
  display: contents;
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--stat-accent);
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.75), transparent 35%),
    color-mix(in srgb, var(--stat-accent) 16%, #ffffff);
  border-radius: 48% 42% 52% 40% / 42% 52% 38% 48%;
  transform: rotate(-3deg);
}

.stat-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat-value {
  position: relative;
  z-index: 1;
  display: block;
  justify-self: end;
  text-align: right;
  margin-top: 0;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  line-height: 1.1;
  color: #172a3b;
}

.stat-value::after {
  content: "";
  display: block;
  width: 42px;
  height: 3px;
  margin: 5px 0 0 auto;
  background: currentColor;
  border-radius: 999px;
  opacity: 0.28;
  transform: rotate(-4deg);
}

.test-section:has(+ .records-section[hidden]) {
  padding-bottom: var(--page-card-gap);
}

.rating-modal[hidden] {
  display: none;
}

.rating-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.rating-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(23, 42, 59, 0.28);
  backdrop-filter: blur(5px);
  pointer-events: none;
}

.rating-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(210px, 0.86fr) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 28px);
  width: min(760px, calc(100vw - 34px));
  padding: clamp(16px, 3vw, 24px);
  color: #172a3b;
  background: #ffffff;
  border-radius: 22px 20px 24px 19px;
  box-shadow: 0 24px 70px rgba(23, 42, 59, 0.18);
}

.rating-card:focus {
  outline: none;
}

.rating-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: #5f6a64;
  background: #f2f5f7;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.rating-close:hover {
  color: #172a3b;
  background: #e8f2fb;
  transform: translateY(-1px);
}

.rating-close svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.rating-media {
  overflow: hidden;
  min-height: 220px;
  border-radius: 18px 16px 20px 15px;
  background: #e8f2fb;
}

.rating-media img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
}

.rating-content {
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 8px 34px 8px 0;
}

.rating-eyebrow {
  margin: 0;
  color: #65706b;
  font-family: "Segoe Print", "Bradley Hand ITC", "Comic Sans MS", "SF Pro Rounded", cursive;
  font-size: 0.88rem;
  font-weight: 800;
}

.rating-content h2 {
  margin: 0;
  color: #172a3b;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1;
}

.rating-stars {
  display: flex;
  gap: 4px;
  color: #d8dde4;
  font-size: clamp(1.85rem, 4vw, 2.55rem);
  line-height: 1;
}

.rating-stars span {
  transform: rotate(-4deg);
}

.rating-stars .filled {
  color: #f0b84d;
  text-shadow: 0 2px 0 rgba(23, 42, 59, 0.08);
}

.rating-summary {
  margin: 0;
  color: #65706b;
  font-size: 1rem;
  line-height: 1.65;
}

.rating-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.rating-stats span {
  padding: 8px 10px;
  color: #65706b;
  background: #f4f7fb;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
}

.rating-stats strong {
  color: #172a3b;
}

html[data-page="cps"] body.rating-open,
html[data-page="cps"] body.app-fullscreen-open {
  overflow: hidden;
}

@media (max-width: 760px) {
  .click-area {
      touch-action: pan-y pinch-zoom;
    }

  .test-panel:not(.has-started) .tool-controls {
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transform: translateY(4px);
      transition: opacity 180ms ease, transform 180ms ease, visibility 0s linear 180ms;
    }

  .test-panel.has-started .tool-controls,
  .test-panel:fullscreen .tool-controls,
  .test-panel.is-app-fullscreen .tool-controls {
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
      transform: translateY(0);
      transition-delay: 0s;
    }

  .tool-btn {
      width: 44px;
      height: 44px;
    }

  #test {
      scroll-margin-top: 82px;
    }

  .rating-modal {
      padding: 16px;
    }

  .rating-card {
      grid-template-columns: 1fr;
      gap: 14px;
      padding: 16px;
    }

  .rating-media,
  .rating-media img {
      min-height: 190px;
    }

  .rating-content {
      padding: 0;
    }

  .time-btn {
      padding: 0 10px;
    }

  .click-area {
      min-height: 230px;
    }

  .tester-workspace {
      grid-template-columns: 1fr;
    }

  .side-panel {
      min-height: auto;
      height: auto;
      padding: 0;
    }

  .click-stack {
      min-height: auto;
    }

  .test-panel:fullscreen,
  .test-panel.is-app-fullscreen {
      --click-stack-pad: 12px;
      --duration-toolbar-gap: 12px;
      --click-stack-height: auto;
      align-content: start;
      gap: 14px;
      padding: 14px 16px 18px;
    }

  .test-panel:fullscreen .tester-workspace,
  .test-panel.is-app-fullscreen .tester-workspace {
      min-height: auto;
      align-items: start;
      gap: 14px;
    }

  .test-panel:fullscreen .click-stack,
  .test-panel.is-app-fullscreen .click-stack {
      grid-template-rows: minmax(220px, 44dvh) auto;
      min-height: auto;
      padding: 12px;
    }

  .test-panel:fullscreen .click-area,
  .test-panel.is-app-fullscreen .click-area {
      min-height: 220px;
    }

  .test-panel:fullscreen .side-panel,
  .test-panel.is-app-fullscreen .side-panel {
      grid-template-rows: auto;
      min-height: auto;
      padding: 0;
    }

  .stats-grid {
      grid-template-columns: 1fr;
      gap: 18px;
    }

  .stats-grid {
      height: auto;
      margin-top: 0;
    }

}

/* Score records: a personal click-cadence view built from local test history. */
.records-section .records-title-block {
  display: grid;
  gap: 0;
}

.records-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
  margin: 0 0 22px;
}

.records-dashboard,
.records-reference-grid {
  display: contents;
}

.records-dashboard[hidden],
.records-reference-grid[hidden],
.records-details-head[hidden] {
  display: none;
}

.records-reference-grid {
  margin: 0;
}

.records-analysis-card {
  grid-column: 1 / -1;
  min-width: 0;
  padding: 22px;
  background: #ffffff;
  border: 1px solid rgba(61, 87, 125, 0.12);
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(28, 54, 82, 0.04);
}

.records-analysis-head,
.record-analysis-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}

.records-analysis-head {
  margin-bottom: 18px;
}

.records-analysis-head h3,
.record-analysis-panel-head h4 {
  margin: 0;
  color: #172a3b;
  font-family: var(--font-display);
  line-height: 1.25;
}

.records-analysis-head h3 {
  font-size: 1.18rem;
}

.record-analysis-panel-head h4 {
  font-size: 0.9rem;
}

.records-analysis-head p,
.record-analysis-panel-head span {
  margin: 0;
  color: #82908b;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: right;
}

.records-analysis-main {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.65fr);
  gap: 20px;
}

.record-analysis-summary {
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 18px;
  background: linear-gradient(145deg, #f3f9ff 0%, #edf5ff 100%);
  border: 1px solid rgba(91, 139, 200, 0.15);
  border-radius: 15px;
}

.record-analysis-label {
  color: #66756f;
  font-size: 0.72rem;
  font-weight: 850;
}

.record-analysis-value {
  display: flex;
  align-items: baseline;
  gap: 7px;
  color: #172a3b;
}

.record-analysis-value strong {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5vw, 3.7rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.record-analysis-value span {
  color: #5d6edb;
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.record-analysis-level {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 3px;
}

.record-analysis-level span,
.record-analysis-level small {
  color: #75847f;
  font-size: 0.68rem;
  font-weight: 750;
}

.record-analysis-level strong {
  color: #263b4e;
  font-size: 1rem;
  font-weight: 900;
}

.record-analysis-description {
  margin: 0;
  color: #687975;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.45;
}

.record-analysis-next {
  margin: 5px 0 0;
  padding: 9px 10px;
  color: #315c78;
  background: rgba(255, 255, 255, 0.72);
  border-left: 3px solid #6faee8;
  border-radius: 3px 9px 9px 3px;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.4;
}

.record-analysis-scale-panel {
  display: grid;
  align-content: center;
  gap: 14px;
  min-width: 0;
  padding: 18px 18px 14px;
  background: #fbfcfe;
  border: 1px solid rgba(61, 87, 125, 0.08);
  border-radius: 15px;
}

.record-analysis-scale {
  --record-analysis-position: 2%;
  position: relative;
  display: grid;
  grid-template-columns: 5fr 2fr 2fr 3fr 1fr;
  height: 13px;
  margin-top: 8px;
  overflow: visible;
  background: #e7edf3;
  border-radius: 999px;
  box-shadow: inset 0 1px 2px rgba(23, 42, 59, 0.09);
}

.record-analysis-scale > i {
  min-width: 0;
  background: var(--record-band-color);
}

.record-analysis-scale > i:first-child {
  border-radius: 999px 0 0 999px;
}

.record-analysis-scale > i:nth-child(5) {
  border-radius: 0 999px 999px 0;
}

.record-analysis-marker {
  position: absolute;
  z-index: 2;
  left: var(--record-analysis-position);
  top: 50%;
  width: 18px;
  height: 18px;
  background: #ffffff;
  border: 4px solid #172a3b;
  border-radius: 50%;
  box-shadow: 0 3px 9px rgba(23, 42, 59, 0.2);
  transform: translate(-50%, -50%);
}

.record-analysis-scale-labels {
  display: grid;
  grid-template-columns: 5fr 2fr 2fr 3fr 1fr;
  min-width: 0;
}

.record-analysis-scale-labels > span {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: #6f7f7a;
  text-align: center;
}

.record-analysis-scale-labels strong {
  overflow: hidden;
  color: #35495b;
  font-size: 0.68rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-analysis-scale-labels small {
  font-size: 0.56rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}

.record-analysis-mix {
  display: grid;
  gap: 11px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(61, 87, 125, 0.1);
}

.record-analysis-mix-track {
  display: flex;
  height: 14px;
  overflow: hidden;
  background: #e7edf3;
  border-radius: 999px;
  box-shadow: inset 0 1px 2px rgba(23, 42, 59, 0.08);
}

.record-analysis-mix-segment {
  min-width: 4px;
  background: var(--record-band-color);
}

.record-analysis-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.record-analysis-legend-item {
  display: grid;
  grid-template-columns: 7px auto auto;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  background: #f6f8fa;
  border: 1px solid rgba(61, 87, 125, 0.06);
  border-radius: 10px;
}

.record-analysis-legend-item i {
  width: 7px;
  height: 7px;
  background: var(--record-band-color);
  border-radius: 50%;
}

.record-analysis-legend-item strong {
  color: #263b4e;
  font-size: 0.74rem;
  font-weight: 900;
}

.record-analysis-legend-item span {
  color: #74817d;
  font-size: 0.68rem;
  font-weight: 750;
}

.record-band-tone-1 {
  --record-band-color: #79bbf2;
}

.record-band-tone-2 {
  --record-band-color: #65cbbb;
}

.record-band-tone-3 {
  --record-band-color: #8b7cec;
}

.record-band-tone-4 {
  --record-band-color: #d76cc2;
}

.record-band-tone-5 {
  --record-band-color: #ed7c96;
}

.records-report-card {
  grid-column: 1 / -1;
  min-width: 0;
  padding: 22px;
  background: #ffffff;
  border-radius: 18px;
}

.records-report-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.records-report-head h3 {
  margin: 0;
  color: #172a3b;
  font-family: var(--font-display);
  font-size: 1.18rem;
  line-height: 1.25;
}

.records-report-head p {
  margin: 0;
  color: #7d8c87;
  font-size: 0.75rem;
  font-weight: 750;
  line-height: 1.4;
  text-align: right;
}

.records-report-main {
  display: grid;
  grid-template-columns: minmax(420px, 1.08fr) minmax(0, 1.42fr);
  gap: 18px;
}

.record-latest-result {
  display: grid;
  align-content: start;
  gap: 0;
  min-width: 0;
  padding: 18px 20px;
  overflow: hidden;
  background: #f7f9fb;
  border-radius: 15px;
}

.record-latest-result > header {
  margin-bottom: 10px;
}

.record-latest-result > header h4 {
  margin: 0;
  color: #172a3b;
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.record-rating-identity img {
  display: block;
  flex: 0 0 auto;
  object-fit: cover;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.record-latest-summary {
  margin: 0;
  color: #465566;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.72;
}

.record-latest-summary strong {
  color: #172a3b;
  font-size: 1.05em;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  white-space: nowrap;
}

.record-latest-rating-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  align-items: center;
  gap: 15px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(61, 87, 125, 0.12);
}

.record-latest-rating-row img {
  display: block;
  width: 90px;
  height: 78px;
  object-fit: cover;
  background: transparent;
  border: 0;
  border-radius: 13px;
  box-shadow: 0 7px 16px rgba(41, 78, 112, 0.1);
}

.record-latest-rating-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.record-latest-rating-copy span {
  color: #7b8896;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.35;
}

.record-latest-rating-copy strong {
  overflow: hidden;
  color: #172a3b;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-report-summary {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  min-width: 0;
}

.record-report-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.record-report-metrics article {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 5px;
  min-width: 0;
  padding: 13px 14px;
  background: #f7f9fb;
  border-radius: 12px;
  text-align: center;
}

.record-report-metrics span,
.record-comparison-card span,
.record-rating-identity span {
  color: #74817d;
  font-size: 0.68rem;
  font-weight: 800;
}

.record-report-metrics strong {
  overflow: hidden;
  color: #172a3b;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-report-metrics strong b {
  font-size: 1.42rem;
  font-weight: 950;
}

.record-report-metrics small {
  color: #87938f;
  font-size: 0.61rem;
  font-weight: 700;
  line-height: 1.35;
}

.record-comparison-card {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  align-items: center;
  gap: 5px 18px;
  padding: 14px 16px;
  background: #fbfcfe;
  border-radius: 12px;
}

.record-comparison-card > div {
  display: grid;
  gap: 3px;
}

.record-comparison-card small,
.record-comparison-card p {
  color: #7c8b86;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.4;
}

.record-comparison-card > strong {
  color: #52657a;
  font-size: 1.12rem;
  font-variant-numeric: tabular-nums;
  font-weight: 950;
}

.record-comparison-card > strong.is-positive {
  color: #1f8061;
}

.record-comparison-card > strong.is-negative {
  color: #b54f65;
}

.record-comparison-card p {
  grid-column: 1 / -1;
  margin: 0;
}

.record-rating-summary {
  display: grid;
  grid-template-columns: minmax(210px, 0.68fr) minmax(0, 1.6fr);
  align-items: center;
  gap: 28px;
  margin-top: 20px;
  padding: 4px 2px 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.record-rating-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.record-rating-identity img {
  width: 52px;
  height: 52px;
  border-radius: 10px;
}

.record-rating-identity div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.record-rating-identity strong {
  overflow: hidden;
  color: #263b4e;
  font-size: 0.95rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-rating-identity small {
  color: #5d6edb;
  font-size: 0.7rem;
  font-weight: 900;
}

.record-rating-progress {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.record-rating-progress-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 12px;
  color: #7b8984;
  font-size: 0.65rem;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.record-rating-progress-head strong {
  overflow: hidden;
  color: #40566d;
  font-size: 0.72rem;
  font-weight: 850;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-rating-progress-track {
  --record-rating-progress: 0%;
  height: 4px;
  overflow: hidden;
  background: #e3e9ee;
  border-radius: 999px;
  box-shadow: none;
}

.record-rating-progress-track i {
  display: block;
  width: var(--record-rating-progress);
  height: 100%;
  background: #6b65dc;
  border-radius: inherit;
}

.record-report-method {
  margin: 12px 2px 0;
  color: #85928e;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.45;
}

.records-trend-card {
  min-width: 0;
  border-radius: 18px;
}

.records-trend-card {
  display: grid;
  grid-column: 1 / -1;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 20px 22px 16px;
  background: linear-gradient(155deg, #ffffff 0%, #f8fbff 100%);
}

.record-panel-head {
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) max-content minmax(max-content, 1fr);
  align-items: center;
  gap: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(61, 87, 125, 0.08);
}

.record-panel-head h3 {
  justify-self: start;
}

.record-panel-head h3,
.records-details-head h3 {
  margin: 0;
  color: #172a3b;
  font-family: var(--font-display);
  font-size: 1.18rem;
  line-height: 1.2;
}

.record-panel-meta,
.records-details-head span {
  flex: 0 0 auto;
  color: #7b8984;
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.4;
}

.record-panel-meta {
  justify-self: end;
  padding: 5px 9px;
  background: #eef7ff;
  border-radius: 8px;
}

.record-duration-filter {
  display: flex;
  justify-content: center;
  gap: 16px;
  min-width: 0;
  overflow-x: auto;
  padding: 3px 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.record-duration-filter::-webkit-scrollbar {
  display: none;
}

.record-duration-filter-button {
  display: inline-block;
  flex: 0 0 auto;
  min-height: 0;
  padding: 3px 0;
  color: #77847f;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 0.75rem;
  font-weight: 750;
  line-height: 1.35;
  cursor: pointer;
  transition: color 160ms ease;
}

.record-duration-filter-button:hover {
  color: #35495b;
}

.record-duration-filter-button.is-active {
  color: #655fd4;
  background: transparent;
  font-weight: 900;
}

.record-duration-filter-button:focus-visible {
  outline: 0;
  color: #655fd4;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.records-chart-frame {
  position: relative;
  width: 100%;
  min-height: 184px;
  margin-top: 5px;
  display: grid;
  align-items: center;
}

.records-trend-pending {
  position: absolute;
  z-index: 1;
  top: 16px;
  left: 50%;
  display: none;
  margin: 0;
  color: #687a8c;
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.4;
  text-align: center;
  transform: translateX(-50%);
  white-space: nowrap;
}

.records-trend-card.is-single-record .records-trend-pending,
.records-trend-card.is-empty .records-trend-pending {
  display: block;
}

.records-trend-card.is-single-record .record-chart-grid,
.records-trend-card.is-single-record .record-chart-average-line,
.records-trend-card.is-empty .record-chart-grid {
  opacity: 0.55;
}

.records-trend-card.is-empty .record-chart-average-line {
  display: none;
}

.records-trend-card.is-empty .records-chart-legend {
  visibility: hidden;
}

.records-trend-chart {
  display: block;
  width: 100%;
  height: 220px;
  max-height: none;
  overflow: visible;
}

.record-chart-grid {
  stroke: rgba(61, 87, 125, 0.11);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.record-chart-axis-label,
.record-chart-date-label {
  fill: #82908b;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 750;
}

.record-chart-date-label {
  font-size: 9.5px;
}

.record-chart-duration-label {
  fill: var(--record-label-color, #655fd4);
  font-family: var(--font-body);
  font-size: 9.5px;
  font-weight: 850;
}

.record-chart-average-line {
  stroke: rgba(237, 124, 150, 0.72);
  stroke-width: 1.5;
  stroke-dasharray: 5 6;
  vector-effect: non-scaling-stroke;
}

.record-chart-area {
  fill: url("#recordsTrendAreaGradient");
}

.record-chart-line {
  fill: none;
  stroke: var(--record-series-color, #655fd4);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.record-chart-point {
  fill: #ffffff;
  stroke: var(--record-point-color, var(--record-series-color, #655fd4));
  stroke-width: 3;
  cursor: default;
  transition: r 160ms ease, stroke 160ms ease, stroke-width 160ms ease;
  vector-effect: non-scaling-stroke;
}

.record-chart-point:hover,
.record-chart-point:focus {
  r: 6.5px;
  stroke: #ed7c96;
  stroke-width: 4;
  outline: none;
}

.records-chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 16px;
  margin-top: 0;
  padding-top: 10px;
  border-top: 1px solid rgba(61, 87, 125, 0.08);
  color: #74817d;
  font-size: 0.72rem;
  font-weight: 750;
}

.records-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.records-chart-legend b {
  font: inherit;
}

.records-chart-legend i {
  display: block;
  width: 20px;
  height: 0;
  border-top: 2px solid var(--record-series-color, #655fd4);
}

.records-chart-legend .record-legend-series i,
.records-chart-legend .record-legend-duration i {
  position: relative;
  border-top-color: var(--legend-color, var(--record-series-color, #655fd4));
}

.records-chart-legend .record-legend-series i::after,
.records-chart-legend .record-legend-duration i::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  background: #ffffff;
  border: 2px solid var(--legend-color, var(--record-series-color, #655fd4));
  border-radius: 50%;
  content: "";
  transform: translate(-50%, -50%);
}

.records-chart-legend .record-legend-average i {
  border-top-color: rgba(237, 124, 150, 0.82);
  border-top-style: dashed;
}

.records-section .records-table-wrap {
  padding: 0 24px 22px;
  background: #ffffff;
  border-radius: 20px;
}

.records-details-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
  padding: 18px 6px 13px;
}

.records-section .records-details-head h3 {
  font-size: 1.22rem;
  letter-spacing: -0.02em;
}

.records-section .records-details-head span {
  color: #778390;
  font-size: 0.8rem;
  font-weight: 700;
}

.records-section .records-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  table-layout: fixed;
  text-align: center;
}

.records-section .records-table th,
.records-section .records-table td {
  width: 20%;
  padding: 17px 14px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.records-section .records-table thead th {
  padding-top: 13px;
  padding-bottom: 15px;
  color: #8993a3;
  border-bottom: 1px solid rgba(79, 96, 128, 0.18);
  font-size: 0.79rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.records-section .records-table tbody th,
.records-section .records-table tbody td {
  color: #263444;
  background: transparent;
  border-bottom: 1px solid rgba(79, 96, 128, 0.15);
  border-radius: 0;
  font-size: 0.91rem;
  font-weight: 700;
  line-height: 1.45;
  transition: background-color 160ms ease, color 160ms ease;
}

.records-section .records-table tbody td:nth-child(4),
.records-section .records-table tbody td:nth-child(5) {
  color: #263444;
  font-weight: 800;
}

.records-section .records-table tbody tr:hover {
  transform: none;
}

.records-section .records-table tbody tr:hover th,
.records-section .records-table tbody tr:hover td {
  color: #182a3e;
  background: #f8faff;
  box-shadow: none;
}

.records-section .records-table tbody tr:last-child th,
.records-section .records-table tbody tr:last-child td {
  border-bottom-color: rgba(79, 96, 128, 0.18);
}

@media (max-width: 900px) {
  .records-overview-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .records-chart-frame {
    min-height: 0;
  }

  .records-section .records-table-wrap {
    padding: 0 18px 18px;
  }
}

@media (max-width: 820px) {
  .records-report-main {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

}

@media (max-width: 680px) {
  .record-panel-head {
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 10px 16px;
  }

  .record-duration-filter {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    width: 100%;
  }

  .record-rating-summary {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .record-report-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .record-report-metrics article:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .records-overview-grid {
    gap: 12px;
  }

  .records-trend-card,
  .records-report-card {
    padding: 16px;
  }

  .record-panel-head {
    align-items: flex-start;
    padding-bottom: 12px;
  }

  .records-report-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .records-report-head p {
    text-align: left;
  }

  .record-latest-result {
    padding: 15px;
  }

  .record-rating-summary {
    padding: 4px 0 0;
  }

  .record-comparison-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .record-rating-progress-head {
    grid-template-columns: auto auto;
    gap: 4px 10px;
  }

  .record-rating-progress-head strong {
    grid-column: 1 / -1;
    grid-row: 1;
    white-space: normal;
    text-align: left;
  }

  .record-rating-progress-head span:first-child {
    grid-column: 1;
    grid-row: 2;
  }

  .record-rating-progress-head span:last-child {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
  }

  .record-panel-head {
    gap: 12px;
  }

  .record-panel-meta {
    max-width: 140px;
    text-align: right;
    white-space: nowrap;
  }

  .records-trend-chart {
    height: 180px;
  }

  .records-details-head {
    position: sticky;
    z-index: 1;
    left: 0;
    width: calc(100vw - 100px);
    min-height: 60px;
    padding: 15px 4px 10px;
    background: #ffffff;
  }

  .records-section .records-table-wrap {
    padding-right: 14px;
    padding-bottom: 16px;
    padding-left: 14px;
    border-radius: 17px;
  }

  .records-section .records-table {
    min-width: 564px;
  }

  .records-section .records-table th,
  .records-section .records-table td {
    padding: 15px 12px;
  }

}

@media (max-width: 380px) {
  .record-latest-result {
    padding: 14px;
  }

  .record-latest-summary {
    font-size: 0.8rem;
    line-height: 1.65;
  }

  .record-latest-rating-row {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 12px;
  }

  .record-latest-rating-row img {
    width: 64px;
    height: 64px;
    border-radius: 11px;
  }

  .record-latest-rating-copy strong {
    font-size: 1.08rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .record-chart-point,
  .records-section .records-table tbody th,
  .records-section .records-table tbody td {
    transition: none;
  }
}

@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  .test-panel:not(.has-started) .tool-controls,
  .test-panel.has-started .tool-controls {
      transform: none;
      transition: none;
    }
}

@media (max-height: 760px) and (min-width: 761px) {
  .test-panel:fullscreen,
  .test-panel.is-app-fullscreen {
      --click-area-min-height: 430px;
      --click-stack-height: min(82vh, 640px);
      padding-top: 22px;
      padding-bottom: 22px;
    }

  .test-panel:fullscreen .click-stack,
  .test-panel.is-app-fullscreen .click-stack {
      grid-template-rows: minmax(430px, 1fr) auto;
    }

  .test-panel:fullscreen .click-area,
  .test-panel.is-app-fullscreen .click-area {
      min-height: 430px;
    }
}

@media (max-width: 560px) {
  #test {
      scroll-margin-top: 76px;
    }

  .tool-controls {
      right: 10px;
      bottom: 10px;
    }
}

@media (max-width: 460px) {
  .test-section {
      width: min(100% - 22px, 1200px);
    }

  .test-panel {
      padding: 14px;
    }

  .click-area {
      min-height: 210px;
      padding: 20px;
    }

  .click-area-icon {
      width: 78px;
      height: 78px;
    }

  .time-toolbar {
      grid-template-columns: repeat(7, minmax(0, 1fr));
      gap: 4px;
      width: 100%;
    }

  .time-btn {
      min-height: 32px;
      height: 32px;
      padding: 0 2px 6px;
      border-radius: 8px;
      font-size: 0.82rem;
    }

  .stat-card {
      padding: 14px;
    }
}

/* Mobile classic mode mirrors the challenge summary and keeps stats above the play field. */
@media (max-width: 760px) {
  .test-panel:not(.is-challenge-mode) .tester-workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 10px;
    min-width: 0;
    padding-top: 44px;
  }

  .test-panel:not(.is-challenge-mode) .side-panel {
    position: static;
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    min-height: 0;
    height: auto;
    padding: 0;
  }

  .test-panel:not(.is-challenge-mode) .click-stack {
    grid-column: 1;
    grid-row: 2;
    grid-template-rows: minmax(350px, 1fr) auto;
    min-width: 0;
    padding: 0;
    background: transparent;
  }

  .test-panel:not(.is-challenge-mode) .click-area-shell {
    width: 100%;
    min-height: 350px;
  }

  .test-panel:not(.is-challenge-mode) .click-area {
    min-height: 350px;
    padding: 30px 20px 38px;
    border-radius: 28px;
    clip-path: inset(0 round 28px);
  }

  .test-panel:not(.is-challenge-mode) .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: auto;
    gap: 6px;
    width: 100%;
    height: auto;
    margin: 0;
  }

  .test-panel:not(.is-challenge-mode) .stat-card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    justify-items: center;
    row-gap: 4px;
    column-gap: 0;
    min-width: 0;
    text-align: center;
  }

  .test-panel:not(.is-challenge-mode) .stat-icon {
    grid-column: 1;
    grid-row: 1;
    justify-self: center;
  }

  .test-panel:not(.is-challenge-mode) .stat-label {
    grid-column: 1;
    grid-row: 2;
    align-self: auto;
    justify-self: center;
    max-width: 100%;
    font-size: 0.7rem;
    line-height: 1.2;
    text-align: center;
  }

  .test-panel:not(.is-challenge-mode) .stat-value {
    grid-column: 1;
    grid-row: 3;
    justify-self: center;
    min-width: 0;
    font-size: clamp(1.35rem, 6vw, 1.75rem);
    font-variant-numeric: tabular-nums;
    text-align: center;
  }

  .test-panel:not(.is-challenge-mode) .stat-value::after {
    display: none;
  }

}
