/* Video quote layout. Structural selectors support the currently deployed UI. */
section[aria-label]:has(> div > label > select):has(> div > label > input[type='number']) {
  container-type: inline-size;
  padding: 20px;
  min-width: 0;
}

section[aria-label]:has(> div > label > select):has(> div > label > input[type='number']) > div:last-child {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.85fr) minmax(0, 1.25fr);
  align-items: start;
  gap: 16px;
  margin-top: 16px;
}

section[aria-label]:has(> div > label > select):has(> div > label > input[type='number']) > div > label {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

section[aria-label]:has(> div > label > select):has(> div > label > input[type='number']) > div > label > :is(select, input) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 8px 12px;
  border-radius: 8px;
  font: inherit;
}

section[aria-label]:has(> div > label > select):has(> div > label > input[type='number']) > div > div:last-child {
  min-width: 0;
  padding: 16px;
  border-width: 1px;
  border-style: solid;
  border-radius: 12px;
  overflow-wrap: anywhere;
}

section[aria-label]:has(> div > label > select):has(> div > label > input[type='number']) > div > div:last-child:not(.border-amber-200) {
  background: var(--background);
  border-color: var(--border);
}

section[aria-label]:has(> div > label > select):has(> div > label > input[type='number']) [role='status'] {
  font-size: 18px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

header:has(+ section[aria-label] > div > label > select) > div:first-child {
  align-items: flex-start;
}

header:has(+ section[aria-label] > div > label > select) h1 {
  min-width: 0;
  overflow-wrap: anywhere;
}

header:has(+ section[aria-label] > div > label > select) > p {
  display: none;
}

section[aria-label]:has(> div > label > select) > div > label > input[type='number'] + span {
  display: none;
}

@container (max-width: 640px) {
  section[aria-label]:has(> div > label > select):has(> div > label > input[type='number']) > div:last-child {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  section[aria-label]:has(> div > label > select):has(> div > label > input[type='number']) > div > div:last-child {
    grid-column: 1 / -1;
  }
}

@container (max-width: 360px) {
  section[aria-label]:has(> div > label > select):has(> div > label > input[type='number']) > div:last-child {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Activity prices share rows so the quote does not leave empty space below the fields. */
section[aria-label]:has(> div > label > select):has(> div > label > input[type='number']):has(> div > div > span) {
  padding: 16px;
}

section[aria-label]:has(> div > label > select):has(> div > label > input[type='number']) > div:last-child:has(> div > span) {
  gap: 12px;
  margin-top: 12px;
}

section[aria-label]:has(> div > label > select):has(> div > label > input[type='number']) > div > div:last-child:has(> span) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 12px;
  padding: 12px;
}

section[aria-label]:has(> div > label > select):has(> div > label > input[type='number']) > div > div:last-child:has(> span) > * {
  min-width: 0;
  margin: 0;
}

section[aria-label]:has(> div > label > select):has(> div > label > input[type='number']) > div > div:last-child:has(> span) > span {
  justify-self: end;
  max-width: 100%;
}

section[aria-label]:has(> div > label > select):has(> div > label > input[type='number']) > div > div:last-child:has(> span) > p:has(del) {
  justify-self: end;
}

section[aria-label]:has(> div > label > select):has(> div > label > input[type='number']) > div > div:last-child:has(> span) > p:last-child:not([role='status']) {
  grid-column: 1 / -1;
}

@container (min-width: 721px) {
  section[aria-label]:has(> div > label > select):has(> div > label > input[type='number']) > div:last-child:has(> div > span) {
    grid-template-columns: minmax(0, 1fr) 120px minmax(0, 1.6fr);
  }
}

@container (min-width: 641px) and (max-width: 720px) {
  section[aria-label]:has(> div > label > select):has(> div > label > input[type='number']) > div:last-child:has(> div > span) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  section[aria-label]:has(> div > label > select):has(> div > label > input[type='number']) > div > div:last-child:has(> span) {
    grid-column: 1 / -1;
  }
}

@container (max-width: 420px) {
  section[aria-label]:has(> div > label > select):has(> div > label > input[type='number']) > div > div:last-child:has(> span) > :is([role='status'], p:has(del)) {
    grid-column: 1 / -1;
    justify-self: start;
  }
}
