#selectionWorkbench,
#selectionWorkbench .selection-stage,
#s2Unified .s2-step {
  min-width: 0;
}

#selectionWorkbench .selection-stage-nav,
#selectionWorkbench #selectionWorkbenchContext,
#s2Unified :is(.s2-unified-heading, .s2-scope-bar, .s2-feature-tabs) {
  margin-block-end: 8px;
  gap: 6px;
}

#selectionWorkbench #selectionWorkbenchContext {
  min-height: 40px;
  padding: 5px 8px;
}

#selectionWorkbench #selectionWorkbenchContext > span {
  white-space: nowrap;
}

body.s2-shell #selection #selectionModelWorkspace {
  display: grid;
  grid-template-columns: minmax(215px, 0.85fr) minmax(0, 2fr);
  align-items: start;
  gap: 10px;
  overflow: visible;
  margin-block: 10px;
}

#selection #selectionModelLibrary,
#selection #selectionModelEditor {
  min-width: 0;
  margin: 0;
  border-color: var(--wb-border);
  background: var(--wb-surface);
}

#selection #selectionModelList {
  max-height: 340px;
  overflow: auto;
  padding: 3px;
}

#selection .selection-model-list-item {
  background: var(--wb-surface);
  border-color: var(--wb-border);
}

#selection .selection-model-list-item.active {
  background: var(--wb-info-bg);
  border-color: var(--wb-primary);
}

#selection .selection-model-select-button :is(strong, small) {
  color: var(--wb-secondary);
  white-space: normal;
  overflow-wrap: anywhere;
}

#selection .selection-model-editor .quota-table-wrap {
  max-width: 100%;
  margin-block: 6px;
  overflow-x: auto;
}

#selection .selection-model-editor .quota-table {
  min-width: 780px;
}

#selection .selection-model-editor select,
#selection .selection-model-editor input {
  min-width: 0;
}

#selection :is(.selection-stage, .auction-prep-workspace) :is(.page-heading, .section-heading-row) {
  gap: 8px;
  margin-block-end: 8px;
}

#selection :is(.selection-stage, .auction-prep-workspace) .table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

#selection :is(.tool-drawer, .auction-template-workspace) {
  margin-block: 8px 0;
}

#selection .auction-draft-review .inline-actions {
  flex-flow: row wrap;
  align-items: center;
  gap: 6px;
}

#selection #auctionTemplatePanel .form-grid > .field-label {
  min-width: 0;
}

#s2Unified .s2-scope-bar {
  padding-block-end: 6px;
}

#s2Unified .s2-step {
  padding: 10px;
  margin-block-end: 8px;
}

#s2Unified :is(.s2-unified-heading, .s2-step-heading) :is(h2, h3, p) {
  margin-block: 0 4px;
}

#s2Unified .s2-step-heading .s2-inline-actions {
  gap: 6px;
}

#s2Unified .s2-photo-center {
  min-width: 0;
}

#s2Unified .s2-result-scroll {
  overflow-x: auto;
}

#s2Unified [data-photo-table] {
  min-width: 0;
  margin-block-start: 6px;
}

#s2Unified .s2-scope-bar [aria-pressed="true"],
#s2Unified .s2-feature-tabs [aria-selected="true"] {
  background: var(--wb-primary);
  color: var(--wb-on-primary);
}

@media (max-width: 900px) {
  body.s2-shell #selection #selectionModelWorkspace {
    grid-template-columns: minmax(0, 1fr);
  }

  #selection #selectionModelList {
    max-height: 190px;
  }
}

@media (max-width: 620px) {
  #selectionWorkbench .selection-stage-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  #selectionWorkbench .selection-stage-nav > * {
    flex: 0 0 auto;
  }

  #selectionWorkbench #selectionWorkbenchContext {
    overflow-x: auto;
  }

  #selection .auction-draft-review .inline-actions > button,
  #s2Unified .s2-scope-bar > button {
    flex: 0 0 auto;
  }

  #s2Unified .s2-scope-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
}
