.theme-explorer {
  display: grid;
  gap: 1.25rem;
  min-inline-size: 0;
  background: var(--tx-base);
  color: var(--tx-fg);
}

.theme-explorer .tx-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.75rem 1rem;
}

.theme-explorer label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.8125rem;
  color: var(--tx-muted);
}

.theme-explorer input[type="color"] {
  inline-size: 3rem;
  block-size: 2.25rem;
  padding: 0.125rem;
  border: 1px solid var(--tx-line);
  border-radius: 0.375rem;
  background: var(--tx-surface);
}

.theme-explorer input[type="text"] {
  block-size: 2.25rem;
  padding: 0 0.5rem;
  border: 1px solid var(--tx-line);
  border-radius: 0.375rem;
  background: var(--tx-surface);
  color: var(--tx-fg);
  font: inherit;
  font-family: ui-monospace, monospace;
}

.theme-explorer button {
  block-size: 2.25rem;
  padding: 0 0.875rem;
  border: 0;
  border-radius: 0.375rem;
  background: var(--tx-accent);
  color: var(--tx-on-accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.theme-explorer :focus-visible {
  outline: 2px solid var(--tx-focus);
  outline-offset: 2px;
}

.theme-explorer .tx-presets,
.theme-explorer .tx-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.theme-explorer .tx-presets a,
.theme-explorer .tx-actions a,
.theme-explorer .tx-actions button {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--tx-line);
  border-radius: 999px;
  color: var(--tx-fg);
  font-size: 0.8125rem;
  text-decoration: none;
}

.theme-explorer .tx-presets a {
  padding-inline-start: 0.25rem;
}

.theme-explorer .tx-actions button {
  block-size: auto;
  border-color: transparent;
  background: var(--tx-accent);
  color: var(--tx-on-accent);
  font-weight: 600;
}

.theme-explorer .tx-presets svg {
  inline-size: 1.25rem;
  block-size: 1.25rem;
}

.theme-explorer .tx-view {
  display: grid;
  gap: 1.25rem;
  min-inline-size: 0;
}

.theme-explorer .tx-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--tx-muted);
  font-size: 0.875rem;
}

.theme-explorer .tx-summary p {
  margin: 0;
}

.theme-explorer .tx-summary strong {
  color: var(--tx-fg);
  text-transform: capitalize;
}

.theme-explorer .tx-error {
  margin: 0;
  color: var(--tx-error);
  font-weight: 600;
}

.theme-explorer .tx-clashes {
  margin: 0;
  padding-inline-start: 1.25rem;
  color: var(--tx-muted);
  font-size: 0.875rem;
}

.theme-explorer .tx-row {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  gap: 1rem;
  min-inline-size: 0;
}

.theme-explorer figure {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  min-inline-size: 0;
}

.theme-explorer figcaption {
  color: var(--tx-muted);
  font-size: 0.8125rem;
}

.theme-explorer svg {
  display: block;
  inline-size: 100%;
  block-size: auto;
  font-family: inherit;
}

.theme-explorer .tx-mockfig {
  flex: 1 1 18rem;
  max-inline-size: 27rem;
}

.theme-explorer .tx-rolefig {
  flex: 0 1 15rem;
}

.theme-explorer .tx-roles {
  max-inline-size: 15rem;
}

.theme-explorer .tx-gridfig {
  flex: 3 1 30rem;
}

.theme-explorer .tx-scrollwrap {
  position: relative;
  min-inline-size: 0;
}

.theme-explorer .tx-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--tx-muted) transparent;
  padding-block-end: 0.5rem;
}

.theme-explorer .tx-scrollwrap::before,
.theme-explorer .tx-scrollwrap::after {
  position: absolute;
  inset-block-start: 50%;
  display: grid;
  place-items: center;
  inline-size: 2rem;
  block-size: 2rem;
  border: 1px solid var(--tx-line);
  border-radius: 999px;
  background: var(--tx-surface);
  box-shadow: 0 1px 6px rgb(0 0 0 / 0.35);
  color: var(--tx-fg);
  font-size: 1.25rem;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  translate: 0 -50%;
  transition: opacity 120ms;
}

.theme-explorer .tx-scrollwrap::before {
  content: "‹" / "";
  inset-inline-start: 0.375rem;
}

.theme-explorer .tx-scrollwrap::after {
  content: "›" / "";
  inset-inline-end: 0.375rem;
}

.theme-explorer .tx-scrollwrap[data-left]::before,
.theme-explorer .tx-scrollwrap[data-right]::after {
  opacity: 1;
}

.theme-explorer .tx-scrollwrap:not([data-left], [data-right]) + figcaption .tx-more {
  display: none;
}

.theme-explorer .tx-swatches {
  min-inline-size: 34rem;
  max-inline-size: 46rem;
}

.theme-explorer .tx-plotfig {
  flex: 1 1 18rem;
  max-inline-size: 28rem;
}

.theme-explorer .tx-swatch {
  cursor: pointer;
  outline: none;
}

.theme-explorer .tx-ring {
  opacity: 0;
  pointer-events: all;
}

.theme-explorer .tx-swatch[aria-pressed="true"] .tx-ring,
.theme-explorer .tx-swatch:focus-visible .tx-ring {
  opacity: 1;
}

.theme-explorer .tx-swatch:focus-visible .tx-ring {
  stroke-dasharray: 4 2;
}

.theme-explorer .tx-readout {
  display: grid;
  flex: 1 1 14rem;
  grid-template-columns: 3rem 1fr;
  gap: 0.75rem;
  align-content: start;
  padding: 0.75rem;
  border: 1px solid var(--tx-line);
  border-radius: 0.5rem;
  font-size: 0.8125rem;
}

.theme-explorer .tx-readout svg {
  inline-size: 3rem;
}

.theme-explorer .tx-readout dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.75rem;
  margin: 0;
}

.theme-explorer .tx-readout dt {
  color: var(--tx-muted);
}

.theme-explorer .tx-readout dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.theme-explorer .tx-dot {
  transition: opacity 120ms;
}

.theme-explorer .tx-dot.tx-dim {
  opacity: 0.18;
}

.theme-explorer .tx-space {
  inline-size: 100%;
  aspect-ratio: 1;
  border-radius: 0.5rem;
  cursor: grab;
  touch-action: none;
}

.theme-explorer .tx-space:active {
  cursor: grabbing;
}

.theme-explorer .tx-ringlabel {
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .theme-explorer .tx-dot,
  .theme-explorer .tx-scrollwrap::before,
  .theme-explorer .tx-scrollwrap::after {
    transition: none;
  }
}
