/* A working screen: what to choose on the left, what has been chosen (and the button to finish) on the right, so the
   person does not scroll up and down between the two. Below 64rem the two stack. */
.ez_workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24rem;
  gap: var(--ez-space-6);
  align-items: start;
}

.ez_workspace__main,
.ez_workspace__aside {
  display: flex;
  flex-direction: column;
  gap: var(--ez-space-4);
  min-inline-size: 0;
}

.ez_workspace__aside {
  position: sticky;
  inset-block-start: 5.5rem;
  max-block-size: calc(100dvh - 7rem);
  overflow: auto;
}

.ez_workspace__aside > .ez_card {
  display: flex;
  flex-direction: column;
  gap: var(--ez-space-4);
  flex-shrink: 0;
}

@media (max-width: 64rem) {
  .ez_workspace { grid-template-columns: minmax(0, 1fr); }
  .ez_workspace__aside { position: static; max-block-size: none; }
}

/* A searchable list with a quantity on every row */
.ez_picklist {
  display: flex;
  flex-direction: column;
  gap: var(--ez-space-1);
  max-block-size: calc(100dvh - 22rem);
  min-block-size: 14rem;
  overflow: auto;
}

.ez_picklist__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--ez-space-3);
  padding: var(--ez-space-2) var(--ez-space-3);
  border-radius: var(--ez-radius-md);
  transition: background var(--ez-duration-fast);
}

.ez_picklist__row:hover { background: var(--ez-color-surface-container); }
.ez_picklist__row--on { background: var(--ez-color-surface-container-high); }
.ez_picklist__row[hidden] { display: none; }
.ez_picklist__name { font-weight: var(--ez-font-weight-medium); }
.ez_picklist__meta { color: var(--ez-color-text-muted); font-size: var(--ez-font-size-sm); }
.ez_picklist__none { padding: var(--ez-space-4); color: var(--ez-color-text-muted); }

/* - [ 2 ] + */
.ez_stepper {
  display: inline-flex;
  align-items: center;
  gap: var(--ez-space-1);
}

.ez_stepper__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 2.25rem;
  block-size: 2.25rem;
  padding: 0;
  background: var(--ez-color-surface-container-high);
  border: 0;
  border-radius: var(--ez-radius-pill);
  color: var(--ez-color-text-primary);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--ez-duration-fast), transform var(--ez-duration-fast);
}

.ez_stepper__button:hover { background: var(--ez-color-surface-variant); }
.ez_stepper__button:active { transform: scale(0.92); }

.ez_stepper__input {
  inline-size: 3.75rem;
  min-block-size: 2.25rem;
  padding: 0 var(--ez-space-1);
  background: var(--ez-color-surface-container);
  border: 0;
  border-block-end: 2px solid var(--ez-color-border);
  border-radius: var(--ez-radius-sm) var(--ez-radius-sm) 0 0;
  color: var(--ez-color-text-primary);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.ez_stepper__input:focus { outline: none; border-block-end-color: var(--ez-color-action-primary); }

.ez_form-grid--tight { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }

/* The running list of what has been chosen */
.ez_cart {
  display: flex;
  flex-direction: column;
  gap: var(--ez-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ez_cart__line {
  display: flex;
  justify-content: space-between;
  gap: var(--ez-space-3);
  animation: ez-pop-in 140ms ease-out;
}

.ez_cart__name { display: flex; flex-direction: column; }
.ez_cart__meta { color: var(--ez-color-text-muted); font-size: var(--ez-font-size-sm); }
.ez_cart__amount { font-variant-numeric: tabular-nums; white-space: nowrap; }

.ez_cart__total {
  display: flex;
  justify-content: space-between;
  margin: 0;
  padding-block-start: var(--ez-space-3);
  font-size: var(--ez-font-size-lg, 1.125rem);
}

/* A single form on its own page does not stretch across the window */
.ez_form--narrow { max-inline-size: 40rem; }

/* Figures in a narrower column must not touch the edge of their card */
.ez_workspace__main .ez_stat__value { font-size: 1.5rem; }

/* A form folded away until it is needed, so a long page of vacancies stays short */
.ez_disclosure > summary {
  display: inline-flex;
  padding: var(--ez-space-2) var(--ez-space-4);
  background: var(--ez-color-surface-container-high);
  border-radius: var(--ez-radius-pill);
  font-weight: var(--ez-font-weight-medium);
  cursor: pointer;
  list-style: none;
  transition: background var(--ez-duration-fast);
}

.ez_disclosure > summary::-webkit-details-marker { display: none; }
.ez_disclosure > summary:hover { background: var(--ez-color-surface-variant); }
.ez_disclosure[open] > summary { margin-block-end: var(--ez-space-3); }

/* Sections of a long page shown one at a time */
.ez_tabs { display: flex; flex-direction: column; gap: var(--ez-space-4); min-inline-size: 0; max-inline-size: 100%; }
.ez_tabs__list {
  display: flex;
  gap: var(--ez-space-1);
  padding: var(--ez-space-1);
  overflow-x: auto;
  background: var(--ez-color-surface-container);
  border-radius: var(--ez-radius-pill);
  position: sticky;
  inset-block-start: 4.75rem;
  z-index: 5;
  max-inline-size: 100%;
  scrollbar-width: none;
}

.ez_tabs__tab {
  flex: none;
  padding: var(--ez-space-2) var(--ez-space-4);
  background: none;
  border: 0;
  border-radius: var(--ez-radius-pill);
  color: var(--ez-color-text-muted);
  font-weight: var(--ez-font-weight-medium);
  cursor: pointer;
  transition: background var(--ez-duration-fast), color var(--ez-duration-fast);
}

.ez_tabs__tab:hover { background: var(--ez-color-surface-container-high); color: var(--ez-color-text-primary); }
.ez_tabs__tab[aria-selected="true"] { background: var(--ez-color-action-primary); color: var(--ez-color-on-action-primary); }
.ez_tabs > .ez_card[hidden] { display: none; }

.ez_form--wide { max-inline-size: 56rem; }

/* On a narrow screen the total and the finish button stay at the bottom of the window, so the person does not scroll past the list to submit */
.ez_workspace__bar { display: none; }

@media (max-width: 64rem) {
  .ez_workspace__bar {
    position: sticky;
    inset-block-end: 0;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ez-space-4);
    padding: var(--ez-space-3) var(--ez-space-4);
    background: var(--ez-color-surface);
    border-radius: var(--ez-radius-lg, var(--ez-radius-md));
    box-shadow: var(--ez-shadow-lg);
  }
  .ez_workspace__bar-total strong { font-size: var(--ez-font-size-lg, 1.125rem); }
  .ez_workspace__submit { display: none; }
}

/* A group of related fields under a small heading, in a modal or on a page */
.ez_form-section {
  display: flex;
  flex-direction: column;
  gap: var(--ez-space-4);
}

.ez_form--narrow,
.ez_form--wide { gap: var(--ez-space-6); }
