/* Owner-only density: retain all controls, labels and existing state handlers. */
.operations-content-container:has(#owner-dashboard-scope-title) > header {
  display: none;
}

#operations-main:has(#owner-dashboard-scope-title) {
  padding-top: 1rem;
}

#operations-main > div:has(> section[aria-labelledby='owner-dashboard-scope-title']) {
  container: owner-dashboard / inline-size;
}

#operations-main:has(#owner-dashboard-scope-title) section[aria-labelledby='management-dashboard-title'] {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .75rem;
  padding: 1rem;
  border-radius: .75rem;
  box-shadow: none;
}

#operations-main:has(#owner-dashboard-scope-title) #management-dashboard-title {
  margin-top: 0;
  font-size: 1.5rem;
  line-height: 1.25;
}

#operations-main:has(#owner-dashboard-scope-title) section[aria-labelledby='management-dashboard-title'] p {
  display: none;
}

#operations-main:has(#owner-dashboard-scope-title) section[aria-labelledby='management-dashboard-title'] time {
  font-size: 1.25rem;
  line-height: 1.25;
}

#operations-main:has(#owner-dashboard-scope-title) section[aria-labelledby='management-dashboard-title'] > div:last-child > span {
  font-size: .875rem;
  letter-spacing: normal;
  text-transform: none;
}

#operations-main:has(#owner-dashboard-scope-title) section[aria-labelledby='owner-dashboard-scope-title'],
#operations-main:has(#owner-dashboard-scope-title) section[aria-labelledby='owner-dashboard-scope-title'] + form {
  margin-top: .75rem;
}

#operations-main:has(#owner-dashboard-scope-title) section[aria-labelledby='owner-dashboard-scope-title'] > div:first-child {
  display: none;
}

#operations-main:has(#owner-dashboard-scope-title) [aria-label='Контекст дашборда собственника'] {
  min-width: 0;
  gap: .5rem;
}

#operations-main:has(#owner-dashboard-scope-title) [aria-label='Контекст дашборда собственника'] button {
  min-width: 0;
  min-height: 3.75rem;
  padding: .5rem .25rem;
  border-radius: .75rem;
  box-shadow: none;
}

#operations-main:has(#owner-dashboard-scope-title) [aria-label='Контекст дашборда собственника'] button > span {
  overflow-wrap: normal;
}

#operations-main:has(#owner-dashboard-scope-title) [aria-label='Контекст дашборда собственника'] button > span:last-child {
  margin-top: .125rem;
  line-height: 1.25;
}

#operations-main:has(#owner-dashboard-scope-title) fieldset[aria-label='Фильтры дашборда'] {
  padding: .75rem 1rem;
  border-radius: .75rem;
  box-shadow: none;
}

#operations-main:has(#owner-dashboard-scope-title) fieldset[aria-label='Фильтры дашборда'] > div:first-of-type {
  margin-bottom: 0;
  font-size: 1rem;
}

#operations-main:has(#owner-dashboard-scope-title) #dashboard-filter-fields {
  margin-top: .75rem;
  gap: .75rem;
}

#operations-main:has(#owner-dashboard-scope-title) #dashboard-filter-fields .ops-control {
  min-width: 0;
  min-height: 2.75rem;
  font-size: 1rem;
}

@container owner-dashboard (min-width: 36rem) {
  #operations-main:has(#owner-dashboard-scope-title) [aria-label='Контекст дашборда собственника'] button {
    padding-inline: .75rem;
  }

  #operations-main:has(#owner-dashboard-scope-title) #management-dashboard-title {
    font-size: 1.75rem;
  }

  #operations-main:has(#owner-dashboard-scope-title) section[aria-labelledby='management-dashboard-title'] time {
    font-size: 1.5rem;
  }

  #operations-main:has(#owner-dashboard-scope-title) #dashboard-filter-fields {
    grid-template-columns: minmax(0, 1.25fr) repeat(2, minmax(0, 1fr));
  }

  #operations-main:has(#owner-dashboard-scope-title) #dashboard-filter-fields > label:last-of-type {
    grid-column: span 2;
  }

  #operations-main:has(#owner-dashboard-scope-title) #dashboard-filter-fields > div:last-child {
    grid-column: auto;
    align-items: end;
  }
}

@container owner-dashboard (max-width: 20rem) {
  #operations-main:has(#owner-dashboard-scope-title) [aria-label='Контекст дашборда собственника'] {
    grid-template-columns: minmax(0, 1fr);
  }

  #operations-main:has(#owner-dashboard-scope-title) [aria-label='Контекст дашборда собственника'] button {
    display: grid;
    grid-template-columns: 5rem minmax(0, 1fr);
    align-items: center;
    gap: .5rem;
    min-height: 2.75rem;
    padding-inline: .75rem;
  }
}

@container owner-dashboard (min-width: 52rem) {
  #operations-main:has(#owner-dashboard-scope-title) #dashboard-filter-fields {
    grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr)) minmax(0, 1.25fr) auto;
    align-items: end;
  }

  #operations-main:has(#owner-dashboard-scope-title) #dashboard-filter-fields > label:last-of-type {
    grid-column: auto;
  }
}

@container owner-dashboard (max-width: 23rem) {
  #operations-main:has(#owner-dashboard-scope-title) section[aria-labelledby='management-dashboard-title'] {
    grid-template-columns: minmax(0, 1fr);
    gap: .5rem;
  }

  #operations-main:has(#owner-dashboard-scope-title) section[aria-labelledby='management-dashboard-title'] > div:last-child {
    display: flex;
    align-items: baseline;
    gap: .5rem;
  }

  #operations-main:has(#owner-dashboard-scope-title) section[aria-labelledby='management-dashboard-title'] time {
    margin-top: 0;
  }
}
