.layout-component-showcase wa-page {
  --aside-width: clamp(22rem, 28vw, 32rem);
}

.component-showcase-toolbar {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: var(--wa-space-l);
  max-width: 100rem;
}

.component-showcase-toolbar > div:first-child {
  max-width: 68rem;
}

.component-showcase-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--wa-space-s);
}

.component-showcase-filter,
.theme-variable-search {
  display: grid;
  gap: var(--wa-space-3xs);
}

.component-showcase-filter input,
.theme-variable-search input {
  min-height: var(--wa-form-control-height);
  padding: var(--wa-form-control-padding-block) var(--wa-form-control-padding-inline);
}

.component-showcase-filter input {
  width: min(24rem, 70vw);
}

.component-showcase {
  display: grid;
  gap: var(--wa-space-xl);
  max-width: 100rem;
  margin-inline: auto;
}

.component-showcase-section[hidden] {
  display: none;
}

.component-showcase-section-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--wa-space-m);
  margin-block-end: var(--wa-space-l);
  padding-block-end: var(--wa-space-m);
  border-block-end: var(--wa-border-width-s) solid var(--wa-color-surface-border);
}

.component-showcase-section-header h2,
.component-showcase-section-header p {
  margin: 0;
}

.component-showcase-section-header h2 {
  margin-block-start: var(--wa-space-3xs);
}

.component-showcase-section-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: end;
  gap: var(--wa-space-xs);
}

.component-showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: var(--wa-space-m);
  align-items: stretch;
}

.component-showcase-example {
  min-width: 0;
  overflow: clip;
}

.component-showcase-preview {
  min-height: 7rem;
}

.component-showcase-preview > :first-child {
  margin-block-start: 0;
}

.component-showcase-preview > :last-child {
  margin-block-end: 0;
}

.component-showcase-empty {
  max-width: 100rem;
  margin-inline: auto;
  padding: var(--wa-space-xl);
  text-align: center;
}

.theme-variable-aside {
  box-sizing: border-box;
  min-width: 0;
}

.theme-variable-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--wa-space-s);
}

.theme-variable-heading h2 {
  margin: 0;
}

.theme-variable-intro {
  display: grid;
  gap: var(--wa-space-m);
  margin-block-end: var(--wa-space-l);
}

.theme-variable-intro p {
  margin: 0;
}

.theme-variable-groups {
  display: grid;
  gap: var(--wa-space-s);
}

.theme-variable-groups summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--wa-space-s);
  padding: var(--wa-space-s);
  cursor: pointer;
}

.theme-variable-list {
  display: grid;
  gap: var(--wa-space-xs);
  padding: 0 var(--wa-space-s) var(--wa-space-s);
}

.theme-variable-row {
  display: grid;
  gap: var(--wa-space-2xs);
  padding: var(--wa-space-s);
}

.theme-variable-row[hidden],
.theme-variable-groups details[hidden] {
  display: none;
}

.theme-variable-row[data-dirty] {
  outline: var(--wa-focus-ring);
  outline-offset: calc(-1 * var(--wa-focus-ring-width));
}

.theme-variable-control {
  display: grid;
  gap: var(--wa-space-2xs);
}

.theme-variable-control wa-input,
.theme-variable-control wa-color-picker {
  width: 100%;
  min-width: 0;
}

.theme-variable-name {
  display: flex;
  align-items: center;
  gap: var(--wa-space-2xs);
  min-width: 0;
}

.theme-variable-name code {
  overflow-wrap: anywhere;
}

.theme-variable-swatch {
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
}

.theme-variable-row-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--wa-space-s);
  min-width: 0;
}

.theme-variable-row-footer output {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-variable-row-footer button {
  padding: 0;
  cursor: pointer;
}

.theme-variable-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  gap: var(--wa-space-s);
  width: 100%;
  margin-block-start: auto;
  padding-block-start: var(--wa-space-m);
}

@media (max-width: 720px) {
  .component-showcase-filter,
  .component-showcase-filter input {
    width: 100%;
  }

  .component-showcase-section-meta {
    justify-content: start;
  }
}
