.theme-preview-shell {
  display: grid;
  gap: 1.2rem;
}

.theme-preview-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
}

.theme-preview-selector {
  align-items: center;
  display: inline-flex;
  gap: 0.55rem;
}

.theme-preview-selector span {
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.theme-preview-selector select {
  min-width: 12rem;
}

.theme-preview-grid {
  align-items: start;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 0.7fr);
}

.theme-preview-section {
  align-content: start;
  display: grid;
  gap: 0.85rem;
}

.theme-preview-card {
  padding: 1rem;
}

.theme-preview-ref {
  align-items: center;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  color: var(--app-muted);
  display: inline-flex;
  font-family: var(--app-font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
  margin-top: 0.35rem;
  max-width: 100%;
  min-height: 1.35rem;
  overflow-wrap: anywhere;
  padding: 0.22rem 0.45rem;
  vertical-align: middle;
}

.navbar .theme-preview-ref {
  margin-top: 0;
}

.theme-preview-card h2,
.theme-preview-card h3 {
  color: var(--app-text);
  font-size: 1rem;
  font-weight: 850;
  margin: 0;
}

.theme-preview-card p {
  margin: 0.25rem 0 0;
}

.theme-preview-split {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.theme-preview-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.theme-palette-strip {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
}

.theme-palette-color {
  border: 1px solid var(--app-border);
  border-radius: 0.5rem;
  display: grid;
  gap: 0.4rem;
  min-width: 0;
  padding: 0.55rem;
}

.theme-palette-swatch {
  border: 1px solid var(--app-border);
  border-radius: 0.35rem;
  min-height: 4.25rem;
}

.theme-palette-label {
  color: var(--app-text);
  font-size: 0.78rem;
  font-weight: 850;
}

.theme-palette-value {
  color: var(--app-muted);
  font-family: var(--app-font-mono);
  font-size: 0.72rem;
}

.theme-preview-table {
  min-width: 0;
}

.theme-preview-table th,
.theme-preview-table td {
  width: auto;
}

.theme-token-grid {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}

.theme-token-item {
  border: 1px solid var(--app-border);
  border-radius: 0.45rem;
  display: grid;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.65rem;
}

.theme-token-swatch {
  border: 1px solid var(--app-border);
  border-radius: 0.35rem;
  min-height: 2.6rem;
}

.theme-token-name {
  color: var(--app-text);
  font-size: 0.78rem;
  font-weight: 850;
}

.theme-token-value {
  color: var(--app-muted);
  font-family: var(--app-font-mono);
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}

.theme-component-list {
  display: grid;
  gap: 0.6rem;
  max-height: 38rem;
  overflow: auto;
  padding-right: 0.2rem;
}

.theme-component-item {
  border: 1px solid var(--app-border);
  border-radius: 0.45rem;
  padding: 0.7rem;
}

.theme-component-item h3 {
  margin-bottom: 0.4rem;
}

.theme-component-item dl {
  display: grid;
  gap: 0.3rem;
  grid-template-columns: minmax(6rem, 0.4fr) minmax(0, 1fr);
  margin: 0;
}

.theme-component-item dt {
  color: var(--app-muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.theme-component-item dd {
  color: var(--app-text);
  font-family: var(--app-font-mono);
  font-size: 0.72rem;
  margin: 0;
  overflow-wrap: anywhere;
}

.theme-preview-launchers {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.theme-preview-form {
  display: grid;
  gap: 0.7rem;
}

.theme-preview-form label {
  color: var(--app-muted);
  display: grid;
  font-size: 0.78rem;
  font-weight: 850;
  gap: 0.3rem;
}

.theme-progress-options {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.theme-progress-form {
  display: grid;
}

.theme-preview-save-status {
  color: var(--app-good);
  font-size: 0.78rem;
  font-weight: 850;
  margin: 0.6rem 0 0;
}

.theme-preview-save-status.is-error {
  color: var(--app-bad);
}

.theme-progress-option {
  border: 1px solid var(--app-border);
  border-radius: 0.5rem;
  cursor: pointer;
  display: grid;
  gap: 0.65rem;
  min-width: 0;
  padding: 0.75rem;
}

.theme-progress-option:has(input:checked) {
  border-color: var(--app-highlight-border);
  box-shadow: inset 0 0.2rem 0 var(--app-highlight);
}

.theme-progress-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-progress-header {
  align-items: center;
  color: var(--app-text);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.86rem;
  font-weight: 850;
  gap: 0.45rem;
  justify-content: space-between;
}

.theme-progress-meta {
  color: var(--app-muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.theme-progress-track {
  background: color-mix(in srgb, var(--app-panel-strong) 42%, transparent);
  border: 1px solid var(--app-border);
  display: block;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.theme-progress-track > span {
  background: var(--app-accent);
  display: block;
  height: 100%;
}

.theme-progress-solid {
  border-radius: 0.35rem;
  height: 0.9rem;
}

.theme-progress-thin {
  background: color-mix(in srgb, var(--app-muted) 24%, transparent);
  border: 0;
  border-radius: 999px;
  height: 0.35rem;
}

.theme-progress-thin > span {
  background: var(--app-highlight);
  border-radius: inherit;
}

.theme-progress-striped {
  border-radius: 0.35rem;
  height: 1rem;
}

.theme-progress-striped > span {
  background-color: var(--app-accent);
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.24) 0,
    rgba(255, 255, 255, 0.24) 0.45rem,
    transparent 0.45rem,
    transparent 0.9rem
  );
}

.theme-progress-segmented {
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent calc(20% - 2px),
      var(--app-border) calc(20% - 2px),
      var(--app-border) 20%
    ),
    color-mix(in srgb, var(--app-panel-strong) 42%, transparent);
  border-radius: 0.35rem;
  height: 0.95rem;
}

.theme-progress-segmented > span {
  background: var(--app-highlight);
}

.theme-progress-pill {
  border-radius: 999px;
  height: 1.2rem;
  padding: 0.15rem;
}

.theme-progress-pill > span {
  background: var(--app-highlight);
  border-radius: inherit;
}

.theme-progress-steps {
  display: grid;
  gap: 0.35rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.theme-progress-steps span {
  background: color-mix(in srgb, var(--app-panel-strong) 42%, transparent);
  border: 1px solid var(--app-border);
  border-radius: 0.35rem;
  min-height: 1rem;
}

.theme-progress-steps .is-filled {
  background: var(--app-accent);
  border-color: var(--app-highlight-border);
}

@media (max-width: 920px) {
  .theme-preview-grid,
  .theme-preview-split,
  .theme-preview-launchers {
    grid-template-columns: 1fr;
  }
}
