.ts-explorer {
  --ts-accent: #fedb00;
  --ts-dark: #313030;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin: 20px 0;
}
.ts-explorer .ts-instructions {
  margin: 0;
  text-align: center;
  font-size: 0.9em;
}
.ts-explorer .ts-diagram {
  position: relative;
  width: 100%;
  max-width: 760px; /* Decrease to make the diagram shorter. */
  min-width: 0;
  margin: 0 auto;
}
.ts-explorer .ts-diagram img {
  display: block;
  width: 100%;
  height: auto;
}
.ts-explorer .ts-outlines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.ts-explorer .ts-hotspot {
  pointer-events: all;
  cursor: pointer;
  fill: transparent;
  stroke: transparent;
  stroke-width: 3;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition: fill 150ms ease, stroke 150ms ease;
}
.ts-explorer .ts-hotspot.is-active,
.ts-explorer .ts-hotspot.is-selected,
.ts-explorer .ts-hotspot:focus-visible {
  fill: rgba(254, 219, 0, 0.16);
  stroke: var(--ts-accent);
}
.ts-explorer .ts-hotspot:focus-visible {
  outline: 3px dashed var(--ts-dark);
  outline-offset: 3px;
}
.ts-explorer .ts-details {
  min-width: 0;
  border-top: 3px solid var(--ts-accent);
  padding-top: 12px;
}
.ts-explorer .ts-detail {
  display: flex;
  align-items: center;
  gap: 24px;
  min-width: 0;
  padding: 20px 24px;
  background: #ffffff;
  color: var(--ts-dark);
  border: 3px solid var(--ts-dark);
  border-radius: 0;
}
.ts-explorer .ts-detail[hidden] { display: none; }
.ts-explorer .ts-detail-image {
  display: block;
  width: 25%;
  max-width: 220px;
  height: 150px;
  object-fit: contain;
  flex-shrink: 0;
}
.ts-explorer .ts-detail-copy { flex: 1; min-width: 0; }
.ts-explorer .ts-detail h3 { margin: 0 0 10px; color: var(--ts-dark); }
.ts-explorer .ts-detail p { margin: 0 0 10px; line-height: 1.6; }
.ts-explorer .ts-detail-copy > :last-child { margin-bottom: 0; }
.ts-explorer .ts-detail-link {
  display: inline-block;
  margin: 8px 20px 0 0;
  color: var(--ts-dark);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.ts-explorer .ts-detail-link:focus-visible {
  outline: 3px solid var(--ts-dark);
  outline-offset: 4px;
}
.ts-explorer .ts-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 600px) {
  .ts-explorer .ts-detail {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 18px;
  }
  .ts-explorer .ts-detail-image { width: 100%; align-self: center; }
}
@media (prefers-reduced-motion: reduce) {
  .ts-explorer .ts-hotspot { transition: none; }
}
/* Diagram and shared details side by side */
.ts-explorer {
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  align-items: center;
  gap: 24px;
}

.ts-explorer .ts-instructions {
  grid-column: 1 / -1;
}

.ts-explorer .ts-diagram {
  max-width: none;
}

.ts-explorer .ts-details {
  grid-column: 2;
  min-width: 0;
  padding-top: 0;
  border-top: 0;
}

.ts-explorer .ts-detail {
  flex-direction: column;
  align-items: stretch;
  border-top: 3px solid #fedb00;
}

.ts-explorer .ts-detail-image {
  width: 100%;
  height: 140px;
  align-self: center;
}

/* Stack on smaller screens */
@media (max-width: 800px) {
  .ts-explorer {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .ts-explorer .ts-diagram {
    max-width: 480px;
  }

  .ts-explorer .ts-details {
    grid-column: 1;
  }
}

/* Remove the black outline after mouse/touch selection */
.ts-explorer .ts-hotspot:focus {
  outline: none;
}

/* Keep a yellow indicator for keyboard navigation */
.ts-explorer .ts-hotspot:focus-visible {
  outline: 3px dashed #fedb00;
  outline-offset: 3px;
}

/* Yellow border around the entire detail box */
.ts-explorer .ts-detail {
  border: 3px solid #fedb00;
}
.ts-explorer .ts-detail-link {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin: 12px 0 0;
  padding: 12px 16px;
  background: #313030;
  color: #ffffff;
  border: 3px solid #313030;
  border-radius: 0;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
}

.ts-explorer .ts-detail-link:hover,
.ts-explorer .ts-detail-link:focus-visible {
  background: #fedb00;
  color: #313030;
  border-color: #fedb00;
  text-decoration: none;
}

.ts-explorer .ts-detail-link:focus-visible {
  outline: 3px solid #313030;
  outline-offset: 3px;
}
