* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bar-h: 44px;
  --gap: 5px;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #f7f7f9;
  color: #20242e;
}

code {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.9em;
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
}

.intro,
.outro {
  max-width: 620px;
  padding: 28px 20px;
}

.intro h1 {
  font-size: 26px;
  margin-bottom: 12px;
}

.intro p,
.outro p {
  font-size: 15px;
  line-height: 1.55;
  color: #4a5061;
}

.intro p + p,
.outro p + p {
  margin-top: 10px;
}

.predictions {
  margin: 12px 0 0 20px;
}

.predictions li {
  font-size: 14px;
  line-height: 1.5;
  color: #4a5061;
}

.predictions li + li {
  margin-top: 6px;
}

/* ---------- the test track ---------- */

.track {
  position: relative;
  height: 320dvh;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.06) 0 1px,
    transparent 1px 25vh
  );
}

/* full-size overlay holding the deep wrapper chain; bars re-parented
   into #deepEnd keep the same sticky range as the track itself */
.deep {
  position: absolute;
  inset: 0;
}

.deep > div,
.deep > div > div,
#deepEnd {
  position: relative;
  height: 100%;
}

/* ---------- test subjects ---------- */

.bar {
  position: sticky;
  z-index: 2;
  width: 100%;
  height: var(--bar-h);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1f6feb;
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 13px;
  font-weight: 600;
}

.track[data-width="85"] .bar {
  width: 85%;
}

.track[data-width="48"] .bar {
  width: 48%;
  margin-inline: 0 auto; /* left-aligned: the centered probe misses it */
}

.top-bar {
  top: var(--gap);
}

.bottom-bar {
  top: calc(100dvh - var(--bar-h) - var(--gap));
}

/* tiny sticky chip pinned flush over the probe point */
.decoy {
  position: sticky;
  z-index: 3;
  width: 76px;
  height: 30px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5b50a;
  color: #3c2c00;
  font-size: 11px;
  font-weight: 700;
}

.track:not([data-decoy="yes"]) .decoy {
  display: none; /* display:none removes it from edge sampling */
}

.top-decoy {
  top: 0;
  border-radius: 0 0 8px 8px;
}

.bottom-decoy {
  top: calc(100dvh - 30px);
  border-radius: 8px 8px 0 0;
}

/* ---------- control panel (kept out of the probe's reach) ---------- */

.panel {
  position: sticky;
  top: 60px;
  z-index: 10;
  margin: 0 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.row + .row {
  margin-top: 8px;
}

.lbl {
  width: 46px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7284;
}

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 8px;
}

.seg button {
  border: 0;
  padding: 5px 10px;
  border-radius: 6px;
  background: transparent;
  color: #4a5061;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.seg button.active {
  background: #fff;
  color: #20242e;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.verdict {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
}

.verdict b.bad {
  color: #b3261e;
}

.verdict b.good {
  color: #1a7f4e;
}

.verdict span {
  display: block;
  margin-top: 4px;
  font-family: system-ui, sans-serif;
  line-height: 1.45;
  color: #6b7284;
}

/* ---------- shared ---------- */

.hint {
  position: absolute;
  left: 0;
  right: 0;
  padding: 0 16px;
  text-align: center;
  font-size: 13px;
  color: rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.outro {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.outro h2 {
  font-size: 18px;
  margin-bottom: 10px;
}

.outro .note {
  margin-top: 14px;
  font-size: 13px;
  color: #8a90a0;
}
