/* The small choosers inside the panels (year, time since signup, region).
   A drawn instrument locks onto the choice and travels to the next one, like the vector graphics on an
   old targeting screen: a double frame, corner marks, a ring, and a comb each side. */

html[data-m='d'] .toggle {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 14px 0 26px -14px; /* the labels, not the frames, line up with the text above */
  padding: 0;
}

html[data-m='d'] .toggle button {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  background: none;
  border: 0;
  cursor: pointer;
  transition: color 0.2s, box-shadow 0.2s;
}

html[data-m='d'] .toggle button::before,
html[data-m='d'] .toggle button::after,
html[data-m='d'] .toggle button[aria-pressed='true']::before,
html[data-m='d'] .toggle button[aria-pressed='true']::after {
  content: none;
}

html[data-m='d'] .toggle button:hover {
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 47, 230, 0.45);
}

html[data-m='d'] .toggle button:focus-visible {
  outline: 1px solid #fff;
  outline-offset: 3px;
}

html[data-m='d'] .toggle button[aria-pressed='true'] {
  color: #fff;
  background: none;
  box-shadow: none;
  text-shadow: 0 0 6px rgba(255, 120, 240, 0.9);
}

.toggle-mark {
  --line: #ffd3fa; /* the tube, white-hot */
  --dim: rgba(255, 107, 238, 0.75);
  position: absolute;
  left: 0;
  top: 0;
  width: var(--w, 0);
  height: var(--h, 0);
  transform: translate(var(--x, 0), var(--y, 0));
  pointer-events: none;
  border: 1px solid var(--line);
  /* thick marks at the four corners, and a faint grid inside */
  background:
    linear-gradient(var(--line), var(--line)) 0 0 / 9px 3px no-repeat,
    linear-gradient(var(--line), var(--line)) 0 0 / 3px 9px no-repeat,
    linear-gradient(var(--line), var(--line)) 100% 0 / 9px 3px no-repeat,
    linear-gradient(var(--line), var(--line)) 100% 0 / 3px 9px no-repeat,
    linear-gradient(var(--line), var(--line)) 0 100% / 9px 3px no-repeat,
    linear-gradient(var(--line), var(--line)) 0 100% / 3px 9px no-repeat,
    linear-gradient(var(--line), var(--line)) 100% 100% / 9px 3px no-repeat,
    linear-gradient(var(--line), var(--line)) 100% 100% / 3px 9px no-repeat,
    repeating-linear-gradient(to right, rgba(255, 47, 230, 0.1) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(to bottom, rgba(255, 47, 230, 0.1) 0 1px, transparent 1px 8px),
    rgba(255, 47, 230, 0.03);
  filter: drop-shadow(0 0 2px #ff4dea) drop-shadow(0 0 6px #ff2fe6) drop-shadow(0 0 14px rgba(255, 47, 230, 0.55));
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* the second, inner frame */
.toggle-mark::before {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid var(--dim);
}

/* the ring: only its two side arcs show, as if the frame sat inside a dial */
.toggle-mark .ring {
  position: absolute;
  left: -13px;
  right: -13px;
  top: -9px;
  bottom: -9px;
  border: 1px solid var(--dim);
  border-radius: 50%;
  -webkit-mask: linear-gradient(to right, #000 0 11px, transparent 11px calc(100% - 11px), #000 calc(100% - 11px));
  mask: linear-gradient(to right, #000 0 11px, transparent 11px calc(100% - 11px), #000 calc(100% - 11px));
}

/* the combs: a toothed contact on each side, joined to the frame by a short lead */
.toggle-mark .comb {
  position: absolute;
  left: -18px;
  right: -18px;
  top: 50%;
  height: 11px;
  margin-top: -6px;
  background:
    repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 3px) 0 0 / 7px 100% no-repeat,
    repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 3px) 100% 0 / 7px 100% no-repeat,
    linear-gradient(var(--line), var(--line)) 7px 50% / 11px 1px no-repeat,
    linear-gradient(var(--line), var(--line)) calc(100% - 7px) 50% / 11px 1px no-repeat;
}

@media (max-aspect-ratio: 1/1) {
  html[data-m='d'] .toggle {
    gap: 6px 10px;
    margin: 10px 0 18px -12px;
  }

  html[data-m='d'] .toggle button {
    padding: 9px 12px;
    font-size: 10px;
  }
}

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