/* MousePoll — three-panel tester (poll / click / scroll).
   Theme colors come from site.config.json (--primary rose / --accent teal).
   Elements that can carry [hidden] keep display rules behind :not([hidden])
   per repo convention (P015). */

.mp-tool {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.1rem 1.25rem 1.35rem;
  margin: 1.4rem 0 2rem;
}

/* ---- tabs ---- */

.mp-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.7rem;
}
.mp-tab {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 650;
  padding: 0.42rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem; /* 44px tap target */
}
.mp-tab:hover { border-color: var(--primary); color: var(--primary); }
.mp-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.mp-tab.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ---- control row ---- */

.mp-ctl {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.9rem;
}
.mp-lbl {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 700;
}
.mp-pills {
  display: inline-flex;
  gap: 0.3rem;
}
.mp-pill {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  padding: 0.32rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem; /* 44px tap target */
}
.mp-pill:hover { border-color: var(--primary); color: var(--primary); }
.mp-pill.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.mp-btn {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 650;
  padding: 0.42rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem; /* 44px tap target */
}
.mp-btn:hover { border-color: var(--primary); color: var(--primary); }
.mp-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.mp-btn--primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-size: 0.95rem;
  padding: 0.55rem 1.3rem;
}
.mp-btn--primary:hover { color: #fff; filter: brightness(1.08); }

/* ---- test pads ---- */

.mp-pad {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 180px;
  padding: 1.2rem 1rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  text-align: center;
  cursor: crosshair;
  touch-action: none;          /* drags must reach the page, not scroll it */
  user-select: none;
  -webkit-user-select: none;
  margin-bottom: 0.85rem;
  overflow: hidden;
}
.mp-pad.is-live {
  border-style: solid;
  border-color: var(--primary);
}
.mp-pad-main {
  font-size: 1.25rem;
  font-weight: 750;
}
.mp-pad-sub {
  font-size: 0.82rem;
  color: var(--text-dim);
  max-width: 34rem;
}
.mp-dot {
  position: absolute;
  left: -7px;
  top: -7px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.mp-pop { animation: mp-pop 0.12s ease-out; }
@keyframes mp-pop {
  0% { transform: scale(1); }
  40% { transform: scale(0.985); }
  100% { transform: scale(1); }
}

/* ---- HUD ---- */

.mp-hud {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}
.mp-pill2 {
  font-size: 0.8rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  padding: 0.3rem 0.8rem;
  white-space: nowrap;
}
.mp-pill2 b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  margin-left: 0.25rem;
}

/* ---- histogram ---- */

.mp-hist {
  display: block;
  width: 100%;
  height: 120px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  margin-bottom: 0.85rem;
}
.mp-hist:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---- results ---- */

.mp-results:not([hidden]) {
  display: block;
  border-top: 1px dashed var(--border);
  padding-top: 0.9rem;
  margin-bottom: 0.9rem;
}
.mp-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  margin: 0 0 0.3rem;
}
.mp-big {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.05;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.mp-big-unit {
  font-size: 1.3rem;
  font-weight: 650;
  color: var(--text-dim);
}
.mp-verdict {
  font-size: 0.92rem;
  color: var(--text);
  margin: 0.25rem 0 0.85rem;
}
.mp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.mp-cell {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  min-width: 0;
}
.mp-cell-l {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}
.mp-cell-v {
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.mp-cell-s {
  font-size: 0.74rem;
  color: var(--text-dim);
  line-height: 1.4;
}
.mp-fineprint {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.55;
  margin: 0;
}

/* ---- ceiling / honesty note ---- */

.mp-ceiling {
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 0.7rem 0.9rem;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text);
}
.mp-ceiling code {
  font-size: 0.78rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 0.3em;
}

.mp-loading { color: var(--text-dim); }

/* ---- small screens ---- */

@media (max-width: 700px) {
  .mp-tool { padding: 0.9rem 0.75rem 1.1rem; }
  .mp-pad { min-height: 200px; } /* longer runway for touch drags */
  .mp-grid { grid-template-columns: repeat(2, 1fr); }
  .mp-big { font-size: 2.4rem; }
}
